[R-sig-ME] Chi-square test on random effects

Ned Dochtermann ned.dochtermann at gmail.com
Thu Oct 7 00:05:49 CEST 2010


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]]




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