Recent changes in the R package “arm” (applied regression and multilevel modeing)

Yu-Sung writes,

Here are some recent changes in arm that might be crucial for your research.

There has been 30 updates in the past 9 months since arm was publicly available through CRAN. This implies that you should always check for updates before you use arm. (Not our fault, we have to adopt arm to work with lme4. And lme4 changes a lot.)

/To Jouni, You can skip to the last point. We need your help!!/

*Changes:*

*1. Yes, arm computes the DIC*: display() will compute DIC for a lmer-object. It could be a reference statistic when you want to compare different models. But as some other formal test, we should not solely rely on it. There are many other better ways to do model comparisons. Andy and Jennifer’s book has detailed discussion. One caveat is that we still do not know if the DIC is correctly computed or not (Ooops)!!!!!! We are waiting for the reply from Dr. Bates. The sure thing is that the DIC statistic might not be 100% accurate, though; it is not off the target a lot. So you can still use that to make a quick assessment of your models. arm also display the AIC for you if you feel uneasy about this information. Or please see the 2nd point!!

*2. Use mcsamp() instead of sim.mer() & se.coef()*:* *Andy wrote a nice function sim() that can simulate lmer fitted models. But again, because of the problem in lmer, we might not get the right V.beta for group levels estimates. So sim() and se.coef() might not yield correct answers. The answer are not far off the right answers though. To play safe, please use mcsamp(). mcsamp() has made some changes. One big change is that it will return the DIC for lmer objects (not glmer!!!). So if you want to get variances of the estimates plus the DIC of your model, please use mcsamp(). Now it supports thinning. And it returns more conventional names for estimates (no more “beta.xxx” and “eta.xxx”).

*3. Use display() instead of summary()*: lmer is undergoing a big change now. We just found out that summary() for lmer-object is buggy. It will fail to display the lmer-object sometimes. So please use display() to show the lmer fitted objects.

*4. S4 now! *One other big change in arm that related to lmer is that arm now uses S4 language. I have to do this just to clean up the codes. But it is no longer easy to see the source code of the S4 functions. If you want to see the source code of the functions, please check my recent blog entry here.
*

5. Default digits=2*: When you load arm, arm will change the default digits to 2 digit display. You can tune it back to default by typing options(digits=5) if you feel like to do so.

*6. Problem of V.beta: *You might encounter this when you use sim() for lmer objects. The error message is “‘Sigma’ is not positive definite.” The problem arises from the buggy eigen() in the base package. Sometimes, you can get away with this by using usePQL=TRUE in your lmer().

Jouni, 3 years ago you found that eigen() returns NA’s. The problem has been solved. But now eigen() causes another problem when it deals with V.beta improperly. To see what’s going on, please try the below code:

library(arm);
fm1 <- lmer(Reaction ~ Days + (Days|Subject), sleepstudy); sim(fm1);

Thanks, Yu-Sung, Masanao, and everyone else!