Correlated residual variance in path ... PreviousNext
Mplus Discussion > Structural Equation Modeling >
 Cameron McPhee posted on Thursday, September 21, 2006 - 11:38 am
Hi, I am running a VERY simple path model with repeated measures over time (math scores at T1, T2, T3). I want earlier math scores to predict later math scores but I also want to account for the autoregressive nature of it. I was under the impression that I cannot have the same variables in an ON statement and a WITH statement. Therefore, how do I account for the correlation of the errors between Y1, Y2, and Y3 in the following model?

Model: Y3 ON Y2 Y1;
Y2 ON Y1;
Y1 ON X1-X5;

Thanks so much!
 Bengt O. Muthen posted on Sunday, October 01, 2006 - 11:40 am
You can add

y3 with y2;


because that refers to the residuals of y3 and y2 given that they are dependent variables. But, your model will not be identified if you both regress y3 on y2 and let their residuals correlate.
 Cameron McPhee posted on Wednesday, October 04, 2006 - 12:30 pm
Right, that is what I was afraid of. So what is the right way to specify this model that had these lagged effects without getting biased coeficients?

Or am I totally not understanding?

 Bengt O. Muthen posted on Thursday, October 05, 2006 - 6:57 am
You have to limit yourself to the model

y2 on y1;
y3 on y2;

and hope any residual correlation is small.

To also identify correlated residuals you have to have multiple indicators at each timepoint - see the Wheaton et al (1977) article in the Soc Meth book.
 Annie Desrosiers posted on Wednesday, November 09, 2011 - 1:01 pm
Hi Dr Muthen,

I'm doing a path model with 2 forms of aggression (Y1 and Y2) on 8 independent variables (X1-X8). I need to control for the high correlation between Y1 and Y2. Will the command "Y1 with Y2;" control for shared variance or will it only report error correlation ?

I also tried Y1 on Y2; Y2 on Y1; But I have a just-identified model.

My question : How can I control for the shared variance between Y1 and Y2 ?

Y1 on X1-X8;
Y2 on X1-X8;
Y1 with Y2;

Thank you
 Linda K. Muthen posted on Wednesday, November 09, 2011 - 5:46 pm
The statement y1 WITH y2 estimates a residual covariance. I'm not sure what you mean about the shared variance.
 Xiaoshuang Lin posted on Monday, October 06, 2014 - 4:26 pm
Dear Prof. Bengt and Linda,
I have a similar question with above post. I do SEM and my IV is OT, DVs are V and S. My model structure is as follows:
MODEL: OT BY ot7 ot3 ot2;
RC BY rc3 rc6 rc8;
TC BY tc2 tc3 tc4;
PCBR BY pcb5 pcb4 pcb1;
VO BY v5 v2 v1;
SI BY s4 s2 s1;
SI ON sex age otenure ft;
VO ON sex age otenure ft;
I want control correlations between RC and TC, and between VO and SI. Should I write like as follows?
[RC TC];
[VO SI];
Or write directly as
Thank you very much and I look forward to your reply.
 Bengt O. Muthen posted on Monday, October 06, 2014 - 4:39 pm
Write directly as

 Xiaoshuang Lin posted on Tuesday, October 07, 2014 - 3:54 pm
Thank you very much, Prof. Bengt.
 Paula Vagos posted on Monday, August 24, 2015 - 3:00 pm
Dear Professor Bengt,
I am testing for multi-group invariance using the MLR estimator and get modification indices suggesting WITH mofications. I take they represent correlation between residuals, and I was wondering if the way to put them into a mplus syntax is simply u1 with u2 for example, or if this only applies to ML. I have tried doing this and get what I think is a correlation value between the two observed variables in the ouput, though the model fit improves.

Thank you for your reply.
My kindest regards,
Paula Vagos
 Linda K. Muthen posted on Tuesday, August 25, 2015 - 6:05 am
WITH statements are covariances among residuals for endogenous variables and covariances for exogenous variables.
 Daniel Gladwell posted on Tuesday, January 12, 2016 - 2:35 am
Dear Muthens

I would appreciate your advice on the degree to which I should incorporate WITH commands in a moderately complex SEM.

A simplification of my current Model is
(wave 1 variables generally are latent, wave 7 variables are generally binary indicator variables):

W7GH on W1GH W1Ability W4MH W1Fr (and controls)
W7NEET on W1Ability W1GH W1MH W1Fr (and controls)
W4MH on W1MH W1Ability W1GH W1Fr (and controls)
W7Fr on W1Fr W1MH W1Ability W1GH (and controls)

W7Lifesat on W7GH W7NEET W4MH W7Fr (and controls)

For an additional command I have two options:
2) W7GH W7NEET W4MH W7Fr W7Lifesat WITH
W7GH W7NEET W4MH W7Fr W7Lifesat

I have generally seen equivalents of option "1" used more often in the literature.

If I type in option "2"
a) will MPlus allow the residuals from all the structural regressions to be correlated?
b) what is your view on the legitimacy of this approach if I think there may be unexplained characteristics relating to the individuals which impact all the W7 variables?

When I do option "2" I get some quite odd results whereas the results when I do option 1 are quite intuitive.

Many thanks in advance

 Daniel Gladwell posted on Tuesday, January 12, 2016 - 2:39 am

One correction to the above point is that the W7GH regression should read:

W7GH on W1GH W1Ability W1MH W1Fr (and controls)

I.e. it is regressed on W1MH not W4MH

Many thanks

 Bengt O. Muthen posted on Tuesday, January 12, 2016 - 6:58 pm
You may get a more varied response to this analysis strategy question on SEMNET.
 Daniel Gladwell posted on Wednesday, January 13, 2016 - 1:15 am
Thank you Prof. Muthen - I will ask it on SEMNET.

Do you have any thoughts to offer? I would be very interested in your view.


 Bengt O. Muthen posted on Wednesday, January 13, 2016 - 12:20 pm
In general, option 2 does not give an identified model because you have both a regression of W7Lifesat on W7GH and a correlation between their residuals. So you should probably go with option 1.
 Daniel Gladwell posted on Thursday, January 14, 2016 - 6:24 am
Thank you
 JuliaSchmid posted on Thursday, January 26, 2017 - 12:02 am
Dear Mplus-Team

I'm wondering if it is "allowed" to correlate residuals in ESEM?

Thanking you in anticipation,
 Linda K. Muthen posted on Thursday, January 26, 2017 - 7:51 am
Yes, it is.
 Ads posted on Tuesday, April 25, 2017 - 6:49 pm
I am looking to test how removing the effect of exogenous X3 affects the residual correlation in the following path model:

Y1 ON X1 X2 X3;
Y2 ON X1 X2 X3;
Y1 WITH Y2; ! Residual correlation of interest

I suspect this can be done with MODEL CONSTRAINT and/or MODEL TEST but I am not sure how, and wanted to ask for suggestions.

I cannot just set X3@0 and then look at overall model differences, as the model difference test will reflect the regression paths being set to 0 in addition to a change in residual correlation. I am looking to test the difference in residual correlation only. Thank you!
 Bengt O. Muthen posted on Wednesday, April 26, 2017 - 3:01 pm
I can't think of a way to do this directly using either command. Not sure why a formal test of this would be of interest.
 Christopher Cambron posted on Saturday, July 06, 2019 - 2:25 pm
I am trying to understand how estimating the residual covariances among endogenous mediators at the within person level impacts between level indirect effects. In the following model, the the estimates change depending on whether the covariances among residuals are estimated or not. Any info would be much appreciated.

a1 | m1 on x;
a2 | m2 on x;
a3 | m3 on x;
b1 | y on m1;
b2 | y on m2;
b3 | y on m3;
x y m1 m2 m3 on t;
y m1 m2 m3 on y&1;

m1 m2 m3 WITH m1 m2 m3; !covariance among residuals

y a1 a2 a3 b1 b2 b3 WITH y a1 a2 a3 b1 b2 b3;

a1 WITH b1 (cov1); a2 WITH b2 (cov2); a3 WITH b3 (cov3);

[a1](a1); [a2](a2); [a2](a2);
[b1](b1); [b2](b2); [b3](b3);

NEW(i1 i2 i3);
i1 = (a1*b1)+cov1;
i2 = (a2*b2)+cov2;
i3 = (a3*b3)+cov3;
 Tihomir Asparouhov posted on Monday, July 08, 2019 - 1:27 pm
The estimates might be changing simply because you are using the Bayes estimation. With the Baysian estimation the estimates can change just a little bit because of the random nature of the estimation. Is the change in the estimates significant to warrant looking for another reason? Also, are m1-m3 centered and declared as within variables. If they are within-between variables the missing within level covariances will affect the between level covariance structure. Also, if you have missing data for m1-m3, the within level covariance structure will affect dramatically the missing value imputation and from there the rest of the model. I would recommend setting up a montecarlo simulation with large sample size as this will yield the best answer.
 Christopher Cambron posted on Monday, July 08, 2019 - 4:13 pm
Thank you for the response. m1-m3 are centered and declared as within variables. The a paths are stable up to 2 decimal places with some variation in the 3rd decimal. The means and variances for the b paths are substantially different in some cases suggesting there might be a reason beyond the Bayes estimator. There is also a

c | y on x

I had forgotten to include that is very different across models. There are missing values on x, m1-m3, and y which I'm guessing from your response is the likely source. Thanks again.
Back to top
Add Your Message Here
Username: Posting Information:
This is a private posting area. Only registered users and moderators may post messages here.
Options: Enable HTML code in message
Automatically activate URLs in message