[R-sig-ME] Correlations among random variables

Viechtbauer, Wolfgang (SP) wolfg@ng@viechtb@uer @ending from m@@@trichtuniver@ity@nl
Mon Jan 14 13:28:32 CET 2019


I did not follow the whole thread, but what you describe, Avi, clearly suggests an overparameterized model. The 'decompositions' are essentially arbitrary then and are just a matter of differences in the optimization routines. The marginal var-cov structure might still be the same (as suggested by the fact that the sum of the two components is identical in both model fits), so inferences about the fixed effects could still be valid, but I would still worry about fitting a model whose parameters are not uniquely identified (esp. if inferences of interest pertain to the variances of the random effects / errors).

Best,
Wolfgang

>-----Original Message-----
>From: R-sig-mixed-models [mailto:r-sig-mixed-models-bounces using r-
>project.org] On Behalf Of Avraham Kluger
>Sent: Sunday, 13 January, 2019 4:42
>To: R-sig-mixed-models using r-project.org
>Cc: Kenny, David
>Subject: Re: [R-sig-ME] Correlations among random variables
>
>Hi,
>
>Following help from James Uanhoro, I produced models with correlated
>random variables both with nlms and lme4.  Curiously, the estimates of
>the variances and their correlation are identical, but the error
>variances and their correlation are not.  Yet, the sum of the error
>variances are identical.  For example, in the nlme code below the error
>for focalcode + residual is .376 + .046 = .422, and in the lme4 it is .2
>+ .222 = .422.  Can anyone guide me to read about these different
>decompositions?  This may explain the different correlations among the
>error terms .265 vs. .451.
>
>MLM with nlme
>          Variance                            StdDev    Corr
>focalid = pdLogChol(0 + focalcode + partcode)
>focalcode 0.20840953                          0.4565189 foclcd
>partcode  0.06089854                          0.2467763 0.699
>dyadid =  pdLogChol(0 + focalcode + partcode)
>focalcode 0.37674500                          0.6137956 foclcd
>partcode  0.50282362                          0.7091006 0.265
>Residual  0.04641050                          0.2154310
>
>MLM with lme4
>
>> as.data.frame(VarCorr(lme4Mlm))
>             grp      var1     var2       vcov     sdcor
>1 dyadid:focalid focalcode     <NA> 0.20018050 0.4474153
>2 dyadid:focalid  partcode     <NA> 0.32625940 0.5711912
>3 dyadid:focalid focalcode partcode 0.11523355 0.4509065
>4        focalid focalcode     <NA> 0.20840930 0.4565187
>5        focalid  partcode     <NA> 0.06089846 0.2467761
>6        focalid focalcode partcode 0.07872740 0.6988182
>7       Residual      <NA>     <NA> 0.22297497 0.4722023
>> VarCorr(lme4Mlm)
>Groups         Name      Std.Dev. Corr
> dyadid:focalid focalcode 0.44742
>                partcode  0.57119  0.451
>focalid        focalcode 0.45652
>                partcode  0.24678  0.699
>Residual                 0.47220
>
>Yours,
>
>Avi Kluger<http://avikluger.wix.com/avi-kluger>
>
>From: Uanhoro, James<mailto:uanhoro.1 using buckeyemail.osu.edu>
>Sent: Saturday, January 12, 2019 5:38 PM
>To: Avraham Kluger<mailto:avik using savion.huji.ac.il>
>Subject: Re: [R-sig-ME] Correlations among random variables
>
>That is the exact lme4 syntax that replicates the nlme model. I did not
>attempt to run it but when I did, I noticed that the problem is you have
>two random effects, each having 624 values, 624 by 2 equals the sample
>size. lme4 will not run when this happens hence the error message. You
>can tell lme4 to run nevertheless
>
>summary(mlms <- lmer(
>  outcome ~ 0 + focalcode + partcode +
>    (0 + focalcode + partcode | focalid/dyadid),
>  Chapter10_df,
>  control = lmerControl(check.nobs.vs.nRE = "warning")))
>
>This will force the program to run the code, and will print out warnings.
>The log likelihood was the same with that from nlme indicating that the
>models are the same. But the variance-covariance matrices for the random
>effects by the interaction between focalid and dyadid - the inner cluster
>variable - are different. Which one do you trust? Probably neither -
>there is just not enough information to estimate this varCov matrix. See
>this thread for commentary on the issue:
>https://github.com/lme4/lme4/issues/175
>
>Hope this helps, -James.



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