[R-sig-ME] weights in lmer

Sundar Dorai-Raj sundar.dorai-raj at pdf.com
Wed Jul 25 18:50:46 CEST 2007


Hi, Prof. Bates,

It appears the weights argument is ignored in lmer but not in lmer2. 
See, for example:

library(lme4)
set.seed(1)
w <- abs(rnorm(nrow(sleepstudy)))
fm1 <- lmer(Reaction ~ Days + (Days|Subject), sleepstudy)
fm2 <- lmer(Reaction ~ Days + (Days|Subject), sleepstudy, weights = w)
fm3 <- lmer2(Reaction ~ Days + (Days|Subject), sleepstudy, weights = w)
VarCorr(fm1) # no weights
VarCorr(fm2) # same as fm1, incorrect
VarCorr(fm3) # `w' applied correctly

sessionInfo()
R version 2.5.1 (2007-06-27)
i386-pc-mingw32

locale:
LC_COLLATE=English_United States.1252;LC_CTYPE=English_United 
States.1252;LC_MONETARY=English_United 
States.1252;LC_NUMERIC=C;LC_TIME=English_United States.1252

attached base packages:
[1] "stats"     "graphics"  "grDevices" "utils"     "datasets"  "methods"
[7] "base"

other attached packages:
         lme4       Matrix      lattice
  "0.99875-6" "0.999375-0"     "0.16-2"




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