Chi-square test on random effects
Hi Rob, Thanks, I didn't know about that package and a simulation approach certainly seems preferable. 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. Thanks, Ned -- Ned Dochtermann Department of Biology University of Nevada, Reno ned.dochtermann at gmail.com http://wolfweb.unr.edu/homepage/mpeacock/Dochter/ -- ---------------------------------------------------------------------- Message: 1 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:
Thanks. Chris 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
test
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 without the random factor in lme4 and you can't use the likelihood from lm
because
they aren't "commensurate" between lme4 and lm (this issue is discussed
at:
http://glmm.wikidot.com/random-effects-testing). I've run the same sorts of tests for lmer and lm, as I'm sure many other people have and they aren't compatible. You can, however, get what you want using nlme: m.rand<-lme(Y~1,random=~1|Group,data=data) m.null<-gls(Y~1,data=data) (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 -- Ned Dochtermann Department of Biology University of Nevada, Reno ned.dochtermann at gmail.com http://wolfweb.unr.edu/homepage/mpeacock/Dochter/ -- Hi, I originally ran a model in HLM 6 that I am now in lme4. In lme4 the
model
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
this
random variable. Does anyone know how I can calculate this chi-square
statistic in R or what formula the HLM authors are using?
Thanks!
Chris
[[alternative HTML version deleted]]
------------------------------ _______________________________________________ R-sig-mixed-models mailing list R-sig-mixed-models at r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models End of R-sig-mixed-models Digest, Vol 46, Issue 10