Message/Author 


The following message was posted yesterday on SEMNET and is of interest to Mplus users. SEMNET readers may be interested in a new paper: Muthen, B. (2011). Applications of Causally Defined Direct and Indirect Effects in Mediation Analysis using SEM in Mplus. Submitted for publication. which is available at http://www.statmodel.com/examples/penn.shtml#extendSEM together with Mplus scripts. The paper discusses causallydefined effects for mediation analysis in an SEM context for continuous, binary, ordinal, nominal, and count variables. With noncontinuous variables, causallydefined effects have not been available in SEM software until now. The paper discusses maximumlikelihood and Bayesian analysis for nonnormal effects, latent response variable mediators, Monte Carlo simulations for planning new studies, sensitivity analysis when violating sequential ignorability, and generalizations to continuous and categorical latent variables. Furthermore, the paper is the first to present a method for mediation with a nominal mediator. One of the illustrations is an analysis of Judea Pearl's hypothetical example with binary mediator and binary outcome that was debated on SEMNET in September. 


Mplus users who do mediation analysis are urged to study the paper in the previous posting. The research in this paper elaborates and extends our previous recommendations of how to report indirect and direct effects. Some of the analyses performed in the new paper require Mplus Version 6.12 which is scheduled to be released next week. 


I have just read the new paper on Mediation and had a couple of basic questions. 1) How are the DE, TIE, PIE parameters interpreted for a count or negative binomial outcome? It looks as though parameters are exponentiated before being entered into these formulas from the example code in the table 512. 2) I am also new to the Causal Effect modeling approach, so I will go back and read some more of the introductory papers, but I wondered what the basic change to the formulas would be with say 3 or 4 treatments as opposed to two conditions. 


1) Count and negbin modeling focus on the log mean (often called the log rate), whereas the casual effect formulas consider the mean (that is, the rate). Hence the exponentiation. 2) You would do the analysis jointly for all treatments and control groups, so several dummy covariates. And then use the formulas for one treatment at a time. 


When examining mediation using parallel process growth models, several studies have looked at the relationship between X (e.g.tx condition) and subsequent M & Y parallel process models. However, I have not been able to locate any examples for which X & M are parallel process models and Y is a future outcome. Do you see any inherent methodological problems for a model in which the relationship between both initial status and growth of X and its relationship with the future outcome Y is thought to be mediated by the slope of M? If such a model is plausible, does the model presented below appear to represent an adequate means for examining such a relationship? MODEL: !Growth Model Xint Xslp  X1@0 X2@0.5 X3@1 X4@1.5 X5@2 X6@2.5; Mint Mslp  M1@0 M2@0.5 M3@1 M4@1.5 M5@2 M6@2.5; Xint with Mint; Mslp with Mint; Xint with Xslp; Xslp on Mint; Mslp on Xint (a1); Mslp on Xslp (a2); Y on Mslp (b); Y on Xint Xslp Mint; Model Constraint: new (med1 med2 ); med1=a1*b; med2=a2*b; 


Such modeling seems reasonable, generally speaking. The time ordering needs to be clear  it seems odd to have Xslp on Mint if M mediates X. 


Hi there, I'm brand new to MPlus so I apologize if this is extremely basic.I am attempting to decompose several significant interactions. I have one categorical predictor (sexual victimization history) and have found that my continuous moderators (life stress and social support) significantly moderate the relationship between my predictor and outcome variables (of which I have threeall are categorical). Can I do this in Mplus? 


Yes, you can do this. See Example 3.18. It is more complicated than your model but you should be able to use that as a starting point. 

Boliang Guo posted on Wednesday, March 19, 2014  2:43 am



2011 paper is really great!! especially for model with nominal mediator, thank. Here is also two more points in my mind for your kind attention, based on equation (16), could I say the PIE is mathematically equivalent to the traditional mediation estimate, e.g a*b? could the definition be generalized to case when x is continuous variable? i.e. X is not the treatment status but the dose of drug, so the effect of X is change in y due to unit change in x?thanks. 


I will send you a new paper that is forthcoming in the SEM journal where I lay out the counterfactual formulas for the continuous X case. 


If I wanted to use the model constraint command to estimate create a sensitivity plot of a treatment outcome error correlation rather than a treatment mediator correlation is it correctly understood that I can use the estimate of beta1 in "run 23" in your 2011 paper on causal mediation analysis? I.e. an example with a treatment an outcome and two independent variables: MODEL: outcome with treatment (cov) ; outcome (sig) ; treatment (sig2) ; outcome on x1 x2; treatment on x1 x2 ; MODEL CONSTRAINT: plot(beta1) ; loop(mod, 1,1,0.1) ; NEW(rhocurl rho) ; rhocurl=cov/(sqrt(sig)*sqrt(sig2)) ; rho=mod ; beta1=(sqrt(sig)/sqrt(sig2))*(rhocurlrho*sqrt((1rhocurl*rhocurl)/(1rho*rho))) ; plot: type=plot2 ; 


I haven't thought about that. It is a different setting. You would have to go through the steps of Section 10 to see if that is right. 


Hi Bengt thank you for your response. I have essentially just reproduced the script from "run24" where I use "beta1" which is the effect of the mediator on the outcome variable but do not multiply it with the effect of the treatment on the mediator to obtain the indirect effect but simply keep the "direct" effect. Would this not simply correspond to the "total" effect if it is not theorized to be a mediator but simply the total effect of an independent variable after the other independent variables are held constant, and thus obtain the sensitivity of the treatmentoutcome relationship of an error correlation between the two e.g. an unobserved confounder? 


We originally fit an SEM model with one predictor, 2 mediators at time point 1, 2 mediators at time point 2 (that are the same, therefore there is a path from time 1 to time 2) and 3 outcome variables. Reviewers recommended that we explore causal mediation, and more specifically Imai et al.’s sensitivity analyses. I found the paper (Applications of causally defined direct and indirect effects in mediation analysis using SEM in Mplus) and code for these analyses but I am unsure how to extend them to a model with multiple mediators and outcomes. I am able to include the other pathways when I code a single pathway for the sensitivity analyses, but it won’t let me specify the indirect effects. Is there a way to code this, and particularly for calculating indirect effects through two mediators (predictor – mediator1 – mediator 2 outcome) similar to using the VIA command? Can these analyses be done with multiple mediators? I have also noticed that when I specify a single pathway (predictor mediatoroutcome) the “INDIRECT” coefficient under New/Additional parameters is much larger than the coefficient using a simple mediation model when the rho is set to 0. Is there a reason for this? Finally, is there code for the graphs which show how the effect is altered over a range of rho values? I saw that the LOOP command could be used, but I did not have any success in coding this. Thank you so much for your help. 


There is an interesting paper in a 2015 issue of Amer J of Epi: Mediation Analysis With Intermediate Confounding: Structural Equation Modeling Viewed Through the Causal Inference Lens Bianca L. De Stavola et al Bianca's L and M can be seen as sequential mediators and she presents Mplus scripts. I am not aware of sensitivity analyses with multiple mediators. I would think Imai's approach can be generalized bu I haven't tried that yet. You can do VIA when you have multiple mediators. For a zero rho value I would expect the same indirect effect as obtained using Model Indirect. Mplus 7.4 automatically does a sensitivity plot when there is one mediator. In the PLOT command just say TYPE=SENSITIVITY PLOT2; 

shaun goh posted on Friday, July 29, 2016  2:48 am



Dear Dr Muthens, I have questions about the treatmentmediator as moderator model, specifically Figure 1 of 'Causal effects in Mediation modelling : An introduction with applications to latent variables' (2015) as follows To model Figure 1, I would need to do declare X, M(mediator), and XM as predictors, and also use 'MODEL INDIRECT : y MOD M XM X' I'm struggling to understand the nuances of the model. Are there texts/papers you would recommend that have used this model or give insight into the interpretation of the treatmentmediator as moderation effect? I believe my mediator interacts with my treatment, and am afraid it will violate the assumptions of a simple mediation model. Is this a good motivation to use this model? Thank you for your time, Shaun 


This is thoroughly described in our new book, chapter 2, section 6: http://www.statmodel.com/Mplus_Book.shtml The book is on backorder right now but we expect to have it available again next week. 


Hello Prof. Muthen. I am trying to get a sensitivity plot and following your suggestion dated "March 23, 2016  6:52 pm" above, along with your paper in the website. I start with a simple mediation setup with (giving code excerpts below, version 7.4) " M on x1 x2; Y on M; MODEL INDIRECT: Y IND x1 x2; plot: type = sensitivity plot2; " I don't get any output of sensitivity plot. IS keyword 'MOD' necessary for automated output of sensitivity plot? In that case then I would need a moderatedmediation setup right? But I thought 'rho could tested for range of values from negative, zero, & positive in simple mediation setup as well? The reason I ask is that, this would then force me to fit a moderatedmediation rather than a simple mediation (, which is my conceptual model) to get to this sensitivity plot. IS that a right approach? 


MOD is not necessary but you should say y IND m x1; ! or x2 


Thank you. I also noticed that all 'X' variables in the regression on 'M' has to be included on the regression on 'Y' for Mplus to show me the sensitivity plots. Any specific reason for this? i.e. for the model I noted above, where X1 and X2 are not regressed on Y, I am still not getting the sensitivity plots. But when I include them, then Mplus shows the plots. Kindly advice why is the case? This would mean that that I must always test for partial mediation and cannot assume complete mediation? 


Try fixing the slopes in the regression of Y on X1 and X2 to zero. By the way, I think you want to say "Y regressed on X1, X2" rather than the other way around. 


Dear Prof. Muthen. I did try this. Unfortunately I don't get sensitivity plots. Given that I have several control variables in the regression of M; i.e. M on x1 x2....x5 and that I MUST add all of these in the regression of Y to get sensitivity plots, makes the model less parsimonious, too clumsy, consumes degrees of freedom and makes modelfit indices worse. Further most of these control variables are insignificant with their beta estimates close to zero. Any workaround on this please? Or there is a theory from Imai, Pearl or others that I can cite to defend that ALL variables in the regression of M, must be there in Y? Many thanks in advance. p.s.: Yes, I meant Y on x1 x2 . My apologies for the confusion please. 


You are right that our current implementation of the sensitivity plot for a case like y = b1*m + b2*x + b3*c + e1 m = gamma1*x + gamma2*c + e2 requires free b2 and b3. I don't think this restriction is necessary and we might change that in the future. But in fact you can do your own sensitivity plot by repeated runs of the type shown in the book for Table 3.26. Here you don't have to bring in b2 or b2 and still get a sensitivity plot for the indirect effect. Having said that, I think that in mediation analysis one wants to explore both direct and indirect effects. It is probably rare to have a strong hypothesis about zero b2 and b3 coefficients. Instead, you want to report which are significant and which are not. But if you have that strong hypothesis there is another way to explore the concern about mediatoroutcome confounding than sensitivity plots  you can use Instrumental Variable estimation. This is described in Section 3.4 in our book. 


Looking at the Imai and Muthen (2011) formulas more closely, I don't think it is correct to modify the approach in Table 3.26. I vote for bringing in all covariate effects  or use IV estimation (which is not problemfree). 


Dear Prof. Muthen. Thanks a lot for your detailed directions and advice. Truly appreciate it. As for IV estimation, can I not directly specify the correlation between residuals of M and Y, if I have at least one X variable that doesn't have a direct path to Y? I am referring to this method as noted here http://tinyurl.com/h76w87u Or should I follow the book steps (page 155156) of taking ratio of the two slopes? So for IV estimation is sensitivity analysis not necessary? I am confused now comparing IV vs. sensitivity analysis, if I Can directly specify the residual correlation of M & Y. When should I go for sensitivity analysis and when should I go for IV estimation? Kindly advice please. 


You can try both approaches you mention: IV and the freeing of the residual covariance. I don't know how they compare. In both cases, the drawback is that you have to rely on a direct effect being zero. With IV estimation the sensitivity analysis is not necessary. 


Thank you very much Prof. Muthen. 

DavidBoyda posted on Monday, November 27, 2017  12:27 pm



Hi Dr Muthen, to pick up on a previous reply by Bengt back in 2016, is Mplus able to conduct sensitivity analysis with multiple mediators now? thank you, D 


Not automatically. 


Dear Prof. Muthen, Imai et al (2010a,b) and your two papers Muthen (2011) & Muthen Asparouhov (2015) refer to sequential ignorability assumption. I understand the intuition behind that. However there is a statement made in the above papers "under sequential ignorability assumption the causal mechanism is nonparametrically identified"; May I kindly request you to provide a simple explanation (intuitive) on what nonparametric identification means in this context of causal mediation please? Many thanks in advance. 


Nonparametric identification means that you have identification even if you don't impose e.g. a linear or logistic link in your model. You have an example of this in Chapter 8 of our book Regression and Mediation Analysis using Mplus. 


Thank you Prof. Sorry for the late response. Chap 8 is quite long. Did you refer to section 8.4 ? If not kindly please point to the example. Many thanks in advance. 


Actually, I should have referred to Chapter 4 where such a nonparametric example is introduced in section 4.2.1. and is discussed throughout this chapter. 


Thank you Prof. Muthen. I will refer to ch 4. 


I am trying to construct a model based on the 2011 causal mediation paper. I have a dichotomous mediator (INTENT) and threecategory nominal outcome (ATTRIT). I would like the TE, PIE, and DE of the latent variables on the ATTRIT variable while controlling for covariates, so I have entered them all on one line with a single labeled beta used in the model constraint language, but I am not sure that is correct. I am also not sure if this model is giving me a direct effect of the INTENT mediator on the ATTRIT variable, and that would be helpful to have or be able to calculate. Any guidance would be welcome. 


MODEL: %OVERALL% DEPROF BY P1 P2 P4 P5 P6; TEACH BY DM1 DM8 DM12 DM13 DM15 DM16 DM17 P8; STUDENT BY DM2 DM3 DM4 DM5 DM6 DM9; [Intent2#1] (gamma01); Intent2#1 ON DEPROF (gamma11); Intent2#1 ON TEACH (gamma12); Intent2#1 ON STUDENT(gamma13); ATTRIT ON DEPROF TEACH STUDENT Early Late altcert NonWhite female;%Intent2#1% [ATTRIT#1](beta01); [ATTRIT#2](beta04); ATTRIT ON DEPROF TEACH STUDENT Early Late altcert NonWhite female (beta11); %Intent2#2% [ATTRIT#1] (beta02); [ATTRIT#2] (beta05); ATTRIT ON DEPROF TEACH STUDENT Early Late altcert NonWhite female (beta12); 


Note that your statements Intent2#1 ON DEPROF (gamma11); Intent2#1 ON TEACH (gamma12); Intent2#1 ON STUDENT(gamma13); are not how you refer to a binary DV. See UG examples. If you can't get the setup right, send your full output to Support along with your license number. We request that postings be limited to one window. For longer matters, send to Support. 

Back to top 