Hi,

Using lme from the package nlme 3.1-103, I meet a strange warning. I am trying to compare to models with:

library(nlme)
lmez6=lme(lepus~vulpes,random=~1|troncon/an,data=ika_z6_test)
lmez60=lme(lepus~1,random=~1|troncon/an,data=ika_z6_test)

Both have the same number of observations and groups:

lmez6
Linear mixed-effects model fit by REML
  Data: ika_z6_test
  Log-restricted-likelihood: -2267.756
  Fixed: lepus ~ vulpes
(Intercept)      vulpes
 1.35017117  0.04722338

Random effects:
 Formula: ~1 | troncon
        (Intercept)
StdDev:   0.8080261

 Formula: ~1 | an %in% troncon
        (Intercept)  Residual
StdDev:    1.086611 0.4440076

Number of Observations: 1350
Number of Groups:
        troncon an %in% troncon
            169            1350


> lmez60
Linear mixed-effects model fit by REML
  Data: ika_z6_test
  Log-restricted-likelihood: -2266.869
  Fixed: lepus ~ 1
(Intercept)
   1.435569

Random effects:
 Formula: ~1 | troncon
        (Intercept)
StdDev:   0.8139646

 Formula: ~1 | an %in% troncon
        (Intercept)  Residual
StdDev:    1.086843 0.4445815

Number of Observations: 1350
Number of Groups:
        troncon an %in% troncon
            169            1350

...but when I want to compare their AIC, I get:

AIC(lmez6,lmez60)
       df      AIC
lmez6   5 4545.511
lmez60  4 4541.737
Warning message:
In AIC.default(lmez6, lmez60) :
  models are not all fitted to the same number of observations


Has anybody an explanation about this strange warning ? To what extent this warning may limit the conclusions that could be drawn from AIC comparison ?

Thanks in advance,

Patrick

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to