I am running a path analysis with both continuous and categorical variables. My categorical variable (y1, with two categories) is a dependent variable. I have a continuous variable (x1) predicting y1. I did test the relationship by indicating the categorical variable as stated in the User's Guide. I have another variable x2, which is a continuous variable as a moderator in the relationship between x1 and y1 in my model. My hypothesis predicts that x2 interacts with x1 in predicting y1. I want to run this model as a multigroup analysis. I am using raw data in my analysis. Would there be anyone who can lead me step-by-step on how to test the moderating effect? Thank you very much.
If I understand you correctly, you are interested in the interaction between x1 and x2 in predicting y1. If x1 and x2 are both continuous variables, then creating a variable that is the product of the two variables is the interaction term and can be used as a predictor of y1. Multiple group analysis can be used if the variable is categorical.
I got some more questions. Should I use the procedure mentioned above even if the moderating effect is toward the end of a long model:
x1-->y1---->y2---->y3; and if I have a moderating variable, let's say x2, on the relationship between y2 and y3, should I create an interaction term for y2 and x2 and use it as a predictor or should I use a multi-group analysis?
If I have to use multi-group analysis, how do I constrain the other paths (x1-->y1 and y1--->y2)so that I could see the differences of the two groups with respect to the effect on y2--->y3 moderated by x2?
Thank you for your unreserved and immediate responses.
I did as you suggested, i.e., holding paths equal across groups. I would appreciate if you please help me with the following questions.
1. If I hold parameters equal, is there an LMTest that indicates a parameter that should be released? Or a chi square which I can compare? I see a note on the output not to trust the chi square indicated since I have a categorical dependent variable. Remember, the moderating effect I am testing is on the relationship between a continuous variable and a categorical variable.
2. How do I know whether or not the parameter I am interested in is different in the two groups?
3. When I run the model by holding the parameters equal, I got only the estimates (no S.E., std., StdX/Y and any indicator of the significance of the values. What should I do to know the significance of the paths?
Can I send you the output so that you can see what is happening in there? I thank you very much for your responses.
The note in the ouput warns that WLSM and WLSMV cannot be used for chi-square difference tests. This does not mean that they are not trustworthy for testing model fit. You can use WLS for chi-square difference testing. If you are not getting standard errors and the ratio of the parameter estimate to the standard error, then you must also be getting a message regarding this--for example, your model must not be converging. If this is the case, you would also not get Std or StdYX. Note also that you must ask for Standardized in the OUTPUT command to obtain the standardized coefficients.
finch posted on Wednesday, November 15, 2000 - 12:50 pm
I have two questions regarding SEM with MPlus. First, is it possible to test for the moderating effects of a latent variable in a lisrel type model? Secondly, is it possible to estimate non-recursive models in MPlus? Thanks very much.
finch posted on Thursday, November 16, 2000 - 6:43 am
Thanks much for your response. I think that I asked questions that were too narrowly focused. My obvious next questions are, "How?" and "How?" I looked in the manual and couldn't find examples or discussion of either. I found the on-line discussion of moderation with observed variables, but am unsure how to apply that to the factors. Thanks for any help.
I guess I could have elaborated a bit. If you want a latent variable to be a moderator variable, just use it on the right hand side of an ON statement. So, for example,
f2 ON f1.
For a non-recursive model say,
f1 ON f2; f2 ON f1;
If you use the ON statements to describe the regressions among observed variables in your model and latent variables in your model that have been created using BY statements, Mplus automatically does any other manipulations that are needed. Let me know if this does not answer your question.
Anonymous posted on Wednesday, December 13, 2000 - 7:28 am
Is there a way to do a latent variable interaction or non-linear effects model such as those described in the Schumaker and Marcoulides book?
bmuthen posted on Wednesday, December 13, 2000 - 8:22 am
There is a Joreskog-Yang chapter which describes how to do such modeling using non-linear parameter constraints. This facility is not yet available in Mplus.
In your response to a post (By Linda K. Muthen on Thursday, May 25, 2000 - 06:44 am)
The note in the ouput warns that WLSM and WLSMV cannot be used for chi-square difference tests. This does not mean that they are not trustworthy for testing model fit. You can use WLS for chi-square difference testing.
Do you mean by this that instead of the default estimator (WLSMV) for analyses with categorical indicators, that the WLS estimator can be selected in order to obtain a chi-square value that can be used for differnce testing? If not, how does one test for differences in multiple group analyses with categorical indicators?
Yes, WLS can be selected in the ANALYSIS command using the ESTIMATOR= option. We recommend using WLS for difference testing and WLSMV to get a chi-square for the final model.
Sandra Lyons posted on Saturday, February 09, 2002 - 7:55 am
I have a multi-group model with categorical indicators and want to test the equality of coefficients between the groups. But since the matrix is not positive definite, I can't do chi-square difference tests with WLS. I see that you have posted the steps to compute a chi-square difference test for the chi-square obtained with the MLM estimator. Is there something similar for the adjusted chi-square obtained with WLSMV. Alternatively, is there a way to hand calculate a significance test for the difference between two coefficients.
bmuthen posted on Monday, February 11, 2002 - 7:05 am
The difference between two coefficients can be tested using the TECH3 output, giving the variances and covariance for the coefficients. The numbering of the parameters is shown in TECH1. The test is the approximately normal quantity
where diff is the coefficient difference and sd is the square root of
v1 + v2 - 2 cov
where v1, v2 and cov are the variance and covariance elements for the coefficients found in the TECH3 output.
In calculating t to test coefficient differences, I noticed that for WLS estimates t is significant, but t is not significant for WLSMV estimates because the difference is smaller and the s.e. is larger. Why is this? Since this is the case, how is it that WLS can be used for nested model testing for WLSMV estimated models?
There can be differences between WLS and WLSMV particularly when the sample size is not large. The WLSMV results are more trustworthy. Because WLSMV cannot be used for difference testing, we recommend using WLS for this purpose only. We recommend WLSMV for the final model.
Anonymous posted on Monday, March 17, 2003 - 8:34 pm
I am trying to test the moderating effect of a continuous latent variable on the relations between three other continuous latent variables in the model. I understand (via your post on 11/16/00) that by placing the moderator on the right side of the ON statement, you can test for moderating effects on the variables in question (ie. f2 f3 f4 ON f1 w/f1 as the moderator). However, where in the print out can I see whether this moderating effect influences the relations between the two predictors f2 f3 and the outcome variable f4?
I am not sure that I understand your question, but I think that you are asking about indirect effects. If so, Mplus does not currently estimate indirect effects. You would have to do these by hand. If this is not what you mean, can you show your entire MODEL command and then tell me what you are not finding in the output?
Anonymous posted on Tuesday, March 18, 2003 - 1:11 pm
I am sorry if I was unclear. I am attempting to determine whether my moderator, f1, influences the relations between f2 and f4 and f3 and f4. My model command is:
Model: f1 BY y1-y4; f2 BY y5-y6; f3 BY y7-y10; f4 BY y11-y13; f2 f3 f4 ON f1;
I have found the coefficients for the relations between the moderator and each factor and its significance. However, I am looking for any way to see if the inclusion of the moderator changes the relations between f2, f3, and f4.
It sounds like you are interested in looking at the model estimated covariances among factors 2, 3, and 4 for two models -- the model above without the ON statment and the model above as it is. In both cases, the model estimated covariances would be the same. Check TECH4 to see if that is the case. Also, the two models should have the same chi-square and degrees of freedom. This is because both models allow for all four factors to be freely interrelated. If this is still not what you are asking, please try again.
Anonymous posted on Thursday, March 20, 2003 - 6:10 pm
I think I am still being unclear. I am trying to complete a standard moderation analysis with latent variables. I have read Jaccard & Wan (1995)'s article and have investigated that approach. From what I gather from your comments above, it is not possible to do this in MPlus because of the need for nonlinear constraints (12/13/00). I am trying to find an alternative to test if my moderator influences the direct relation between two other latent variables. I have been told that dichotomizing my moderator to create two data sets and using invariance testing on the models is not an appropriate approach. Therefore, I am looking for an alternative. I hope this clarifies my question.
bmuthen posted on Thursday, March 20, 2003 - 6:29 pm
Let's see if this responds to your question. In your last message it sounds as if you are interested in the relationship between 2 latent variables, e.g.
f3 on f2
where this relationship is moderated by a continuous variable, say x. To me, this is the same as x and f2 interacting in their influence on f3.
If this represents what you want to do, we have the solution - see Mplus Web Note #6. If not, please try again.
Paul Kim posted on Tuesday, April 29, 2003 - 4:44 pm
Hi Drs. Muthen,
I've been trying to use a random slopes model but I'm running into a couple problems.
1). Is there any way I can conduct a random analysis with a categorical latent dependent variable? That is, I'd like to run a model that interacts a latent factor and an observed variable to see the effects on a categorical latent variable.
2). I'm using mplus version 2.13, but I'm getting an error that says that the Analysis=random command is not recognized. Is there an update or a patch or something I can get to allow the program to recognize this command?
Anonymous posted on Wednesday, December 17, 2003 - 11:03 pm
Is there a way to do a latent variable interaction or non-linear effects model such as those described in the Schumaker and Marcoulides book? Or is It possible to do the model Including nonlinear constraints in MPLUS2.14? Thank you very much.
Mplus Version 3 will have latent variable interactions using maximum likelihood estimation. I don't believe that what is described in the Schumaker and Marcoulides book is true maximum likelihood. Version 3 will also have non-linear constraints. In Version 2.14 one can do an interaction between a continuous latent variable and a continuous observed variable by using a trick.
Anonymous posted on Wednesday, March 10, 2004 - 8:26 am
I would like to test an interaction between a continuous latent variable and continuous observed variable. What is the trick one needs to use in version 2.14 to do this? Thank you!
This is described in Web Note 6 which can be accessed from the homepage at www.statmodel.com.
Anonymous posted on Wednesday, March 17, 2004 - 1:19 pm
I'm interested in knowing if its possible to do something like an F-test using the Mplus output (specifically the THETA parameter array). I'd like to perform more "targeted" tests of model fit than I expect can be done with the RMSE and SRMR summary statistics Mplus provides.
Specifically, I'm intersted in testing for level-1 interaction effects in a multilevel SEM with mutiple dependent variables.
Could the THETA parameter array for a set of constrained versus unstrained models be used in this way ?
bmuthen posted on Wednesday, March 17, 2004 - 4:51 pm
Could you describe the types of interaction effects that you are interested in?
Anonymous posted on Sunday, May 23, 2004 - 9:46 pm
I would like to test moderation effect of one continuous latent construct (f1) on another (f2), where the moderator is also a continuous latent construct (f3). I want to divide the sample into two equal percentile subsamples based on f3 (below and above f3 median), and look at the change in coefficients (f2 on f1) between these two groups. How do I implement it in MPlus (dividing sample into two subsamples)?
This would be modeled by defining the 3 factors using BY statements and then saying (assuming f2 is your dependent variable)
f1xf3 | f1 XWITH f3;
f2 on f1 f3 f1xf3;
I would not divide the sample but instead use the estimated model. From the estimated model you can deduce what the moderated f2 on f1 slope is for different values of f3. The f3 mean is zero and you get its estimated variance and can therefore try say +1SD and -1SD from the zero mean.
How to deduce such moderated slopes is exemplified on page 59 in the Mplus Short Course handout New Features in Mplus Version 3. Essentially, this involves rewriting the expression on the RHS,
b1*f1 + b2*f1*f3,
(b1 + b2*f3)*f1
showing that f3 moderates the influence of f1 on f2.
Anonymous posted on Monday, May 24, 2004 - 10:04 am
Thank you. Is it a new feature in MPLUS 3? Can I still do it by dividing the sample in MPLUS 2.14 - I have received a firm external recommendation to do this, instead of testing interaction with a continuous latent variable.
Yes, this is a new feature in Version 3. You can divide the sample in Version 2.14 or Version 3 by saving the factor scores and creating groups based on f3. However, if you believe there is an interaction and save factor scores using a model without an interaction, the factor scores will be biased and the model will be fraught with problems.
Anonymous posted on Monday, May 24, 2004 - 12:51 pm
Is this feature included in Base, Mixture add-on or Multilevel add-on part of Version 3?
The new ML latent variable interaction feature (XWITH) is included in the Base part of Version 3. For background reading, see Klein and Moosbrugger (2000) in Psychometrika.
Anonymous posted on Monday, May 24, 2004 - 1:23 pm
Is there any limit on the number of interactions to be tested in one model in Version 3? In other words, if f2 is dependent variable, f3 is a moderator, g1, g2, g3 etc are independent variables, can I test the model:
f2 on g1 g2 g3 g4...f3 g1xf3 g2xf3 g3xf3 g4xf3..; for any number of g, or is there any technical/computational limit? All variables here are continuous latent constructs.
Latent variable interactions require numerical integration which is computationally demanding. So although there is no limit set by Mplus, there is a practical limit on how long you probably want to wait for the model to converge. If you look under numerical integration in the Version 3 Mplus User's Guide, you will find a discussion of numerical integration.
I'm trying to test a model where I have a latent categorial variable infuencing a dependent latent continuous variable and 3 observed continuous variables as moderators. Is mixture modeling an appropriate way to test the interaction between the latent categorial variable and the observed continuous variables?
If so, do you know some readings that can help me with the procedure?
Anonymous posted on Wednesday, July 07, 2004 - 1:35 pm
I have a methodological question for you and would appreciate if you could offer some insights. We are using structural equation modeling to determine whether the relationship between a predictor and an outcome is mediated by an intermediate variable. We are interested in determining whether these relationships are "independent", but believe that may be confounded by another variable. How would you test for confounding in this case? More generally, how do you test for confounding if a model includes an intermediate variable?
Anonymous posted on Wednesday, July 07, 2004 - 1:37 pm
Hi Linda, I have a methodological question for you and would appreciate it if you could offer some insights. We are using structural equation modeling to determine whether the relationship between a predictor and an outcome is mediated by an intermediate variable. We are interested in determining whether these relationships are "independent", but believe they may be confounded by another variable. How would you test for confounding in this case? More generally, how do you test for confounding if a model includes an intermediate variable?
bmuthen posted on Wednesday, July 07, 2004 - 6:42 pm
This is the answer to Montreal - Bonjour!
Yes, in the mixture modeling you can allow the effects of the 3 observed continuous variables on the dependent latent continuous variable to vary across classes - so that captures the interaction, i.e. the moderation.
"One way that you could test the confounder effect is to consider the confounder as a oderator. If the confounder is a grouping variable, then a researcher could test the equality of the mediated effect across the levels of the grouping (confounder) variable(Multiple Group SEM). The equality of the relation of X to M and from M to Y across the groups can be tested. In this way, the researcher could test whether confounder effects the a (X to M) or b (M to Y), or the mediated ab (X to M to Y) effect. It would be especially compelling if the researchers' hypothesized which part of the mediation effect should be confounded.If the confounder is a continuous variable, the same type of tests could be used but would require constructing interactions between the confounder and M, and Y so that there would be interaction effects in the prediction of Y and M. Your work with Andreas Klein is helpful here (Klein & Moosbrugger, 2000 cited in the Mplus manual; Example 5.13). These interactions then provide tests of the equality of the a and b paths across levels of the confounder.
aap034 posted on Tuesday, January 11, 2005 - 4:39 pm
I am trying to run an analysis where the x, y and z (z being a moderator) are all continuous. Most of the research I am seeing is telling me to catergorize z apriori. However, I am still unsure on how to analyze the data if all three variables are continuous. Can you help?
I used WLSMV. As far as I understood it is not possible to compare chi-square values of 2 models based on WLSMV. Now I have 2 non-nested models. The models have the same number of free parameters, the same WLSMV-degrees of freedom, they are based on the same data set. Is it perhaps possible to compare the chi-squares of these models under these conditions? Thanks for help!
I'm not sure about this. Perhaps someone else can comment.
Anonymous posted on Thursday, September 22, 2005 - 2:32 pm
I am running a path analysis and am interested in testing for mediating influences (using the IND command) as well as moderation effects. When using MLR, can I still compare across nested models and compute chi-square differences to assess model fit? The output gives me a warning statement "The chi-square value for MLM, MLMV, MLR, WLSM and WLSMV cannot be used for chi-square difference tests." The manual does not cover MLR as one of the estimators for which the DIFFTEST command can be used.
For the estimators mentioned in the message, it is not the DIFFTEST option that you should use but the scaling factor that is printed in the output. See the homepage where a discussion of this is found under Chi-Square Difference Testing for MLM. This applies to all estimators mentioned including MLR.
joshua posted on Saturday, November 26, 2005 - 2:57 pm
I'm trying to determine whether 9 regression coefficients differ with respect to 2 groups in the context of multigroup analysis. Basically, I've 3 exos and 3 endos and a moderating variable (2 groups) which is categorical.
Just to confirm...I would have to fix the path to be equal in both groups in one analysis and allow them to be freely estimated in another analysis. Am i right to assume that this is done one at a time for all 9 of the paths?
Also, assuming that holding the first path to be equal did not significantly worsen the fit, we would still hold that path to be equal while moving on to constraining the next path to be equal across both groups, correct?
If you are interested in 9 slopes beoing equal across groups, I would hold them equal and then not equal and get a joint test for all of them. If that test is rejected, I look at Modification indices in the run with them held equal to see which ones violate equality.
joshua posted on Monday, November 28, 2005 - 3:37 am
1. Btw, I'm assuming that you would use similar approach to test for measurement invariance for factor loadings in say across both groups?
2. When you mentioned you would look at the modification indices (MIs) to see which violates equality, did you mean that we should be looking for ones above 3.84 for 1 df?
What if we have a path with significant MIs across both groups? One group could still have a path that would be significantly larger than another. Should we test this path separately again?
1. Yes. 2. Yes. Yes, if you want to know if one is larger than the other.
joshua posted on Friday, December 02, 2005 - 8:43 am
I've run the analysis as what you've suggested.
I've found a significant difference between the model in which all 9 regression coefficients were held equal and the model where all 9 were freely estimated.
Out of the 9 regression coefficients, I found 3 to be non-invariant across both groups (as suggested by mod. indices). Hence, I can interpret that my dichotomous variable moderated the 3 relationships.
Here's where my problem lies....
I went on to free the 3 regression coefficients while allowing the other 6 to be freely estimated between both groups. Basically, I respecified the model as suggested by Mod Indices.
I observed the regression coefficients..the ones that were previously found to be moderated by ethnicity (as suggested by Mod indices)... one of the 3 regression coefficients that registered a mod indices > 3.84, was not even statistically significant in their respective groups.For example, in one group the Est/S.E = -1.122 and in another 0.438.
Am I right to state that the Mod Indices can only be used as a neceesary but not sufficient tool to test for the presence of a moderating effect? If yes, does this mean we still have to observe the individual paths estimate in both groups after respecifying the latent variable model as previously suggested by the Mod Indices?
Once you free a parameter, you would need to rerun the model to see how other modification indices are affected. I would free the parameter with the largest modification index first and then see if the others still need to be freed.
Carol posted on Thursday, January 26, 2006 - 12:11 pm
Dear Dr. Muthen,
I am trying to model the moderating effects of one variable on the heritability of another variable. In other words, are the genetic influences on X stronger in individuals who are high on Y where X and Y are both continuous observed variables. I believe this is the same as asking of there is an interaction between the latent additive genetic factor (A) and the observed variable Y.
Without the moderator variable I would specify something like
A1 by X1 (11); A2 by X2;
where 1 and 2 designate twins.
Would I think use XWITH to define a second variable
A1xY1 | A1 XWITH Y1
and then also specify that X is indexing this interaction variable?
instead of using a BY statement. You cannot use a BY statement when a1xy1 has already been defined in the interaction statement.
Carol posted on Monday, January 30, 2006 - 9:17 am
Hi Dr. Muthen,
Thank you for your suggestion. Below is the script that I am using, recall that I want to know if heritability of X changes across Y (both continuous). With this script I get an error message saying that Y1 and Y2 are uncorrelated with any variables in the model, but I thought that any variables that weren't specified as being uncorrelated were automatically assumed to be correlated. Certainly X and Y are correlated on a phenotypic level. I'm not sure where the error is.
Mplus has defaults that are described in the user's guide. All variables are not automatically correlated. If there are covariances missing from your model results that you want to see, you need to add them to the model using the WITH option.
I would like to compare two models: one model in which latent variable A is considered a mediator between variables B (observed) and C (observed), and one model in which I have entered an interaction term between A and B (using XWITH and adding ALGORITHM = INTEGRATION to the ANALYSIS command). I have compared the loglikelihoods of both models using the Satorra-Bentler scaled chi-square difference test and find that the mediation model has significant better loglikelihood than the interaction model. However, I would also like to know whether the Rsquare of variable C differs between the models. The Mplus output for the interaction model, however, does not include this information. Is there any way to get Rsquares for the interaction model? Thank you.
I was wondering if you knew of a reference for properly displaying structural models with moderators when using the Xwith command. Specifically, I'm not sure, particularly given the algorithm used by mplus whether I should have indicators of the interaction construct.
The issues of graphically displaying the interaction between continuous variables are the same for observed or latent variables. This is difficult to do. I would think this is discussed in regression texts and also articles by Aitkin and West.
Sorry...I've been unclear. My question was not about how to graphically display the interaction, but about how to represent the moderator variable in a path diagram. Its not that important and I don't need to take up more of your time on this.
I am trying to run a model (all observed and continuous variables) with two moderator variables interacting with four predictor variables to predict the outcome variable. I do not want to use multigroup analysis.
Is this currently possible in MPlus? If so, are there issues with model convergence?
If you want to create interactions between two observed variables, use the DEFINE option to do so and include those variables in your model as covariates. This has always been possible in Mplus and I know of no obvious convergence problems.
I'm specifying a model that has somewhat skewed indicators and an interaction between two exogenous latent variables.
Typically I would use the 'two-step approach', where the CFA model is specified first after which the SM is tested.
I can still do the first step (i.e., CFA; possibly using mlm or mlmv to deal with the non-normality). But having done that, do I then just start with the final CFA model as my foundation when I move to the SEM? Because there's no way to compre the CFA results to the SEM model with the latent interaction.
Also, when using the interaction test (i.e., XWITH), do I need to worry about the non-normality of my indicators?
One question is if the lv interaction variable influences the factor indicators or only some other variable. Both are possible in Mplus.
Yes, just start with the final CFA as your foundation.
Non-normality of indicators is possible even with the normality of the factors that XWITH assumes. Due to non-normal residuals, or due to the lv interaction influencing the indicators. Use MLR to take non-normality of indicators into account.
I am trying to run a model that includes multiple interactions among continuous latent variables (created using XWITH). This apparently requires TYPE=MIXTURE and ALGORITHM=INTEGRATION. However, I keep recieving an error message that says there is not enough memory because " analysis requires 8 dimensions of integration resulting in a total of 0.39062E+06 integration points." I've been assured that I have all the memory I'm likely to get. Is there any other way around this problem?
8 dimensions of integration is difficult to accomplish. You can try
integration = montecarlo;
which demands less memory.
Or, you can try to simplify the model so that you have fewer dimensions of integration. To simplify the model, you can try to break it down into its parts. This might show that not all of your lv interactions play a significant role in the full model.
I have a quick question. I ran a latent interaction model with two latent variables comprised of 3 items each using the integration algorithm, and the t-value associated with the interaction term is significant. My next step is to plot the interaction using a method similar to Aiken & West. However, this method is based on the assumption that the mean of each latent variable comprsing the interaction is zero due to centering. From my understanding, it is not necessary to center variables when using the Kline & Moosbrugger approach. How then do I find out what the latent means of my variables are? Are they automatically set to zero or is a there a specific command I need to give Mplus to retrieve these values in my output?
Hello, I am new to Mplus and currently have the demo version. I am trying to gain a better understanding of the program because I am interested in using it for my dissertation research.
My hypothesized model posits mediated-moderation, and there are 6 continuous variables involved (4 predictors (2 pairs of interacting variables) and two outcomes (one is a proposed mediator, the other the outcome).
Which examples would be most proximal to this type of study? If none exist in the demo version, can you refer me to articles that may have done similar analyses so I can have a better idea of (a) how to explain my proposed data analytic strategies and (b)understand what I will need to do?
In my model two continuous latent predictors (a,b) and an interaction between these (a*b) predict a latent continuous variable d. As described in the Mplus user guide, I am using: ANALYSIS: TYPE = RANDOM; ALGORITHM = INTEGRATION; and XWITH. I have got following questions:
1) I would like to compare the interaction model with the model without interaction. Which is the correct Mplus syntax (concerning estimation method, model specification etc.) for the model without interaction term? Should I simply run the syntax for the model with interaction (see above) and delete the interaction part? Or use another estimation method, for example : TYPE = GENERAL; ESTIMATOR = MLR or ML?
2) When I am running the interaction model, I do n0t get a R**2 and intercept to calculate the regression between the latent variables. How do I get these? My solution was to save the fscores of the latent variables and then run a regression on these (get R**2 and intercept). However, I get different results for the parameter estimates. Regression (latent interaction model): d = no intercept + 0.620*a - 0.208*b - 0.884*inter Regression (fscores; ML,Meanstructure): d = 0.01 + 0.730 *a - 0.150*b - 0.852*inter Why?
1. Run the model with the interaction and the model without the interaction. You will not need RANDOM and ALGORITHM=INTEGRATION without the interaction. Be sure you use the same estimator. 2. How R-square would be defined in this situation is unclear and is a research question. I would not use factor scores for this purpose. Means and intercepts of factors are fixed at zero in a single group analysis.
thanks for your quick response! So my conclusion out of your suggestion is:
1) I can use the same Syntax (RANDOM and ALGORITHM=INTEGRATION) but it is not needed. I also can run TYPE = GENERAL; but as ESTIMATOR I should use MLR, because MLR is used in conjunction with ALGORITHM=INTEGRATION as default. Could I also use another Estimator with ALGORITHM=INTEGRATION?
2) How do I free the intercept? I tried it with: TYPE=RANDOM, ALGORITHM=INTEGRATION and additional I included TYPE=MEANSTRUCTURE into the syntax, but I do not get it.
Ok! I would like to have the intercept of the dependent latent variable to be able to show the latent interaction graphically. Do you know another possibility how to do this, except of running a regression with the saved latent variable scores?
sorry, silly question: the intercept is zero, as you mentioned above.
Last question: If I use MLR, I have to calculate the difference-test between the two models using the formulas from your website http://www.statmodel.com/chidiff.shtml under "Difference Testing Using the Loglikelihood"?
Do you have a reference to suggest on the MLR estimator ?
and, If I do, for instance, a SEM with non normal data and missing values, is there any problem in using MLR (would you suggest something else), instead of MLM or MLV which do not accomodate missing, even if the TYPE is not COMPLEX ?
I am trying to test the moderating effects of a continous latent variable (L) on the relationship between a binary IV (x) and a binary DV (Y).
i followed the instructions of the userguide, using:
ANALYSIS: TYPE=RANDOM; ALGORITHM=INTEGRATION;
MODEL: y ON X L; X x L | x XWITH L; Y ON X x L;
this generates an error message
ERROR in Model command Only one interaction can be defined at a time.Definition for the following: X X L
Perhaps this is because my IV (x) is a binary variable. Am i using the incorrect syntax to test the moderating effects of a latent continous variable on the relationship between 2 binary variables? If so, perhaps you could suggest the appropriate syntax for such a model?
I have conducted a mediational analysis using the syntax below, where x is a continuous latent variable, M is continuous observed and y is binary observed.
Y on X; Y on M; M on X;
MODEL INDIRECT: Y IND X;
This model provided a good fit to the data and indicated partial mediation. However, I would like to determine whether the mediating effects of M are moderated by a confounder (C). C is a binary observed variable, so I understand I must conduct mulitple group analysis. Having read the manual and this site I am unclear as to how exactly I write the syntax to test these effects. What syntax must i add to the model above to determine whether C moderates the mediating effects of M.
I am running a multiple mediation analysis with a single dichotomous outcome. I am trying to test for moderation by gender. I have included gender as a grouping variable and generated output by gender. Now I'm not sure how to test whether the mediation is different by gender. So for example, if I wanted to test the equality of the mediated effect in each group, would I subtract the mediated effects (a11b11-a12b12) for each mediator I'm testing and then divide it by the average of the standard errors for the two groups? Or is there some code I can include to get Mplus to test this for me? Thanks!
Kihan Kim posted on Friday, January 23, 2009 - 6:38 pm
One follow-up questions is:
For the sample path model, x1 -> y1 -> y2 -> y3, and X2 moderating the relationship between Y2 and Y3 only,
When I run a multi-group path model with NO constraint, I find that the path Y2 to Y3 is significant for one subgroup, but non-significant for another subgroup. Is this also an evidence of moderating effect? If so.. then which method is better: (a) the chi-square difference test between constrained and non-constrained model OR (b) just one multi-group path model with NO constraint.
In (a) you get a likelihood-ratio chi-square. In (b) you can get a Wald chi-square by letting the y2->3 path be different in the 2 groups and then test for equality using Model Test. The 2 chi-square tests are asymptotically equivalent but may differ in any one sample.
I have a simple path model which appears to fit my data well (RMSEA<0.001). However, when I introduce an interaction term between two (endogenous) variables the fit becomes dramatically worse (RMSEA=0.32). Is this a common problem with an obvious explanation? I notice that by removing variables from the path model so that the variables in the interaction term are no long endogenous I again get a good fit (RMSEA<0.001).
I'm sure there's something very simple I'm overlooking! Any help gratefully received.
Thank you in advance.
Full path model without interaction (RMSEA<0.001):
X2 ON X1; X3 ON X1; Y1 ON X1 X2 X3; Y2 ON X2 X3 Y1;
Full path model with interaction (RMSEA=0.32):
X2 ON X1; X3 ON X1; Y1 ON X1 X2 X3 X2X3; Y2 ON X2 X3 X2X3 Y1;
Restricted path model with interaction (RMSEA<0.001):
Y1 ON X2 X3 X2X3; Y2 ON X2 X3 X2X3 Y1;
All variables are continuous and centred about their means. X2X3 denotes the product of X2 and X3.
As far as I know this is not a common problem with an obvious explanation. Of the 3 models you listed the content (the restriction that makes the model have degrees of freedom) of the first 2 seems to be that x1 does not influence y2 directly. For some reason, adding the interaction seems to make that restriction less well fitting. It is hard to say why this partial effect is needed with the interaction included and not without it. The third model looks like it has zero d.f.'s.
Many thanks for your prompt response. Is it perhaps because I need to include
X2X3 ON X2 X3?
I had not done so as there is no obvious analogy in standard multivariable regression (i.e. I would just regress Y1 on X2, X3 and X2X3) but thinking about it now this is actually constraining X2 -> X2X3 and X3 -> X2X3 to be zero, which is clearly ridiculous...
y1 ON sex x1 x2 x3 x1_x2 x1_x3 x2_x3 x1_x2_x3; y1#1 ON sex x1 x2 x3 x1_x2 x1_x3 x2_x3 x1_x2_x3;
Where y1 is a count variable on a zero-inflated Poisson distribution, sex and x1-x3 are coded bivariate 0/1, and underscore terms are interactions between x variables.
For graphing purposes, I would like to get [y1] for: * different combinations of x1-x3 levels (e.g., [y1] where x1=0, x2=1, x3=1), with sex covaried out; as well as * [y1] where one of the x variables is treated as an additional covariate (e.g., [y1] for x2=1, x3=1, sex & x1 covaried out)
Is there a way to request these covariate-adjusted group means as part of the output?
I am a PhD Student working on my dissertation proposal. I am familiar with SEM using LISREL but was directed towards Mplus becuase of its ability to handle dichotomous outcome variables. I would like to use SEM to test a model of three continuous latent factors with a moderated mediation effect on the dichotomous observed outcome variable. Am I correct in saying that Mplus can be used to test this model and will be able to provide a test of the indirect and interaction effect?
brianne posted on Tuesday, April 07, 2009 - 1:45 pm
I am wondering if I can compare two alternate moderator models using model fit indices if the main variables are the same, but the interactions are different. In other words, are these considered the same variables, but different paths OR are they considered different variables?
In model 1: a on y b on y a*b on y c on y (control)
For model 2: b on y c on y b*c on y a on y (control)
brianne posted on Tuesday, April 07, 2009 - 1:50 pm
Because residual variances vary as a function of x, there is not a single R-square with TYPE=RANDOM. This is not related to the Marsh Wen Hau paper.
Gloria Li posted on Tuesday, May 19, 2009 - 7:36 pm
Dear Prof Muthen,
I have a mediated-moderation model involing 5 latent variables. My hypothesized model includes 3 antecedents, Y1 - Y3, they interact with each other (two 2-way and one 3-way interaction) to predict Y4 which then predicts Y5. They are all continous variables. I have used "TYPE=RANDOM & ALGORITHM = INTERGRATIPN" in ANALYSIS, however, I was not able to get the fit indices. Is there anyway to calculate them? If not, how can i report the model fit for the model? Please advise.
What's typically done in situations like this is to work with "neighboring" models for which you compute 2 times the loglikelihood difference to get a chi-square test.
You said you had 5 latent variables y1-y5 where y1-y3 (and their interactions) influence y4 which influences y5. So the model has 2 types of content which can be tested. First, are the measurement models (the factor models) well-fitting? You can test that by regular fit indices of each measurement part separately. Second, are there any direct effects from y1-y3 to y5? This second question can be addressed by a "neighboring" model which allows such direct effects versus one that doesn't.
Gloria Li posted on Monday, May 25, 2009 - 7:55 am
By measurement model, which vairables should I plug in? Becasue I do not hypothesize the main effect of y1-y3, instead, I have 3 hypotheses respecting interaction effects: y1*y2, y1*y3 and y1*y2*y3 on y4 and then to y5. Regarding "neighboring" model, which section in the user's mannual i can refer to? Would you please give some more info?
You have one measurement model for each latent variable - see your BY statements. The fact that you have interactions of the latent variables y1-y3 in their influence on y4 does not change the fact that you have a regular factor analytic measurement model for each of y1-y3, plus also for the 3 together.
Neighboring models are not explicitly explained in the User's Guide but in our courses. I gave an example of a neighboring model that has direct effects, which seems relevant for what you do. Such a model is straightforward to specify using the UG. Also see our courses available on the web - particularly topic 1.
Gloria Li posted on Monday, May 25, 2009 - 11:14 pm
Since I am new to Mplus, I am sorry for the overwhelming questions. For the measurement model, I have tested 4 models: (a) y1,y4 & y5; (b) y2,y4 & y5; (c) y3,y4 & y5; (d) y1-y5. Only the first one obtains acceptable fit index. Is that still ok to run SEM of interaction-effect model?
I have been searching more info of neighboring models and I have referred to this online handout: http://www.statmodel.com/download/Topic%201.pdf However, I still have not able to write commands for that. Would you please give more guidance? What does it mean by "using the UG"?
Regarding your first question, no you have to have acceptable fit in your measurement models. Otherwise your latent variable modeling has little meaning - not a strong enough relationship to your data.
Regarding your second question, look at UG ex 3.11. The content of this model is that x1 and x3 don't influence y3 directly. As a test of whether this is a good model you can apply the neighboring model idea and include those 2 direct effects:
y3 on x1 x2;
The 2 times loglikelihood difference is a chi-square test with 2 df of the initial model. You can use that same general approach for the relationships among your latent variables.
I suggest that you study the web video of Topic 1 on our web site and read up on the SEM literature.
Hello, Drs. Muthen I¡¯m wondering if it is possible to examine the moderating effect of a second-order continuous factor(f9) between second-order continuous factors (f5 & f13).
Could you check my syntax?
VARIABLES: NAMES ARE y1-y30 ANALYSIS: TYPE = RANDOM; ALGORITHM = INTEGRATION; MODEL: f1 BY y1-y3; f2 BY y4-y6; f3 BY y7-y9; f4 BY y10-y12; f5 BY f1-f4; f6 BY y13-y15; f7 BY y16-y18; f8 BY y19-y21; f9 BY f6-f8; f10 BY y22-y24; f11 BY y25-y27; f12 BY y28-y30; f13 BY f10-f12; f13 ON f5 f9; f5xf9 | f5 XWITH f9; f13 ON f5xf9; OUTPUT: TECH1 TECH8;
Eulalia Puig posted on Thursday, October 29, 2009 - 12:42 pm
Dear Linda or Bengt,
I have a path model with several mediation variables. All dependent variables are continuous. I'd like to know whether the direct effect is smaller than the indirect effect(s) altogether - what test can I use and how do I enter it in Mplus?
You can test if the direct effect is different from all the indirect effects using Model Constraint and parameter labels to express these effects and their difference. The difference then gets an estimate and a SE. This requires you to know how to express the effects in terms of the parameters.
Essentially, mediation concerns indirect effects quantified as a*b, where a and b are slopes. So your Mplus model should label a and label b (see UG) and use Model Constraint to compute a*b. It sounds like your model has several such indirect effects which you can then add up and compare to the direct effect. You can check that you do the effects right by comparing to the Model Indirect results. I'm afraid I can't help you more than that. If not sufficient, you have to consult a more experienced Mplus user.
I'm finding tons of things through this reference, so I think I know how to do it.
dan berry posted on Sunday, November 01, 2009 - 3:17 pm
Dear Mplus folks,
I’m looking to fit a three-way moderation model in which the growth factor (i.e., LGM) effect on a distal outcome varies as a function of observed X1, which should, in turn, vary as a function of observed X2 (i.e., X1*Slope*X2
I’m unclear if there’s a way to do a 3-way interaction using the “xwith” function.
Is it possible (or sensible) to use the 2-way interaction variable created in one “xwith” command and then use that created two-way interaction term in second “xwith “ command where it is used as one of the variables to be interacted (i.e., does this create a 3-way). Are 3-way interactions possible, when one variable of the 3 is latent?
You can do a three-way interaction as shown above. Or you can use the KNOWNCLASS option for the binary variable.
Anonymous posted on Tuesday, December 01, 2009 - 6:20 pm
Hi Linda: I am testing an interaction between two continuous latent variables. When I run the model I get an error message saying "RECIPROCAL INTERACTION". What does this mean? It seems this error comes up if the variables are categorical but my variables are continuous. Any suggestion will be helpful.
The estimates in the results section of the output are not standardized.
With TYPE=RANDOM, chi-square and related test statistics are not developed. In this case, nested models are compared using -2 times the loglikelihood difference which is distributed as chi-square.
Ewan Carr posted on Thursday, May 13, 2010 - 3:57 am
Quick question: if a moderating variable has a significant effect, but worsens the overall model fit considerably, what should I do?
The model fit without the moderator is > 0.968. When the moderator is included it drops to 0.800. The modification indices suggest I should allow for relationships between the moderator and other predictors in the model, but I'm not sure if that makes sense.
I’m testing a model similar to that outlined in Example 5.13 in the Mplus user guide (with direct and interaction effects of two continuous latent variables f1 and f2 on a mediating variable f3, which has a direct effect on a DV f4).
My question is, how can we test mediation in this case?
If I may ask some sub-questions: 1. Is it possible to test moderated mediation without creating dummy variables for the different levels of the moderating variable? For example, is it possible to test for mediation in the case of a continuous LV interaction just like I would for mediation for any other latent variable? I.e., may a method such as causal steps method (Judd & Kenny, 1981; Baron & Kenny, 1986) be used by treating the interaction term like any other LV, and look at the direct and indirect effects?
2. If the answer to question 1 is yes, then, how do I compare the size of the loadings in the case of interactions, since standardized loadings are not available for TYPE=RANDOM, ALGORITHM=INTEGRATION?
3. If the answer to question 1 is no, then to test mediation at 2 levels of the moderator (mean +- 1SD), is it possible to obtain the mean and standard deviation of the moderating variable and create a dummy variable in Mplus that codes the mean+-1SD values of the moderator as 0 and 1?
Thank you for the quick response Linda. Is it possible for you to point me towards any references that would support the use this approach for testing moderated mediation? That is, any references suggesting that we can indeed treat the interaction term as any other LV.
I think that judging the significance of indirect and direct effects from latent variable interactions is alright from basic statistical principles. I am not familiar with the "causal steps method (Judd & Kenny, 1981; Baron & Kenny, 1986)" that you mention. To me, mediation means that the indirect effect is significant, be it from a main effect or an interaction effect.
I have not seen writings on this particular issue.
Thank you for the explanation. Please ignore my comment about the causal steps method; it was just a potential solution I was considering to test whether a significant indirect effect exists.
As you note, I'm basically trying to establish the significance of the indirect effect of an interaction (f1xf2) on a dependent variable (f4) through a mediating variable (f3). As the MODEL INDIRECT command is not available when using TYPE=RANDOM, ALGORITHM=INTEGRATION, I was not sure about how to test the significance of the indirect effect, even though the size effect can be calculated.
So, I will greatly appreciate any guidance you may provide regarding how I can test the significance of the indirect effect of f1xf2 on f4 via f3. I apologize if this is an elementary question, but having looked at the literature in my field, I couldn't see references to any articles that would suggest a method.
Hi! I was wondering if you could help me figure out this puzzle. I am testing a structural relationship between one latent predictor at time 1 and two latent outcomes at time 2, controlling for the time 1 values of the outcomes. These data come from an intervention study, but because I am only interested on the developmental patterns, I am controlling for intervention effects. The problem is when I add the intervention variable as a predictor of the time 2 outcomes, the model also estimates a series of correlations between all time 1 predictors and the intervention variable. This does not make sense in my model because the time 1 predictors were assessed prior to random assignment to the intervention, so whatever correlation there is between intervention and the time 1 predictors is just spurious. However, when I try to set these correlations to be 0, the model does not converge.
Interestingly when I fit a similar model, but using the main effect of the intervention and the interaction of the latent predictor and the observed intervention variable, it no longer presents those strange correlations I did not ask for and do not need.
Can you please help me figure out how to make sense or get rid off these spurious correlations? Ultimately they make my models not nested and require me to account for missing degrees of freedom that make no sense.
However, when I do that I get the following message:
THE MODEL ESTIMATION TERMINATED NORMALLY
THE STANDARD ERRORS OF THE MODEL PARAMETER ESTIMATES MAY NOT BE TRUSTWORTHY FOR SOME PARAMETERS DUE TO A NON-POSITIVE DEFINITE FIRST-ORDER DERIVATIVE PRODUCT MATRIX. THIS MAY BE DUE TO THE STARTING VALUES BUT MAY ALSO BE AN INDICATION OF MODEL NONIDENTIFICATION. THE CONDITION NUMBER IS -0.197D-16. PROBLEM INVOLVING PARAMETER 54.
Should I still trust the results of this model and compare the fit with other nested models?
Also should i interpret from your words that there are different defaults for main effects models versus models with an interaction? Because when I fit a similar model, but using the main effect of the intervention and the interaction of the latent predictor and the observed intervention variable, it no longer presents those strange correlations.
Since Monday, I have consulted the user's guide, but unfortunately, I am such a newbie, I'm not sure about the syntax. And unfortunately, others in my department are not familiar with what I want to do.
Can I clarify what I think I am suppose to do? In order to constrain the "indirect effect" (Rel_15 VIA Rel_6 C_REL_B), do I need to create a new variable, the use that new variable in the model constraint syntax?
If so, what is the syntax for both pieces, i.e. creating the "new" indirect effect variable and then constraining said indirect effect variable?
You need to label the two parameters that make up the indirect effect in the MODEL command. Then create a NEW parameter in MODEL CONSTRAINT and is the product of the two components of the indirect effect.
Thank you for your reply. The reason why we want to plot the continuous variable is because we wanted to test theoretically whether this variable modifies the dummy variable (and not the other way around).
There is no interaction plot feature in Mplus. I don't think you can tell if the continuous variable modifies the dummy variable or the other way around. But you can certainly see/plot how the DV probabilities at the 2 different dummy values change over the values of the continuous variable. Imagine 2 bars (one for each dummy value; height being the probability) situated at several values for the continuous variable.
Marie Taylor posted on Wednesday, February 23, 2011 - 4:51 pm
I am sorry if I am not posting my question in the correct spot. I am trying to model the relationship between beliefs (at Time 1) and interracial contact (at Time 1, 2, & 3).
Currently, I have: T1RaceContact ON belief; T2RaceContact ON belief; T3RaceContact ON belief;
Am I right that this only shows tests of linear relations between T1 beliefs and T1, 2, and 3 race contact, but doesn't depict the relation between T1 belief and the change in race contact from T1 to T2? Or is that in the model, given that T1 is in the model? If it is not, how would I include it?
No, this model does not show how belief influences the change in racecontact. You would have to specify a change model for racecontact and let belief influence that change. For instance, using a growth model you could let belief influence the slope growth factor.
sunnyshi posted on Wednesday, April 13, 2011 - 3:54 pm
Dear Dr. Muthen, I am running an SEM using survey data. My questions are: 1. I try to test the effect of moderator M on the relationship of A and B. A,B, M are latent constructs. The model command: AxM| A XITH M; B ON A M AxM; Just from the model command, how can Mplus know which one is the moderator? A or M? Could I use just the following command: AxM| A XITH M; B ON A AxM;
2. To get the fit of the model, I run a model without the interaction term of AxM and do the chi square difference test. Both the models using MLR estimator. However, I could not obtain the scaling correction factor for the model with the latent interaction term. How should I conduct the test under this situation.
3. To conduct the chi square difference test, I have to assure both models (the models with and without the interaction term) to use the same information matrix. Am I right? Thanks!
1. An interaction model like this is symmetric in A and M. That is, you can't say that one and not the other is the moderator - your substantive reasoning suggests which way you want to present it, but statistically there is no difference.
2-3. A simpler approach is to just look at the significance of the interaction term. See also
Mooijaart & Satorra (2009). On insensitivity of the chi-square model test to nonlinear misspecification in structural equation models. Psychometrika, 74, 443-455.
This also shows an example on page 445 of how the R-square contribution for the latent variable interaction is computed. For general covariance algebra with latent variable interactions, see the appendix of
Mooijaart & Bentler (2010). An alternative approach for nonlinear latent variable models. Structural Equation Modeling, 17, 357-33.
No, because you don't use information from only the covariance matrix (2nd-order moments), but higher-order information - namely the raw data. Chi-square testing in the usual way is not available with latent variable interactions.
Since the use of multiplicative scores can be problematic to measure an interaction between ordinal-level and polytomous variables, is there a preferred approach in creating this term in Mplus? I'm interested in the moderating effect of a 7 category ordinal variable on a 5 category polytomous variable.
Unless you have strong floor or ceiling effects, perhaps you can simply treat them as continuous and use the product. Otherwise, perhaps you can use substantive reasoning to create a binary dummy variable from the 7-cat vble and let that moderate (or a couple of such dummies).
I'm interested in testing a moderated-mediated model in which an x - me - y relationship is moderated by MO. I want to test two theories, one in which MO affects the entire relationship, and one in which MO affects only part of the relationship, say between x-me. I've read the previous posts on how to create interaction terms in Mplus. However, I wondered (and please forgive what may be a silly question) if the interaction terms can be created outside of Mplus and imported in as separate LVs? I'm just wondering if this would avoid any computational problems with the integration algorithm (I have all continuous measures) and if this would give 'typical' model fit statistics (RMSEA, CFI); although I appreciate that there are other ways to test the fit of a model.
Thanks Linda. I wondered if I might ask two further questions (or rather, confirm that my understanding from reading your responses to related topics is correct)?
1. The analysis I described will produce unstandardized estimates (e.g, y on x), but not standardized estimates. Because the analysis is done as a single group, it is not possible to estimate the mean and sd for individual 'factors' in the model (e.g., x, me), and therefore, not possible to compute standardized estimates (from the unstandardized values)?
2. Simple slopes is not possible in Mplus (this one I'm less sure on)? However, it is possible to estimate most necessary statistics (covariance matrix, SE, etc.) to conduct this analysis outside of Mplus (e.g., through Kris Preacher's calculator for 2-way interactions). However, it wasn't clear to me if Mplus computes a constant at the model level, rather than the individual parameter level?
Sorry to ask further questions. Mplus is new to me and I want to make sure that my understanding is correct.
Linda, I now have a clearer understanding on the two issues that I posted on yesterday so please don't feel the need to reply.
From what I've read it seems that the interaction effect can be explored by using the MODEL CONSTRAINT command. I understand how this is achieved, however, I'm unsure how to extract the SD values to enter into this command (if I wanted to see the slopes at +/- 1SD of the mean of the moderator)?
Dear Linda, at the moment I am confused with my model. Would be great if you could help me out. First of all I am using MLM, have 300 raw data (with 3 items each) and use for all my analysis the output “standardized tech4” In addition to my “normal model” which looks like as the following: Model: x by(x1-x3) y by(y1-y3) c by(c1-c3) d by(d1-d3) e by(e1-e3) c on x C on y d on c e on d Now I wanna do the following: 1) "f" (is ordinal 1 or 2 :does a multi group analysis make sense when I would like to examine the impact on "e" and "d" (by f)? (I am not interested in the impact on x,y,c) (and also see the data which would be then such 150 each)Would it be better to analyze an indirect effect (ind) f1 f2 ind d f1 f2 ind e? 2)to examine the moderate effect g (g1-g3)with influence between e and d. Would a mod.regression analysis be correct when I write under “e on d”: g with e g with d? Thank you so much for your support
Dear Bengt, wow! thank you so much for your fast reply! I tried your advice. to 1)"f" is a bivar. variable (0 and 1) all other variables are multivar.: --> when I do "d on f" I get a significant negative value - did the programme take automatically 0 (yes)? So I know that if the answer was "yes" it has an neg. impact? (so I do not have to give any other comment under "names are")?
to 2) unfortunately it did not work. I also read the Example 5.13 in your book. But I guess it is s.th else. So I did the following in addition to my normal model (because my moderate variable is G and I wanna have the moderate effect between d and e): INTER |G XWITH D; E ON D E ON INTER; But it did not work. So I included under ANALYsis = RANDOM; ALGORITHM = INTEGRATION; (Do I need this comments really?)but still did not work. AND I would like to have the ESTIMATOR = MLM and it still did not work?? Maybe you have an advice for me? Sorry, I feel just stupid at the moment. Thank you again so much.
Well it does work when I do it as I described (Analysis=Random; Algorithm = Integration; Estimator = MLM;) The programmes calcuates s.th., but it looks very wrong (very slow, black backround (C://windows/system32/cmd.exe)...
Wen-Hsu Lin posted on Monday, October 31, 2011 - 1:19 am
After reading some of the posts, I am still confused as what to use to evaluate model fit? Is declaring the significance of the multiplicative term (xwith) enough? Thank you.
Yes, the significance of the interaction is enough. Chi-square is not valid with a latent variable interaction because means, variances, and covariances are not sufficient statistics for model estimation. See the FAQ on the website:
The variance of a dependent variable as a function of latent variables that have an interaction is discussed in Mooijaart and Satorra
Wen-Hsu Lin posted on Friday, November 11, 2011 - 10:44 pm
The xwith command was executed with type = random, does that mean the coefficient of the interaction term is like the random effect in the multi-level modeling? The explanation of the coefficient is still like the one we will use for the regular interaction term in the OLS? Thank you.
The latent variable interaction is a fixed effect. The interpretation is the same as a regular interaction.
Wen-Hsu Lin posted on Saturday, November 12, 2011 - 7:38 pm
Thank you Linda, one follow up, can I use type = imputation while I am running inter| A xwith B crime on inter? I did run it but the results wont give me significant test like when I ran with one of the five datasets.
I am running a model with 3 factors (all continuous indicators), where factor 1 and 2, as well as the interaction of factor 1 x 2 predict factor 3. f3 ON f1 f2 f1xf2;
I am using XWITH to create the interaction term, with TYPE=RANDOM and ALGORITHM=INTEGRATION. The model indicates that factor 2 is a significant moderator in the relationship between factor 1 and 3. Because of TYPE=RANDOM the output does not provide the usual model fit indices. You suggested earlier that in order to assess model fit, one should compare nested models using 2 times the loglikelihood difference.
I ran the model without the interaction term, only including the regression paths f3 ON f1 f2. All model fit indices for this model are good (Chi-Square Test of Model Fit, p = 0.1209, RMSEA = 0.031, CFI = 0.977). Loglikelihood increases from -1405.365 in the model without interaction to -1401.301 in the model with the interaction. However, the 2 times loglikelihood difference indicates that the models are not significantly different.
1. Does that mean the nested models have equally good model fit? Can i report the model fit from the model without the interaction, and state my model including the interaction has equally good model fit?
2. That means including the interaction does not improve my model significantly? Is this an argument against my moderator hypothesis?
Two times the difference between your two loglikelihoods is about 8 which is significant for one degree of freedom. This should agree with the z-test for the interaction in the model where the interaction was included.
Does that mean my moderation model is significantly better than the model without the interaction term? Is it appropriate to report model fit for the model without the interaction term and then state that the model including the interaction has a good model fit too (or according to loglikelihood a significantly better model fit)?
Using estimated factor scores in regressions is usually not as good as estimating the model you specified.
Martina Gere posted on Thursday, February 09, 2012 - 4:53 am
A follow-up question on my moderator model (see february 5th). How do I calculate the slopes of f3 ON f1 for different values of my moderator f2?
Q1: Can I use the regression coefficients and variances of the latent variables in the output of my interaction model in order to calculate the slopes for mean, -sd, +sd of the moderator by hand? (e.g. for slope when moderator +1sd: unstandardized regression coefficient of f1 + unstandardized regression coefficient of f1xf2 * sd of f2)
Q2: Can i test whether slopes are significantly different in this case? How?
Q3: Or can I run the model in MPlus while setting different means for f2 (0, +1sd, -1sd) and observe the resulting regression coefficients for f1? If yes, how do I set a mean of a latent variable?
Thank you. I looked at the example in your handout, and there you are calculating different slopes for the mean, +1SD, -1SD of the moderator using an equation with standardized regression coefficients. However, running the interaction model with TYPE=RANDOM, the standardized option in the output is not available.
Can I use unstandardized regression coefficients and calculate the standard deviation of my moderator variable based on the variance in the output?
You would use the unstandardized as shown in the course slides and then standardize as also shown using the variance from TECH4.
Martina Gere posted on Saturday, February 11, 2012 - 3:02 am
When I run my moderator model with TYPE=RANDOM the output tells me that TECH4 is not available for TYPE=RANDOM. Do I use the variances from the simple model before adding the interaction?
If yes, I think I understand how to calculate standardized regression coefficients for both independent variables. But how do I calculate the standardized regression coefficient for the interaction of my latent variables? Could you point me to the page in the handout where this is described?
I'm sorry for all the questions. I'm new to Mplus.
I have follow-up questions about slide 170-171 of topic 3 (text is pasted here, 3 questions follow).
Unstandardized s = 0.417 + 0.087*i + (0.045 – 0.047*i)*mthcrs7
Standardized with respect to i and mthcrs7 s = 0.42 + 0.08 * i + (0.04-0.04*i)*mthcrs7
1. Is the intercept term "a" simply rounded (and unstandardized)?
2. Is "a" unstandardized because you are attempting to calculate an unstandardized "s"?
3. If I wanted to "s" to also be standardized, would I use the StdYX equation to standardize all coefficients with respect to i, s, and mthcrs7, yet only involve i, s, or mthcrs7 in the StdYX formula if they are relevant to the coefficient being standardized?
1. Yes. 2. Yes. 3. This would be difficult to do. You would need to divide all coefficients by the standard deviation of s. TECH4 is normally where you would find this but it is not available with TYPE=RANDOM.
Dear Linda- please disregard that last question. Having the web note 6 dataset available to replicate the analyses of Topic 3 slides 165-171 was key to help me understand how to graph an interaction from XWITH. Also, web note 6 described that these calculations are easier if the moderating latent variable is standardized to have a mean of 0 - that was very helpful too. Thanks for these.
Minor suggestion- the excellent "Latent variable interactions" FAQ would be more reachable to beginners like me if it included code/output and concrete examples, such as those mentioned above. Thanks as always!
Hello, I would like to use "gender" as a predictor in a path model that includes many other observed variables. I am also interested to know if path coefficients among the variables differ across gender. I thought about two strategies: (1) To run a multiple group analysis using "gender" as a grouping variable to test the original model from which gender would be excluded. (2) To create interaction variables (varXgender) for all of the paths that are hypothesized to differ across genders. I would prefer the first strategy, but because the model would not be exactly identical to the original model (i.e., gender would be excluded), I am not sure I can do that. Thanks for your help.
Interactions can be assessed using multiple group analysis or creating an interaction term. In multiple group analysis, an interaction exists if, for example, a regression coefficient is different for the two groups. This can be assessed by chi-square difference testing or using MODEL TEST.
I am working on a path analysis where I have 2 latent factors (made up of categorical variables) as my DV's and 3 continuous variables as my IV's. I am interested in doing a multiple group analysis based on gender - and I know how to write that into Mplus. But I also want to look at a continuous puberty score as a moderator from each IV to each DV. Here is the syntax I have so far...
f1 by x1 x2 x3 x4 x5 x6; f2 by x7 x8 x9 x10 x11 x12 x13;
f1 on teach1 teach2 teach3; f2 on teach1 teach2 teach3;
How do I write in the moderator information, using P1 as the variable name?
You use DEFINE to create interaction variables such as p1*teach1 and then include those new variables in the ON statements.
NI YAN posted on Monday, October 01, 2012 - 5:14 pm
Dear Dr.Muthen, I was trying to use path analysis to demonstrate a significant indirect path (A->B->C). I have two questions about choosing from estimators of MLR and MLMV. First, I was wondering what is the exact difference between MLR and MLMV estimators. Because I know my endogenous variable C is skewed, I chose MLMV as the estimator type. The indirect path was significant. However, when I used MLR, the indirect path could not be detected any more. I did not understand what made the results different. Second, in above responses, you mentioned that "MLMV cannot be used with missing data". I compared the number of observations from both models using MLMV and MLR, and they are completely the same. Does this suggest MLMV could take care of missing data? Looking forward to hearing back from you. Thanks!
I'm wanting to run an analysis with the following variables:
IV's: X1 (between-subjects, categorical 2 levels), X2/Y1 (attractiveness high/low, within-subjects variable with 2 levels, also a 2 continuous depended variables) X3/Y2 (status high low, within-subjects variables with 2 levels, also two continuous dependent variables)
Mediator: Y3, Y4, Y5, Y6 (all continuous)
DV: X2/Y1 (dependent variable, also a within-subjects variable) X3/Y2 (dependent variable, also a within-subjects variable)
participants had to rate 4 photos on their desire to date the person (high-attractiveness and high status, high-attractiveness and low status, low-attractiveness and high status, low-attractiveness and low status) which made up the within-subjects/dependent variables
I want to set up a pathway analysis that tests whether X1, X2, X3 moderate the participants desire to date the photos. Additionally I would like to see if Y3, Y4, Y5, Y6 mediate the effect of X1 on the within/dependent variables.
Is it possible to set up this pathway?
If so would you please be able to help me set it up? I've looked through the manual and found the within and between commands but I'm still unsure how to use them.
Jackson posted on Tuesday, March 12, 2013 - 4:30 pm
If I want to look at the moderation effect of variable M on relations between X and Z and Y and Z. Should I create two interaction terms (X*M and Y*M) and then regress Z on X, Y, XM, and YM? Is there anything particular that I should be doing other than this if so?
That looks correct. You may also want to include u1 on x48 so you have both main effects and the interaction.
Cecily Na posted on Friday, May 31, 2013 - 9:46 am
Dear professor, I came up with a model in which a causes b, and b subsequently causes c. (a-->b-->c). I hypothesized that the fourth variable d moderates the link a-->b, as well as the link b-->c. Thus, d serves as a moderator twice in this model. Is this a reasonable model and testable in Mplus? If d serves as mediator twice (mediates between a-->b, and b-->c), would it be testable in Mplus as well? Thank you again for your generous help!
recently I calculated latent moderation analysis using the LMS approach. I am looking for a way to test the simple slopes - yet I do not know how to get/caculate the covariance between the latent predictor and the latent interaction term (which is needed for the slopes-tools, e.g. http://quantpsy.org/interact/mlr2.htm). Is there a way doing this in MPLUS? (since TECH 4 doesn't work with TYPE=RANDOM)
I am testing for group differences in a two-way interaction by using a multigroup model (boys vs. girls) comparing the constrained model where the two-way interaction (using the define command) was constrained to the model where all parameters were freed. The difference in the degrees of freedom for the two models, however, was 7 (not 1 as I expected). Why? What other parameters have been constrained by fixing the interaction? Do I need to constrain the main effects of the interacted variables as well?
I was wondering if you could give any advice on adapting the formulas in "Latent variable interactions" for cases where there are two exogenous latent factors (and their interaction) predicting an observed outcome (either continuous or categorical)? I am most likely misunderstanding the document in various ways, but it seems like it should be a lot easier to get standardized coefficients and r-squared in such an example (that is, given that the mean and variance are fixed at 0 and 1, respectively, for the exogenous factors and that the mean and variance of the observed outcomes are directly obtainable).
Your example has the structure of (1) for which the eta-3 variance is in (16) combined with (17). The quantities involved are directly obtained from the estimated model. With those in hand you go through the standardization described in Section 1.4.
The only thing affected is the residual variance of the DV, which is no longer a free parameter to be estimated. And it refers to an underlying continuous latent response variable behind your categorical outcome. Because you have latent variable interactions you are using ML and you can use either logit or probit link. With logit the residual variance is pi-squared/3 and with probit it is 1.
searching for the Big Fish little Pond Effect, i´m running a doubly latent SEM with a model constraint command in the end. I'd like to analyze a moderating effect of a manifest metric Variable (akzclass) on the BFLPE. Is it possible to use the xwith command on a variable computed by model constraint?
My input concerning the Model Constraint looks like this:
Model Constraint: new(bflpe); bflpe=b_betwn - b_within;
No, this is not possible. MODEL CONSTRAINT estimates parameters. It does not create variables.
H Ito posted on Monday, October 28, 2013 - 9:29 am
I'm interested in whether a variable z moderates an effect of x on y. All of them are observed continuous variables. To my knowledge, there are two methods to address this issue.
(1) Creating an interaction term using DEFINE command (xz = x*z; y ON x z xz;)
(2) Random coefficient regression using TYPE=RANDOM option (s | y ON x; s y ON z;)
I'm considering that the former provides an indirect test of moderation because it does not assume the causal direction of moderation (i.e., whether z moderates the effect of x on y or x moderates the effect of z on y) while the latter provides a direct test of moderation. In my data, the results of the two analysis were very similar, but information criteria (AIC, BIC, aBIC) indicated that the latter model is superior to the former model and to the random coefficient model where x and z were interchanged (s | y ON z; s y ON x;). From these results, can I assert that hypothesized direction of moderation (i.e., z moderates an effect of x on y) is supported?
I see these two approaches as the same when the residual variance of s in the regression on z is zero.
H Ito posted on Tuesday, October 29, 2013 - 8:39 pm
Thank you professor. Indeed, I confirmed that these models produce the same results when the residual variance of s is zero. Does this mean that the difference in information criteria between the original models (where the residual variance of s is estimated) can not be interpret?
I think the model with a free residual variance for s is an interesting generalization of an interaction. It says that some of the moderation is unobserved. If it has a better BIC, one could choose to settle on this model.
Hi, I am planning to use SEM to examine the relationship between x and y where y is a latent variable. I will also be running models to test three different moderator variables in this relationship. Is there a way to take into consideration confounders while testing moderation? I've seen posts regarding confounding for mediation and also dealing with them as moderators but I'm wondering if there is another way to handle it when the goal of my model is to test moderation? It is confusing if I have to treat my possible confounders also like my moderator.
Dear M&M, I am running a SEM with continuous and dichotomous categorical variables. My categorical observed variable X1 (an easy text version versus a difficult text version) is an independent variable. I have a continuous observed variables X2 (decoding ability) and latent variable X3 (knowledge) predicting a latent construct Y (text comprehension). My hypothesis predicts that both continuous variables X2 and X3 interact with the categorical variable X1 and moderate the relationship between X1 and Y in my model. Furthermore I want to include a mediating latent variable. Could you tell me which procedure is necessary? Thank you very much. Anke
Thanks for your reply. Can you help me once more what to to with my independent categorical variable? When I'm not allowed to include the variable into the model, where to put it? It is my manipulated factor which I cannot exclude from my study. Regards, Anke.
Linda, I have to admit I don't know. I'm quite new to Mplus and SEM. Bengt wrote this (see note from 01-06-14 above). Can I include the binary observed ndependent variable to create interaction terms with latent continuous variables? Regards, Anke.
Bengt said not to put the independent variable on the categorical list. He did not say to not include it in the model. Yes, you can include it and use XWITH to create an interaction with a latent variable. Please look at the suggested examples.
Andy Hayes lists some citations for examples of applied research articles that use each model in the 2007 paper, including Model 3, here.
The 2007 paper is mainly about estimating and testing conditional indirect effects, or indirect effects at specific values of a moderator. If you want to determine whether there is evidence for moderated mediation (that is, whether the indirect effect varies across values of a moderator), there is a way to test that. In Hayes' book, he proposes that (for Model 3) the product of the 'a' path (X -> M) and the 'b3' path (the interaction of M and V predicting Y) quantifies this effect, and that a bootstrap confidence interval for a*b3 is a good way to test H0: a*b3 = 0.
Thanks very much Kris. I really appreciate the detailed response.
EM posted on Wednesday, February 05, 2014 - 6:02 am
Dear Prof. Muthen,
in the document on latent variable interactions a formula is given on R-square (p.6). I was wondering if I can find all of the information needed to calculate R-square in the MPlus output. For example: I'm not sure where to find V(eta3)?
Equation (21) on page 6 shows that eta3 is a DV and as such the variance parameter that is estimated is the residual variance for eta3 (the variance of zhi3). You have to compute the total variance of eta3 using the instructions in this document.
I am MD student, writing a dissertation. I want to use SEM to test a model with moderated mediation in which an x - me - y relationship is moderated by MO. I assumed that both x-me and me-y would be moderated by MO. I wonder I can analyze this model at once. If not, each path should be analyzed? (For example, whether x-me is moderated by MO. And then me-y is moderated by MO). MO is a continuous latent variable.
I will look forward to hearing from you soon. Thank you
I am doing a multiple group analysis with a latent construct A(with 4 continuous indicators) predicting a latent construct B(with 1 continuous indicator).
I want to now test whether A-->B relation is moderated by a latent construct C (1 binary indicator), and whether the moderation differ across groups.
My initial thought was to further divide the groups I have -- so from group 1, I will create group1A and group 1B (because the moderator I have is binary), and run the A-->B model for these new groups. Is my thinking here correct?
However, this strategy will further make my sample size small, so I don't think this is possible for my data. I've been reading on the forum and it seems that I can make an interaction term with xWITH between categorical latent variable and continuous latent variable. Is this true? If so, can I apply this to a multiple group analysis as well (that is, create an interaction term, then test the model across groups)?
Can you please explain to me if moderation effects are the same than study the influence of the interaction between two variables on an outcome?
I want to analyse the influence of the interaction between intelligence and prior academic achievement on subsequent academic achievement. I used the XWITH command to estimate the interaction effect. Is it correct?
What should I do to get the model fit and the standardized results?
See the Latent Variable Interaction FAQ on the webiste.
Nara Jang posted on Thursday, June 05, 2014 - 7:22 pm
Dear Dr. Muthen,
I tried to test the interaction term between one continuous latent variable and an observed variable. I wrote the variable of A*b in the left side of | without any blank, but there is warning sign that only one interaction can be defined at a time. Would you tell me how to fix this?
Don't use a*b as the name of the interaction. The * has a particular meaning in Mplus. Use a name like
ab | a XWITH b;
Nara Jang posted on Sunday, June 08, 2014 - 10:10 am
Dear Dr. Muthen,
Thank you so much!
Nara Jang posted on Sunday, June 08, 2014 - 11:11 am
Dear Dr. Muthen,
I have two latent variables (X1 and Y) and several observed categorical variables (x2). I am conducting moderating effects using the categorical variables. That is, one latent variable (X1) is an exogenous variable, the each categorical variable is a moderator (x2), and the endogenous variable (Y). Y=X1+x2 + X1*x2. Would you explain to me how to test the moderating effect? Thank you very much for your great help.
I am trying to run a test of moderation using the technique of creating orthogonolized latent variables described by Little, Bovaird, & Widaman, (2006).
The measurement model with only the latent predictor and outcome variables terminated normally and with a good fit. But I have not been able to get the model to run with the interaction term estimated. The error message I receive is:
"NO CONVERGENCE. NUMBER OF ITERATIONS EXCEEDED."
I'm not sure what the problem is and would really appreciate any guidance you could provide. I wasn't able to copy the syntax due to the size limits of posting here. I would be happy to send you any more information that you might need to conceptualize this problem.
George Y posted on Tuesday, July 29, 2014 - 4:33 am
I am examining an interaction effect in a probit model in Mplus. Typically I would use Tech3 to get the info I need for the standard errors of each level of the moderator (as per K.Preacher's webpage http://www.quantpsy.org/interact/interactions.htm) and then use a t-test for significance at each level. But are the results from Tech3 appropriate to use to calculate the SE when using a probit model?
Yes, TECH3 can be used for a probit model. You may find using Example 3.18 easier to do.
Nara Jang posted on Monday, August 04, 2014 - 11:15 pm
Hello Dr. Muthen,
I got the result of latent interaction model. In the output, it states that 1 perturbed starting values in the initial stage and 7 perturbed starting values were not converged, but the model estimates terminated normally. Followed by previous messages, all the results were computed. In this case, would you tell me if the estimates can be trusted?
Still unable to grasp this concept. I have a mediation model with x m y. Trying to add z as a moderator. With z being a grouping variable, it was suggested that I should use a 2-group analysis. Have since attempted to follow similar posts from this discussion forum, but couldn’t work out my problems. Would appreciate your guidance again on the following:
(1)Where and how should specify grouping variable in the input section? (2)also have followed the counterfactually-defined indirect effect approach described in Muthén and Asparouhov, 2014, and have come up with the input below. The model runs, but not sure whether my specification is correct and meaningful. (3)Are the (low, high, increment) in the Model Indirect section fixed values in all situations and what do they entail? (4)Are all the outputs requested in your paper necessary or which specific output should I focus on to just figure out results of the moderated mediation?
Usevariables Are ORNIR AAQ GSE LOTR SHS breach gender int; CATEGORICAL = breach; Define: int =gender*ORNIR; ANALYSIS: ESTIMATOR = ML; LINK = PROBIT;
MODEL: PPS BY AAQ GSE LOTR SHS; breach ON PPS gender int ORNIR; PPS ON gender int ORNIR; MODEL INDIRECT: breach MOD PPS gender (-1,1,0.1) int ORNIR;
Thank you so much for your prompt response Bengt. Still having difficulty as a novice. I have referred to the guideline on how to specify a grouping variable and the addendum for moderated mediation. When I include the grouping variable to the model, the following error appears: "ERROR in ANALYSIS command ALGORITHM=INTEGRATION is not available for multiple group analysis. Try using the KNOWNCLASS option for TYPE=MIXTURE." Would the output be interpretable if I simply run the input below and leaving the grouping specification out? Also referred to the handout on your website from the July Mplus 7.2 workshop, slide 37 for the output relating “TOTAL, INDIRECT, AND DIRECT EFFECTS BASED ON COUNTERFACTUALS (CAUSALLY-DEFINED EFFECTS)”. Is that relates to the output at the beginning? I am a bit confused as my output has several of those in the list and each with different estimates and significance values. Thanking you for your patience and support.
Usevariables Are ORNIR AAQ GSE LOTR SHS breach gender int; CATEGORICAL = breach; Grouping Is gender (1 = male 2 = female); Define: int =gender*ORNIR; ANALYSIS: ESTIMATOR = ML; LINK = PROBIT;
MODEL: PPS BY AAQ GSE LOTR SHS; breach ON PPS gender int ORNIR; PPS ON gender int ORNIR; MODEL INDIRECT: breach MOD PPS gender (-1,1,0.1) int ORNIR;