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

Mark Difford mark_difford at yahoo.co.uk
Sat Mar 19 09:25:55 CET 2011


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.



More information about the R-help mailing list