[R-sig-ME] Difference in variance estimates by nlme and lme4
YANG, Richard ChunHSi
RichardChunHSi.YANG at NRCan-RNCan.gc.ca
Thu Jun 30 18:37:36 CEST 2011
Dear all;
I'm using both nlme and lme4 to estimate random effects of a
data set with three nested levels Site/Block/Spacing. Estimates of both
fixed and random components are almost identical with one exception of
Block:Site. The estimated std. dev. was 0.0000000 from lme4 and
8.819877e-07 from nlme (see attached output); both are small and close
to 0, in fact. But refitting a reduced model by dropping Block, the
estimated intercept std. dev. for Site level was 1.4298e-7, and
1.1499e-06, respectively for lme4 and nlme; two estimates differ by 8
times.
The anova method reports
> anova(ltvlmer, ltvlmer.R)
Data: temp2
Models:
ltvlmer.R: log(TotVolha + 10) ~ SDI * Dq * SpH + Standage + (1 | Site) +
ltvlmer.R: (1 | Site:Spacing)
ltvlmer: log(TotVolha + 10) ~ SDI * Dq * SpH + Standage + (1 |
Site/Block/Spacing)
Df AIC BIC logLik Chisq Chi Df Pr(>Chisq)
ltvlmer.R 12 -747.21 -705.45 385.61
ltvlmer 13 -741.47 -696.23 383.74 0 1 1
> anova(ltvlme, ltvlme.R)
Model df AIC BIC logLik Test
L.Ratio p-value
ltvlme 1 13 -545.5575 -500.8061 285.7788
ltvlme.R 2 12 -552.3547 -511.0457 288.1774 1 vs 2 4.797232 0.0285
The anova from lme4 indicates no significant difference between two
models, but significant at the 5% level by nlme.
The discrepancy maybe result from different optimization
implementation. Did I miss anything?
> sessionInfo()
R version 2.11.0 (2010-04-22)
i386-pc-mingw32
locale:
[1] LC_COLLATE=English_Canada.1252 LC_CTYPE=English_Canada.1252
LC_MONETARY=English_Canada.1252 LC_NUMERIC=C
[5] LC_TIME=English_Canada.1252
attached base packages:
[1] grDevices datasets splines graphics stats tcltk utils
methods base
other attached packages:
[1] lme4_0.999375-33 Matrix_0.999375-44 lattice_0.18-5 nlme_3.1-96
svSocket_0.9-48 TinnR_1.0.3 R2HTML_2.1 Hmisc_3.8-1
[9] survival_2.35-8
loaded via a namespace (and not attached):
[1] cluster_1.12.3 grid_2.11.0 svMisc_0.9-57 tools_2.11.0
Richard
<<lmerVs lme.Output.txt>>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: lmerVs lme.Output.txt
URL: <https://stat.ethz.ch/pipermail/r-sig-mixed-models/attachments/20110630/067cab24/attachment-0003.txt>
More information about the R-sig-mixed-models
mailing list