[R-sig-eco] CI for mixed models with lme
Manuel Spínola
mspinola10 at gmail.com
Sat Sep 25 22:12:20 CEST 2010
Dear list members,
I am fitting 2 linear mixed model with function lme and I cannot get the
CI for "modelo2" with function "intervlas" (below are the output from
the 2 models).
Any clue why? Thank you very much in advance. Manuel.
> intervals(modelo1)$fixed
lower est. upper
(Intercept) 29.21725 42.85153 56.48581
tempo -24.41173 -19.74592 -15.08011
attr(,"label")
[1] "Fixed effects:"
> intervals(modelo2)$fixed
Error en intervals.lme(modelo2) :
Cannot get confidence intervals on var-cov components: Non-positive
definite approximate variance-covariance
modelo1 = lme(ipa ~ tempo, data=ipa, random = ~1 | localidad)
> summary(modelo1)
Linear mixed-effects model fit by REML
Data: ipa
AIC BIC logLik
2062.101 2075.172 -1027.050
Random effects:
Formula: ~1 | localidad
(Intercept) Residual
StdDev: 44.61678 36.95279
Fixed effects: ipa ~ tempo
Value Std.Error DF t-value p-value
(Intercept) 42.85153 6.898734 146 6.211507 0
tempo -19.74592 2.360827 146 -8.363982 0
Correlation:
(Intr)
tempo 0
Standardized Within-Group Residuals:
Min Q1 Med Q3 Max
-2.50376489 -0.45760686 -0.07812592 0.39097892 5.25554463
Number of Observations: 196
Number of Groups: 49
modelo2 = lme(ipa ~ tempo, random = ~1 | tempo/localidad, data=ipa)
> summary(modelo2)
Linear mixed-effects model fit by REML
Data: ipa
AIC BIC logLik
2144.981 2161.32 -1067.490
Random effects:
Formula: ~1 | tempo
(Intercept)
StdDev: 5.540235
Formula: ~1 | localidad %in% tempo
(Intercept) Residual
StdDev: 54.1832 19.60406
Fixed effects: ipa ~ tempo
Value Std.Error DF t-value p-value
(Intercept) 42.85153 4.961152 192 8.637415 0.000
tempo -19.74592 4.437389 2 -4.449895 0.047
Correlation:
(Intr)
tempo 0
Standardized Within-Group Residuals:
Min Q1 Med Q3 Max
-0.42528137 -0.17487600 -0.08655534 0.06944999 2.05895746
Number of Observations: 196
Number of Groups:
tempo localidad %in% tempo
4 196
--
Manuel Spínola, Ph.D.
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspinola at una.ac.cr
mspinola10 at gmail.com
Teléfono: (506) 2277-3598
Fax: (506) 2237-7036
More information about the R-sig-ecology
mailing list