Message/Author 


I am trying to model an interaction between 2 latent variables. I keep getting the following error message: THE MODEL ESTIMATION DID NOT TERMINATE NORMALLY DUE TO A CHANGE IN THE LOGLIKELIHOOD DURING THE LAST E STEP. AN INSUFFICENT NUMBER OF E STEP ITERATIONS MAY HAVE BEEN USED. INCREASE THE NUMBER OF MITERATIONS OR INCREASE THE MCONVERGENCE VALUE. ESTIMATES CANNOT BE TRUSTED.SLOW CONVERGENCE DUE TO PARAMETER 63.THE LOGLIKELIHOOD DERIVATIVE FOR THIS PARAMETER IS 0.12262334D+04. I tried increasing the number of minterations up to 5,000 and I keep getting this message. Is there anything else I can try to resolve this issue? Thank you for any help, 


Please send your input, data, output, and license number to support@statmodel.com. 


Dear Drs. Muthen, I am trying to incorporate an interaction in a latent variable SEM model between one of my latent exogenous variables and an observed exogenous variable. I read the article by Marsh, Wen, and Hau (2004) entitled "Structural Equation Models of Latent Interactions: Evaluation of Alternative Estimation Strategies and Indicator Construction." These authors discussed various choices of which indicators to center and crossmultiply when creating a latent interaction between two latent variables. However, in my case, one variable in the interaction is latent, and the other is observed. Should I center all of the indicators, as well as the observed variable, and then crossmultiply each of the centered indicators with the centered observed variable, to create the indicators for the latent x observed interaction term? Thanks very much for your help, Lisa M. Yarnell 


Also, please note, Drs. Muthen: This question pertains to analyses I personally am doing for my dissertation, using Mplus. 


You can use the XWITH option to estimate an interaction between a latent and observed variable. You can center the observed variable but should not center the factor indicators. 


Hi Dr. Muthen, I tried XWITH in the following code. The model is taking over an hour to converge. Is this due to the sheer complexity of the modelI used XWITH twice, and am working with a large data setor did I do something wrong in my code? CENTERING = GRANDMEAN(povratio EDACH); WEIGHT IS gswgt4; DEFINE: pratxEDC = povratio * EDACH; ANALYSIS: TYPE = RANDOM; MODEL: F1 BY LN_HRS GOAL INS RETIRE VAC; LN_HRS WITH GOAL; F2 BY LN_PEARN HHINC OWNMORT COMB_ASS; F3 BY PHONE NOMORT EVICT UTILP UTILO FOOD; F4 BY CONT1 CONT2 CONT3 CONT4; CONT2 WITH CONT3; F5 BY CONT5 CONT6 CONT7 CONT8 CONT9; pratxOCC  povratio XWITH F1; pratxINC  povratio XWITH F2; CONT7 WITH CONT8; CONT8 WITH CONT9; F1 WITH EDACH; EDACH WITH F2; F1 WITH F2; F3 WITH LADDER; F3 WITH F4; F3 WITH F5; LADDER WITH F4; LADDER WITH F5; F4 WITH F5; F1 on povratio; F2 on povratio; EDACH on povratio; F3 ON F1 EDACH F2 povratio pratxOCC pratxEDC pratxINC; LADDER ON F1 EDACH F2 povratio pratxOCC pratxEDC pratxINC; F4 ON F1 EDACH F2 povratio pratxOCC pratxEDC pratxINC; F5 ON F1 EDACH F2 povratio pratxOCC pratxEDC pratxINC; HEALTH ON F1 EDACH F2 F3 LADDER F4 F5 povratio pratxOCC pratxEDC pratxINC; 


I would suggest first running the model with only the BY statements. I would then add the ON statements and after that add one XWITH at a time. A poorly specified model can take a long time to converge and the poor specifications can be in any part of the model. A stepwise approach is needed. 


Thanks for all of your help, Dr. Muthen. So far, the estimation is still taking a long time. Would my results be incorrect if I tried to create indicators for the latent interaction by hand, rather than using the XWITH option? I could do this by centering the measured variable, centering the latent variable's indicators, crossmultiplying them, and using these crossmultiplied terms as indicators of the latent variable interaction? This seems to be the approach suggested by authors such as Marsh, Wen, and Hau (2004), mentioned above. Or would trying to construct the latent interaction "manually" in this way lead to incorrect results? 


Have you taken the steps I suggested? If just the BY statements take a long time, you should send the full output and your license number to support@statmodel.com. 


Dr. Muthen, Yes, I am trying the stepwise approach you suggested. I determined the measurement models in a previous stage of the research, so I believe that the specification of the portions of this model with the BY statements are OK. Basically, I am trying to add three interactions to the model (povratio x F1, povratio x EDACH, and povratio x F2), two of which are latent (the interactions with F1 and F2), along with the main effect of povratio. The three interactions are represented in the terms pratxOCC, pratxEDC, and pratxINC. First, I added the main effect of povratio; this worked, and the the model ran quickly. Then, I added in the interaction pratxEDC; this worked. The run time becomes slow, however, when I try to add in one of the latent interaction terms using the XWITH command. I started by trying to add in pratxOCC. I also had to add in the line ANALYSIS: TYPE = RANDOM in order to use the XWITH command. Could making the analysis type RANDOM be what is slowing down the run time? Thank you again. 


XWITH involving a latent variable can be slow if you work with a very large data set. If that's the case, you can take a random sample of say n=1000 and do a preliminary model investigation. That then gives you good starting values for a final analysis using the full data. 


Thanks, Dr. Muthen. I will try starting values. I saw some sample code online for starting values for the measurement portion of the model. That code looked like this: trend1b BY y11@0 y12@1 y13*2.5 y14*3.5; (The 2.5 and 3.5 represent starting values.) How do I supply starting values for direct effects in the model? Could you give me a line of code I could use as a model? (I am just not sure where to place the starting values for direct effects.) 


See pages 588589 of the current user's guide. If this is not sufficient to help you, send your input, output, and license number to support@statmodel.com. 


Hi Linda, I am not permitted to send you the data (at least, not the 100% sample of it) because it is secure, and the XWITH command is still making the program run very slowly. I have a mix of dichotomous and continuous indicators. If I try to create the latent interaction term "by hand," without using XWITH, should I center the indicators or not? For example, should I center the continuous indicators, not center the dichotomous indicators, then crossmultiply scores on these indicators, and use the crossmultiplied terms as indicators of the new latent variable? I am unsure whether I should be centering the indicators or not. Ideally, I would use the XWITH command to handle all of this, but it is not working (in a reasonable amount of time, at least). Thanks for your time, Lisa 


I would not use the indicator approach. I wonder if the model ran without the interaction. If so, send the output without the interaction and the input with the interaction to support@statmodel.com. If not, that is the place to start. 


Hello Dr. Muthen, I successfully ran a model where I have an interaction between 2 latent variables predicting a latent variable outcome (all indicators for predictors and outcome are continuous). What I am trying to do now is run multiple group analyses with this model. Specifically, my groups will be boys = 0, girls = 1. I am having difficulty with this as it seems that I should use the TYPE = MISSING command for multigroup analyses, but the TYPE = RANDOM command when using the XWITH command. How can I do a multiplegroup analyses while still keeping my latent interaction term? Thank you for your time. Best, Elizabeth 


I have some related questions: I am attempting to account for the relation among three measured control variables (two categorical) that predict latent variables but I saw that the WITH command causes the variables to be treated as dependent. How do I include this in my model where I am also going to include an interaction between two of the latent variables in predicting a third latent variable? I looked at the handouts for the Mplus Short Course Topic 1 (Exploratory Factor Analysis, Confirmatory Factor Analysis, And Structural Equation Modeling For Continuous Outcomes from August 6, 2009)where there is an example of CFA with covariates. The covariates are shown as covarying with one another in the model on slide 171, but there is no indication in the commands of this. Do these relations need to be specified or are they included in the analysis automatically? How do I obtain the output if they are automatically specified? Thank you for your help, Alexis 


Elizabeth: You need to use TYPE=MIXTURE and the KNOWNCLASS option. This is the same as multiple group analysis when all classes are known. See Example 7.21 to see how the KNOWNCLASS option is set up. 


Alexis: The correlations among observed exogenous covariates do you need to be specified. In regression, the model is estimated conditioned on these variables. Their means, variances, and covariances are not model parameters. To obtain these values, do a TYPE=BASIC. 


Thank you very much! Alexis 


Thanks very much for your help. Elizabeth 

Steve posted on Friday, July 05, 2013  5:44 am



Hello, I am wondering if you could refer me to any information which explains: a) How Mplus calculates latent variable interactions b) The most appropriate way to interpret (and plot) these interactions I think this may have been available at one point through the "short courses" section  however, it no longer appears to be there. Many thanks. 


a) It is based on the Klein and Moosbrugger article found in the reference list of the user's guide. b) See the Latent Variable Interaction FAQ on the webiste. 

Steve posted on Monday, July 08, 2013  7:38 am



Dear Linda. Got it  thanks very much. 

Steve posted on Thursday, July 11, 2013  4:24 am



Dear Linda/Bengt, I am testing moderation with an interaction term between two continuous LVs. I was planning on using product indicator (matched pairs) approach (e.g., Marsh, Wen, & Hau, 2004)  however I would prefer to use the Mplus (LMS) approach (based on Klein & Moosbrugger as you mentioned) because it is more straightforward and I don’t need to introduce/input ‘new’ standardized product variables to the data. Would it be possible to get your recommendation regarding the product indicator approach vs. Mplus approach to estimating interactions? Basically, I am looking for some statistical justification I can use for why Mplus approach is superior to indicator product method so I can proceed. Thank you very much. 


One statistical justification is that the Mplus approach is a maximumlikelihood method  a highly regarded estimator with good general properties  and the more ad hoc product indicator method isn't. I think, however, that the Marsh et al article suggests that the ML approach is a bit more sensitive to the normality assumption of the latent variables. 

Steve posted on Thursday, July 11, 2013  10:26 am



Dear Bengt, Thanks for your response. As your paper on Latent Variable Interactions at the end talks about the standardization of the interaction coefficient  may I ask if this is what Mplus provides in the STDYX output? Or in order to find the 'appropriate' standardized solution (e.g., Wen, March, & Hau, 2010), do you still need to multiply the Mplus standardized interaction coefficient by {sqrt[V(F1)*V(F2)]}/{sqrt[V(F1xF2)]} Thank you. 


Mplus does not provide a standardized solution in this case. You get the standardized values as described in the FAQ, Section 1.4. 

Steve posted on Thursday, July 11, 2013  3:06 pm



Okay. Thank you very much Bengt. 


We want to examine the interaction of two continuous latent variables (T and Tn) in prospectively predicting a categorical outcome using survival analysis. When we use the following syntax, along with the model=nocovariances statement (that is useful for other aspects of the larger model), the effect sizes for each predictor and for their interaction effect are all significant (p < .000), and range from .413 to 1.356. TxTn  T XWITH Tn; f on T; f on Tn; f on TxTn; However, when we include the correlation between the two predictors (i.e., we add the following statement to the above syntax: T with Tn;), all the effect sizes are reduced to 0.000, and are not significant (ps range from 0.997 to 1.000). That all three effect sizes are estimated to be 0.000 seems very odd. Any ideas why this might be happening? 


Please send the two outputs and your license number to support@statmodel.com. 

TA posted on Monday, March 03, 2014  8:53 am



Hi, Is there a way of producing a latent variable interaction graph, very much like the one you published in the article "Latent Variable Interactions" Bengt Muthen September 20, 2012 (https://www.statmodel.com/download/LV%20Interaction.pdf), page 9 using Mplus? I guess I was trying to interpret a latent variable interaction where one of the variables in the interaction is negatively correlated with the other, and then trying to interpret its relationship on the Y variable. Thanks. 


Yes, you can use the LOOP option that is described in UG ex 3.18. 

TA posted on Tuesday, March 04, 2014  1:02 pm



Will this work on a Mac? 


No, it will not. 

TA posted on Friday, March 07, 2014  10:10 am



Hi, Will I be able to a) run a latent variable interaction and b)plot the latent variable interaction using LOOP on older Mplus versions before 7. Thanks. 


No, the LOOP option was added in Version 7. 

TA posted on Sunday, March 16, 2014  8:30 pm



Hi, I was wondering if you could expand upon the example 3.18 to involve latent variables. The example is not helpful because it is between observed variables, not latent variables. This is my thought process of adapting the syntax. I would appreciate any input on getting this to work or even posting the syntax Dr. Bengt Muthen used to get the latent variable graph in the white paper. MODEL: emotional BY ITEM1 ITEM2 ITEM3 ITEM 4 ITEM5 ITEM6; k6 BY D1 D2 D3 D4 D5 D6; emotk6  k6_latent XWITH emotional; consult ON emotional k6_latent emotk6; The consult line is the model  is that what I include under model constraint? MODEL CONSTRAINT: PLOT(final_model) LOOP(mod, 2,2,0.1); final_model=consult*(emotk6*mod); PLOT: TYPE=PLOT2; Is this how the the syntax should be written? Thanks. 

TA posted on Sunday, March 16, 2014  8:44 pm



Or: MODEL: emotional BY ITEM1 ITEM2 ITEM3 ITEM 4 ITEM5 ITEM6 (gamma1); k6 BY D1 D2 D3 D4 D5 D6 (gamma2); emotk6  k6_latent XWITH emotional; consult ON emotional k6_latent emotk6 (b); The consult line is the model  is that what I include under model constraint? MODEL CONSTRAINT: PLOT(final_model) LOOP(mod, 2,2,0.1); final_model=b*(gamma1+gamma2*mod); PLOT: TYPE=PLOT2; My apologies for another post. This syntax ran and I wanted to make sure my syntax was correct for interpretation purposes. 


Please see the new FAQ Latent variable interaction LOOP plot at http://www.statmodel.com/faq.shtml 

TA posted on Friday, March 21, 2014  4:31 pm



Thank you, Dr Muthen. This is extremely helpful in comparison to my code. 

RuoShui posted on Monday, March 31, 2014  4:27 am



Dear Drs. Muthen, I am running a model with interactions between latent variables with continuous indicators. I have a couple of questions: 1) From reading previous posts, I understand that I can create the interaction term using two latent factors as they are without having to standardize any indicator, is this correct? 2) In the UG, it says "By specifying ALGORITHM=INTEGRATION, a maximum likelihood estimator with robust standard errors...." Does it mean that I do not have to specify Estimator=MLR if I want to account for potential nonnormal data? Thank you very much for your help! 


1. Yes. 2. I believe this is the case. Look at the output to see which estimator is used to be certain. 

RuoShui posted on Monday, March 31, 2014  2:48 pm



Thank you very much Dr. Muthen! 

TA posted on Friday, April 18, 2014  12:40 pm



I was curious to know if the interaction between two latent variables is computed in a similar fashion as Kenny and Judd (1984) paper? I guess I'm curious how the latent variable is computed exactly in Mplus. Thank you for your help as always. 


No, we use the LMS method described in the Klein and Moosbrugger article cited in the user's guide. 

Luo Wenshu posted on Monday, June 02, 2014  3:14 am



Dear Drs. Muthen, I am running SEM with latent interactions. I have two questions. 1) In a SEM model with latent interaction,do we need to centre the latent predi ctor factors to avoid multicollinearity when using the first order and interaction terms to predict an outcome latent variable? If so, how to do it? 2) My latent interaction model is more complex than the model in the manual. It has direct effects from the predictor factors and their interaction to the outcome factor, in addition to the indirect effect through an mediator factor. I also intend to control for two observed covariates in the model. Then how to calculate the standardized coefficients as well as R square? Thank you very much! 


1. No. 2. See the Latent Variable Interaction FAQ on the website. 

Luo Wenshu posted on Monday, June 02, 2014  5:18 pm



Thank you for your response, Linda. Is it appropriate to set the mean and variance of latent predictors to be 0 and 1 respectively in latent variable interaction model? I found that the regression coefficients would change if I do so. I have read the FAQ on latent variable interaction. So the formulas for standardized coefficients and R square are appropriate for my complex model where I have some observed covariates? Thank you so much. 


Q1. You can do so. Q2. The general formulas can be applied to your case, but doing so might require a degree of statistics knowledge. 

Luo Wenshu posted on Monday, June 02, 2014  6:16 pm



Thank you very much Dr. Muthen. After setting 0 and 1 as mean and variance for latent factors, can I assume that I can still apply the formula to the output in order to calculate standardized coefficients and R2? It seems that I need to be very careful about the calculation.I hope Mplus can provide the standardized coefficients and explained R2. 


Yes. At some point we plan to have this automated. 


Dear dr. Muthén, I ran a structural equation model using TYPE = COMPLEX RANDOM with a threeway interaction. Now that my interaction is significant, I try to plot my interaction using software by Dawson and Richter. However, to test simple slopes, I need the covariances between the interaction terms, which I cannot find in my output. I have used TECH1 and TECH3. Could it be the problem that I am using latent variables? What would you recommend to plot my interaction? Kind regards, Kim Breevaart 


It sounds like you are asking about a WITH statement between two XWITH parameters. That is not a model parameter. An XWITH parameter can be used only on the righthand side of an ON statement. 


Hi, I'm estimating a model with an interaction between a latent variable and observed variable. I would like to free the parameters of the first indicators. Is that acceptable in a latent interaction model? Thank you! f1 by T1* T2 T3 T4 T5; f1@1; [f1@0]; f2 by MB1* MB2 MB3; f2@1; [f2@0]; f3 by PER1* PER2 PER4 PER5 PER6 PER7 PER8; f3@1; [f3@0]; inter1  f1 XWITH salien; inter2  f3 XWITH salien; f3 on f1 f2 salien inter1 inter2; 


Yes. 

Karina posted on Monday, September 01, 2014  10:47 am



Dear Prof. Muthen, I'm trying to fit a model with one interaction among two latent variables using LMS (XWITH command). The indicators of the exogenous factors are 5pointsLikerttype items, and I have a single continuous Y variable so I think I have two ways to fit the model: a. Simply treating categorical indicators as continuous variables and run the model. b. Treating categorical indicators as categorical variables using the Categorical command (ie. categorical = x1x8) and run the model. I did run my model both ways but I get fairly different results, so I was wondering: 1. What does the software do when I add the Categorical command to the LMS procedure? 2. If I treat the indicators as continuous variables, LMS decomposes the distribution of the endogenous and exogenous indicators, but if I treat them as as categorical: am I using a limited information procedure instead? is there any decomposition of variable distribution as Klein and Moosbrugger (2000) mention? how is that done?. 3. I know that when type=RANDOM, output show unstandardised coefficients that we can standardize "by hand". But only when I add the "categorical" command, I get awkward results (i.e. lambda greater than 1 even after standardization). Should I use another way to standardize the lambda coefficients in this case? I'll appreciate your advice, thank you! 


1. The latent variable, the factor behind the set of Likert indicators, is a continuous normal variable in both cases (that is, when treating the indicators as continuous vs as categorical). If there is a large difference in results, this might mean that the Likert variables have strong floor or ceiling effects. 2. XWITH always uses maximumlikelhood estimation, which in the continuous indicator case is also referred to as the LMS method (which is really only one of several possible computing algorithms to get maximumlikelihood estimates). Mplus uses a somewhat different algorithm than in Klein's LMS, but it is still maximumlikelihood estimation  also with categorical indicators. 3. Standardization with XWITH is discussed in the FAQ on our website: Latent variable interactions 

Karina posted on Monday, September 01, 2014  7:54 pm



Dear Dr. Muthen, Thanks for your quick reply... I don't want to bother you but I'm afraid I still have some questions: 1. I didn't know that the estimation algorithm in MPlus was somewhat different than the procedure described in Klein & Moosbugger. Could you please suggest some readings that I can check to understand the difference, especially when categorical indicators are used in the measurement models? 2. I had a look on the FAQ about standardization (Latent variable interactions section 1.4) but it only covers the standardization of parameters in the structural model and I'm talking about the standardization of lambda parameters in the measurement model when indicators are treated as categorical. Could you please give me some clues about how that standardization is done? because after applying the standard procedure (parameter *(sdx/sdy)) I still get standardized values greater than 1 (I don't get that result when I treat categorical variables as continuous). Thank you so much for your help 


1. These small algorithmic differences have not been documented. They are not noteworthy enough to have been published. The estimators are the same. 2. The FAQ shows how to get the variances of the factors. You can take the square root of these to get the standard deviations which you can use to standardize the factor loadings. See the FAQ on Factor loadings greater than one. 

Karina posted on Tuesday, September 02, 2014  12:32 pm



Great, thank you so much for your answer Dr. Muthen! just two more things (these are the last questions, I promise) 1. About the standardization, I found in one of your answers to the forum that the formula should be: (lambda * SD(Factor) / sqrt(lambda^2 * V(Factor) + V(Residual)). Is that the way I should use? 2. In case that formula to standardize factor loadings is right, the only problem I'm facing is that I don't get the residual variance of the X variables when I treat them as categorical... the syntax I'm using is: DATA: FILE IS DATA.DAT; FORMAT IS FREE; VARIABLE: NAMES ARE: Y X1X10; CATEGORICAL = X1X10; ANALYSIS: TYPE=RANDOM; ALGORITHM = INTEGRATION; ITERATIONS = 500; MITERATIONS = 500; MODEL: F1 BY X1X4*; F1@1; [F1@0]; F2 BY X5X10*; F2@1; [F2@0]; INT  F1 XWITH F2; Y ON F1 F2 INT OUTPUT: sampstat; tech8; Should I add anything else to get the residual variances? (I do get the residual variances in the output if I delete the instruction "CATEGORICAL = X1X8;") 


1. Yes 2. With categorical and logit  which is the default with ML  the residual variance is 3.14*3.14/3. (This is discussed in our handouts on the website.) 

Karina posted on Wednesday, September 03, 2014  10:33 am



Thanks very much for taking the time to answer all of my questions!!! you helped me a lot!. Have a nice week! 


Dear Dr. Muthens, We are fitting a latent growth curve model where we have an interaction between intercept and slope growth factors that, in turn, predict a count variable. I have been reading your FAQ on latent variable interactions, but I’m still a bit unsure how to represent the results of the latent interaction in this case. Is it ok to apply those formulas in your FAQ to standardize the latent interaction on log scale and then exponentiate the estimate? 


You should standardize with respect to the latent variable predictors and then exponentiate. 

Jen posted on Friday, March 06, 2015  1:34 pm



Hello, Hope you are well. I am having problems with a structural model involving latent interactions. The general model involves partial mediation A>B B>C A>C Additionally, a moderator M is predicted to moderate A>B and A>C. A, B, and M are latent variables; C is a dichotomous outcome. To test the moderation, I am including a latent interaction variable: AM  A XWITH M; I then regress B and C on this interaction: B ON A M AM; C ON A B M AM; I tested the significance of AM>B and AM>C separately; the models converged and both coefficients were significant. However, even using starting values from these models and increasing the MITERATIONS, I cannot get the model with both B ON AM and C ON AM to converge. Before I continue increasing my MITERATIONS, I am curious whether there is something about this model that would be expected to cause problems. It seems computationally demanding but otherwise nonproblematic to me, but I am definitely not an expert in latent interactions. Thank you much! 


This model should work fine. It sounds like you would have 2 dimensions of integration which shouldn't be too heavy. Please send the output of your full model, its input, and data to support@statmodel.com along with your license number. 


Dear Dr. Muthens, In your discussion on computing Rsquare for a latent interaction term (in FAQ document), the formula seems to work well for a model in which there are two “main effects” and one interaction effect. I am working on a model in which there are more than one interaction terms and wonder if you have any insights into computing the Rsquare? If we assume that the (multiple) interaction terms are not correlated, could we compute each of the interaction term’s Rsquare first, and sum them up later to cover the incremental Rsquare explained by these interaction terms? Thanks, Chong. 


Q1. The FAQ approach to variance and Rsquare computations covers the case of more than one interaction term. You consider E(DV*DV) which involves E(eta_3*eta_3) in (14) and that results in E of the product of 4 eta's in (15). That approach can be used also with 2 or more interaction terms influencing the DV since there won't be more than 4 eta's in any product. Q2. With zero covariances among the eta's the last term on the righthand side in (15) is zero but you still have the first term. Just go through the algebra. 


Thank you so much, Dr. Muthen. I will give it a try. Chong. 

Tao Yang posted on Thursday, June 04, 2015  10:18 am



Hello, I was trying to model the interaction of two latent variables at level2b in crossclassified data. Is it available in Mplus? If I understand correctly, Bayes estimation is needed for crossclassified data. Is latent variable interaction available in Bayes? Thanks! 


I believe that XWITH is available with CROSSCLASSIFIED RANDOM. Try it. 

Tao Yang posted on Friday, June 05, 2015  8:32 am



Thanks, Linda. I tried XWITH with CROSSCLASSIFIED RANDOM and got the message "Interaction variables are not allowed with ESTIMATOR=BAYES." Are other estimators available with CROSSCLASSIFIED at this point? If not, are there other ways to handle interaction in crossclassfied? Thanks! 


Then this cannot be done at this time. 


Dear Dr. Muthens, In my model I have an interaction effect (just 10% significance). When I plot this interaction effect, the lines do not drop to the same zone of the plot (which to the best of my knowledge is interpreted as nonsignificant interaction). I am wondering if I am doing something wrong or this plot is due to the low significance level? Thanks 


Sorry I forget to write in my previous comment that I am trying to plot "marginal interaction effect". But the lines do not drop to the same zone of the plot. 


Our Mediation page http://www.statmodel.com/Mediation.shtml shows how to get a loop plot with CIs for a moderated effect using UG ex 3.18. 


I would like to test a model with a continuous latent variable as a moderator (using XWITH for the interaction) of other continuous latent variables on the dependent variable versus an alternative model with that same variable as a direct factor (using BY) on the dependent variable. Would the second model with direct rather than indirect effects be considered nested in the first? With XWITH, I have to use TYPE=RANDOM and the model converges but model fit shows only AIC and BIC rather than Chi Square. As such I can only compare AIC and BIC rather than Chi Square and degrees of freedom. How would you recommend I test these alternative models? Please let me know what you think. Thanks 


I think you want to consider the two models: fy on f1 f2 f12; ! f12 is interaction of f1 and f2 versus fy on f1 f2; You don't want to leave out the main effects in the first model. Which means that the significance of the slope for f12 is what you want to check. For testing alternative models, see our FAQ Latent variable interactions 


Hello, I am testing an interaction model with 1 latent (EF4) and 1 observed variable. Based on theory, I would like my latent variable to moderate my observed variable. The LOOP plot supports my hypothesis but I would also need to run simple slope analysis. To do this, I would need to define 2 variables: 1 SD above EF4 and 1 SD below EF4. When I try this code, Define: EFAb = EF4 + .19; EFB = EF4 .19; I get this message: Undefined variable used in transformation: EF4. Can we not "transform" latent variables in MPlus? Thanks so much. 


The DEFINE command is for observed variables only. Use MODEL CONSTRAINT for your purposes. See MODEL CONSTRAINT in the user's guide for further information. 


Hello. Does the "Latent variable interaction" paper on the FAQ also apply to the interaction between a latent and an observed variable? If yes, do I need to standardize the observed variable so that mean = 0 in order to use the same formulas to calculate standardized regression coefficients? If no, how can I derive standardized coefficients and plots of an interaction between a latent and an observed variable (using XWITH)? 


Yes interactions between latent and observed are covered and you don't need to standardize the observed ahead of time. 


Thank you. And where do I see the variance for my observed variable in the Mplus output (which I would need for the formulas described in the paper)? My output file only lists variances for latent variables. 


You don't need these variances, because Mplus does the standardization. But they are available by running Type=Basic. 


Hi Bengt, I am running an interaction between a latent and an observed variable using XWITH, with knownclass to compare groups, so I am using TYPE = MIXTURE RANDOM. Mplus does not do the standardization for me in this case, so I want to calculate that by hand using your "latent variable interaction" paper. For this, I need the variance of my observed variable. 


Do Type = Basic. 

Vera Denton posted on Thursday, November 17, 2016  5:32 am



Dear Prof. Muthen, I'm interested in the interaction effect on the within level only. I use the following syntax: usevar = K_1 K_2 D_1 D_2 P_1 P_2; missing = all (99); cluster = VP_Nr; within = P_1 P_2 K_1 K_2; analysis: type = twolevel random; ALGORITHM=INTEGRATION; model: %within% K by K_1 K_2; D by D_1 D_2; P by P_1 P_2; PxK  K xwith P; D on K P PxK; My question for you is: Are the effects estimates on the within level trustworthy if I 'ignore' the variance on the between level? Or are they artificially overestimated? Would you have any suggestions on modeling a multi level latent moderation? I appreciate your help very much. 


You want to add D; on Between. Otherwise your variance estimates will be off. 

Rick Borst posted on Saturday, November 19, 2016  2:48 am



Dear professor Muthen, I have the same problem as the first person of this thread. I want to test the latent interaction of Z on X>Y but receive the following message: THE MODEL ESTIMATION DID NOT TERMINATE NORMALLY DUE TO A NONZERO DERIVATIVE OF THE OBSERVEDDATA 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.23921167D+02: Parameter 31, ADMBURD I did montecarlo(5000) and have 4 dimensions of integration. How can I resolve this problem? Thank you. 


Please send the output and your license number to support@statmodel.com. 


Dear Drs. Muthen, I have a question regarding model comparisons using the loglikelihood values provided by a basic model and a latent interaction model (with one interaction effect). Based on my understanding of the LMS method, a chisquare statistics can be computed based on the 2(difference in loglikelihood) with corresponding df (addition of numbers of interaction terms). I observe something strange, however, in my analyses. I specified a latent interaction model with one interaction term (df = 1), and the interaction effect was not significant. However, when I compared this model with the basic model, the chisquare was significant (with 1 df). Is it possible that the significant test of the only one interaction term was not significant, but the chisquare change between models was significant? Thanks, Chong. 


Please send the two outputs and your license number to support@statmodel.com. 


Dear Drs Muthen May I know what are the factors that may lead to the problem that the rsquare in a model with latent interaction terms is smaller than one without? Some insights from you will be excellent. Chong. 


When adding a latent variable interaction you are fitting a different model so that all estimates may change and not necessarily give a higher Rsquare. The important thing is to see if the interaction has significant effects. 


Thank you for you response, Dr. Muthen. If that is the case, what would be the way of calculating the incremental Rsquares for the latent interaction terms? Can we hand compute ithem based on the standardized betas of the interaction terms? Thanks, Chong 


Dear Professors, I'm running several models without an interaction and one model with a latent variable interaction. Before entering the interaction I was using the option cluster = class (students within one class). Now I am attempting to run a model with a latent variable interaction, to which I am not very familiar. When I add the interaction effect to my model (xwith) I need to use ‘type = random’. Yet, to use the option cluster = class I cannot use ‘type = random’. Is there a way to control for nonindependent observations when adding a latent interaction? I look forward hearing from you soon. Best, Danique 


If you have enough classes (say at least 30), you can use Type=Twolevel Random. 


Dear Bengt Muthen, Thank you for your quick reply. I have enough classes (31). Can I also use 'type = twolevel random' when I’m not interested in doing multilevel analysis (effects class level) but I solely want to control for nonindependence. Best, Danique 


Dear Prof. Muthen, I have a quick question about latent interaction analysis. a) Do I get standardized beta coefficients when I use "Define: standardize" option to standardize all the items I use to build latent variables? b) Can I use the formula "1residual variance" in dependent variable to report R square? Best regards, Vera 


a) No, use Standardized in the Output command b) No, it has to be 1  Stand'd(res var) 


Thank you for Your quick response! However, I do not get standardized output for the analysis "random". Would You find it appropriate to report nonstandardized estimates in a paper? Is there any more elegant solution? I do not get the stand. res var neither. I know, I can calculate R sq. by hand. However, I do not understand how do I find (calculate) the covariance between two latent variables as suggested in the "Latent variables interaction" handout which is needed for the formula (R sq). I'm a bit embarrassed to ask you this, but could you please tell me how one should deal with R sq. after adding a latent interaction term. And: Do You find it necessary to report it overall. 


Which version of Mplus are you using? 

Vera Denton posted on Tuesday, June 20, 2017  11:40 pm



Dear Prof. Muthen, I'm using VERSION 7.3. 


Update to Version 8. 


Dear Drs. Muthen, I am currently running a twolevel growth model in Mplus. I would also like to test between level interactions (one manifest Variable (COS) and one latent variable (IB)). input: between = cos; Cluster = klasse; centering = grandmean (cos) Analysis: type = TWOLEVEL Random; ALGORITHM=INTEGRATION; Miterations = 4000; Model: %within% iw sw  t1@0 t2@1 t3@2 t4@3 t5@4 t6@5 t7@6 t8@7; t1  t8 (1); sw on iw@0; %between% ib sb qb t1@0 t2@1 t3@2 t4@3 t5@4 t6@5 t7@6 t8@7; t1  t8@0; cosxib  cos xwith ib; sb ON cos IB cosxib; qb@0; 1. Is grandmean centering correct in my case (only centering the between level manifest variable (cos))? 2. Or are there any alternatives? 3. Do you think this input looks fine? Thank you very much for your help! Frank 


12. This is fine. 3. What is unusual is the inclusion of qb and not qw. I am not sure what the implications are for the relationship between the mean and the covariance structure in this case. Perhaps it is ok because qb doesn't have a variance. It is not a model that is done in regular multilevel growth analysis. 


Thank you so much, Dr. Muthen! I have 2 more questions: 1. Would you recommend centering the manifest predictor "cos"(CGM or other) when testing a cross level interaction? 2. If I don't CGM "cos" the model runs fine. If I CGM "cos" I get nonsign negative residual variances for sw. Do you have an idea, why these negative residual variances may occur when centering the manifest predictor (cos)? Input: between = cos; Cluster = klasse; centering = grandmean (cos) Analysis: type = TWOLEVEL Random; ALGORITHM=INTEGRATION; Model: %within% iw sw  t1@0 t2@1 t3@2 t4@3 t5@4 t6@5 t7@6 t8@7; t1lfje2S  t8lfje2S (1); sw on iw@0; b  sw ON iw %between% ib sb qb t1@0 t2@1 t3@2 t4@3 t5@4 t6@5 t7@6 t8@7; t1lfje2S  t8lfje2S@0; sb ON cos IB; b on cos; qb@0; Thank you so much again! 


Dear Dr. Muthen, I am really sorry. Actually the regative residual variance of sw occurs whether I center at grandmean or not. So question 2 of my previous post is out. Still, may there be something wrong with my input? Anyways I am considering to address the negative residual variance problem to support@statmodel.com. Nevertheless I would be very much interested in your opinion on question 1 of the previous post (even though estimates are almost equal  for centering and not centering the manifest between variable (cos)). Thank you very much! Frank 


Q1: I would center only if it made the interpretations easier. To resolve the negative residual variance for sw you can do a run where you simply say iw WITH sw; and see how highly correlated they are (in standardized part). Perhaps a high correlation is the cause. 


Dear Dr. Muthen, thank you so much for your answer! I am wondering about specifying „sw with iw“ because I was already specifying a slope (random) by „b  sw on iw“ which does not have a parameter estimate, but I thought it was still a slope similar to a constant one (such as „sw on iw“)  also because I get residual variances for sw. 1. Is it o.k. to allow correlation between two variables („sw with iw“) next to a random slope („b  sw on iw“) concerning the same variables? As you predicted, there is a strong correlation between sw and iw. In a model without interaction effects, the correlation is 0.407 (when „sw with iw@0“) and .753 (when „sw with iw“). 2. May there be more to consider when specifying the model since I have a cross level interaction with a manifest between level predictor (cos) and a latent within level predictor (iw)? Thank you again, Frank 

Vera Denton posted on Thursday, July 06, 2017  4:34 am



Dear Professors, we are running a twolevel moderation analysis. We are interested in the effects on withinlevel only. usevar = x1 x2 x3 y1 y2 y3 z1 z2 z3; missing = all (99); cluster = VP_Nr; within = x1 x2 x3 y1 y2 y3; analysis: type = twolevel random; estimator=mlr; ALGORITHM=INTEGRATION; model: %within% x by x1 x2 x3; y by y1 y2 y3; zw by z1 z2 z3; XxYx xwith y; z on x y XxY; %between% zb by z1 z2 z3; Does this look right to you? I understand, there is no need to center indicators of latent variables because latent variables have a mean of zero. Does this apply for a twolevel analysis as well? Appreciate your help! 


Q1: Yes. Q2: Yes. 


I apologize for asking again  I just want to make sure that we do it right. If we are only interested in the withinlevel effects  would it be incorrect to groupmean center individual indicators of the independent latent variables? Thank you for your support! 


No need to groupmean center  the zb factor takes care of pulling out the betweenlevel parts of those indicators. 


I successfully ran a latent variable interaction model and used the syntax below to obtain a moderation plot for the interaction between my two latent constructs and their influence on my outcome. A journal reviewer is requesting that we include the coefficients for our predictor variable at different levels of the moderator. Is this possible? If so, can you please tell me where to find or how to obtain those values? ANALYSIS: TYPE = RANDOM; AlGORITHM = INTEGRATION; MODEL: S BY SpNW_tot SpW_tot; A BY ASpNW_tot ASpW_tot ASd_tot; SA@1; RADS BY RADSp1 RADSp2 RADSp3; RADS ON age gender S (b1) A (b2); SxA  S XWITH A; RADS ON SxA (b3); OUTPUT: STANDARDIZED TECH1 TECH8; Model Constraint: PLOT (lowA highA); LOOP (S, 3, 3, 0.1); lowA = (b1+b3*(1))*S+b2*(1); highA = (b1+b3*(+1))*S+b2*(+1); Plot: type = plot2; 


S is your predictor and A is your moderator. Your expressions (b1+b3*(1)) (b1+b3*(+1)) give the 2 coefficients for S at these 2 values of A. If you want to get those 2 coefficients and their SEs in the output you just replace the PLOT and LOOP statements with NEW(lowA highA); and keep the lowA and highA statements. 


Thank you very much, Dr. Muthen. When I run the revised input file below, replacing the PLOT and LOOP statements with NEW (lowA highA), I receive an error message stating, "Unknown parameter label in MODEL CONSTRAINT: S" Can you please help me find my error? Thank you! ANALYSIS: TYPE = RANDOM; AlGORITHM = INTEGRATION; MODEL: S BY SpNW_tot SpW_tot; A BY ASpNW_tot ASpW_tot ASd_tot; SA@1; RADS BY RADSp1 RADSp2 RADSp3; RADS ON age gender S (b1) A (b2); SxA  S XWITH A; RADS ON SxA (b3); OUTPUT: STANDARDIZED TECH1 TECH8; Model Constraint: NEW (lowA highA); lowA = (b1+b3*(1))*S+b2*(1); highA = (b1+b3*(+1))*S+b2*(+1); Plot: type = plot2; 


Model Constraint doesn't know that S is when it is no longer in a LOOP. You can give S various values. But I thought you wanted (b1+b3*(1)) (b1+b3*(+1)) that is, the S coefficients for different values of A. 


Thank you very much, Dr. Muthen. We were able to obtain the information we needed. 

fred posted on Saturday, June 13, 2020  4:19 am



Hi, I am running a moderation analysis with 4 potenial latent interaction terms (X1X2* Z1Z2) using XWITH option. I am fitting these one at a time and check their signficance before comapring model BIC values. None of the XWITH terms are signficant. Given the nonsignificance of these individual XWITH terms does it make any sense to proceed with model comparssion and plottimg the slopes or does theses nonsignificant parameters mark the inapproprity of including the XWITH terms? thanks 

fred posted on Saturday, June 13, 2020  4:29 am



just a follow up to my questions, although the interaction terms are nonsignifcant the BIC values of the models with interactions included are smaller that those without interactions. 


There is often not sufficient power to reject that an interaction term is zero, so it can make sense to include the interaction when plotting. 

fred posted on Sunday, June 14, 2020  10:24 pm



Thank your for your response! Do you mean that the graphic presentation in the plots actually can be interpreted as a better indicator of latent interaction than Wald statistics (or Z)? Also I have to correct my follow up, the BIC values for the model without interaction is in fact smaller than than BIC of interaction model (also no significant structural pathes from the hypothesized moderator to the outcome). Does it still make sense to inspect the plot? 

fred posted on Monday, June 15, 2020  7:48 am



I retract my question, checking the plots confirms there is no interactions! Just a question about the lower and upper lines, are they the 95% CIs? 


Yes, 95% CIs. 

fred posted on Wednesday, June 17, 2020  12:56 am



Thank you very much! So in regard to Wald outputs vs the plots: In other runs with nonsignifcant Walds statistics, the estimate lines cross at extreme levels of X (X = 2.9 SD for a case, and X = 2.5 SD for another), however, this is not the case for both of the CIs (in one case the lower displays a similar crossing but not the upper, and vice versa in the other case). The diff on Y between the two estimate lines after the crossing point and up to extreme end of X is also very small (diff Y = 0.013 SD). Given than not both of the CI lines replicate the estimate line's crossings, would you say that the plots confirm the Wald statistics regarding nonsignficance of the latent interaction terms? 


I have to see your output and plots to say  send to Support along with your license number. 

Back to top 