[R-sig-ME] Bug in weights in lmer

Nick Isaac njbisaac at googlemail.com
Wed Apr 23 18:00:32 CEST 2008


Thanks Harold - very curious.
See my results below. This sounds like a versioning issue, in which
case it would be good to get as many folk as possible to replicate it.

cheers, Nick

> w<-rep(1,nrow(sleepstudy))
> (fm1 <- lmer(Reaction ~ Days + (Days|Subject), sleepstudy) )
Linear mixed model fit by REML
Formula: Reaction ~ Days + (Days | Subject)
   Data: sleepstudy
  AIC  BIC logLik deviance REMLdev
 1756 1775 -871.8     1752    1744
Random effects:
 Groups   Name        Variance Std.Dev. Corr
 Subject  (Intercept) 612.095  24.7405
          Days         35.071   5.9221  0.065
 Residual             654.944  25.5919
Number of obs: 180, groups: Subject, 18

Fixed effects:
            Estimate Std. Error t value
(Intercept)  251.405      6.825   36.84
Days          10.467      1.546    6.77

Correlation of Fixed Effects:
     (Intr)
Days -0.138
>
>  (fm2 <- lmer(Reaction ~ Days + (Days|Subject), sleepstudy, weights =
+ w) )
Linear mixed model fit by REML
Formula: Reaction ~ Days + (Days | Subject)
   Data: sleepstudy
  AIC  BIC logLik deviance REMLdev
 1756 1775 -871.8     1752    1744
Random effects:
 Groups   Name        Variance Std.Dev. Corr
 Subject  (Intercept) 6640265  2576.87
          Days         380465   616.82  0.065
 Residual             7105115  2665.54
Number of obs: 180, groups: Subject, 18

Fixed effects:
            Estimate Std. Error t value
(Intercept)    975.9      710.8   1.373
Days           173.3      161.0   1.076

Correlation of Fixed Effects:
     (Intr)
Days -0.138
> (fm3 <- lmer(Reaction ~ Days + (Days|Subject), sleepstudy, weights =
+ w/sum(w)) )
Linear mixed model fit by REML
Formula: Reaction ~ Days + (Days | Subject)
   Data: sleepstudy
   AIC BIC logLik deviance REMLdev
 820.9 840 -404.4    817.3   808.9
Random effects:
 Groups   Name        Variance  Std.Dev. Corr
 Subject  (Intercept) 169988830 13038.0
          Days          9739898  3120.9  0.065
 Residual               1010497  1005.2
Number of obs: 180, groups: Subject, 18

Fixed effects:
            Estimate Std. Error t value
(Intercept)    72.74    3596.47 0.02022
Days           12.92     814.61 0.01586

Correlation of Fixed Effects:
     (Intr)
Days -0.138




More information about the R-sig-mixed-models mailing list