Re: [R] AIC in lmer

From: Douglas Bates <dmbates_at_gmail.com>
Date: Fri 07 Oct 2005 - 23:47:59 EST

The calculation is being done in

                  print(data.frame(AIC = AIC(llik), BIC = BIC(llik),
                               logLik = c(llik),
                               deviance = -2*llik,
                               row.names = ""))

where llik is defined as

              llik <- object@logLik

so the important question is whether the logLik slot has the correct values for the number of parameters.

By the way, why are you calculating a random effect for year when you only have two years of data? The estimate of the variance of that random effect will have almost no precision.

On 10/7/05, Richard Chandler <rchandler@forwild.umass.edu> wrote:
> Hello all,
>
> Is AIC calculated incorrectly in lmer? It appears as though it uses
> AIC = -2*logLik - 2*#parms, instead of -2*LogLik + 2*#parms? Below is
> output from one of many models I have tried:
>
> Generalized linear mixed model fit using PQL
> Formula: cswa ~ pcov.ess1k + (1 | year)
> Data: ptct50.5
> Family: poisson(log link)
> AIC BIC logLik deviance
> 224.8466 219.19 -114.4233 228.8466
> Random effects:
> Groups Name Variance Std.Dev.
> year (Intercept) 0.0062643 0.079147
> # of obs: 125, groups: year, 2
>
> Estimated scale (compare to 1) 1.277183
>
> Fixed effects:
> Estimate Std. Error z value Pr(>|z|)
> (Intercept) -0.1059628 0.1283976 -0.82527 0.4092
> pcov.ess1k 0.0101182 0.0093962 1.07683 0.2816
>
>
> A snip of my data:
>
> cswa pcov.ess250 year
> [1,] 4 7.14 2004
> [2,] 4 19.26 2003
> [3,] 1 3.66 2004
>
> I'm using R 2.1.1 with Windows XP.
>
> Thanks,
> Richard
>
> --
> Richard Chandler
> Department of Natural Resources Conservation
> UMass Amherst
> (413)545-1237
>
> ______________________________________________
> R-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
>



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Sat Oct 08 00:11:32 2005

This archive was generated by hypermail 2.1.8 : Sun 23 Oct 2005 - 18:28:32 EST