1
$\begingroup$

I am running a linear mixed model in r:

 model <- lmer(variable ~  time +(1+time|id), data = long)

The output for random effects is:

Random effects:
 Groups   Name        Variance   Std.Dev. Corr
 id       (Intercept) 0.14163958 0.376350     
          time        0.00008384 0.009157 0.39
 Residual             0.01127142 0.106167     
Number of obs: 842, groups:  id, 250

I was wondering how to disaggregate the residual terms to show random effect residuals at each time point. In comparison, Mplus output automatically produces what we wanted:

MODEL RESULTS

                                                    Two-Tailed
                    Estimate       S.E.  Est./S.E.    P-Value

 Residual Variances
    N01                0.010      0.003      3.704      0.000
    N02                0.012      0.002      5.021      0.000
    N03                0.012      0.002      5.951      0.000
    N04                0.009      0.003      3.352      0.001

It appears that the residual term in R is simply an average of the 4 residual terms in Mplus. Is there a way to split up the R residual to each time point, and obtaining similar output to Mplus? Thank you!

$\endgroup$
1
$\begingroup$

You have identified one of the differences between modeling longitudinal data within a mixed modeling framework vs. an SEM framework. In the mixed modeling framework with longitudinal data, the base assumption is that there is a common residual variance whereas in SEM, the residual variances at each time point are estimated separately. The question is whether you actually need the variances to be separately estimated at each occasion. You can run a model comparison test to examine this issue in Mplus by constraining the time-point specific variances to be equal (mixed modeling default) in your .inp file as such:

N01 [a];
N02 [a];
N03 [a];
N04 [a];

Then run a likelihood ratio test comparing the two models, either in Mplus or in R (check out SBSDiff in R if you are using type=MLR in MPlus). If the model with the equivalent residual variances fits the data as well as the model with unique residual variances, then the mixed model approach in lmer is perfectly acceptable.

If you wanted to use R to get unique residual variances, you will have to switch over to nlme or lavaan. For examples with nlme, see this extremely helpful page.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.