Message/Author 

Anonymous posted on Friday, September 17, 2004  1:01 pm



In an autoregressive path model with no latent variables, When does a WITH statement refer to the correlation between two variables and when does it refer to the residuals of those variables? 


It refers to the covariance between two variables when the two variables are exogenous. It refers to the residual covariance when the two variables are endogenous. 

Michael posted on Thursday, September 29, 2005  4:16 am



Since a WITH statement for endogenous variables refers to their residual covariance: how can I get the covariance of two endogenous variables (e.g. in a crosslagged panel design)? 

bmuthen posted on Thursday, September 29, 2005  5:43 am



Uset TECH4. 

Michael posted on Thursday, September 29, 2005  6:03 am



Thanks for the quick answer! Is there also a possibility to get the standard error of a covariance of two endogenous variables? 

bmuthen posted on Thursday, September 29, 2005  6:54 am



That is not straighforward currently. This covariance is a function of several parameters and therefore the "Delta" method has to be applied to get the standard error. If you have a simple model you can use Model Constraint to define a new parameter as this function and thereby get the SE. Perhaps we should add automatic SEs for TECH4. 


In testing for measurement invariance over time, it seems to me standard and reasonable to account for the association of a factor with itself over time and for the residual of an indicator with itself over time. My intuition was that it should not make a difference for model whether I model those associations as regression paths (e.g., t2 factor regressed on t1 factor) or as correlations (t1 factor with t2 factor). Yet, I am clearly wrong about that as I just tried this and see that it does impact model fit. Can you recommend a reading that might help to explain why this should make a difference? Also, I am assuming that on theoretical grounds it would be more appropriate to go with the On statements rather than With statements given the temporal ordering but not sure that is the conventional choice. Any thoughts? Thanks as always! 


There must be more in the model to produce that difference in fit. 


yes, the full model consists of 3 indicators of a factor measured at two time points. So, we have one factor at time 1 with 3 indicators and one factor at time 2 with 3 indicators. For one of the 3 indicators, its correlated residual with itself over time is notsignificant. Thus, we have in addition to the six factor loadings, one correlated residual (or regression path) from the time 1 factor to itself at time 2 and two additional correlated residuals (or regression paths) from two of the time 1 indicators to themselves at time 2. I am not sure that I follow why these other parts of the model make a difference though. 


If you like you can send your two outputs to support. 


Dear Sir or Madam, I have a model with six latent factors f1 to f6. f4 ON f1; f5 ON f2; f6 ON f3; f1 WITH f2; f1 WITH f3; f2 WITH f3; If I additionally state f4 WITH f5; f4 WITH f6; f5 WITH f6; does Mplus correlate the three latent factors f4 to f6 or the residuals of the three latent factors f4 to f6 (i.e. as partial correlations of the unexplained variance)? Thank you very much! 


The residuals of the three latent factors. 

Jon Heron posted on Thursday, May 07, 2015  4:33 am



By the way, the diagrammer would have given you the answer. best, Jon 


I have a model: AP on f1 f2 f3 AV on f4 f5 f6 AP on AV AD on AV Mplus is automatically correlating the error residuals of AP and AD. Why is it doing that? Please let me know. thanks David 


Ultimate DVs have correlated residuals by default because they are identified and are most often needed in my experience. This is due to leftout predictors. You can easily get rid of them using e.g. y1 WITH y2@0. 


Dear Drs. Muthen, I and my coauthors are testing a multiple mediator SEM model as below. All factors are latent factors based on (mutually exclusive sets of) continuous indicators. X is the independent factor. Y1 and Y2 are dependent factors. M1 and M2 are theorized to mediate the relationship between X and Y1, and X and Y2 resp. As you can see below, we allow the residual covariance between M1 and M2 to be freely estimated. We would like to preemptively avoid any reviewer questions. Specifying this (M1 WITH M2) does not change the fit statistics or the specific indirect effect statistic much (it deteriorates slightly); the results of the hypothesized relationships do not change. I would like to receive your opinion on: 1. Whether we should include M1 WITH M2. 2. If we should also include Y1 WITH Y2 or that inclusion is implicit (the Y1 WITH Y2 statistic appears in the output even if we don’t include that statement). MODEL: M1 ON X; M2 ON X; Y1 ON M1; Y1 ON M2; Y1 ON X; Y2 ON M1; Y2 ON M2; Y2 ON X; M1 WITH M2; MODEL INDIRECT: Y1 IND M1 X; Y1 IND M2 X; Y2 IND M1 X; Y2 IND M2 X; 


1. Yes  that gives you more information. 2. Yes  but that is already be included by default as you've noticed. 


Thank you so much for your prompt reply. 


Hello Dr. Muthen, I would like to ask about the syntax of "correlation among residuals". If I have the following model: f1 by x1 x2 x3 x4; f2 by u1 u2 u3; f1 on f2; x1 with u2; Can I say that "x1 with u2" refers to residuals correlation? The indicators could be continuous or categorical variables. Thank you, Owis 


Yes. 


Thank you for your response, Is this also applied if the indicators are loaded on the same factor? For example, in the above syntax, can I say "X1 with x2"? Thank you, Owis 


Yes. 

xiao guo posted on Wednesday, September 05, 2018  4:28 am



I would like to ask about the syntax of "correlation among residuals". If I have the following model: f1 by x1 x2 ; !x variable are categorical f2 by u1 u2 ; !u variable are continuous f1 with f2; x1 with u2; !correlated residuals ERROR in MODEL command: Covariances for categorical, censored, count or nominal variables with other observed variables are not allowed. how can I do it! Thank you, guo 


You cannot use the WITH option in these cases. Each residual covariance requires one dimension of integration. Instead specify the residual covariance as follows where u1 and u2 are categorical variables: f BY u1@1 u2; f@1; [f@0]; where the residual covariance will be found in the factor loading for u2; 


Sounds like you are using ML. You can instead use WLSMV or Bayes which allow these WITHs. 

xiao guo posted on Thursday, September 06, 2018  11:19 pm



##########my code######## DATA: FILE = data3.DAT; VARIABLE: NAMES ARE u1u30 t1t30; CATEGORICAL ARE u1u30; ANALYSIS: ESTIMATOR =MLR; !LINK=LOGIT; MODEL: abili BY u1@1 u2u30*; sp BY t1t30@1; abili@1; sp@1; [abili@0]; [sp@0]; sp WITH abili; u1u30 PWITH t1t30; thank you! 1、################# when I do with "f BY u1@1 u2; f@1; [f@0];", the code can not work. thank you! 2、#################### when I use WLSMV to run,yes it can work! but the load and Thresholds of categorical variables is large different with the simulation by logstic regression. I guess maybe they all be standard! how can I compare with the simulation by logstic regression. thank you! guo 

xiao guo posted on Friday, September 07, 2018  2:41 am



thank you! I think the answer is"For estimators WLS, WLSM, WLSMV and ULSMV, all categorical variables can be analyzed using probit link only. "! thank you for your help! 


This is true. 

xiao guo posted on Saturday, September 08, 2018  4:48 am



##########my code######## DATA: FILE = data3.DAT; VARIABLE: NAMES ARE u1u30 t1t30; CATEGORICAL ARE u1u30; ANALYSIS: ESTIMATOR =MLR; !LINK=LOGIT; MODEL: abili BY u1@1 u2u30*; sp BY t1t30@1; abili@1; sp@1; [abili@0]; [sp@0]; sp WITH abili; u1u30 PWITH t1t30; ## why the code can not work! how can i use the mlr to estimate the model thank you! 


Please send the output where you try this model and your license number to support@statmodel.com. 

xiao guo posted on Monday, October 22, 2018  7:52 pm



Hi I want estimate a interaction between two latent variables. eg: eta1 by x1x3; eta2 by y1y3; then the interaction is that: eta3=eta1*eta2 eta3 by x1x3; how can i do it? thank you! 


LV interactions are handled by XWITH: eta 3  eta1 XWITH eta 2; Your statement eta3 BY x1x3 does not make sense: (1) x1x3 are indicators or eta1 and (2) an XWITH interaction variable can appear on only the RHS of ON. 

Back to top 