Re: [R] lmm WITHOUT random factor (lme4)

From: Mark Difford <mark_difford_at_yahoo.co.uk>
Date: Fri, 18 Mar 2011 03:21:30 -0700 (PDT)

On Mar 18, 2011; 10:55am Thierry Onkelinx wrote:

>> Furthermore, I get an error when doing an anova between a lm() and a
>> lme() model.

Hi Thierry,

You get this error because you have not done the comparison the way I said you should, by putting the lme$obj model first in the call to anova(). This ensures that lme's anova method is invoked, rather than lm's anova method.

You really do need to be careful with this...

## From my original posting
>> ## Compare models with and without random effects
>> fm <- lm(Reaction ~ Days, sleepstudy)
>> fm1 <- lme(Reaction ~ Days, random= ~1|Subject, sleepstudy)
>> anova(fm1, fm) ## lme-fitted model must come first

Regards, Mark.

--
View this message in context: http://r.789695.n4.nabble.com/lmm-WITHOUT-random-factor-lme4-tp3384054p3386810.html
Sent from the R help mailing list archive at Nabble.com.

______________________________________________
R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Received on Fri 18 Mar 2011 - 10:47:07 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 18 Mar 2011 - 11:00:23 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive