[R-sig-ME] Zero variance and Std. Dev. using lmer?
Jude Phillips
jude.phillips at gmail.com
Fri Jan 16 21:07:45 CET 2009
Hi, I have a similar problem to Luciano. I am running a mixed effects
model with a continuous dependent variable, a categorical fixed effect
and a categorical random effect. The dependent variable has a
distribution that is skewed to the left, which can be normalized by a
log transformation. There is a huge difference in the results I get,
depending on whether I use the transformation, and I am not sure why.
When I run
spime1<-lmer(X13c ~ crop + (1|field.single), spi)
I get
Linear mixed model fit by REML
Formula: X13c ~ crop + (1 | field.single)
Data: spi
AIC BIC logLik deviance REMLdev
422.5 440.1 -204.2 414.3 408.5
Random effects:
Groups Name Variance Std.Dev.
field.single (Intercept) 0.0000 0.0000
Residual 5.8811 2.4251
Number of obs: 91, groups: field.single, 27
Fixed effects:
Estimate Std. Error t value
(Intercept) -21.3635 0.5882 -36.32
cropHay -2.6131 0.9997 -2.61
cropHedge -2.0445 0.6715 -3.04
cropSoy 3.7215 1.2338 3.02
cropWheat 0.6910 1.3477 0.51
Correlation of Fixed Effects:
(Intr) cropHy crpHdg cropSy
cropHay -0.588
cropHedge -0.876 0.515
cropSoy -0.477 0.280 0.418
cropWheat -0.436 0.257 0.382 0.208
then
> spime1 at deviance
ML REML ldL2 ldRX2
sigmaML sigmaREML pwrss disc
usqr wrss
4.143326e+02 4.084787e+02 3.301496e-08 1.205152e+01
2.357530e+00 2.425094e+00 5.057730e+02 5.057730e+02
1.514514e-07 5.057730e+02
dev llik NULLdev
NA NA NA
However,
spimelog<-lmer(log(X13c +28) ~ crop + (1|field.single), spi)
gives
Linear mixed model fit by REML
Formula: log(X13c + 28) ~ crop + (1 | field.single)
Data: spi
AIC BIC logLik deviance REMLdev
143.9 161.5 -64.95 120.7 129.9
Random effects:
Groups Name Variance Std.Dev.
field.single (Intercept) 0.024557 0.15671
Residual 0.212558 0.46104
Number of obs: 91, groups: field.single, 27
Fixed effects:
Estimate Std. Error t value
(Intercept) 1.8692 0.1341 13.937
cropHay -0.7846 0.2242 -3.500
cropHedge -0.4403 0.1545 -2.850
cropSoy 0.4236 0.2705 1.566
cropWheat 0.1113 0.2888 0.385
Correlation of Fixed Effects:
(Intr) cropHy crpHdg cropSy
cropHay -0.598
cropHedge -0.868 0.519
cropSoy -0.496 0.297 0.431
cropWheat -0.464 0.278 0.403 0.230
> spimelog at deviance
ML REML ldL2 ldRX2
sigmaML sigmaREML pwrss disc usqr
wrss dev
120.7413657 129.9082247 8.5530877 10.4710000 0.4481952
0.4610400 18.2799815 17.0420840 1.2381553 17.0418262
NA
llik NULLdev
NA NA
>From the previous posts, I think I understand that the first model has
0 std.dev and var for the random effects because the log-likelihood is
not being evaluated correctly, but why is the result so different when
the dependent variable is transformed. (note that the dependent
variable happens to take negative values, the lowest of which is
-27.5, which is why I add 28 before the log transformation).
Thanks for your attention
Jude Phillips
PhD Candidate
GLEL, Biology Dept. Carleton University.
More information about the R-sig-mixed-models
mailing list