[R-sig-ME] heterogeneous variance models

Ben Bolker bbolker at gmail.com
Mon May 11 17:28:01 CEST 2015


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

  Quick answer:  I think I shot from the hip and made a mistake.  If
you want to model heterogeneous *residual* variation, the dummy
variable should be applied to an *individual-level* random-effect,
i.e. define something like

   transform(mydata,obs=factor(seq(nrow(mydata)))
   lmer(...~... + (0+dummy(Sex,"Female")|obs)

 More later I hope.

On 15-05-11 11:03 AM, Hufthammer, Karl Ove wrote:
> 
> l_new1 = lmer(distance ~ age + Sex + (age|Subject), data =
> Orthodont) l_new2 = update(l_new1, . ~ . + (0+dummy(Sex,
> "Female")|Subject)) summary(l_new1) summary(l_new2)
> 
> l_old1 = lme(distance ~ age + Sex, random=~age|Subject, data =
> Orthodont) l_old2 = update(l_old1, weights=varIdent(form=~1|Sex)) 
> summary(l_old1) summary(l_old2)
> 
> While the fixed effects estimates for the two models assuming
> homoscedasticity are very ~identical, the estimates from the
> heteroscedasticity models differ:
> 
>>> fixef(l_new1)
> (Intercept)         age   SexFemale 17.6351989   0.6601852
> -2.1454883
>>> fixef(l_new2)
> (Intercept)         age   SexFemale 17.6487393   0.6601852
> -2.1787238
>>> fixef(l_old1)
> (Intercept)         age   SexFemale 17.6352002   0.6601852
> -2.1454915
>>> fixef(l_old2)
> (Intercept)         age   SexFemale 18.4385143   0.5795744
> -1.9407706
> 
> It's a clever trick, but doesn't seem to work properly (or is it
> nlme that doesn't work properly?). (Also, it assumes that one
> *knows* which group has the lowest residual variance.)
> 
> 
> Regards, Karl Ove Hufthammer

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)

iQEcBAEBAgAGBQJVUMqAAAoJEOCV5YRblxUH3KkH/AgZfnd8nzrOOMXgsStOv6yE
nx4cp+bK9uXh9g43iPVFi2rWk7ZoacVt4WyOmsPfprlYOmxU6ri9hsAImyF1TCmM
nQAQd6oDCsJraU683nuizKeqxovntcY2xHOLjUQfITdG0nQUprwX/Oqe3hZS+wcv
IOoJaNk+FIdWEv8zxazkihfcwNCoaKCd55UttSEKVIxnxTOWOSoF+/82i62kBksd
AccTmVzyA5s2H8/yQgjzwWB1usYEqnRBbuu1+Th1RBqQt6eWjmxMRBXLBrLiQ+fR
cLDDdfjDLIKG4rOZiDi5g1ojqiYq/30tjHCuIj4PH1Q0EoSk4PXJuL+gMG6YVoc=
=KD6O
-----END PGP SIGNATURE-----



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