Logistic regression in mediation anal... PreviousNext
Mplus Discussion > Categorical Data Modeling >
Message/Author
 Jian Wang posted on Tuesday, December 06, 2011 - 6:17 pm
Dear Drs. Muthen&Muthen,

I am working on a mediator model with a binary outcome Y, two continuous mediators M1 and M2 and a continuous initial variable X. I am trying to use the logistic regression. The input file is as following:

TITLE: Two-mediator example
DATA: FILE IS data1.txt;
VARIABLE: NAMES ARE x m1-m2 y;
CATEGORICAL IS y;
ANALYSIS: ESTIMATOR = ML;
MODEL: m1 ON x(a1); m2 ON x(a2); y ON m1(b1);
y ON m2(b2); y on x; m1 WITH m2;
MODEL INDIRECT: y IND m1 x; y IND m2 x;
OUTPUT: CINTERVAL;TECH3;
SAVEDATA: RESULTS ARE results_data1.txt;
TECH3 IS tech3_data1.txt;

However, when I run it, I got an error message like:

*** ERROR
MODEL INDIRECT is not available for analysis with ALGORITHM=INTEGRATION.

I am not quite sure what the error message means. Thank you a lot for your help.
 Linda K. Muthen posted on Tuesday, December 06, 2011 - 8:14 pm
You would need to use MODEL CONSTRAINT to create the product term of the indirect effect. Note that this is the indirect effect of the latent response variable underlying y. If you are interested in the indirect effect of the observed variable y, see on the website:

Muthén, B. (2011). Applications of causally defined direct and indirect effects in mediation analysis using SEM in Mplus. Submitted for publication.
 Jian Wang posted on Tuesday, December 06, 2011 - 9:57 pm
Dear Linda,

Thank you very much for your quick response.

1. Now I have tried to use the Model constraint command, and it seems work. But when I tried to use bootstrap to get the confidence interval, it gave me the error message again:

*** ERROR in ANALYSIS command
BOOTSTRAP is not allowed with ALGORITHM=INTEGRATION.

Does it mean I can not use bootstrapping for logistic regression?

2. I remember that when the outcome is binary, I need to rescale the coefficients to make the coefficients comparable across equations. (http://nrherr.bol.ucla.edu/Mediation/logmed.html) I wonder if the mplus will rescale the coefficients? If yes, what option I should use?

Really appreciate your help!
 Bengt O. Muthen posted on Wednesday, December 07, 2011 - 12:25 am
1. Yes, bootstrap is disallowed with integration due to the worry about computational time. If you are concerned about the indirect effect having a non-normal distribution, you can switch to Estimator=Bayes.

2. That rescaling is not necessary - the approach your refer to is about two generations of papers behind now. The first generation change is described in

MacKinnon, D.P., Lockwood, C.M., Brown, C.H., Wang, W., & Hoffman, J.M. (2007). The intermediate endpoint effect in logistic and probit regression. Clinical Trials, 4, 499-513.

The second generation change is the Muthen (2011) paper Linda referred to (it comes with Mplus scripts).
 Jian Wang posted on Wednesday, December 07, 2011 - 1:11 pm
This is very helpful! Appreciate your help.
 Mario Mueller posted on Monday, May 07, 2012 - 3:56 pm
Hello,

I specified a mediated logistic regression model as follows (x1 and x2 are categorical: sex, education-hi/lo):

usevariables are x1 x2 x3 x4 x5 x6 x7 c;

missing are all (-999);
categorical is c;

analysis:
estimator=ML;
integration=montecarlo;
ALGORITHM=INTEGRATION;


model:
c on x6 (p1) x7 (p2) x4 (p3) x1 (p4) x2 (p5) x3 (p6) x5 (p7);
x6 on x1 (p8) x2 (p9) x3 (p10) x5 (p11);
x7 on x1 (p12) x2 (p13) x3 (p14) x5 (p15);
x4 on x1 (p16) x2 (p17) x3 (p18) x5 (p19);

model constraint:
new (x1_x6_c x1_x7_c x1_x4_c
x2_x6_c x2_x7_c x2_x4_c
x3_x6_c x3_x7_c x3_x4_c
x5_x6_c x5_x7_c x5_x4_c);

x1_x6_c=p1*p8;
x1_x7_c=p2*p12;
x1_x4_c=p3*p16;
x2_x6_c=p1*p9;
x2_x7_c=p2*p13;
x2_x4_c=p3*p17;
x3_x6_c=p1*p10;
x3_x7_c=p2*p14;
x3_x4_c=p3*p18;
x5_x6_c=p1*p11;
x5_x7_c=p2*p15;
x5_x4_c=p3*p19;


I requested Tech1 & Tech8 but the output did not provide any fit statistics.
Is this useful and how can I obtain it?

Thanks, Mario
 Linda K. Muthen posted on Monday, May 07, 2012 - 11:20 pm
With categorical dependent variables and maximum likelihood estimation, chi-square and related fit statistics are not available because means, variances, and covariances are not sufficient statistics for model estimation.
 Mario Mueller posted on Thursday, May 10, 2012 - 11:07 am
Dear Linda,

thank you very much for your quick reply!

We have a path analysis with one categorical dependent variable (a two-class solution of a latent profile analysis of health behaviors) and two sets of predictor variables: 3 proximal predictor variables and four more distal predictor variables (e.g. sociodemographics).
Predictor variables are either Likert, ordinal or binary.

Can I ask two follow-up questions to make sure that I understand how to proceed:
(1) In this model with a categorical dependent variable, are there any usable fit indices?

(2) If yes, which should we use and which values would indicate acceptable fit?

Many thanks for your reply in advance,
all the best,
Mario
 Linda K. Muthen posted on Thursday, May 10, 2012 - 5:33 pm
There are no absolute fit statistics. Nested models can be compared using -2 times the loglikelihood difference which is distributed as chi-square. BIC can be used to compare models with the same set of observed variables.
 Mario Mueller posted on Wednesday, July 18, 2012 - 10:55 am
Dear Linda,

I have a follow-up question:
As recommended by you, I have used the MODEL CONSTRAINT option to obtain Odds Ratios for both the direct and the indirect effects (via a continuous mediator). How can I interpret these total effect-ORs, especially when it is summarized from two paths with opposite directions? Do you know any reference I could refer to?

Thanks, Mario
 Linda K. Muthen posted on Wednesday, July 18, 2012 - 5:48 pm
See the following paper which is available on the website:

Muthén, B. (2011). Applications of causally defined direct and indirect effects in mediation analysis using SEM in Mplus.
 Mario Mueller posted on Monday, August 13, 2012 - 9:32 am
Dear Linda,

Is there a way to obtain p-values for these indirect effects (via MODEL CONSTRAINT)? Is it possible to compute it from confidence intervals?

Thank you,
Mario
 Linda K. Muthen posted on Monday, August 13, 2012 - 12:24 pm
You will get p-values for all new parameters defined in MODEL CONSTRAINT.
 Mario Mueller posted on Monday, August 13, 2012 - 12:50 pm
Okay, I realized that but was uncertain how to interpret them, since I got for an estimate of -.004 (p<.001) of an indirect effect but the OR was 1.00 (95%CI: 1.00-1.00). Is that possible?

Thanks, Mario
 Linda K. Muthen posted on Monday, August 13, 2012 - 3:14 pm
Please send the output and your license number to support@statmodel.com.
 Dm posted on Monday, January 13, 2014 - 2:58 pm
Dear Prodessor Muthen,

I have quite a large mediated logistic regerssion model (x1-x13 m1-m4 Y1-y6). I see that i need to use the MODEL CONSTRAINT to specify the indirect effects based on posts on statmodel.

My question is, is there any way to use a collapsed type of labeling format to specify each of the paths instead of labeling each and every path? So instead of this:

MODEL:
y1 on m1 (p1) m2 (p2) m3 (p3) m4 (p4) x1 (p5) x2 (p6) x3 (p7) x4 (p8) x5 (p9) X6 (p10) x7 (p11) x8 (p12) x9 (p13) x10 (p14) x11 (p15) x12 (p16) x13 (p17) ;

maybe something like this? Since my syntax is getting very large specifying all the individual paths and then specifying all the labels as well.

Model:
Y1-y6 on m1-m4 (p1-p24) ; <----- if this is possible.

thanks
 Bengt O. Muthen posted on Monday, January 13, 2014 - 10:09 pm
I think that works - give it a try.

You can't give several labels on the same row as you have done - you need to separate them by semi colons.
 DavidBoyda posted on Wednesday, February 12, 2014 - 6:45 pm
Thank you so much Bengt, it worked wonderfully.

However, I have a follow up question. If the indirect effects are the product of OLS regression coefficient and probit coefficient, how on earth do would you interpret the indirect effects estimates since they are the product of two different scales?

I understand neither scales can be scaled.
 Bengt O. Muthen posted on Wednesday, February 12, 2014 - 7:52 pm
These issues are discussed in my paper on our website:

Muthén, B. (2011). Applications of causally defined direct and indirect effects in mediation analysis using SEM in Mplus. Click here to view the Technical appendix that goes with this paper and click here for the Mplus input appendix. Click here to view Mplus inputs, data, and outputs used in this paper.
 DavidBoyda posted on Wednesday, February 12, 2014 - 8:57 pm
Thank you so much sir - good day.
 namer posted on Sunday, April 20, 2014 - 5:16 pm
Dear Linda and Bengt,

I am conducting a similar model to Mario, with 6 continuous IVs, 1 continuous mediator and a binary DV. Based on readings on this forum, I have opted for the mlr estimator versus wlsmv.

I have 2 questions:
1.Is the following syntax appropriate for a sensible interpretation of indirect effects - or is another step was required given the combination of OLS and logit coefficients?
2. to compute total effects do I simply add the indirect and direct effects? or again should I be weary of the combination of OLS and logit coefficients?

ANALYSIS:
estimator is mlr;
type is missing;
integration = monte;

MODEL:
abexp on sesgez_low gender;
abexp on sch1 sch2 sup con consci socanx;

peer on sch1 (p9);
peer on sch2 (p10);
peer on sup (p11);
peer on con (p12);
peer on consci (p13) ;
peer on socanx (p14);

abexp on peer(m1);

MODEL CONSTRAINT:
new (ind_sch1);
new (ind_sch2);
new (ind_consci);
new (ind_con);
new (ind_sup);
new (ind_anx);

ind_sch1=m1*p9;
ind_sch2= m1*p10;
ind_consci=m1*p13;
ind_con=m1*p12;
ind_sup=m1*p11;
ind_anx=m1*p14;

Sorry for my confusion and thank you in advance for any help.
Namer
 db40 posted on Sunday, April 20, 2014 - 5:58 pm
Dear Professor Muthen,

I have completed a mediation model using Bayes since the results of MLR gave me product estimates that were non significant even though I have significant AB paths.

However I am a little bit confused over one of the results of the Bayes estimation. I have significant P values but the credibility intervals contain zero. So is the mediated effect significant or not?

For example;

m1 on x1 is significant (0.313, p =0.008, 95%CI= 0.063 - 0.555)

y1 on m1 is significant??? (0.098, p 0.035, 95%CI= -0.009 - 0.207)

and the mediated effect is:

Y1_M1_X1 = (0.028, p = 0.043, 95%CI= -0.003 - 0.085).
 Linda K. Muthen posted on Monday, April 21, 2014 - 4:10 pm
Namer:

With MLR and a binary distal outcome and a continuous mediator, you can use the product specification for an indirect effect involving the latent variable underlying the binary distal outcome. You can also use this with WLSMV. For further information about indirect effect specification, see

Muthén, B. (2011). Applications of causally defined direct and indirect effects in mediation analysis using SEM in Mplus.
 Linda K. Muthen posted on Monday, April 21, 2014 - 4:13 pm
DB40:

Go by the credibility interval. If it covers zero, the estimate is not significant.

The p-value is the probability of being in the other tail. For a positive estimate, it is the probability of being zero or negative.
 namer posted on Friday, April 25, 2014 - 10:35 am
Dear Linda,

Thank you for your prompt response. I have one follow up question - if I use WLSMV can I also use MODEL INDIRECT to calculate indirect effects and make use of bootstrapping? Or given that I have a binary outcome with continuous mediators and predictors is the MODEL CONSTRAINT method preferred?

Thank you kindly for your advice,

Namer.
 Linda K. Muthen posted on Friday, April 25, 2014 - 12:12 pm
In your situation, you can use either.
 namer posted on Wednesday, April 30, 2014 - 12:14 pm
Dear Linda,

Yet another follow up question. If I wanted to add two binary covariates to the model, would WLSMV with MODEL INDIRECT still be a valid method? It seems to me the combination of continuous and categorical predictor variables are fine with WLSMV. These are control variables, which are only regressed on binary DV, not continuous M.

I am trying to stick with WLSMV instead of switching back to MLR as long as valid, due to the benefit of the fit statistics produced.

Furthermore, I normally interpret my indirect effects as: for one unit in change in x, y changes by the value of the indirect effect. However, it is not clear to me how to translate this combined probit/OLS indirect effects I have in this model. I guess I cannot change these coefficients into probabilities as with the strictly probit coefficients? Nor can I interpret as I would with OLS coefficients? So how do you advise to interpret them?

Kind regards,
Namer
 Bengt O. Muthen posted on Thursday, May 01, 2014 - 1:33 am
WLSMV has no problem with binary covariates, just don't put them on the Categorical list.

With WLSMV and a binary DV the y in your story is a latent continuous response variable behind the observed binary y. If you want to instead think about probabilities you have to study

Muthen, B. & Asparouhov T. (2014). Causal effects in mediation modeling: An introduction with applications to latent variables. Forthcoming in Structural Equation Modeling.

which is on our website under Papers, Mediational Modeling.
 Stephanie Aymans posted on Friday, November 28, 2014 - 11:39 am
Dear Professor Muthen,

I saw your tutorial about the logistic regression and read your paper about the direct and indirect effects in mediation analysis using SEM in MPlus.

I have a binary outcome and two continous mediators. I understand that I have to create a MODEL CONSTRAINT. Now I get the following error message:

*** FATAL ERROR
THIS MODEL CONSTRAINT IS AVAILABLE ONLY WITH THE ODLL ALGORITHM.ADD ALGORITHM=ODLL TO THE ANALYSIS COMMAND.

Can you tell me what I did wrong?

Thank you for your help.
 Linda K. Muthen posted on Friday, November 28, 2014 - 12:21 pm
Try the suggestion of the error message. Otherwise, send the output and your license number to support@statmodel.com.
 Danyel Moosmann posted on Wednesday, February 04, 2015 - 9:55 pm
Professor Muthen,

I'm running a single mediation model (7 continuous IVs; 1 continuous mediator; 1 categorical outcome).

I'm currently using the following to run my model before testing for mediation.

ANALYSIS:
type = complex;
estimator = MLR;
integration = montecarlo;

To test for mediation, can I use model indirect with bootstrapping? Also, I read in an article that when testing mediation with a categorical outcome, it is best to standardize all variables (not the outcome). Thoughts on this technique?

Any help you can give is greatly appreciated.

Danyel
 Bengt O. Muthen posted on Thursday, February 05, 2015 - 1:25 pm
You should read

Muthén, B. & Asparouhov, T. (2014). Causal effects in mediation modeling: An introduction with applications to latent variables. Structural Equation Modeling: A Multidisciplinary Journal, 22(1), 12-23. DOI:10.1080/10705511.2014.935843
 Danyel A.Vargas posted on Tuesday, March 17, 2015 - 5:47 pm
Dr. Muthen,

Thank you for recommending this article to me, it was a great help.

I have several IVs and want to extend this model. Thus when referring to Table A.2, would I include *-.2 on each of my IVs?

Thank you very much!

Danyel
 Danyel A.Vargas posted on Tuesday, March 17, 2015 - 7:41 pm
Dr. Muthen,

Also, I read your paper - Applications of Causally Defined Direct and
Indirect Effects...& ran Table 31 syntax with just one IV; however, the model won't run when I try to add additional IVs.

Under model constraint, wouldn't I need NEW variables for the multiple direct and indirect effects? Am I misunderstanding?

THanks in advance.

Danyel
 Bengt O. Muthen posted on Tuesday, March 17, 2015 - 9:57 pm
First post:

You can do that, but note that X is the "cause" here. When you say "several IVs", do you mean that there are covariates beyond the "cause" that are used as control variables?
 Bengt O. Muthen posted on Tuesday, March 17, 2015 - 10:01 pm
Second post:

Table 31 is rather advanced with a binary Y and X*M interaction - is that really what you need? If so, you may be better off doing that using the new Mplus language shown in my 2014 article.
 Danyel Moosmann posted on Wednesday, March 18, 2015 - 3:28 pm
Dr. Muthen,

1st post:
Yes, my IV is a dichotomous variable (whether students participated in an intervention) and the other vars. are covariates.

2nd post: No, I don't need the XM interaction so I will use the new language in the 2014 article.

When adding the covariates and asking for the indirect effects - is this the correct way?

RET IND CurGPA FYSApp;
RET IND CurGPA HSGPA;
RET IND CurGPA ACG1;

Thanks for responding.

Danyel
 Danyel Moosmann posted on Wednesday, March 18, 2015 - 4:10 pm
Dr. Muthen,

I had another thought - OR by just adding the covariates in the model and only requesting the indirect effect with my intervention variable, would this consider the covariates?

Thanks,

Danyel
 Bengt O. Muthen posted on Wednesday, March 18, 2015 - 5:32 pm
Your IND statements should have only the intervention X on the right hand side. The covariates are taken into account in the sense that they affect the partial regression coefficient for X. The covariates play into the counterfactual effect estimates only if you have interactions between them and X or include the X*M interaction (and then only for the direct effect).
 Danyel Moosmann posted on Wednesday, March 18, 2015 - 6:20 pm
OK - thanks.

Another question - is this a correct interpretation of the Odds Ratio of the TNIE = 1.085?

"As mediated by GPA, students who participated in the intervention were 1.085 times more likely to retain than students who did not participate."

Danyel
 Bengt O. Muthen posted on Wednesday, March 18, 2015 - 9:44 pm
I recommend that you use the effect on the probability scale, so what's reported first in the output. See my example on page 19 of my 2014 article.
 Danyel Moosmann posted on Thursday, March 19, 2015 - 2:45 pm
OK, thanks. Is there a specific situation when you would suggest to use the Odds Ratio?

Danyel
 Bengt O. Muthen posted on Thursday, March 19, 2015 - 6:15 pm
No; I am just saying to keep it simple at first.
 Danyel Moosmann posted on Friday, March 20, 2015 - 5:15 pm
Ok - thanks again!

Danyel
Back to top
Add Your Message Here
Post:
Username: Posting Information:
This is a private posting area. Only registered users and moderators may post messages here.
Password:
Options: Enable HTML code in message
Automatically activate URLs in message
Action: