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;
Good morning Linda Muthen and thanks again for your answer, what I want say is that if I have two variables (for example variable A composed by the items the A1, A2 and A3, and variable B composed by the items B1, B2 and B3) impacting on a third variable, I’m not able to create the right script to compute the moderation (i.e. the interaction between the variables A and B). Please, can you help me?
Thank you for your helpful reply. To f/u: if I create interaction variables alongside a main effect of gender, would I only multiply that gender term across the actor and partner predictor variables, or the covariates as well?
output creates Estimates, but no S.E.s or p-values. THE ESTIMATED WITHIN COVARIANCE MATRIX IS NOT POSITIVE DEFINITE AS IT SHOULD BE. COMPUTATION COULD NOT BE COMPLETED. THE VARIANCE OF IW APPROACHES 0. FIX THIS VARIANCE AND THE CORRESPONDING COVARIANCES TO 0, DECREASE THE MINIMUM VARIANCE, OR SPECIFY THE VARIABLE AS A BETWEEN VARIABLE. THE MODEL ESTIMATION DID NOT TERMINATE NORMALLY DUE TO AN ERROR IN THE COMPUTATION. CHANGE YOUR MODEL AND/OR STARTING VALUES.
Fix the iw variance at zero. But ask yourself why it is so low - this is unusual. Perhaps you should start with deleting
iwXz_cos | iw XWITH z_cos; sw ON iw iwXz_cos;
and same on Between.
Frank Egloff posted on Wednesday, October 08, 2014 - 1:50 am
Dear Bengt, thank you very much for your answer! In my moderation Model I am interested in how the skill level of students (represented by iw) moderates the effect between z_cos and the learning effect (represented by sw). So I guess that I rely on the variance that iw provides. If I fix the iw variance at zero – I guess it might not be suitable to serve as a moderator anymore. Could it be that this part of my input… MODEL: %within% iw sw | t1@0t2@1t3@2t4@3t5@4t6@5t7@6t8@7; t1_leflu - t8_leflu (1); …actually by default does not allow or constrains variance on iw? Naturally there should be variance on iw. If that might be the case, what kind of command do I have to use to allow unconstrained variance on iw? Thank you so much Kind regards from an Mplus beginner in Germany
Frank Egloff posted on Wednesday, October 08, 2014 - 5:31 am
Dear Bengt, I found a piece of evidence in the Mplus User’s Guide 6 - Chapter 9.12 “Two-Level growth model for a continuous outcome (three-level analysis)”. In the 2nd paragraph it says “The coefficients of the intercept growth factor are fixed at one as part of the growth model parameterization”.
However if I exclude the part that has to do with iwXz_cos in the following way from the analysis (sw ON iw still in)…
! iwXz_cos | iw XWITH z_cos; sw ON iw; !iwXz_cos;
…it technically works. However it doesn’t address my research question anymore. And the output shows that there actually is variance on iw.
Variances IW 1286.117 0.057 22475.586 0.000
I am a bit confused. Your help is much appreciated. Thank you very much!
In terms of moderation, does it matter if this is tested through interaction terms (say, gender*predictor) or through applying model constraints to determine if there are differences on predictors between men and women?
It works now. But unfortunately I have more questions:
1) I receive for both classes (groups) the same interaction effect (estimates and z value). I tried to calculate the interaction per class in the model but than I receive the error "Random effect variables can only be declared in the OVERALL model". Is their a possibility to get the interaction effect per group?
2) Should I also constrain the intercepts and factor loadings of the moderator to be equal over groups?
3) Should I fix the factor mean of the moderator to zero in one group?
4) Is their a possibility to plot the interaction? I used the MODEL CONSTRAINT option (with Plot and Loop) from example 5.13. But this works only when I have the groups separatly.
5) Is their a possibility to examine simple slopes?
Thank you very much for your very helpful support.
1) I assume that you use XWITH. If so, the XWITH statement can be given in the Overall, but you can regress on the corresponding interaction in different classes, thereby getting different slopes for this.
2) Yes, otherwise you are not sure the same latent variable moderator is in play.
4) Latent variable interaction plotting using LOOP is described in our FAQ:
Latent variable interaction LOOP plot
5) Yes. You can do that via Model Constraint also.
1) Now, I just want to make sure that the syntax is correct for the simple slopes:
f3 on f1 f2 f1xf2 (slope1 slope2 int); f2; ! factor variance of f2 (moderator) = 1.034;
model constraint: new (lowf2 highf2); lowf2 = slope1-int*sqrt(1.034); highf2= slope1+int*sqrt(1.034);
Is the syntax correct?
2) Under FAQ Latent variable interaction LOOP plot you give an example for a moderation plot. In this example you regressed only f3 on f1 and f3 on f1xf2.
Is it ok not to regress f3 on f2?
I ask because my Mplus calculation is substantially faster without f3 on f2 and the slope f3 on f2 is not significant in my data.
3) Is it possible to calculate a difference score between two latent variables and if yes how is it possible?
I would like to test if the baseline level of a variable X (pre-test) moderate the post-test variable X values.
I tried this in SPSS/Process Macro. Instead I used the Post-Pre-Difference of Variable X as outcome, group as independent variable, Baseline level as moderator. Now I would like to test this in the SEM for both groups.
1) I am not sure the labeling gets correct when saying
f3 on f1 f2 f1xf2 (slope1 slope2 int);
You may have to split it up on 3 lines.
Note also that you don't get the right SEs if you use the fixed value 1.034. Instead you can label the factor variance and use sqrt(label) - this will acknowledge that the variance estimate also has sampling variation.
2) When you have an interaction you typically want to include the main effects as well. So include f3 ON f2.
3) Not sure if you want the diff to be a variable or if you just want to look at the diff of the factor means. For the former, see the literature on latent change models (McArdle and others; see also the work of Emil Coman) - you can ask about this on SEMNET.
Thank you very much for your helpful reply. I am working at the latent variable interaction. I have pre-post design (multiple-group SEM). As you recommend, I fittet the model first without the interaction term, that worked really well. Unfortunately, I received the following error term for the model with the interaction:
RANDOM STARTS RESULTS RANKED FROM THE BEST TO THE WORST LOGLIKELIHOOD VALUES 1 perturbed starting value run(s) did not converge. Final stage loglikelihood values at local maxima, seeds, and initial stage start numbers: -4664.550 569833 85 -4664.562 432148 30 -4762.859 136842 58 -4763.099 789985 67 -4763.241 915642 40 15 perturbed starting value run(s) did not converge. THE BEST LOGLIKELIHOOD VALUE HAS BEEN REPLICATED. RERUN WITH AT LEAST TWICE THE RANDOM STARTS TO CHECK THAT THE BEST LOGLIKELIHOOD IS STILL OBTAINED AND REPLICATED.
Q1: I tried different strategies (starting values, miterations) – but nothing solved the problem. Do you have any recommendations what I can also check? Q2: It is possible that the skewness of my data is the problem? For the simple pre-post model I used the MLM estimator. If the skewness is the problem, is it better to use the DISTRIBUTION option or binary data? Q3: For the case that is better to use the DISTRIBUTION option - do you have maybe a syntax example for this option?
Your output does not indicate that you have a problem. The two best logL's differ only in the 6th digit.
Skewness should not be a problem with MLM or MLR.
Distribution = cannot yet be combined with latent variable interaction modeling.
Chiho Song posted on Monday, February 02, 2015 - 5:31 pm
Dear Dr. Muthen,
I am developing a SEM model based on a baseline model. A baseline model is like the following: a1 -> f1 -> f3; a1 -> f2 -> f3; a1 -> f3; f1 with f2
Based on the above model, I tried to add an additional factor f4 and make two latent variable interactions between f1 and f4, f2 and f4 for testing a moderating effect of f4 on two pathways (f1 -> f3; f2 -> f3):
ANALYSIS: TYPE=random; ALGORITHM=integration; MODEL: f1 by y1@1 y2 y3 y4 y5 y6; f2 by y7@1 y8 y9; f3 by y10@1 y11 y12; f4 by y13@1 y14 y15 y16; f1 on a1; f2 on a1; f1 with f2; intf1f4 | f1 xwith f4; intf2f2 | f2 xwith f4; f3 on a1 f1 f2 intf1f4 intf2f4; OUTPUT: sampstat tech1;
However, the analysis took a very long time to run (Number of integration: 3; Total number of integration points: 3375). After long hours, an error appeared: THE ESTIMATED COVARIANCE MATRIX COULD NOT BE INVERTED. COMPUTATION COULD NOT BE COMPLETED IN ITERATION 190. CHANGE YOUR MODEL AND/OR STARTING VALUES. THE MODEL ESTIMATION DID NOT TERMINATE NORMALLY DUE TO AN ERROR IN THE COMPUTATION. CHANGE YOUR MODEL AND/OR STARTING VALUES.
Could you check my syntax and give me any help about how to fix this problem? Thank you very much in advance.
Add f4 without the interactions. If that works, add one interaction at a time to see when the problem occurs.
Chiho Song posted on Monday, February 02, 2015 - 6:29 pm
Thanks for your prompt reply. As you suggested, I put f4 in the model without any interactions like the following code and it worked.
ANALYSIS: TYPE=general; MODEL: f1 by y1@1 y2 y3 y4 y5 y6; f2 by y7@1 y8 y9; f3 by y10@1 y11 y12; f4 by y13@1 y14 y15 y16; f1 on a1; f2 on a1; f4 on a1; f1 with f2; f3 on a1 f1 f2; OUTPUT: sampstat tech1;
Then, now I am rerunning a model by adding one interaction between f1 and f4 to the model first. I'll keep asking later if any problem arises. Thank you so much.
Chiho Song posted on Tuesday, February 03, 2015 - 8:21 am
Dear Dr. Muthen,
I ran the model with one interaction between f1 and f4. The analysis was done after 8 hours+ and an error happened like the following:
THE MODEL ESTIMATION DID NOT TERMINATE NORMALLY DUE TO A NON-ZERO DERIVATIVE OF THE OBSERVED-DATA LOGLIKELIHOOD. THE MCONVERGENCE CRITERION OF THE EM ALGORITHM IS NOT FULFILLED. CHECK YOUR STARTING VALUES OR INCREASE THE NUMBER OF MITERATIONS. ESTIMATES CANNOT BE TRUSTED. THE LOGLIKELIHOOD DERIVATIVE FOR THE FOLLOWING PARAMETER IS -0.35992952D+01: Parameter 39, SES (i.e. f4)
Dear Dr. Muthen, Thanks again for your help. I am still working at the Latent Interaction(pre-post, multiple-group SEM).
In my current model (Model A) I received the following error: THE MODEL ESTIMATION TERMINATED NORMALLY WARNING: THE LATENT VARIABLE COVARIANCE MATRIX (PSI) IS NOT POSITIVE DEFINITE. The model has a good fit without the interaction term. I tried a second model (Model B) without the f3 on f2 path. Here I revealed the error: WARNING: THE MODEL ESTIMATION HAS REACHED A SADDLE POINT OR A POINT WHERE THE OBSERVED AND THE EXPECTED INFORMATION MATRICES DO NOT MATCH. AN ADJUSTMENT TO THE ESTIMATION OF THE INFORMATION MATRIX HAS BEEN MADE. THE CONDITION NUMBER IS -0.197D-01. THE PROBLEM MAY ALSO BE RESOLVED BY DECREASING ...THE MLF ESTIMATOR.
When I compare the results between Model A and Model B, I get completely different results (also in the simple slopes): Model A: F1xF2: Gruppe 1: ß=-1.506;z=-14.99 Gruppe 2: ß=-3.48;z=-9.25
Model B: F1xF2: Gruppe 1: ß=-1.45;z=-0.24 Gruppe 2: ß=-2.18;z=-0.51
Q1: Do you have any recommendations how I can find out which one (A or B) is the right model? And how can solve the errors?
Q2: I have correlated errors in the model (e.g. Parcel 1 Time and Parcel 1 Time 2). Should I include the error correlations in every group (class) or only in the overall model? Thank you!
Ask you IT person. You must be a registered user of a current license to be eligible for support.
Nara Jang posted on Thursday, February 12, 2015 - 8:59 pm
Dear Professor Muthen, B.,
According to your posting on Jan. 26, 2015-4pm in response to the question on Jan. 26, 2015-3:08 pm, my results has no problem, but I would like to make sure if I can interpret without further investigation. Would you mind confirming with the message in my output. I also tested the moderating effects. Please, take a moment to take a look at the following message.
"1 perturbed starting value run(s) did not converge. Final stage loglikelihood values at local maxima, seeds, and initial stage start numbers: -11017.733 27071 15 9 perturbed starting value run(s) did not converge. THE MODEL ESTIMATION TERMINATED NORMALLY"
It looks like you have not replicated the best loglikelihood. This means you have reached a local solution. You must replicate the best loglikelihood. Increase your random starts to, for example, STARTS = 200 50;
Nara Jang posted on Friday, February 13, 2015 - 4:40 pm
Dear Prof. Muthen,
Thank you so much for your advice.
I increased the starting values. In the output, following messages showed up. Would you tell me if I can consider the best loglikelihood were replicated. Please, take a moment to look at the messages below. Your response will be greatly appreciated!
4 perturbed starting value run(s) did not converge. Final stage loglikelihood values at local maxima, seeds, and initial stage start numbers:
To test gender as a moderator, I would like to multiply through to create separate interaction terms for men and women. I presume I would use -1 and 1 as the coefficients? I know there if often some debate about how to do this in the literature, but what is recommended with MPlus?
Mplus can do it either way. Personally, I find it easy to simply score it as 0/1 so the slopes are say
b1 + b2
where b2 is the slope for the interaction.
Sok An posted on Thursday, February 26, 2015 - 1:25 pm
Hi Dr. Muthen,
I am working to calculate R-square for interaction SEM. I have one DV, two latent variables and one interaction term and also include a few control variables. Your document, latent variable interactions (2012), is helpful to calculate R-square when I have only two latent variables and one interaction term.
From your post February 05, you mentioned that V(eta3) is residual variance for eta3 and need to compute the total variance of eta3 using the instructions in this document.
Instead computing V(eta3), is it ok using covariance matrix to have total variance of eta3 from tech4 output of the model without interaction?
Since R^2 = 1 - SSE(error)/SST(Total),
can I skip whole bunch of painful steps in the document, and use residual variance of DV and variance of DV from Mplus output to calculate R-square?
R^2 = 1 - Residual variance of DV / Variance of DV
It would be an approximation. I don't know how good it would be, but might give a rough picture of R-square. You could try it on a simple example and do it both ways.
Nara Jang posted on Thursday, March 19, 2015 - 5:35 pm
Dear Prof. Muthen,
I used the numerical integration to test moderation. Would you tell me if the following numbers can be considered best Loglikelihood replication? Additionally, would you tell me what is the standard to decide whether this is best loglikelihood? Like Prof. Muthen, B.'s post on on Monday, January 26, 2015 - 4:01 pm. "Your output does not indicate that you have a problem. The two best logL's differ only in the 6th digit."
Thank you so much for your great help in advance.
RANDOM STARTS RESULTS RANKED FROM THE BEST TO THE WORST LOGLIKELIHOOD VALUES
4 perturbed starting value run(s) did not converge. Final stage loglikelihood values at local maxima, seeds, and initial stage start numbers:
I would like to follow up on a message from 12.6.12 in which you wrote that interactions cannot be tested between an observed and latent variable using WLSMV, but requires the XWITH option and TYPE=RANDOM.
In this case: 1. Is the deafult estimator ML? 2. If so, how can you compare estimates of the interaction model to a model without the interaction term which uses a WLSMV estimator due to an ordered categorical DV?
Q1. I suggest simply looking at the z-test of the coefficient for the interaction variable; that tells you all you need. If you want something akin to an F test, use Model Test to test if all coefficients are zero.
Q2. A chi-square test has not yet been developed for the ML estimation with XWITH. For suggestions about how to assess fit, please see our FAQ:
Latent variable interactions
CPK posted on Wednesday, September 09, 2015 - 8:20 pm
I have a moderation model with 3 IVs (a, b, c), 1 moderator (m), and 1 DV (z).
a -> z, moderated by m b -> z, moderated by m c -> z, moderated by m
I used 3 syntax files. 1. z ON m interaction_term a; 2. z ON m interaction_term b; 3. z ON m interaction_term c;
Is this correct? But there will be 3 diagrams. Could I put all into a single syntax file, and have one diagram only?
z ON m interaction_term a interaction_term b interaction_term c main effects;
Then use the Model Constraint command with
PLOT(a b c); LOOP... a= b= c=
where a, b, and c express the moderated effect you want in line with UG ex 3.18.
Sarah P posted on Friday, September 18, 2015 - 2:59 pm
Hello, I am testing 2 moderated-mediation models, where path a is moderated by W.
The moderator was a significant predictor in my first hypothesized model but the interaction was not and in the other hypothesized moderated-mediation model neither were significant predictors.
The indirect effect is significant in both models, (estimate=.05, SE=.01, z=5.32, p<.001). I computed the indirect effect at different levels of the moderator (a1+a3*(0))*b1 and (a1+a3(1))*b2 and (a1+a3(-1))*b1. As well as the conditional indirect effect (a1+a3)*b1.
For the first model, all were significant and for the second model all except the indirect effect at high level of the moderator were significant.
Why might the moderators and interaction effects not be significant contributors to the model, but the conditional indirect effects at high, 0, and low are?
I believe I can report partial mediation, but I am unsure as to whether moderated-mediation is supported by my data.
is significant whereas a3 is not. If so, these quantities have different sampling distributions and different SEs so anything can happen. You also want to make sure that you use bootstrapping for the former effect.
SY Khan posted on Saturday, September 19, 2015 - 6:06 am
I have moderated-mediation, following Preacher et al, 2007 Model 3.
IV: X1, X2, X3, X4 (composites)
Mediator: M (composite)
Outcome: Y1, Y2, Y3, Y4 (composites)
Moderators: W1, W2, W3 (composites)
Interaction(M*W) = W1M, W2M, W3M
Controls: Gender, MS, DC, JS
I run separate models for each moderator, and include only one outcome variable at a time in each model. Paths from X to Y, X to M and M to Y have controls (mediator and outcomes are related to controls)
1-Kindly advise if the code below is correct. I am confused whether to include controls from W1 to Y1 and (W1M) to Y2. I have not – is that correct?
ANALYSIS: Bootstrap = 5000; MODEL:
Y1 ON Gender MS JS DC M (b1) Gender MS JS DC X1 X2 X3 X4 W1 W1M (b3);
M ON Gender MS JS DC X1 X2 X3 X4 (a1);
W1 WITH M; W1M WITH M; MODEL CONSTRAINT: NEW (IND WMODVAL); WMODVAL=-1; IND=a1* (b1+b3*WMODVAL);
OUTPUT: CINTERVAL (bcbootstrap) STDYX;
2- One moderator model (with W3) has poor overall fit indices, but the interaction term is significant. Can you suggest a way to improve model fit, as the interaction effect is significant.
SY Khan posted on Saturday, September 19, 2015 - 9:24 am
Sorry noticed a mistake in the above post. I am hypothesizing that individual differences (controls) will affect both mediator and outcome. As I understand, I am saying that controls will directly affect mediator and outcome (so, path M to Y will not be controlled; only paths X to M and X to Y will be controlled). So the mediation model will be as follows:
MODEL: M ON GENDER MS JS DC X1 X2 X3 X4; Y1 ON GENDER MS JS DC M X1 X2 X3 X4; Y2 ON GENDER MS JS DC M X1 X2 X3 X4; Y3 ON GENDER MS JS DC M X1 X2 X3 X4; Y4 ON GENDER MS JS DC M X1 X2 X3 X4;
MODEL INDIRECT: Y1 IND M X1 X2 X3 X4; Y2 IND M X1 X2 X3 X4; Y3 IND M X1 X2 X3 X4; Y4 IND M X1 X2 X3 X4;
And the conditional indirect effects will as in the above post.
Sarah P posted on Saturday, September 19, 2015 - 11:00 am
Dr. Muthen, In response to your reply:
"I think you are asking why for example
is significant whereas a3 is not. If so, these quantities have different sampling distributions and different SEs so anything can happen. You also want to make sure that you use bootstrapping for the former effect"
Thank you for your advice.
The bias-corrected bootstrapped confidence intervals for the conditional indirect effect, nor those at high medium or low levels of the moderator include 0.
Is there evidence for moderated mediation, even if the interaction effect and moderator are not significant contributors to the model?
Your question has changed quite a lot between your 2 posts. Because it is so input-specific, please send input, output, data and license number to support where you state the question you are interested in.
SY Khan posted on Monday, September 21, 2015 - 10:56 am
Sorry Dr. Muthen,
I have realized that there were two questions in my post. I have sent the out put files, as advised.
For question two; kindly advise if I have correctly incorporated the effects of four control variables on the mediator and outcomes in a partial mediation model. I am hypothesizing that individual differences (controls) will affect both mediator and outcomes.
IV: X1, X2, X3, X4 (composites) Mediator: M (composite) Outcome: Y1, Y2, Y3, Y4 (composites) Controls: Gender MS JS DC
MODEL: M ON GENDER MS JS DC X1 X2 X3 X4; Y1 ON GENDER MS JS DC M X1 X2 X3 X4; Y2 ON GENDER MS JS DC M X1 X2 X3 X4; Y3 ON GENDER MS JS DC M X1 X2 X3 X4; Y4 ON GENDER MS JS DC M X1 X2 X3 X4;
MODEL INDIRECT: Y1 IND M X1 X2 X3 X4; Y2 IND M X1 X2 X3 X4; Y3 IND M X1 X2 X3 X4; Y4 IND M X1 X2 X3 X4;
I run separate models for each moderator, with one outcome. X->Y and X->M have controls. I compare a1*(b1+b3*modval) at mean-1sd,mean & mean+1sd. My questions:
1-There are four a1s in model. Running a model in Mplus including X1-X4 simulatneously, but each time for different moderator levels, brings no change in Ind=a1*(b1+b3*modval). All are significant and have same values. Is this because four a1s are included simultaneously? When I compute the Ind=a1*(b1+b3*modval) separately for each IV by hand, there are differences for different levels of moderators. Should I include all IVs in one model to test for significance of moderated mediation?
2- Is there a way to include all Xs in one model in Mplus and still get Ind=a1*(b1+b3*modval) for every X separately with P-values?
3-One of the interaction term is insignificant in predicting the outcome, and the a1*(b1+b3*modval) when computed by hand show same values for low and moderate but negligible increase (from 0.001 to 0.002) for high level. Does a minor change would still suffice as no proof of conditional indirect effect?
1. You can include everything in one model if you want to control for the other Xs when examining effects of a given X. I think we would need to see your syntax to understand why you keep getting identical effects. But if you are using commands like above:
M ON Gender MS JS DC X1 X2 X3 X4 (a1);
...this definitely will not work, as putting (a1) at the end of the line will constrain all 8 of these effects to equality, probably not what you want. Instead try:
M ON Gender MS JS DC X1(a1) X2(a2) X3(a3) X4(a4);
2. Yes, but you need to use a1, a2, a3, and a4 in computing separate sets of conditional indirect effects. Also, I'd use bootstrapping as Bengt suggested above, not z-tests with p-values.
3. Tests of conditional indirect effects do not depend on the significance of the interaction effect.
SY Khan posted on Friday, October 02, 2015 - 3:55 am
Hi Dr. Preacher,
Thank you for your reply. Unfortunately, I am still not able to get the desired conditional indirect effects for seperate Xs. As advised, I have emailed the syntaxes used for your perusal and advice.
Many thanks for your help and support.
SY Khan posted on Friday, October 02, 2015 - 8:11 am
Managed the syntax for separate IND values. Kindly advise:
1-Is this fine?
ANALYSIS: Bootstrap = 5000;
MODEL: Y1 ON M (b1) GENDER AGE MS JS DC X1 X2 X3 X4 W WM (b3); M ON GENDER AGE MS JS DC X1(a1) X2(a2) X3(a3) X4(a4); W WM WITH M;
2- What to include in model indirect command to plot conditional indirect effects at: -1, mean=12.8, mean+1Sd = 15.8 and mean-1Sd= 9.8.
3- You advised that I should use bootstrapping and not Z-test with p-values. What are the reporting conventions in that case? I was following Hayes (2013) and Preacher et al (2007) for reporting conditional indirect effects with p-values. How would I report bootstrapped results? Any papers which reports confidence intervals for conditional indirect effect?
4- Do I report mm1=a1*b3 to mm4= a4*b3 with the respective a1(b1+b3W)? Not clear on the unique contribution of having the two.
1-The discrepancy in the PLOT and Loop command (as without the Plot/LOOP command the syntax works fine.
2- How to get standardized estimates for the IND1-IND4 with p-values and CI for the standardized IND 1-4. For mediation using MODEL INDIRECT I got standardized CIs for the indirect effects (with the same command in output as above), but not for MODEL CONSTRAINT. I want to check the significance of the conditional indirect effects using standardized co-efficients in ind= a1*(b1+b3Modvalue)and their respective CIs. Is there a way to obtain those in Mplus?
Apologies if I am missing something very obvious. Thank you for your time and support.
SY Khan posted on Sunday, October 04, 2015 - 2:51 pm
Kindly excuse my shallow understanding. This works:
1- Plots and new variable command in one syntax can't work? Need seperate models for plots and IND1-4?
2-wmodval -1, 1 are mean – 1sd and mean + 1Sd values of moderator that the system computes on its own? Can actual values of mean-1sd (9.8), mean+1 sd (15.8) and Mean (12.8) as wmodval be used to obtain INDs?
3- How to get standardized estimates for the IND1-4 with p-values and CIs for the standardized conditional indirect effects 1-4 with/without bootstrap. This does not work
OUTPUT: CINTERVAL (bcbootstrap) STDYX;
4-Is there a way to get estimates of IND1-4 at different levels of moderator in one model? This didn't work
MODEL CONSTRAINT: NEW (IND1 IND2 IND3 IND4 WMODVAL); WMODVAL = (-1, 1, 0.1); IND1=a1*(b1+b3*WMODVAL); IND2= ---; to IND4= ;
5- Models at wmodval= 9.8, 12.8 and 15.8 for significance of conditional indirect effects have INDs insignificant, when moderator, interaction & wmodval=-1 is significant. Any suggestions?
1. You can either use NEW in Model Constraints to evaluate the moderated effect at certain moderator values or you can use LOOP and PLOT to get results for a range of moderation values. You cannot use NEW and LOOP-PLOT in combination. When you use LOOP-PLOT you can get plots for several effects (e.g. indirect, direct).
2. You choose the moderator values. You have to find its mean and SD and decide what range you want to cover.
3. When you use the MOD option of Model Indirect you can give the X (exposure) values for which you want to evaluate the effects. For instance, with X mean of 0 and SD of 3 you can say
y MOD .... X(3 0);
which evaluates the effect of a 1 SD unit of change in X. With moderation Mplus does not provide a standardization with respect to the Y outcome. And you don't need that - see for example the Hayes (2013) mediation book. All you need is knowing the SD for Y so that you can see how big the effect is in SD(Y) terms.
4. Use the LOOP-PLOT approach (no NEW).
5. I don't understand the question.
SY Khan posted on Tuesday, October 06, 2015 - 7:39 am
Thank you Dr. Muthen – your reply clarified things. However, I would be grateful if you could also clarify the following please:
1-Replying to my question of the syntax for separate IND1-4, Dr. Preacher replied that it looks fine, but I should ensure that all the exogenous variables in the model covary as desired. When I look at the diagram that Mplus produces with running the above syntax, I see that X1-X4 and 5 control variables are correlated. Moderator (W) and Interaction (WM) are correlated with each other and the error term of the Mediator. I do not see correlation (bent arrows) between the moderator and interaction term with X1-X4 and Controls! I wonder if that is how it should be? Or should the moderator and interaction term be correlated with X1-X4 and controls too? If yes, then how should I set the correlation between moderator and interaction term and Xs and controls? At the moment, I specify only:
W WM WITH M;
2- For one of my moderators, the overall model fit is extremely poor but the all the direct, indirect, interaction and conditional effects are as desired and significant. How should I deal with the overall model fit in this respect? I can’t pin point the reason for the poor fit. Could you kindly suggest possible modifications by reviewing the output?
1. Yes, the moderator and interaction term be correlated with X1-X4 and controls too. Use WITH.
2. You have to check if your model specifies any left-out arrows apart from the interaction terms. For instance, does it specify no direct effects. If not, there is nothing substantial to test and you should ignore the fit statistics.
In general, pinpointing poor fit can be done via Modindices.
I should add that learning how to do mediation analysis cannot be done solely by asking questions on Mplus Discussion. I would recommend books such as Hayes (2013) and short courses.
I'm trying to run the difftest command to test the difference between a mediation model and a baseline model, but for some reason, the output is telling me they are non-nested and the test cannot be run.
This doesn't seem right given that everything is the same between them except that in the baseline model the outcome is regressed on 2 latent variables and in the mediation model, 1 latent variable is regressed on another and the outcome is regressed on the 1st latent variable (i.e. DRINKING on SOCIAL COPING in the baseline model vs DRINKING ON COPING and COPING ON SOCIAL in the mediation model).
I ran the baseline model after having used / run the the mediation model with the SAVEDATA command and am using the WLSMV estimator which I believe is the proper way to run this.
Anyway, if you have thoughts on why I'm getting this result, I would really appreciate hearing them. Or, if I'm perhaps doing it wrong, and this is the issue, I would also be grateful to hear what I should change!
Rick Borst posted on Friday, August 19, 2016 - 1:41 am
I am trying to conduct moderation analysis. And I have a few questions:
1. The latent variable moderation with LOOP plot example (following UG ex 5.13) has two asterices beyond the indicators at the righthand side of the BY statements of the moderator and the independent variable. a) Why is that? b) Do all the indicators in the BY statement need an asterix or just one indicator of every variable?
2. I have a mediation analysis 5 IV's, 1 mediator and 2 DV's. They are all latent variables existing of categorical variables. I want to check whether the moderator (also a latent variable) influences the effect of 2 IV's on the mediator. I need the R square of the mediator (with and without the interactions) and after that the LOOP plot of both interactions (so two LOOP plots). Is this feasable? Because I get stuck all the time at the moment (Errors such as: too many dimensions, the model has reached a saddle point, the model estimation did not terminate normally due to a non-zero derivetative... check you starting values... the loglikelihood derivetative for parameter .. is -0.86 etc.).
In an SEM we conducted, we found interactions between two observed variables, A and B, in predicting two latent dependent variables, Y1 and Y2. To interpret them, we employed a method described by Aiken and West in which we tested how the slope of A in predicting Y1 (and Y2) differed at different values of B. We'd like to plot these simple slopes. In an earlier post (on May 8-10, 2009), Linda noted that Mplus fixes the intercept of latent factors to 0. However, it seems, conceptually speaking, that there could be different intercepts at different conditional values of a moderator variable. Is there a way to request Mplus to estimate intercepts of latent factors freely?
1. I think you are referring to our FAQ. The asterisk frees the factor loadings (the first one would otherwise be fixed) so that the metric of the factor is instead set by a factor variance fixed at 1.
2. Yes, this is feasible. I would recommend adding one interaction at a time. If this doesn't help, send output and license number to Support.
The intercepts for the latent DVs is captured by the slope for the moderator influencing these DVs - see the role of f2 in our FAQ
Latent variable interaction LOOP plot
Rick Borst posted on Sunday, August 21, 2016 - 7:56 am
Dear Mr. Muthen,
Thank you for your answer. In the mean time I starter An analysis with processors = 4 and montecarlo(2000). It is Running 2 days already and has 421 iterations at the moment. The ABS change colums shows negative numbers since the last 100 iterations or so. Is it still usefull to complete the analysis or is this a lost cause?
Best wishes, Rick
Rick Borst posted on Sunday, August 21, 2016 - 2:47 pm
Dear dr. Muthen,
As expected, it did not converge due to 1 parameter. I send you the input and datafile. Can you see what is wrong? I want it right this time before I start a failed analysis of 2 days again. Thank you.
Thank you so much! One further question- I exported the plot to a jpeg, but when I opened it, it had and off-white background (a light yellow-brown). Is there anything that can be done to prevent this?
We’ve looked at the jpegs and they don’t look off-white to us. You can try EMF as well. If that doesn't help, please send to Support along with your license number.
Rick Borst posted on Monday, September 26, 2016 - 9:09 pm
Dear prof. Muthen,
I try to conduct a latent model with a latent interaction. I analyzed a model with only the latent interaction and it was significant. Now I want to conduct the complete model but it has 9 dimensions of integration. I followed the manual and use montecarlo(5000), processors = 4, and iterations = 7. Still it takes over 3 hours per iteration. Am I doing something wrong?
9 dimensions of integration is very hard to handle - I don't think you are doing anything wrong; it may take a long time particularly if you have a large sample. Check the need for interactions by doing one interaction at a time.
I apologise if these questions have been answered previously or are in the manual but I just wanted to clarify a few things. I am very new to this so some things may be trivial.
(Note. all these questions apply to small sample size, 60-100)
1) If I am including covariates in a moderation analysis, is the following is correct (if DV = Y, IV = X, Moderator = M, covariate = C): Y ON X (b1); Y ON M (b2); Y ON M*X (b3); Y ON C;
or does the covariate need to be applied to each line? Y ON X C (b1); Y ON M C (b2); Y ON M*X C (b3);
2) Is MLR appropriate for a categorical DV?
3) Is it better to use boostrapped SE with ML or MLR in a moderation analysis if outcomes are categorical and/or continuous and some variables are non-normal?
4) I understand in Poisson regression you can use the syntax COUNT to describe a count variable. If the DV is a count variable - can it be used in moderation or do you have to conceptualise it as a continuous variable.
5) Is it appropriate to use bootstrapping for logistic & poisson regression when just looking at main effects or more useful for indirect effects?
1) The two alternatives are the same except for the fact that you can have only one label per line without a semicolon - so the second approach is wrong from that point of view.
3) You can use ML+bootstrap or MLR. MLR should be fine here because you are not looking at indirect effects; it is suitable with non-normal outcomes.
4) You have to treat it as cont's
5) The latter.
Rick Borst posted on Wednesday, October 05, 2016 - 1:36 am
Dear prof. Muthen,
In follow up to my question above: I analyzed one interaction at a time (from which you checked the syntax via e-mail) and I found two significant interactions. Therefore for my final model I included all the IV's plus the interaction effect.
I ran the analysis but it just stopped at iteration 478 and did not receive any output? I ran the analysis for over 6 days so I'm a little bit angry that it just quit. I already had more than 120 negative ABS changes (starting at -28 and ending at -12) so I think it did not ran well (since the UG already mentions that negative ABS changes is a bad sign). On the other hand, I used montecarlo(5000) and integration = 7, so not a too low amount of integration points I would say? What can I do to fix this, I just ran an analysis of more than 6 days for nothing
Note that montecarlo(5000) and integration = 7 are contradictory. One or the other should be stated.
You should first note from your TECH8 screen output how many dimensions of integration you have. You can choose a very small number of iterations just to get that info. If you have many montecarlo(5000) may not be enough and if you have really many, ML may not be possible.
Rick Borst posted on Wednesday, October 05, 2016 - 10:47 pm
Dear Prof. Muthen,
Thank you for your response. I have nine dimensions of integration since I have categorical indicators. MLR will automatically be applied then. I have around 9000 respondenten. (1) So is montecarlo(5000) enough in this situation (and if not: what is)? (2) should it give a result around 100 iterations?
I also saw in the output Long before it stopped 5 "parameter derivatives" and afterwards merely negative ABS changes with every iteration. (3) What does parameter derivatives in this case mean? (4) Is it a problem that I have 38 missings on x-variables for montecarlo integration?
9 dimensions is a lot for ML numerical integration, leading to poor numericAl precision. And with n=9000, this is going to be slow.
Parameter derivatives is what ML tries to get down to zero - getting to max logL.
You may want to use Bayes which doesn't have these problems with high dimensionality. In our new book we talk about how Bayes is particularly useful when the high dimensionality is due to missing on x that are brought into the model.
But if the high dimensionality is due to bringing x with missing into the model and there are only 38 out of 9000 subjects with such missing, then I would just delete those subjects.
Rick Borst posted on Thursday, October 06, 2016 - 12:30 pm
Thanks a lot again for your reply. The Missing on x-variables is on covariates which are observed (age, gender etc.) so this does not provide the High amount of dimensions.
1) I only want my full model to see wheter the explained R Square of the full model grows due to the addition of the interaction; is this affected by bad numerical integration?
2) Bayes is not made for latent interactions yet right?
3) If I start a new analysis with merely montecarlo(5000), what is a good indication of the total amount of iterations before it should converge? ( I saw in another post of yours that it should be around 100 is this correct)?