[R-sig-ME] Chi-square test on random effects
ned.dochtermann at gmail.com
Fri Oct 8 18:33:23 CEST 2010
Thanks, I didn't know about that package and a simulation approach certainly
However, and I easily could be wrong about this, it is worth noting that the
example used for exactLRT looks problematic to me. The two models are fit
using lme and lm which do not necessarily produce commensurate likelihoods
(lmer and lm do not, and I don't think lme and lmer do). Also, and this is
the part I'm a bit less sure about, but when you're comparing models like
those in the example I think you would have to use ML rather than REML. That
seems like something users should be informed of.
I'm really just a dabbler when it comes to this stuff so further
clarification from yourself and others would be useful.
Department of Biology
University of Nevada, Reno
ned.dochtermann at gmail.com
Date: Thu, 07 Oct 2010 12:25:50 -0400
From: Robert Kushler <kushler at oakland.edu>
To: r-sig-mixed-models at r-project.org
Subject: Re: [R-sig-ME] Chi-square test on random effects
Message-ID: <4CADF48E.9080304 at oakland.edu>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
I believe the RLRsim package provides a better solution.
Regards, Rob Kushler
On 10/6/2010 7:01 PM, Christopher Desjardins wrote:
> On Wed, Oct 6, 2010 at 5:05 PM, Ned Dochtermann
> <ned.dochtermann at gmail.com>wrote:
>> Hi Chris,
>> You're not going to be able to do that test using lmer. To conduct the
>> you want you'll need to know the likelihood estimates for two models, one
>> with the random factor and another without it. You can't run a model
>> the random factor in lme4 and you can't use the likelihood from lm
>> they aren't "commensurate" between lme4 and lm (this issue is discussed
>> http://glmm.wikidot.com/random-effects-testing). I've run the same sorts
>> tests for lmer and lm, as I'm sure many other people have and they aren't
>> You can, however, get what you want using nlme:
>> (I don't use nlme much so you may want to double check the code syntax)
>> Then you just run the likelihood ratio test from there, I think with nlme
>> LRT is built in as anova(m.rand,m.null).
>> This issue has been discussed a lot so you may find more detailed info by
>> searching the archives.
>> Good luck,
>> Ned Dochtermann
>> Department of Biology
>> University of Nevada, Reno
>> ned.dochtermann at gmail.com
>> I originally ran a model in HLM 6 that I am now in lme4. In lme4 the
>> would look like the following:
>> lmer(Y ~ 1 + (1 | Group), data= data)
>> So I only have a random intercept for Group.
>> I noticed that HLM 6 gives a chi-square test statistic associated with
>> random variable. Does anyone know how I can calculate this chi-square
>> statistic in R or what formula the HLM authors are using?
>> [[alternative HTML version deleted]]
R-sig-mixed-models mailing list
R-sig-mixed-models at r-project.org
End of R-sig-mixed-models Digest, Vol 46, Issue 10
More information about the R-sig-mixed-models