[R-sig-ME] test significance of single random effect
Douglas Bates
bates at stat.wisc.edu
Tue Nov 17 18:03:25 CET 2009
On Tue, Nov 17, 2009 at 3:49 AM, Matthias Gralle
<matthias_gralle at eva.mpg.de> wrote:
> I had basically the same problem a short time ago, and resorted to lme
> instead of lmer, because one can directly compare lme and lm objects using
> anova(). Is that OK, or is this feature of lme depreciated ?
Is that not possible for linear mixed-effects models fit by lmer using
REML = FALSE? (Occasionally I lose track of what can be done in
different versions of lme4.) You don't want to compare an lmer model
fit by REML with the log-likelihood of an lm model but you should be
able to compare likelihoods (subject to the caveat that the p-value
for the likelihood ratio test on the boundary of the parameter space
is conservative).
> Ben Bolker wrote:
>>
>> Have you tried the RLRsim package??
>>
>> Tom Van Dooren wrote:
>>
>>>
>>> I tried to find an easy way to test whether the random effect would be
>>> significant in a (generalized) mixed model with a single random effect.
>>> It annoyed me that log-likelihoods of lm or glm and lmer are not
>>> necesarily directly comparable -> trouble with calculating likelihood
>>> ratios.
>>> What do members of this list think of the following simulation approach?
>>> It basically amounts to simulating a distribution for the log likelihood,
>>> given the null hypothesis that there is no random effect variance and that
>>> the fixed effect model is correct.
>>>
>>>
>>> library(lme4)
>>> mm1 <- lmer(Reaction ~ Days + (1|Subject), sleepstudy)
>>> lm1<- lm(Reaction ~ Days, sleepstudy)
>>>
>>>
>>> LL<-numeric(500)
>>> for(i in 1:500){
>>> resp<-simulate(lm1)
>>> LL[i]<-logLik(lmer(resp[,1] ~ Days + (1|Subject), sleepstudy))
>>> }
>>>
>>> hist(LL)
>>> logLik(mm1)
>>> mean(LL>logLik(mm1))
>>>
>>> _______________________________________________
>>> R-sig-mixed-models at r-project.org mailing list
>>> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
>>>
>>
>>
>>
>
>
> --
> Matthias Gralle, PhD
> Dept. Evolutionary Genetics
> Max Planck Institute for Evolutionary Anthropology
> Deutscher Platz 6
> 04103 Leipzig, Germany
> Tel +49 341 3550 519
> Fax +49 341 3550 555
>
> _______________________________________________
> R-sig-mixed-models at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
>
More information about the R-sig-mixed-models
mailing list