Message/Author 

Anonymous posted on Wednesday, October 27, 2004  10:46 am



I have a latent continous construct with indicators i treat as categorical (f1 by ...). I would like to examine "interactions" of variables like "education" with a variable "region" (binary: 0 and 1. Is it important if "region" is 01 or 12 for checking the effect?) In the syntax, i have: ... Usevariables:...xed (the regressor); ... Define: xed=x1(region)*x3(education); ... Model: f1 by y1y4; f1 on x1 x3 xed; I´m wondering whether this is everything to check the interaction? Another question is: if i check the main effect of x1 on f1 without the other variable, by modeling: f1 on x1; I get an expected "positive" effect. If i do the model in the interaction, the main effect f1 on x1; suddenly becomes negative. Can you imagine why this can be the case? Last question: How can i manage it if i have a second latent construct with categorical indicators (f2 by...), and want to check the interaction between f2 and x1 in predicting f1? Is there something special to do in handling f2 in the syntax? Thank you very much. 


I think it is most common and easier to interpret when both variables are coded 0/1. The issues here are the same as coding issues in regular regression. If you have a significant interaction, the main effect needs to be interpreted with the interaction. The main effect alone should not be interpreted when there is a significant interaction. You would use the XWITH command for an interaction between an observed and latent variable. 

Anonymous posted on Friday, October 29, 2004  3:40 am



May be you can tell me something about the usage of this XWITH command? So i do not use the Define Command as i do for other interactions, and say: Define: xint=x1*f2;? How do i prepare (transform) my latent variable (f2 by y1 y2 y3;) for an interaction with x1? So that it is possible to see if their is an interaction effect on the other latent variable?Like: f1 on x1 f2 xint; If i code x1 (01) the effects are the same as for code (12). Is this possible and just for the easier interpretation to use code 01, or is there something wrong? Thank you 


Regarding XWITH, I suggest reading what is in the Mplus User's Guide. There is a table that shows various types of interactions. DEFINE is not used for interactions unless both variables are observed. Regarding coding, I suggest going to a regression text to read about the various types of coding available. Coding issues are the same as in regular regression. 

Anonymous posted on Monday, November 01, 2004  8:37 pm



I was playing around with my new MPlus Version 3.1 software and successfully ran a structural model with an interaction term (two continuous latent variables). However, I noted that the output did not include general fit statistics such as RMSEA, SRMR CFI, etc.  only the comparative fit statistics (BIC, etc.). Am I doing something wrong here? I had my Output command set at STANDARDIZED and SAMPSTAT, as I had in my previous model without the interaction. Thanks. 

bmuthen posted on Monday, November 01, 2004  8:55 pm



The lack of overall model fit statistics with latent variable interactions in Mplus is due to the fact that they haven't been invented yet. For example, it is not clear what the "unrestricted model" should be in this case. In regular SEM models you have an unrestricted covariance matrix as H1. But this is only because regular models concern covariance matrix fitting which this is not the case with interactions since they give rise to nonnormal outcomes where sample covariance matrices are not sufficient statistics. There is however work at the research frontier on developing fit statistics, but it is not here yet. In the meanwhile we have to do what statisticians mostly do, namely compare adjacent nested models using loglikelihood difference chisquare tests. 

Anonymous posted on Tuesday, November 02, 2004  10:42 am



I did what Linda K. Muthen wrote at Oct. 28. 9:03: I used the XWITH command to check the interaction between x1(region) and the latent construct in ma onegroup model. In the analysis command only Type is Random seems to be possible? So Standardized and Residual are not available. Is there any way to get these values? In the Tests of Model Fit there is a Loglikelihood H0 Value and some Information Criteria. ..How do i interpret these values and see whether the model is "fit" or not? 

bmuthen posted on Tuesday, November 02, 2004  12:05 pm



See my answer above (Monday, Mov 01, 2004  8:55pm)  these matters are not yet resolved. Also read the KleinMoosbrugger(2000) Psychometrika article and the Marsh et al (2004) Psych Methods article. 

Anonymous posted on Tuesday, November 02, 2004  2:14 pm



Thank you for the articles. I noticed your answer from Nov.0120004 8:55 but ask myself how to "compare adjacent nested models using loglikelihood difference chisquare test". 


2 times the loglikelihood difference is distributed as chisquare. 

Anonymous posted on Friday, November 05, 2004  2:05 am



I have a question to the example from Oct.2710:46am. if i want to check the interaction between education and region and want to use for example 'age' as controlvariable, should i define the effect also in interaction with region or only model its 'main effect' on f1? So: DEFINE: xed=x1*x3; MODEL: f1 by y1y4; f1 on x1 x3 x4(age) xed; or: DEFINE: xage=x1*x4; xed=x1*x3; MODEL: f1 by y1y4; f1 on x1 x3 x4 xed xage; to control 'age' in examining the interaction: education and region THANK YOU 

LMuthen posted on Friday, November 05, 2004  7:47 am



I would run the model with the age interaction and include it if it is significant. There is really no rule that I know of. In ANOVA, all interactions are automatically examined. 

Anonymous posted on Sunday, November 07, 2004  10:00 am



I tried to compute the the effect on f1(y1y4) of the interaction from the latent construct f2(y5y7) with x1. Without control variables it was ok. like in my message from Nov.2. The computation takes much longer than other models. If i want to use controlvariables my Model is: MODEL: f1 by y1 y2 y3 y5; f2 by y9 y10 y11; f2 on x1 x4 x15; f1 on x1 x4 x15 f2; x1xf2  x1 XWITH f2; f1 on x1xf2; First it is shown that INPUT IS TERMINATED NORMALLY. But after the categories of the variables y1y7 an ERROR appears: THE MODEL ESTIMATION DID NOT TERMINATE NORMALLY DUE TO A NONZERO DERIVATIVE OF THE OBSERVEDDATA LOGLIKELIHOOD. CONVERGENCE CRITERION FOR THE LATENT VARIABLE MIXTURE MODEL IS NOT FULFILLED. CHECK YOUR STARTING VALUES OR INCREASE THE NUMBER OF MITERATIONS. ESTIMATES CANNOT BE TRUSTED. THE LOGLIKELIHOOD DERIVATIVE FOR PARAMETER 1 IS 0.86936334D01. 1. Can you imagine what is wrong here? 2. Is it possible to examine the model in another way and not in a mixture model? Thank you. 

Anonymous posted on Monday, November 08, 2004  4:24 am



If i examine an interaction with an involved latent variable and i treat the indicators of the latent variable as categorical, in the XWITH command with Type is Random the Estimator is MLR. Does MPlus nevertheless computes the model with the indicators treated as categorical? I tried to change the Estimator in WLSMV, but it does not work. Thank you 

Anonymous posted on Monday, November 08, 2004  9:42 am



I've a question to the example of Nov.05=> 2:05am: How should i treat a mediator f2 with y5y7 (treated as categorical) in predicting f1: Should the interactions xed and xage also run on this construct or only the variables x3 and x4? So, MODEL: f1 by y1y4; f2 by y5y7; f2 on x1 x3 x4 xage xed; x1xf2  x1 XWITH f2; f1 on x1 x3 x4 xage xed f2 x1xf2; Or without xage and xed on f2? 

bmuthen posted on Sunday, November 14, 2004  11:38 am



Answer to Nov 08  04:24am. Yes, the indicators will be treated as categorical here. Type = random is only available with ML estimators, not WLS estimators. 

bmuthen posted on Sunday, November 14, 2004  11:41 am



Answer to Nov 08  09:42. This is a substantive choice in the modeling that you have to decide, not a choice ruled by statistics. Try it both ways. 

Anonymous posted on Monday, November 15, 2004  5:07 am



Thank you very much for your help. Do you have any suggestions to solve the problem described on Nov 07  10:00? 

bmuthen posted on Monday, November 15, 2004  7:08 am



The problem described in the question of Nov 0710:00 indicates that the estimate of parameter number 1 is hard to determine in the sense that a solution has not been found within the default number of iterations (derivatives are zero at the solution). You should check which parameter this is by looking at Tech1. You should also see what the parameter's value is when the iterations stopped  this might indicate that the parameter is moving towards an extreme value. The outcome you describe is often an indication that the model should be respecified with respect to this parameter. 

Anonymous posted on Tuesday, November 16, 2004  9:12 am



The parameter was the factor loading from y2. I tried to fix it to one and free the loading of y1: ANALYSIS: TYPE IS RANDOM; MODEL: f1 by y1* y2@1 y3 y5; f2 by y9 y10 y11; f2 on x1 x4 x15; f1 on x1 x4 x15 f2; x1xf2  x1 XWITH f2; f1 on x1xf2; OUTPUT: TECH1 The errors that appeared were: THE LOGLIKELIHOOD DECREASED IN THE LAST EM ITERATION. CHANGE YOUR MODEL,STARTING VALUES AND/OR THE NUMBER OF INTEGRATION POINTS. THE MODEL ESTIMATION DID NOT TERMINATE NORMALLY DUE TO AN ERROR IN THE COMPUTATION. CHANGE YOUR MODEL AND/OR STARTING VALUES. What i tried after that was to give starting values to the indicators. I used the loading from the constructvalidation. But it appears the problem described Nov.0710:00,with different parameters, dependent on which loading is fixed. What i do not really understand is why it computes an interactioneffect x1 XWITH f2, if there are no other variables (like x4 or x15...)... I am really thankful for any advise. 


It sounds like you should send your input, output, and data to support@statmodel.com. 

Anonymous posted on Wednesday, November 17, 2004  10:38 am



Thank you for the supply to send my input etc. But with my last try i take new hope (maybe at some time i gonna come back to your offer). My last try was to include the interactions of x4 (xed=x1*x4) and x15(xage=x1*x15) into the model even though i expected problems cause without this interactions the errors from Nov7 appeared. So my syntax was: (...) DEFINE: xsbr=x1*x4; xal=x1*x14; ANALYSIS: TYPE IS RANDOM; MODEL: f1 by y1 y2 y3 y5; f2 by y9 y10 y11; x1xf2  x1 XWITH f2; f1 on x1 x4 x15 f2 xed xage x1xf2; f2 on x1 x4 x14 xed xal; OUTPUT: TECH1 TECH8 With this syntax an output appeared. But because i do a onegroup analysis with interactions with x1, it would be better for an interpretation to get the standardized coefficients. With the inclusion of x1xf2 however only Type is Random (and no standadized Output) is possible. How can i use the unstandardized effects for an interpretation? Thank you once again for your help and in total for your the discussion area with many helpful informations. 

bmuthen posted on Wednesday, November 17, 2004  3:21 pm



I think the unstandardized coefficients are easily interpretable in line with regular linear regression: "for a oneunit change in x, the coefficient tells us how much y changes". This is an interpretation that is convenient when expressing the interaction results in terms of "moderator effects"  see our Day 5 handout and the example of interactions in math growth analysis. You can also yourself standardize the coefficients. It is for example convenient to standardize with respect to the exogenous variables which as in regular regression means that we multiply a coefficient by the standard deviation of the exogenous variable in question. In this case, a unit change in the exogenous variable is a 1 SD change in the exogenous variable which is perhaps more readily interpretable. 

Anonymous posted on Monday, November 22, 2004  6:20 pm



I tried to estimate an interaction model: f1 by y*1@1; (y*1 is a single categorical variable and I am fixing its value for identification) f1@0; f1 on x1 x2 x3 x4; int  f1 xwith w1; y2 on f1 w1 int w2 w3 w4; I used TYPE = RANDOM since the program seems to require that statment. y*1 is set to categorical in the DATA section. I tried to define int = f1*w1 in the DEFINE section, but since f1 is calculated it would not work. The error message I received was: "An interaction variable defined using XWITH must be used at least once on the righthand side of an ON statement that is not part of a  statement. No valid reference of: INT." I thought I had done this on my last line. Am I doing something wrong in setting up this model? 


The interaction variable for the interaction between f1 and w1 is int. You have not include in as a covariate. You should have something like: y2 on f1 w1 int w2 w3 w4 int; I don't think the error message came from DEFINE but from not using int. 

Anonymous posted on Tuesday, November 23, 2004  3:53 am



Suggestion to the problem of Nov22 6:20pm: I don't really no whether this is a good suggestion, but what you can also try is: f1xw1  f1 XWITH w1; y2 on f1 w1 f1xw1 w2 w3 w4; May be Linda or Bengt Muthen can tell you whether this might work. Or when it is wrong, why? 


I think it is the same thing as I posted. You named the interaction f1xw1 and he had named it int. 

Anonymous posted on Tuesday, November 23, 2004  4:13 pm



Thank you for the suggestions. I don't see how putting int in the second equation twice (y2 on f1 w1 int w2 w3 w4 int). Even if I get rid of the first stage equation (f1 on x1 x2 x3 x4) and just run the model with the single variable latent variable interacted with the observed continuous variable, I still receive the same error message. I must be setting up the problem incorrectly, but I just don't see where. 


It sounds like you need to send your output to support@statmodel.com so I can see exactly what you are doing. 


You have int on your USEV list. This list is for observed variables in the analysis. When you form an interaction between a latent and observed variable, it is not an observed variable. DEFINE can only be used to create interactions between observed variables. 

Anonymous posted on Friday, November 26, 2004  8:00 am



What do you think about trying to have interaction variables in the Data? So what i did was: I have the variables like example Nov7. f1(y1y4) and f2(y5y7), the variable x1(region) and i build interaction variables(x1 with the variables of f2) which are aleady in the data: y8=x1*y5, y9=x1*y6 and y10=x1*y7. With the other interactions from Nov17(xed=x1*x4 and xage=x1*x14) i have the model: MODEL: f1 by y1y4; f2 by y5y7; f3 by y8y10; f2 on x1 x4 x14 xed xage; f1 on x1 x4 x14 xed xage f2 f3; OUTPUT: TECH1 TECH8 The computed values are not that much different and significant are the same effects as when i did: x1xf2  x1 XWITH f2; (instead of having f3 now). The difference is mainly: 1. that it was possible to take other variables into the model with the f3 way and 2. in the elapsed time for the computation: with x1xf2=> nearly 7min; with f3=> nearly 2hours Is this nevertheless an alternative in computing interactions between an observed and a latent variable? 


This is an ad hoc approach. The problem with it is that there will be estimation errors as in any stepwise procedure, but you will not know how well it works in any given case without comparing it to the one step approach. 

Anonymous posted on Friday, November 26, 2004  10:12 am



Thank you for your response. My conclusion is that it does not make sense to compute a model with such an approach that does not work with the one step approach (which seems the XWITH one). And if you have to compute every time also with the one step approach ,the ad hoc one seems to be senseless. 

Anonymous posted on Thursday, December 02, 2004  3:42 am



If i look to my output, i have a negative effect of x2(coded 16) on f1, a positive effect of x1(coded 01) on f1 and a negative interaction effect x1*x2 on f1. 1. Can i say that the negative effect of x2 on f1 is the effect if x1=0? 2. Is the interaction effect to interpret that way, that the negative effect of x2 on f1 becomes stronger if x1 changes to 1? Namely +(interaction effect*x1 effect)? 

bmuthen posted on Thursday, December 02, 2004  8:17 am



A useful way to interpret interaction is by a "moderator" approach. In your case you would write your equation f1 = b1*x1 + b2*x2 + b3*x1*x2 as f1 = b1*x1 + (b2 + b3*x1)*x2 where you have b2 < 0 and b3 < 0. This is written to indicate that x1 moderates the influence of x2 on f1. This shows that if x1=0, b2 is the effect of x2 on f1 as you say. So yes on your question 1 and yes also on your question 2. 

Anonymous posted on Friday, December 10, 2004  1:37 am



At Oct.28, Linda K. Muthen wrote that a main effect should not be interpreted if there is no significant interaction... What can be done if we say, the "main" effect seems to be an effect at a special point, let`s say (if we take the example from Dec.02) the effect if x1=0. Is it not possible to say, if this effect is significant but there is no significant interaction (x1 changes to 1), that the effect is independent from x1 and can be interpreted regarding this independence? 


I wrote that the main effect should not be interpreted is there is a significant interaction. See below: "If you have a significant interaction, the main effect needs to be interpreted with the interaction. The main effect alone should not be interpreted when there is a significant interaction." If there is no significant interaction, then the main effect can be interpreted alone. 

Anonymous posted on Friday, December 10, 2004  8:11 am



Oh sorry, it seems that i have to improve my abilities in reading... In such a case that the interaction is not significant. Do you see a problem in exclude it in a next model? 


Some people would take it out to make the model more parsimonious. Others would not. I probably would not. 

Anonymous posted on Sunday, March 20, 2005  9:15 pm



Dear Prof. Muthen I have been using Mplus 3.1 for fitting some SEM models with latent interaction. As you posted in Mplus discussion list before, there is no goodnessoffit measure for evaulating the interaction model itself, due to the lack of "unrestricted model". This is the approach without creating indicators for the latent interaction term. However, in the literature, there are other tedious approaches for fitting latent interaction models which require creating indicators for the latent interaction term and many parameter constraints (including Kenny and Judd appraoch, and the recent by Marsh et al. (2004 in Psychological methods, vol 9(3), 275300). If we use these alternative approaches to fit interaction models, we can now obtain chisquare, RMSEA, CFI, etc. goodnessoffit measure. Are these GOF measures valid? Did I miss some important link here? I am confused which approaches we should take... I appreciate if you can help me to resolve this issue. Thanks a lot. 

bmuthen posted on Monday, March 21, 2005  7:51 am



Good question. I am not sure we fully know the value of those fit indices when using these less efficient methods for lv interaction modeling. And, I think we could develop fit indices for the lv interaction modeling by ML that is used in Mplus. But until then, I think the best way to proceed is to do what is usually done in statistics  work with a series of nested models, looking at their log likelihood differences (2* logL diff is chisquare distributed). For instance, you can look at the regular fit indices for the model without interactions. Then you can look at the logL difference with the model where you add the interaction. 

Anonymous posted on Monday, March 21, 2005  2:22 pm



Hi Prof. Muthen Thank you for your comments. I have one followup question. I can see we can perform the loglikelihood difference test between interaction model and withoutinteraction model using the approach in Mplus (no indicator created). For the other tedious approaches, we need to create product indicators for the latent interaction term, so the dimension of varcov matrix increases (comparing to the model without interaction where we don't include the product indicators). In this case, can I compare the models by likelihoodhood ratio test, AIC or BIC (the varcov matrices are different between the interaction vs. "main effects" models are they nested models )? Thanks again for your help. 

bmuthen posted on Monday, March 21, 2005  5:41 pm



The likelihood ratio test or AIC/BIC are not applicable for the "tedious approaches" since they do not give ML solutions. 

Anonymous posted on Wednesday, June 08, 2005  12:17 pm



Hello. I am following your advice and am comparing two nested models using the log likelihood difference test. One question...I need the degrees of freedom for both models to calculate whether the chisquare is significant. However, I do not see the df's printed anywhere in the output. Can I just use the difference in the number of free parameters given in the output? Thanks. 


Yes, this would be the same thing. 

Anonymous posted on Thursday, July 07, 2005  9:07 pm



Dr. Muthen: The path diagram for an SEM with an interaction between two continuous latent variables (example 5.13 in the user's guide) is different from examples of continuous latent variable interactions presented in other texts. Typically, the interaction is presented as an additional latent variable, whereas in your example it is represented only by an additional pathway stemming from the two main effects. This implies that a residual variance is not estimated for the interaction term. Similarly, the covariance of the interaction term with its constituent main effects is not estimated. If I am estimating an SEM that includes an interaction between a latent exogenous variable and a latent endogenous variable, how should I label the interaction in the path diagram? I am using LISREL notation. It seems to me that I cannot label the interaction as "beta" or "gamma" since the interaction involves both endogenous and exogenous variables. I have thought of using something like iota_a,b.c, where "a" is a subscript denoting the enogenous variable influenced by the interaction and "b" and "c" are subsripts denoting the interacting variables. Does this sound reasonable, or do you have any other suggestions? 


Because it involves an endogenous variable, I would think of it as endogenous, therefore beta, although what you call it doesn't really matter as long as you make it clear what your notation means. 

Anonymous posted on Wednesday, July 20, 2005  2:16 pm



Dr. Muthen: Thanks for your previous response (July 08, 2005  8:36 am). That was very helpful. One further question regarding Klein and Moosbrugger's LMS approach for handling interactions involving latent variables. As I mentioned in my previous post, the interaction example in the Mplus User's Guide suggests that a residual variance is not estimated for the interaction term and that the covariance of the interaction term with each of its constituent main effects is similarly not estimated. This is consistent with discussions I have read on the LMS method. Is there a particular reason why the residual variance and covariances are not estimated? I may be wrong, but I thought that the Joreskog and Yang approach for interactions involved the estimation of these parameters. I am not interested in the residual variance or covariances; however, I want to make sure that I am performing the estimation correctly. Klein and Moosbrugger used the KennyJudd model as an application, which involved an interaction between two latent exogenous variables. In my case, however, the interaction is between a latent exogenous variable and a latent endogenous variable. I do not believe that this should make any differemce, though I am uncertain. 

bmuthen posted on Wednesday, July 20, 2005  2:46 pm



That's right, with ML the latent variable interaction term does not introduce a mean, variance or covariance with other variables  only a regression slope. This is because the interaction is not a new, distinct variable, but merely the product of two existing latent variables. With other nonML approaches, such as the JoreskogYang approach, the interaction is instead seen as a new variable, but that is due to the JY approach drawing on information from observed product variables; in contrast, the ML approach does not change the original set of observed variables. 


Dear Mplus architects: Does Mplus include some sort of graphing capability that would allow one to visually depict a latent variable interaction? I suppose one could use factor scores and depict the interaction in typical ways, but this doesn't seem like that great a method given that it won't really show the same relations as will latent variables. Plus it's a problem when using FIML estimation with missing values b/c many subjects would not have observed data to form factor scores from. Thanks for your input. 

bmuthen posted on Saturday, October 08, 2005  1:57 pm



No, Mplus doesn't have a graphing capability for interactions. I agree that using factor scores would not be the best way to go. I would use the estimates from the interaction model to compute the effects of the key independent variable on the dependent variable when the moderator (the variable that the independent variable is interacting with) is at its mean and below and above the mean (say 1 SD)  this can also be graphed, outside Mplus. 

Anonymous posted on Thursday, December 01, 2005  9:25 am



Dear Mplus folks: What would you make of the following situation? A model with two latent predictors and their interaction (entered simultaneously) has an interaction term that is tiny and way short of conventional significance. However, when the above model with the interaction term is compared to a model where the path from the interaction to the DV is constrained to zero, the comparison of the two models (via the 2* logL diff method; 1df) yields an easily significant difference. Reflecting the small interaction term, the plot using f1 = b1*x1 + (b2 + b3*x1)*x2 modeled at high, med, and low values of x1 and x2 does not suggest interaction. It doesn't appear to me that there's an interaction, but the model is happier with the interaction term in. I'm not sure what this means. Thank you. 


Please send the two outputs along with your license number to support@statmodel.com so we can see exactly what you are seeing. 


When i'm trying to define an interaction term between a latent and an observed variable: inter  div XWITH n_stat; and use it as a predictor: att_b ON sociab_b n_stat div inter; i get the following error message: *** ERROR in Model command Unknown variable(s) in an ON statement: INTER I would be grateful for your suggestions as to what i'm doing wrong? Thank you. 


I would need to see your full output to answer this. Please send your input,data, output, and license number to support@statmodel.com. 

matt diemer posted on Thursday, December 22, 2005  8:48 am



I was interested in modeling interactions between four latent variables, using complex sample data and about 15 total indicators. [I'm still learning exactly how to do this.] About how long should I expect MPlus to finish running the analyses? I've had a few tries of 23 hours without terminating and have had to stop the program myself. How long should I expect this to take? 

bmuthen posted on Thursday, December 22, 2005  8:55 am



If you have 4 latent variables interacting, you can end up with 6 pairwise interaction variables (I assume you don't mean a 4way interaction). This is a very demanding tasks computationally. I would start with doing only one pair at a time and see if the interaction has significant effects. You should request Tech8 which gives you screen output showing how many dimensions of integration you have. With 3 or more dimensions, I would use integration = montecarlo. The Tech8 screen output will tell you how slowly the computations are proceeding. 

David Bard posted on Sunday, October 01, 2006  8:12 pm



I'm running a monte carlo study for a GE interaction twin model with ACE VC's and manifest environmental (X) variables (uncorrelated with one another and all VCs). I've tried numerous approaches, 2 shown below. I get 1 of 2 error messages. Most often: Cov matrix not pos def...; but occassionally: reciprocal interaction. All models are nonlinear regression equations, but the corr A and C terms wreak havoc. I could simulate the cov matrix of the phenotype alone, but the estimates for the full regression model are easier to guess at than this cov matrix (how compute corr between main effect A and GE int term?). Can you help? 

David Bard posted on Sunday, October 01, 2006  8:14 pm



Syntax for above: 1 approach might be: MODEL POPULATION: A1 by y1*.32 (a);A2 by y2*.32 (a);C1 by y1*.63 (c);C2 by y2*.63 (c);E1 by y1*.71 (e);E2 by y2*.71 (e); A1E2@1; [A1E2@0];A1 with A2@1;C1 with C2@1;A1 with C1E2@0;A2 with C1E2@0;C1 with E1E2@0;C2 with E1E2@0;E1 with E2@0; X1X2*1 (vx);[X1X2*0] (mx);X1 with A1E2@0;X2 with A1E2@0;X1 with X2*0 (cx1); A1X  A1 xwith X1; A2X  A2 xwith X2; Y1 on X1*.5 (r1) !Main effect of X1; A1X*.05 (ax); !Interaction effect Y2 on X2*.5 (r1) A2X*.05 (ax); Y1Y2@0.0001;[Y1Y2*0] (my); Model Populationg2: A1 with A2@.5; 2nd approach (no xwith) changing the regression: Y1 on X1@0;s1  Y1 on X1;s1 on A1*.05; s1@0;[s1*.5];Y2 on X2@0;s2  Y2 on X2; s2 on A2*.05; s1@0;[s1*.5]; 


The message about a non pos def cov matrix will occur due to the A and C factors being correlated 1, but that is harmless and should not hinder the analysis as long as the cov matrix for the observed variables is pos def as it should be. If you still have problems, please send input, output, and license number to support@statmodel.com. 


Dear professor Muthèn, I'm starting to use Mplus and I ran a model with interactions of latent variables. To interpret the effects of the interactions I watched your handouts about this topic, in "Advanced growth models" explanation, and I found a distinction between unstardardized and standardized solution, presenting very similar (or the same, approximated?) loading coefficients in the example formulas. My question is very basic: for the standardized solution should I standardize the observed indicators of the latent variables? Or should I consider the latent variables as standardized in computing the formula? Thank you very much 


I standardized the latent variable (the intercept growth factor) and the covariate (math courses) in order to more easily discuss the results. 


Dear prof. Muthèn, thank you very much for your answer. Now I have a followup basic question: how can I standardize one latent variable? Thank you again 


Say that you have y on f, where f is the latent variable (factor). To standardize the slope with respect to f, you simply multiply the slope by the estimated standard deviation (sqrt of var) for f. Then the new slope says how many units y changes for 1 SD change in f. 

kirby posted on Monday, May 12, 2008  11:34 pm



Dear all, I would like to test an interaction effect int  F1 xwith F2 where F1 is a latent variable with continous indicators and F2 is a TWOdimensional latent variable (with formative dimensions, each dimensions with 3 reflective continous indicators). Does it make sense to test an interaction effect with a twodimensional latent variable? I read in a German publication that unidimensionality is necessary when estimating an interaction effect with the Latent Moderated Structural Equation method (which as far as I know is default in MPlus). Many thanks for your answer! 


I think you are saying that F2 is really 2 factors that share some items in common. If F2 is really 2 factors, each factor should be used to create a separate interaction effect. I can't think of a problem of using 2 factors that share some items. 

kirby posted on Thursday, May 15, 2008  8:19 am



Dear Bengt, what I tried to say was that F2 is a second order construct with two formative dimensions, i.e. F1 by a1 a2 a3; dim1 by d1 d2 d3; dim2 by d4 d5 d6; F2 by d1@0; F2 on dim1@1 dim2; F2@0; int  F1 xwith F2; Do you see any problem with such an interaction effect? Thanks for your help! 


This looks reasonable. 

kirby posted on Friday, May 16, 2008  6:30 am



Thanks! 


I am working on a SEM model with latent interaction. I would like to get an effect size for the effect of the interaction term. Can you suggest a formula I can use to compute it? Another question. I would like to partial out the effect of an exogenous latent variable from the first order (latent) factors before the interaction term is computed. Can I do this with Mplus? My understanding is that the interaction term is computed as a first step, but I might be wrong... thanks for your time and help 


To me an effect size is the difference between two means divided by a standard deviation. I can't see how this applies here. Do you mean a standardized coefficient? All parameters are estimated simultaneously in Mplus. There is no first step. 

Joyce posted on Thursday, February 19, 2009  11:19 pm



Hi, I have latent variables X1X4 and Y1Y3 and the following is the Model that I fit, Y1 ON X1 X2 X3; Y2 ON X1 X2 X3; X4Y1 X4 XWITH Y1; X4Y2 X4 XWITH Y2; Y3 ON Y1 Y2 X4 X4Y1 X4Y2; X1 WITH X2 X3; X2 WITH X3; X4 WITH X1@0 X2@0 X3@0; Y1 WITH Y2; As I know, Mplus doesn't give standardized coefficients for latent interaction model and we need to calculate them by using the SDs of the latent variables. Therefore, I would like to ask 1. Does Mplus provide the variance of the dependent latent variable in latent interaction model because currently "TYPE = RANDOM" and the TECH4 Output is not available? 2. How to calculate the standardized path coefficients from the interaction term to the outcome variable (e.g. X4Y1 > Y3)? Thanks 


It is not clear how the interaction would be standardized. I have not seen this presented. 

Timothy posted on Thursday, April 30, 2009  10:50 am



Hi, I have a question about interaction. I found a significant interaction. Then, the next step is to understand the nature of the significant interaction term. How can I examine the simple main effects in Mplus? Thanks! 


See the Topic 3 course handout starting at slide 161. 


Dear Drs. Muthens, It is not clear how the interaction would be standardized. I have not seen this presented. Based on your answer above, I believe that the standardized path coeficient of interaction term cannot be computed yet. Is that correct? Thank you so much in advance. 


I am not aware how to do this but I don't think it is impossible. See Appendix B of TuckerDrob, E.M. (2009). Differentiation of cognitive abilities across the lifespan. Accepted for publication in Developmental Psychology which is on our website. 


Dear Drs. Muthén, I am doing a conditional LGM with multiple indicators. I have three 0/1coded independet variables. Im interesetd in the threewayinteraction of these dummies. And actually I get a sign. interaction term. But I'm not sure of the robustness of the results, because the "1/1/1situation" has just a vew cases (n=13). Do you have any suggestions how to deal with this problem? Does it make sense at all to do the analysis with the interaction term? Furher I would guess, that a subsequent multiple group analysis (boys vs. girls) will be even more problematic. Thank! 


It may be okay given that you are estimating only one parameter. Only a Monte Carlo study could say for sure. 


Thanks for your answer. Do you have any suggestions or do you know about a paper which deals with the problem of small n in connection with dummyinteractions. Is there a rule of thumb? For example: An interaction of two 0/1dummies, how many cases should be the 1/1situation. 


I don't know of any such paper or rule of thumb. 


Dear Linda and Bengt, I conducted a latent interaction analysis with continuous factor indicators and compared the 2LL value in the model without the latent interaction term with the 2LL value for the model with the interaction according to recommendations. Got back the paper with one reviewer claiming one should not compare these two models using log likelihood as they are not nested. I saw in an earlier response a few years back to a similar question that you Linda answered that you thought that these two models are nested and that you therefore can compare them. Is that still your (or Bengts) opinion? The reviewer instead suggested comparing the model with the interaction term with a model where one sets the latent interaction term =0. Would this according to you be more correct? /Magnus 


I think the two approaches are the same. You might try doing what the reviewer suggests and showing that it is the same. 


Thanks for the reply. I tested what the reviewer suggested and it turns out, as you wrote, that the 2LL value for the baseline model and the model where the latent interaction is=0 is almost identical (differs between .003 and .004). So, seems the two approaches do yield the same result. 


Thanks for letting us know. 

Anonymous posted on Friday, December 11, 2009  8:40 am



I am testing continuous latent variable interactions in MPLUS and was looking at this post for looking at why I am not getting fit indices. This clearly explains why. My model converges normally and I get the estimates that look fine. I have a couple of questions: I am trying to get the likelihood ratio test for the interactions in MPLUS. I have a quick question on how I am operationalizing it. Is it correct that I should use the Analysis: Type=random; algorithm = integration; option even for the linear model with no interaction terms? when I compare likelihoods? I see that using the analysis type = random option, the log likelihood is different than when I do not use it. I was encouraged to see that my results are not very different. Could you tell me why this happens in MPLUS ? Also, does the type=random option give robust standard error estimates? I found that in each case, the option gave slightly higher standard error than not using the option. Your insights would be helpful. 


You should use TYPE=RANDOM for both the model with and without the interaction. You don't need ALGORITHM = INTEGRATION for the model without the interaction. The difference you see with and without TYPE=RANDOM is due to the fact that for continuous outcomes and TYPE=GENERAL the model is not estimated conditioned on x whereas it is with TYPE=RANDOM. You should do all models using the same analysis TYPE. MLR is available with TYPE=RANDOM. MLR is robust to nonnormality. 


dear drs. Muthen, Simulation studies (eg. Coenders et al 2008) show, that with nonnormal data LMS overestimates the interaction effects, whereas there are nearly no effects on the significance of the interaction effects. On the other hand the approach suggested by coenders et al underestimates significance, but there is no bias of the interaction effect. Now I have this problem with my data. LMS leads to a significant interaction (gamma=.311). The coenders et al approach shows an insignificant gamma (=.241). Would you suggest to report both approaches in a paper? best wishes Christoph Weber 


One more question: When I'm calculating the confidence bands for the moderation effect, is it possible to use the gammas of the Coenders approach and the co/variances of the coeff. from the LMS approach? 


I'm not familiar with the Coenders approach. I would report both. I would not report estimates from one method and standard errors from another. 


From what I read above, if I want to look at 2 models, 1 without a moderator and one adding in the moderator, I need to use the loglikelihood difference chisquare test? If I multiply 2 times the loglikelihood difference for both models, how do I determine if one is better than the other? Thank you for any help. 


I think you are asking about including an XWITH interaction. If that interaction term influences only one DV, then the test of improvement of the model is the z test for that slope. If the interaction term influences several DVs you could use the 2 times logL diff which is then chi2 distributed. 


Dear Dr. Muthen, I am in fact including an XWITH interaction into my model and it is only influencing 1 DV. Therefore, it appears the z test is what I want to look at. However, I am unclear how to calculate this from my output and also do I want to find significance or not? Do I calculate the z test from something in my output? Thank you for any help! Sarah 


The z test is the ratio of the slope parameter estimate to its standard error which is found in the third column of the results. It is followed by a pvalue or you can compare it to a critical value of 1.96 at the 5 percent level. 


So it is just the the slope parameter / S. E. for the interaction term then? Basically, it the new term is significant then does that tell me that the my moderator is a good fit for the model? Obviously you have mentioned before that there are not fit indices for moderator models... Thank you so much for your prompt reply!! 


Significance indicates that the parameter is significantly different from zero. 


Dear professors, I am trying to run a structural model with interaction terms over five imputed data files. Setting integration to standard(7) and using starting values does not help quicken the process (the estimation screen freezes at some point) probably because I have too many integration points. When I tried Monte Carlo integration, I have some results but feel unsure whether they are of value. So my two questions are: 1. Is there yet another efficient way of specifying such an interaction model? 2. How do I estimate the statistical signifance of MC results? 


How many latent variable interactions does your model have and what is your sample size? 


I have six latent variables. Due to discriminant validity issues as well as concerns related to integration point complexity I am now using four. My sample size is 412. 


My model uses four latent variable interactions. 

soyeon ahn posted on Wednesday, April 20, 2011  8:42 am



Would it be possible to estimate interaction effect of latent variables from the covariance matrix of indicators? 


You could introduce one latent variable interaction at a time to see if it has a significant effect. Or, two at a time. I would think it is unlikely that you need all four. NonML approaches such as using products of indicators are also possible  see e.g. the overview by Marsh et al in Psych Methods a few years ago. 


Thanks for the suggestion, Bengt. Only one interaction is significant when I run the model the standard way introducing two interactions at a time. I do not know whether it would be convincing to state that I am not controlling the rest when I get that significance. What do you think? By the way sorry to iterate but we don't know the significance of MC estimates, is that right? As a general note: I know about the products of indicators technique and tried using it in Lisrel following (Jaccard and Wan 1995) and one reason I am learning MPlus is to study the latent factor interactions. And I am studying interaction effects between subconstructs of market orientation and environmental factors i.e. turbulence and competitive intensity and my theory suggests to study all moderations. 


I would be convinced doing it one latent variable interaction at a time, but I don't know about reviewers. With 4 interactions you could try integ = 7 instead of Monte Carlo integration  this would give less than 2500 integration points which isn't much with your small sample. This should not be slow on at least a 2processor computer. Be sure to say Processors = 2; With Monte Carlo integration you can generally trust the SEs  I think that's what you are asking. 


Thank you very much, these really helped.. 


I am running a simple SEM with two latent variables and their interaction, with the three latent variables predicting one observed outcome variable. I am using analysis type=random since that is what is required for latent interaction estimation, but I cannot get the model indices (e.g., CFI and rmsea) when I use type=random. Is there a way around this? I know journal reviewers will want to see model indices and I hate to have to drop the latent interaction term just to get model indices. 


Chisquare and related fit measures are not available when means, variances, and covariances are not sufficient statistics for model estimation as with TYPE=RANDOM. 


Hello Are you aware of any study that compares power of xwith with product term variables? Thanks 


I think there is a paper that does this by Herb Marsh in Psych Methods. You'll have to search for the reference. I don't have it. 

Jan Zirk posted on Wednesday, May 02, 2012  5:12 pm



Dear Linda or Bengt, I have a model with an interaction term between a binary x and continuous y (entered by DEFINE). Thus the model looks like this (they enter it in broader context of other variables): x>z y>z xy > z This model generally does not fit the data quite well. Would you enter additional covariance parameters between the regressors and the interaction (like this: x>xy y>xy; or x<>xy, y<>xy)? When I enter them the goodnessoffit gets better, though I am not sure if just the command DEFINE, without these additonal links, is not enough? 


Are x and y exogenous or endogenous variables. 

Jan Zirk posted on Thursday, May 03, 2012  11:56 am



They are exogenous in sense that they are predictors of z but at the same time they are mediators (both depend on different variables) 


Let me try to intepret what you are modeling. It sounds like your model is of the following type (although more complex): Usev = x m y; Define: xm = x*m; Model: m on x; y on m x xm; The issue is the interaction xm which is an interaction between an exogenous variable x and an endogenous variable m (you should not call m an exogenous variable even if it is a predictor of y: When it is influenced by another variable, that is x, then it is endogenous). If this is what you are asking, then the answer is that the inclusion of the interaction term does hurt chisquare but you cannot and should not rely on the chisquare test of model fit for such models and you should not try to add parameters to make it fit. The reason you cannot rely on chisquare here is that with an x*m interaction the variance for y conditional on x is no longer constant as is assumed in the chisquare testing, but varies with the x values. 

Jan Zirk posted on Saturday, May 05, 2012  9:14 am



Dear Bengt, Thank you so much for this exhaustive reply. It fully answers my question. Sorry fo lack of precision in my description of the model; next time I will just paste part of the code. Best wishes, Jan 

Jason Major posted on Thursday, August 02, 2012  11:16 am



Hello, I am running an LMS model with one linear and one quadratic effect, and I'm having a problem in calculating the Rsquared of the effects compared to the Mplus output. I've read several papers that state that Rsquared of the quadratic effect is equal to the coefficient of the quadratic effect squared multiplied by 2 times the variance of the IV, all divided by the variance of the DV. (Marsh, Wen and Hau, 2004 gave an expanded form of this formula; Harring, Weiss & Hsu, 2012 recently gave this form). However, when I compare the Rsquared from this formula to the residual variance in Mplus (which I assume can be used to check the explained variance), the two don't match up. The formula overestimates the size of the quadratic effect compared to the explained variance based on the residual variance. This seems to be the case whether I estimate the quadratic effect alone, or both the linear and quadratic effects in the same model. One issue that I thought might be causing this mismatch is that my DV is not latent but manifest. But I'm not sure whether this would effect the formula for the Rsquared of the quadratic effect. I would appreciate any help/advice you can give me. 


See the FAQ on the website called Latent Variable Interactions to see how to compute Rsquare for a regression with an interaction. 

Jason Major posted on Friday, August 03, 2012  3:41 pm



Hi Linda, I have taken a look at the FAQ and Mooijaart & Satorra (2009), which it references. The problem is that the formulas provided there are for calculating Rsquare for the interaction effect in a model with two linear effects and one interaction, whereas my model only has one linear effect and one quadratic effect. The formulas also reference a disturbance term for the dependent variable, whereas my DV is a single manifest variable. I thought that I may be able to infer the Rsquare of the quadratic effect by subtracting the variance due to the linear effect from the explained variance. If the DV is standardized by setting its variance to 1, then I think the Rsquare of the linear effect is simply the square of the standardized regression coefficient? The problem with this though is that the intercept isn't zero in the model, so I'm not sure if this simple forumla applies. I've also have tried comparing the Rsquare of the full model to one with the linear effect only, but the size of the linear effect increases slightly with the inclusion of the quadratic effect, so its size isn't consistent, which may indicate something wrong with the model assumptions? 


I think the general formulas in the FAQ can also be used for your case since they pertain to products of variables. And it would seem that your model also would include a residual for the DV  the fact that your DV is observed doesn't matter. 


Dear Professors, I have a question about interaction,let's say that I have defined a new variable that is the "interaction" where INT=RR*EZ. On my regression, should I include each element? Namely, should the syntax look like this: Y on INT RR EZ; Again, using the same elements but changing the operation INT=RR/EZ, should the syntax look like that above? Thank you? 


I think you should include the main effects and the interaction as you show above. 


Thank you very much for your answer. Just to be sure, you mean I should include them also when INT is RR/EZ. is it correct? Thank you again 


Yes. 


Hello. I would like to present the standardized estimates for an SEM with latent variable interactions. I have looked at this thread and the FAQ on latent variable interactions which includes a description of standardization, but I'm confused about whether it is possible to calculate a standardized interaction beta given some of your answers earlier in the thread. It would seem that once the variance V(n1 ×n2) for the interaction was computed according to the formula in the FAQ, that could be used to compute the standardized interaction beta as b3*SD(n1 ×n2)/SD(n3). Would this be appropriate? If so, then it would seem slightly different than the standardization described in the FAQ, which computes a standardized b3 in the moderator function (b1 + b3*n2) n1 by multiplying b3 by SD(n1) * SD(n2) and dividing by SD(n3); this form of standardization does not include the covariance term for the IVs, which is included in the estimate of V(n1 ×n2). 


One more thing: I think I may be misunderstanding the FAQ, but I also am very confused about the computations in the standardization section of the FAQ: it computes standardized betas for the b1 and b3 coefficients in the term (b1 + b3*n2), which it describes as being obtained by dividing both by SD(n3) = sqrt(3.17), multiplying b1 by SD(n1) = sqrt(2), and multiplying b3 by SD(n1)* SD(n2) = sqrt(2). However, with the given values of b1=.5 and b3=.4, I don't see how the standardized estimates of .199 and .159 for b1 and b3 come out; shouldn't they be .5*sqrt(2)/sqrt(3.17)= .40 and .4*sqrt(2)/sqrt(3.17)=.32? 


Good questions  let me get back to you about them tomorrow. 


Great, any thoughts you have would be appreciated! 


First, a new version of the FAQ posting will be up (probably tomorrow) and corrects the standardized numbers which were from an earlier version that had different population values. Second, the Wen, Marsh, Hau (2010) SEM article gives an explanation for why the square root of the variance of the product of eta1 and eta2 should not be used in the standardization of beta3 and why instead the product of the square root of each variance for eta1 and eta2 should be used as in my note. 


The new version of my FAQ note will have the date 9/20/2012 in the heading. 


The revised version of the FAQ Latent Variable Interactions has now been posted. 


Hello! Has something changed from Version 6 to 7 in connection to the xwith command? I am using syntax and data (nonlinear effect) which run without problems in V6, but now I get the following error messages THE LOGLIKELIHOOD DECREASED IN THE LAST EM ITERATION. CHANGE YOUR MODEL, STARTING VALUES AND/OR THE NUMBER OF INTEGRATION POINTS. THE MODEL ESTIMATION DID NOT TERMINATE NORMALLY DUE TO AN ERROR IN THE COMPUTATION. CHANGE YOUR MODEL AND/OR STARTING VALUES. Thanks Christoph Weber 


It seems that one problem is connected with the centering option. I use the following input: USEVARIABLES ARE b2044_3 b2044_4 b2044_5 b1003_02 b1003_05 b1052_5; define: center b2044_3 b2044_4 b2044_5 (grandmean); ANALYSIS: TYPE = random; ALGORITHM=INTEGRATION; ESTIMATOR = MLR; MODEL: exb2 by b1052_5 b1003_02 b1003_05 ; mstk2 BY b2044_3 b2044_4 b2044_5; sk2  mstk2 xwith mstk2; exb2 ON mstk2 sk2 ; Actually the intercepts of b2044_3b2044_5 are not equal 0. When I fix these parameters to 0, I get very similar parameter estimates to that of Version 6, but the error messages remain. Christoph 


Please send the input, data, and output to support@statmodel.com. 


Hello, one more question regarding the curvilinear effect: the latent var mstk2 is nonnormal distributed, thus I use in addition to the LMS approach Marsh's unconstrained and partial constrained approach (GAPI). Now I am somewhat confused about the messurement error constraints. According to Marsh et al (2006, in the Hancock/Mueller book, see also Kelava et al (2011) Advanced Nonlinear Latent Variable Modeling.... Struct. Equ. Mod. 18, p.465): given: x1 = 1*F1 + e1 x2 = lambda2*F1 + e2 x3 = lambda3*F1 + e3 then... x1² = 1*F1² + e4 x2² = lambda5*F1² + e5 ... where... Var(e5) = 4*lambda2²*Var(F1)*Var(e2) + 2*(Var(e2))² But why is it 4*lambda2²... and 2*(Var...). Shouldn't it be ... Var(e5) = 2*lambda2²*Var(F1)*Var(e2) + (Var(e2))² Thanks Christoph 


hi, With the following paper supplementary material they created Marsh, H. W., Nagengast, B. & Morin, A. J. S. (2012). Measurement invariance of bigfive factors over the life span: ESEM tests of gender, age, plasticity, maturity, and La Dolce Vita effects. Developmental Psychology. They created the syntax for the GROUPING a3s2 (11=A1S1, 12=A1S2,21=A2S1,22=A2S2,31=A3S1,32=A3S2); which was defines as 6 groups (3 age x 2 gender). Can you advise me on how the groupings were created. Either with Mplus or Spss and any syntax for it. it maybe a wrong platform for this question. 


I would ask Herb Marsh that question. 


Does this refer to Marsh et al 2012 (ESEM) or Marsh et al 2006 (Interactions)? 


IS Marsh et al 2012 (ESEM) Can u give me the title of the Marsh et al 2006 interactions paper 


See the following link: http://books.google.at/books?hl=de&lr=&id=iEv0y1MZKjcC&oi=fnd&pg=PA225&dq=marsh+interaction+quadratic&ots=5G5KSrUOwW&sig=bxoLhFcAYDOWpj6yoEHdVVXUnuU#v=onepage&q=marsh%20interaction%20quadratic&f=false 


Christof  please direct your interaction question on 4*lambda2... to Kelava himself. We don't use this method. 


Will like to know if you have had any information concerning my question from Herb Marsh. you promise to ask him. 


I'm sorry. I meant that you should contact Herb Marsh not that we would contact Herb Marsh. 

lamjas posted on Saturday, March 09, 2013  2:13 am



It seems that when XWITH is used for latent variable interactions, multiple group analysis can't be used. So, the only thing I can do is MIMIC approach. Is it correct? Thanks for your advice. 


You can do this using RANDOM MIXTURE with KNOWNCLASS. 

lamjas posted on Saturday, March 09, 2013  4:29 pm



Hi Linda, Thanks for your reply. When I use RANDOM MIXTURE, I need to identify a latent class, which is not my intention. I use XWITH to obtain an interaction of two continuous latent variables. It turns out the only way to do is MIMIC model. Is it correct? I have another question about plotting of interaction. I have read the FAQ paper "LV interaction". What is the syntax to obtain the graph shown in the figure? 


This graph was done outside Mplus. But it can be done using the new LOOP plot facility in Version 7, letting eta_1 vary. You just use the formulas (23)(25) in the FAQ. 


Dear Professors I have a question concerning a latent interaction model I have been running (N=600): SEM without latent interaction fits the data well: estimator = MLR; MA by m1m6 WM by w1w5 TA by t1t3 MA on WM TA CFI=.98; TLI=.979 RMSEA=.03 When I add the interaction WMxTA I get the warning message: latent variable covariance matrix is not positive definite. I see that the residual variance of MA is negative (but nonsignificant). But even after I constrain the residual variance to zero I still get the warning. The interaction is significant so I would really want to include it in my model. But I´m a little cautious about interpreting the results when I get this message. Should I try to standardize the regression paths (as in the FAQ) to see if there is a correlation greater than one (because tech4 is not available)? Or do you have other suggestions? PS. I also did a multiple imputation (20 datasets) and rerun the model and did not get any Warningmessages even though the residual variance of MA was still negative (p=.79). Johan Korhonen 


You need to ask for TECH9 with multiple imputation. This is where the warning messages will be found. It is likely that your model is misspecified. See the Rsquare without the interaction. It may already be high and adding the interaction may explain too much variance. You may need residual covariances among some of your factor indicators. The only way they can relate in your model is through the factors. See modification indices. 


Thank you Linda for your answer. The Rsquare is .39 without the interaction. I will check the modindices. Johan 

una posted on Monday, October 28, 2013  10:27 am



Dear Prof. Muthen, I am running an interaction between a latent factor and a manifest variable (using XWITH). I have two questions regarding this analysis: 1. When I am estimating with full information maximum likelihood, I get the following warning: *** WARNING. Data set contains cases with missing on variables used to define interactions. These cases were not included in the analysis. Number of such cases: 101 > Is it not possible to use FIML with such an interaction? 2. Makes the XWITH statement use of the method of Klein? To support his with a reference, can I refer to the following paper? Klein and Muthen (2007). Quasimaximum likelihood estimation of structural equation models with multiple interaction and quadratic effects. Multivariate Behavioral Research, 42, 647673. Thank you very much in advance, 


Hello, I am trying to run a simulation by using MONTECARLO procedure with a random intercept 2level regression model with an interaction term between two betweenlevel observed variables.My analysis model is very simple like: MODEL: %within% y ON x; %between% y ON w2 mod w2mod; where w2mod is an interaction effect. It does not seem like the DEFINE command does not work with MONTECARLO procedure. How can I handle it? Thank you in advance. Aki 


Do 2 runs: 1. Internal MC using w2 and mod. 2. External MC using Define to create interaction. 

Tamara Fitz posted on Saturday, February 13, 2016  8:14 am



Dear Prof. Muthen, I have a question regarding a latent moderated regression model. All variables are continuous. The variable TI01_01 is observed while the others are latent that have observed factor indicators. I tried different things and read in the forum and users guide but I can not figure out why Mplus keeps telling me that there is an “Unknown variable(s) in an ON statement: ON”. I can imagine that it is related to the manifest variable TI01_01 but I don’t know how to solve the problem. I did not forget to list it in the USEVARPart. DATA: file is sun.dat; VARIABLE: NAMES ARE … USEVAR=... MISSING = all (99); ANALYSIS: TYPE = RANDOM; ALGORITH = INTEGRATION; MODEL:Ident BY EF01_01 EF01_02 (…); Polit BY EF01_05 EF01_06 EF01_07 (…) Partic BY PA01_01 PA01_02; Ident with Polit; Polit with Partic; Ident with Partic; TI01_01 ON Ident TI01_01 ON Polit TI01_01 ON Partic; ParId  Partic XWITH Ident; ParPo  Partic XWITH Polit; TI01_01 ON ParId TI01_01 ON ParPo OUTPUT: TECH8; *** ERROR in MODEL command Unknown variable(s) in an ON statement: ON 


You need to put semicolons after each of the ON statements. 

Tamara Fitz posted on Sunday, February 14, 2016  4:16 am



Dear Prof. Muthen, thanks a lot for your quick answer even at a weekend. It worked out now. Kind regards tamara 

Pia H. posted on Tuesday, April 19, 2016  3:57 am



Hello, I have an interaction term with a continuous latent variable (g_trauma) and a categorical observed variable (maoa_zyg) and I am using the XWITH command: agextrauma age XWITH g_TRAUMA; g_PSYCHO ON agextrauma; maoaxtrauma  MAOA_zyg XWITH g_TRAUMA; g_PSYCHO ON maoaxtrauma; My problem is that I have a cluster variable, which means I need to use the type=complex or twolvel command, but this does not work with the interaction because this needs type=random (if I understood that correctly). Could you tell me if there is a way to have both the cluster and the interaction command in my script? Thank you very much, Pia 


You can use TYPE=COMPLEX RANDOM or TWOLEVEL RANDOM. 

Pia H. posted on Wednesday, April 20, 2016  3:06 am



Dear Prof. Muthen, thank you for the prompt reply. When using TYPE=COMPLEX RANDOM I get the following error warning: *** FATAL ERROR THERE IS NOT ENOUGH MEMORY SPACE TO RUN Mplus ON THE CURRENT INPUT FILE. THE ANALYSIS REQUIRES 10 DIMENSIONS OF INTEGRATION RESULTING IN A TOTAL OF 0.57665E+12 INTEGRATION POINTS. THIS MAY BE THE CAUSE OF THE MEMORY SHORTAGE. YOU CAN TRY TO REDUCE THE NUMBER OF DIMENSIONS OF INTEGRATION OR THE NUMBER OF INTEGRATION POINTS OR USE INTEGRATION=MONTECARLO WITH FEWER NUMBER OF INTEGRATION POINTS SUCH AS 500 OR 5000. Using the MONTECARLO command does not solve the problem, unfortunately. On a related note, I am considering estimating interaction effects in a multigroup model to simplify the interaction terms. Since my grouping variable is a categorical observed variable I was wondering if the KNOWNCLASS command can be used with observed variables (by now, I only found information on latent classes related to KNOWNCLASS). Thank you very much, Pia 


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

Patty Fitz posted on Wednesday, July 06, 2016  7:39 am



Dear MPlus team, I am doing an SEM with an interaction. As there are no modelfit indices given in Mplus, I am looking at the indices (CFI, RMSEA etc.) of the model without interaction, as you recommended in a previous post. You advised also to look at the logL difference between the model with and without interaction. So I looked up their log likelihood difference in chisquare distribution and I found it is not significant (the number is smaller than the critical number in the table, 2df, 0.05). That would mean I cannot reject the null hypothesis of equal fit for both models? Is that correct? What does it mean exactly for an interpretation regarding model fit? The model with or without interaction fits better to data? Or does it mean the modelfits indices of the model without interaction works also for the model with the interaction? Thanks for your help 


Fit is discussed in Section 1.2 of our FAQ on our website: Latent variable interactions If chisquare is not significant, there is no need for an interaction. 


Dear Bengt and Linda, In our longitudinal model, we also look at an interaction term (continuous*continuous) as a predictor. We plotted the interaction in Mplus by using 2 SD, the mean, and +2 SD of one of the predictors in the interaction term, which obviously produces a plot with 3 lines. Is it possible to test whether the slope of each of those 3 lines is significantly different from zero? And yes, how could we do this? Thank you very much for your response 


You can express these lines in Model Constraint in order to test their slopes. 


Dear Bengt, Thank you for your quick response. We used: Model constraint: plot (lowmn medmn highmn); loop(motneg,0,30,0.1); lowmn = (b1+b3 *(2))* motneg + b2 *(2); medmn = (b1+b3 *(0))* motneg + b2 *(0); highmn = (b1+b3 *(2))* motneg + b2 *(2); !simple slopes NEW(ss1ss3); ss1=b1+b3*(2.07); !2.07 = 1SD of f2 ss2=b1; ss3=b1+b3*(2.07); The simple slopes resulting from this code match with the plot data. However, since we requested the plot for 2 and +2sd, we would expect that we need to multiply the SD for the simple slope with 2 and +2 as well. When we do this, the simple slopes estimates do not match with the plot data. Are we missing something? 


I am confused. you have 2 and 2 in for loop but 2.07 and 2.07 for the simple slopes  are they for the same variable? Or is the 2.07 meant to reflect a motneg value? 


In the loop we used 2 and 2 for specifying 2 SD above and below the mean. 2.07 is actually the value of 1 SD of that similar variable. But considering your confusion, I assume they should be the same for both the plot as for specifying the simple slopes? So, should we use 2 and +2 (as in 2 SD below and above the mean) or 4.14 and +4.14 (in our case the value of 2 SD for that variable)? 


That sounds right. The value you choose influences the simple slope. 

Anne Black posted on Friday, June 09, 2017  12:09 pm



Dear Drs. Muthen and Muthen, I need to create an interaction between an observed and latent variable for a SEM. I am using Type=Complex and multiple group analysis, and am modeling a count outcome using WLSMV estimation. I believe XWITH is only available for KNOWNCLASS, and perhaps not with Type=Complex? Is there a way to create the product term using the model specifications I have? Thanks in advance for your advice. 


Use Type = Complex, XWITH, Knownclass, MLR 

Jan posted on Sunday, December 03, 2017  12:51 am



I tried to plot a modified effect on the within level. In the example below both x and z are binary. I wondered what is the appropriate specification of the LOOP XAXIS when x is binary. I doubt that the current code for the plot is correct, as all the variables in the model take only positive values, but the resulting plot shows negative values for both the y scale and the x axis. Is there any necessary option that my loop plot is lacking? Thank you for any help. USEVARIABLES = y x z u xu zu ; WITHIN = x z u xu zu ; ANALYSIS: TYPE = TWOLEVEL RANDOM; ESTIMATOR = Bayes; PROCESSORS = 4; Fbiterations = 10000; MODEL: %WITHIN% y ON x (bs1) ; y ON IT1_Pic_ty_posit; y ON u; y ON xu (bs4); y ON zu; MODEL CONSTRAINT: New ( s1_ s1s4 ); s1_ = bs1 + (bs4*(0)); s1s4 = bs1 + (bs4*(1)); PLOT(pls1_ pls1s4 ); LOOP(XAXIS, 2, 2, 0.1); pls1_ = s1_ * XAXIS; pls1s4 = s1s4 * XAXIS; PLOT: TYPE = plot2; OUTPUT: TECH1 TECH8 sampstat patterns cinterval; PLOT: TYPE = plot1 plot2 plot3; 

Jan posted on Sunday, December 03, 2017  12:54 am



In the code above the "y ON IT1_Pic_ty_posit;" should be "y ON z; " 


The xaxis refers to your u variable which I assume has mean and variance 0,1  so it can be negative. To get the yaxis right you need to add in the other effects (of u, z, and zu) and the y intercept. 

Back to top 