[R-sig-ME] General Questions Regarding lmer Output

Henrik Singmann henrik.singmann at psychologie.uni-freiburg.de
Sat Sep 14 00:00:39 CEST 2013


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:
> Hi,
>
> I am well aware of the reasons why P values don't exist, but that wasn't my
> question.  My question, and maybe I should have provided clarification in
> my first inquiry, was I notice papers publishing p values and F statistics
> for fixed effects, including the intercept.  I am using lmerTest to get F
> statistics and P values for all fixed effects except for the intercept.  If
> said papers do not mention how they are getting a P value for the
> intercept, how do you think they are getting it?
>
> Jacob
>
>
> On Fri, Sep 13, 2013 at 3:23 PM, Doran, Harold <HDoran at air.org> wrote:
>
>> Jacob
>>
>> In terms of (1), see the ?ranef help and specifically the postVar
>> argument. That will return the conditional variances which you can use for
>> the Cis you desire.
>>
>> In terms of (2), this is a longstanding issue with mixed models and has
>> been well-discussed on this list for years. See the link below for a
>> description/rationale for why p-values, etc do not appear.
>>
>> The main issue is that it is unknown what distribution that statistics
>> actually follow.
>>
>> https://stat.ethz.ch/pipermail/r-help/2006-May/094765.html
>>
>> On 9/13/13 2:11 PM, "AvianResearchDivision" <segerfan83 at gmail.com> wrote:
>>
>>> Hi all,
>>>
>>> I have a couple of seemingly basic questions about the lmer output.  I am
>>> running a model with random slopes and intercepts, along with a couple of
>>> fixed effects.  I am using lmerTest to obtain F statistics and P values as
>>> well.  My questions are:
>>>
>>> 1.  How do I obtain 95% CI for the random effects?
>>>
>>> 2.  If I use anova(model, ddf="Kenward-Roger"), I get F statistics and P
>>> values for my fixed effects, however, it never gives me a F statistic or
>>> degrees of freedom for the intercept.  How can I obtain this?
>>>
>>> Thank you for your help ahead of time.
>>>
>>> Jacob
>>>
>>>        [[alternative HTML version deleted]]
>>>
>>> _______________________________________________
>>> R-sig-mixed-models at r-project.org mailing list
>>> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
>>
>>
>
> 	[[alternative HTML version deleted]]
>

-- 
Dipl. Psych. Henrik Singmann
PhD Student
Albert-Ludwigs-Universität Freiburg, Germany
http://www.psychologie.uni-freiburg.de/Members/singmann



More information about the R-sig-mixed-models mailing list