Skip to content
Prev 10664 / 20628 Next

General Questions Regarding lmer Output

Hi,

there is a relatively simple way of getting a p-value for the intercept which involves pbkrtest's KRmodcomp for obtaining the Kenward-Rogers ddf:

1. Fit full model
2. Fit model without intercept (e.g., using 0 + model, or model - 1)
3. compre both using KRmodcomp.

For example:

require(lme4)
require(pbkrtest)

fm1 <- lmer(Reaction ~ Days + (Days | Subject), sleepstudy)
fm2 <- lmer(Reaction ~ 0 +Days + (Days | Subject), sleepstudy)

KRmodcomp(fm1, fm2)

## F-test with Kenward-Roger approximation; computing time: 0.25 sec.
## large : Reaction ~ Days + (Days | Subject)
## small : Reaction ~ 0 + Days + (Days | Subject)
##       stat  ndf  ddf F.scaling   p.value
## Ftest 1357    1   17         1 < 2.2e-16 ***
## ---
## Signif. codes:  0 ?***? 0.001 ?**? 0.01 ?*? 0.05 ?.? 0.1 ? ? 1


Alternatively (and now comes shameless self-promotion) you can use mixed from my afex package which gives you p-values for all effects including the intercept using KRmodcomp:

require(afex)
mixed(Reaction ~ Days + (Days | Subject), sleepstudy)

##        Effect      stat ndf ddf F.scaling p.value
## 1 (Intercept) 1357.0490   1  17         1       0
## 2        Days   45.8529   1  17         1       0

Cheers,
Henrik


Am 13.09.2013 23:41, schrieb AvianResearchDivision: