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

From: Mark Difford <mark_difford_at_yahoo.co.uk>
Date: Sat, 19 Mar 2011 01:25:55 -0700 (PDT)

On Mar 19, 2011; 01:39am Andrzej Galecki wrote:

>> I agree with you that caution needs to be exercised. Simply because
>> mathematically the same
>> likelihood may be defined using different constant.

Yes. But this is ensured by the implementation. If the call to anova() is made with the lm$obj first in the sequence then an error is thrown. If the call is correctly made, with the lme$obj placed first in the sequence, then the log of the likelihood of each object is calculate by nlme:::logLik.lme using the same formula [via lapply(object, logLik, REML), where logLik points to nlme:::logLik.lme].

You will note, as Andrzej Galecki has pointed out, that the logLik.lm of the lm$obj is different from logLik.lme.

##
> logLik(fm)
'log Lik.' -950.1465 (df=3)
> logLik(fm, REML=T)
'log Lik.' -946.8318 (df=3)

Regards, Mark.

--
View this message in context: http://r.789695.n4.nabble.com/lmm-WITHOUT-random-factor-lme4-tp3384054p3389249.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 Sat 19 Mar 2011 - 08:40:50 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 Sat 19 Mar 2011 - 08:50:22 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