Latent variable interaction PreviousNext
Mplus Discussion > Structural Equation Modeling >
 Kimberly A. Rhoades posted on Thursday, August 27, 2009 - 12:07 pm
I am trying to model an interaction between 2 latent variables. I keep getting the following error message:



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,
 Linda K. Muthen posted on Thursday, August 27, 2009 - 2:46 pm
Please send your input, data, output, and license number to
 Lisa M. Yarnell posted on Tuesday, March 22, 2011 - 1:05 pm
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 cross-multiply 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 cross-multiply 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
 Lisa M. Yarnell posted on Tuesday, March 22, 2011 - 1:47 pm
Also, please note, Drs. Muthen: This question pertains to analyses I personally am doing for my dissertation, using Mplus.
 Linda K. Muthen posted on Tuesday, March 22, 2011 - 5:30 pm
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.
 Lisa M. Yarnell posted on Sunday, March 27, 2011 - 10:04 pm
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 model--I used XWITH twice, and am working with a large data set--or did I do something wrong in my code?


WEIGHT IS gswgt4;

DEFINE: pratxEDC = povratio * EDACH;










pratxOCC | povratio XWITH F1;
pratxINC | povratio XWITH F2;












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;
 Linda K. Muthen posted on Monday, March 28, 2011 - 6:29 am
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.
 Lisa M. Yarnell posted on Monday, March 28, 2011 - 10:59 am
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, cross-multiplying them, and using these cross-multiplied 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?
 Linda K. Muthen posted on Monday, March 28, 2011 - 11:23 am
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
 Lisa M. Yarnell posted on Monday, March 28, 2011 - 11:53 am
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.
 Bengt O. Muthen posted on Monday, March 28, 2011 - 4:50 pm
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.
 Lisa M. Yarnell posted on Monday, March 28, 2011 - 7:28 pm
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.)
 Linda K. Muthen posted on Tuesday, March 29, 2011 - 5:59 am
See pages 588-589 of the current user's guide. If this is not sufficient to help you, send your input, output, and license number to
 Lisa M. Yarnell posted on Tuesday, April 05, 2011 - 7:36 am
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 cross-multiply scores on these indicators, and use the cross-multiplied 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,
 Linda K. Muthen posted on Tuesday, April 05, 2011 - 9:00 am
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 If not, that is the place to start.
 Elizabeth Penela posted on Monday, March 05, 2012 - 9:22 am
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 multi-group analyses, but the TYPE = RANDOM command when using the XWITH command. How can I do a multiple-group analyses while still keeping my latent interaction term?

Thank you for your time.

 Alexis Williams posted on Monday, March 05, 2012 - 12:21 pm
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,

 Linda K. Muthen posted on Monday, March 05, 2012 - 2:12 pm

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.
 Linda K. Muthen posted on Monday, March 05, 2012 - 2:15 pm

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.
 Alexis Williams posted on Monday, March 05, 2012 - 5:47 pm
Thank you very much!

 Elizabeth Penela posted on Tuesday, March 06, 2012 - 5:15 am
Thanks very much for your help.

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

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.
 Linda K. Muthen posted on Saturday, July 06, 2013 - 11:41 am
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.
 Bengt O. Muthen posted on Thursday, July 11, 2013 - 7:34 am
One statistical justification is that the Mplus approach is a maximum-likelihood 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.
 Bengt O. Muthen posted on Thursday, July 11, 2013 - 2:44 pm
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.
 Richard E. Zinbarg posted on Friday, November 01, 2013 - 8:10 am
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?
 Linda K. Muthen posted on Friday, November 01, 2013 - 1:22 pm
Please send the two outputs and your license number to
 TA posted on Monday, March 03, 2014 - 8:53 am

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 (, 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.

 Bengt O. Muthen posted on Monday, March 03, 2014 - 12:00 pm
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?
 Linda K. Muthen posted on Tuesday, March 04, 2014 - 1:49 pm
No, it will not.
 TA posted on Friday, March 07, 2014 - 10:10 am

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.

 Linda K. Muthen posted on Friday, March 07, 2014 - 1:28 pm
No, the LOOP option was added in Version 7.
 TA posted on Sunday, March 16, 2014 - 8:30 pm

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.

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?

LOOP(mod, -2,2,0.1);


Is this how the the syntax should be written?

 TA posted on Sunday, March 16, 2014 - 8:44 pm
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?

LOOP(mod, -2,2,0.1);


My apologies for another post. This syntax ran and I wanted to make sure my syntax was correct for interpretation purposes.
 Bengt O. Muthen posted on Tuesday, March 18, 2014 - 1:48 pm
Please see the new FAQ

Latent variable interaction LOOP plot

 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 non-normal data?

Thank you very much for your help!
 Linda K. Muthen posted on Monday, March 31, 2014 - 5:55 am
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.
 Linda K. Muthen posted on Saturday, April 19, 2014 - 10:37 am
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!
 Linda K. Muthen posted on Monday, June 02, 2014 - 10:36 am
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.
 Bengt O. Muthen posted on Monday, June 02, 2014 - 5:41 pm
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.
 Bengt O. Muthen posted on Tuesday, June 03, 2014 - 9:24 am

At some point we plan to have this automated.
 Kimberley Breevaart posted on Tuesday, July 15, 2014 - 1:37 am
Dear dr. Muthén,

I ran a structural equation model using TYPE = COMPLEX RANDOM with a three-way 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
 Linda K. Muthen posted on Tuesday, July 15, 2014 - 7:02 am
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 right-hand side of an ON statement.
 Sara Guediri posted on Wednesday, July 16, 2014 - 11:28 pm
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;

f2 by MB1* MB2 MB3;

f3 by PER1* PER2 PER4 PER5 PER6 PER7 PER8;

inter1 | f1 XWITH salien;
inter2 | f3 XWITH salien;

f3 on f1 f2 salien inter1 inter2;
 Linda K. Muthen posted on Thursday, July 17, 2014 - 8:14 am
 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 5-points-Likert-type 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 = x1-x8) 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!
 Bengt O. Muthen posted on Monday, September 01, 2014 - 3:26 pm
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 maximum-likelhood 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 maximum-likelihood estimates). Mplus uses a somewhat different algorithm than in Klein's LMS, but it is still maximum-likelihood 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
 Linda K. Muthen posted on Tuesday, September 02, 2014 - 9:50 am
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:

F1 BY X1-X4*;
F1@1; [F1@0];
F2 BY X5-X10*;
F2@1; [F2@0];
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 = X1-X8;")
 Bengt O. Muthen posted on Tuesday, September 02, 2014 - 3:06 pm
1. Yes

2. With categorical and logit - which is the default with ML - the residual variance is


(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!
 Samuli Helle posted on Monday, November 10, 2014 - 11:25 pm
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?
 Linda K. Muthen posted on Tuesday, November 11, 2014 - 12:37 pm
You should standardize with respect to the latent variable predictors and then exponentiate.
 Jen posted on Friday, March 06, 2015 - 1:34 pm

Hope you are well.

I am having problems with a structural model involving latent interactions.

The general model involves partial mediation--

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:

I then regress B and C on this interaction:

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 non-problematic to me, but I am definitely not an expert in latent interactions.

Thank you much!
 Bengt O. Muthen posted on Saturday, March 07, 2015 - 12:16 pm
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 along with your license number.
 Chong Man Chow posted on Friday, May 08, 2015 - 6:27 pm
Dear Dr. Muthens,

In your discussion on computing R-square 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 R-square? If we assume that the (multiple) interaction terms are not correlated, could we compute each of the interaction term’s R-square first, and sum them up later to cover the incremental R-square explained by these interaction terms?

 Bengt O. Muthen posted on Sunday, May 10, 2015 - 3:24 pm

The FAQ approach to variance and R-square 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.


With zero covariances among the eta's the last term on the right-hand side in (15) is zero but you still have the first term. Just go through the algebra.
 Chong Man Chow posted on Sunday, May 10, 2015 - 4:35 pm
Thank you so much, Dr. Muthen. I will give it a try.

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

I was trying to model the interaction of two latent variables at level-2b in cross-classified data. Is it available in Mplus?

If I understand correctly, Bayes estimation is needed for cross-classified data. Is latent variable interaction available in Bayes?

 Linda K. Muthen posted on Friday, June 05, 2015 - 8:08 am
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?

 Linda K. Muthen posted on Friday, June 05, 2015 - 9:09 am
Then this cannot be done at this time.
 Mehrnaz Karimi posted on Tuesday, October 13, 2015 - 7:53 am
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 non-significant interaction). I am wondering if I am doing something wrong or this plot is due to the low significance level?

 Mehrnaz Karimi posted on Tuesday, October 13, 2015 - 8:22 am
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.
 Bengt O. Muthen posted on Tuesday, October 13, 2015 - 6:31 pm
Our Mediation page

shows how to get a loop plot with CIs for a moderated effect using UG ex 3.18.
 David R Lewis posted on Tuesday, January 26, 2016 - 6:55 am
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.

 Bengt O. Muthen posted on Wednesday, January 27, 2016 - 3:15 pm
I think you want to consider the two models:

fy on f1 f2 f12;
! f12 is interaction of f1 and f2


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
 Selin Zeytinoglu posted on Tuesday, July 26, 2016 - 3:18 pm

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,
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.
 Linda K. Muthen posted on Tuesday, July 26, 2016 - 4:45 pm
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.
 Martina Narayanan posted on Thursday, September 29, 2016 - 7:45 am

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)?
 Tihomir Asparouhov posted on Thursday, September 29, 2016 - 2:36 pm
Yes interactions between latent and observed are covered and you don't need to standardize the observed ahead of time.
 Martina Narayanan posted on Tuesday, October 11, 2016 - 7:38 am
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.
 Bengt O. Muthen posted on Tuesday, October 11, 2016 - 12:07 pm
You don't need these variances, because Mplus does the standardization. But they are available by running Type=Basic.
 Martina Narayanan posted on Thursday, October 13, 2016 - 2:53 am
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.
 Bengt O. Muthen posted on Thursday, October 13, 2016 - 1:25 pm
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;
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.
 Bengt O. Muthen posted on Thursday, November 17, 2016 - 2:39 pm
You want to add


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:

Parameter 31, ADMBURD

I did montecarlo(5000) and have 4 dimensions of integration. How can I resolve this problem? Thank you.
 Linda K. Muthen posted on Saturday, November 19, 2016 - 6:40 am
Please send the output and your license number to
 Chong Man Chow posted on Sunday, December 18, 2016 - 8:36 am
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 chi-square 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 chi-square was significant (with 1 df). Is it possible that the significant test of the only one interaction term was not significant, but the chi-square change between models was significant?

 Linda K. Muthen posted on Sunday, December 18, 2016 - 12:35 pm
Please send the two outputs and your license number to
 Chong Man Chow posted on Wednesday, January 18, 2017 - 8:37 am
Dear Drs Muthen

May I know what are the factors that may lead to the problem that the r-square in a model with latent interaction terms is smaller than one without?

Some insights from you will be excellent.

 Bengt O. Muthen posted on Wednesday, January 18, 2017 - 10:17 am
When adding a latent variable interaction you are fitting a different model so that all estimates may change and not necessarily give a higher R-square. The important thing is to see if the interaction has significant effects.
 Chong Man Chow posted on Wednesday, January 18, 2017 - 5:19 pm
Thank you for you response, Dr. Muthen. If that is the case, what would be the way of calculating the incremental R-squares for the latent interaction terms? Can we hand compute ithem based on the standardized betas of the interaction terms?

 Danique van de Laar posted on Thursday, April 13, 2017 - 6:13 am
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 non-independent observations when adding a latent interaction?

I look forward hearing from you soon.

 Bengt O. Muthen posted on Thursday, April 13, 2017 - 4:08 pm
If you have enough classes (say at least 30), you can use Type=Twolevel Random.
 Danique van de Laar posted on Friday, April 14, 2017 - 8:08 am
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 non-independence.

 Vera Denton posted on Monday, June 19, 2017 - 4:40 am
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 "1-residual variance" in dependent variable to report R square?

Best regards,
 Bengt O. Muthen posted on Monday, June 19, 2017 - 5:50 pm
a) No, use Standardized in the Output command

b) No, it has to be 1 - Stand'd(res var)
 Vera Denton posted on Monday, June 19, 2017 - 10:17 pm
Thank you for Your quick response!

However, I do not get standardized output for the analysis "random". Would You find it appropriate to report non-standardized 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.
 Bengt O. Muthen posted on Tuesday, June 20, 2017 - 4:07 pm
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.
 Bengt O. Muthen posted on Wednesday, June 21, 2017 - 6:33 pm
Update to Version 8.
 Frank Egloff posted on Thursday, June 29, 2017 - 9:24 am
Dear Drs. Muthen,

I am currently running a two-level growth model in Mplus.
I would also like to test between level interactions (one manifest Variable (COS) and one latent variable (IB)).

between = cos;
Cluster = klasse;
centering = grandmean (cos)
Analysis: type = TWOLEVEL Random;
Miterations = 4000;
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;
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;

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!

 Bengt O. Muthen posted on Thursday, June 29, 2017 - 6:08 pm
1-2. 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.
 Frank Egloff posted on Friday, June 30, 2017 - 3:15 am
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 non-sign negative residual variances for sw. Do you have an idea, why these negative residual variances may occur when centering the manifest predictor (cos)?

between = cos;
Cluster = klasse;
centering = grandmean (cos)
Analysis: type = TWOLEVEL Random;
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
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;

Thank you so much again!
 Frank Egloff posted on Friday, June 30, 2017 - 7:01 am
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 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!

 Bengt O. Muthen posted on Friday, June 30, 2017 - 5:03 pm
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.
 Frank Egloff posted on Monday, July 03, 2017 - 9:29 am
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,

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

we are running a two-level moderation analysis. We are interested in the effects on within-level 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;

x by x1 x2 x3;
y by y1 y2 y3;
zw by z1 z2 z3;

XxY|x xwith y;

z on x y XxY;

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 two-level analysis as well?

Appreciate your help!
 Bengt O. Muthen posted on Thursday, July 06, 2017 - 6:56 pm
Q1: Yes.

Q2: Yes.
 Vera Denton posted on Friday, July 07, 2017 - 1:45 am
I apologize for asking again - I just want to make sure that we do it right.

If we are only interested in the within-level effects - would it be incorrect to group-mean center individual indicators of the independent latent variables?

Thank you for your support!
 Bengt O. Muthen posted on Friday, July 07, 2017 - 4:25 pm
No need to group-mean center - the zb factor takes care of pulling out the between-level parts of those indicators.
Back to top
Add Your Message Here
Username: Posting Information:
This is a private posting area. Only registered users and moderators may post messages here.
Options: Enable HTML code in message
Automatically activate URLs in message