[R-sig-ME] log Likelihood depends on contrasts?

Martin Henry H. Stevens HStevens at muohio.edu
Thu May 10 19:51:20 CEST 2007


Hi folks,
I didn't realize log likelihood of a model depended on the particular  
specification of contrasts.

Example

 > str(cake)
'data.frame':	270 obs. of  5 variables:
$ replicate  : Factor w/ 15 levels "1","2","3","4",..: 1 1 1 1 1 1 1  
1 1 1 ...
$ batch      : Factor w/ 3 levels "1","2","3": 1 1 1 1 1 1 2 2 2 2 ...
$ recipe     : Factor w/ 3 levels "1","2","3": 1 1 1 1 1 1 2 2 2 2 ...
$ temperature: Ord.factor w/ 6 levels "175"<"185"<"195"<..: 1 2 3 4 5  
6 1 2 3 4 ...
$ angle      : int  42 46 47 39 53 42 39 46 51 49 ...
 > options(contrasts=c("contr.treatment", "contr.poly"))
 > mod.t <- lmer(angle ~ recipe + (1|batch), data=cake)
 > options(contrasts=c("contr.sum", "contr.poly"))
 > mod.s <- lmer(angle ~ recipe + (1|batch), data=cake)
 > logLik(mod.t)
'log Lik.' -947.82 (df=4)
 > logLik(mod.s)
'log Lik.' -948.92 (df=4)
 >

Any insight is appreciated.

Many thanks,
Hank


Dr. Hank Stevens, Assistant Professor
338 Pearson Hall
Botany Department
Miami University
Oxford, OH 45056

Office: (513) 529-4206
Lab: (513) 529-4262
FAX: (513) 529-4243
http://www.cas.muohio.edu/~stevenmh/
http://www.muohio.edu/ecology/
http://www.muohio.edu/botany/

"E Pluribus Unum"




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