Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
From | John Antonakis <John.Antonakis@unil.ch> |
To | statalist@hsphsun2.harvard.edu |
Subject | Re: reL Re: st: Interpreting mediation model sobel goodman test |
Date | Sat, 12 Nov 2011 17:24:13 +0100 |
Hi: In the case of the following code: clear set seed 123 set obs 1000 gen x = rnormal() gen e = rnormal() gen m = e + .5*x + rnormal() gen y = .5*m - e + rnormal() reg3 (y = m) (m = x), 2sls nlcom [m]x*[y]m sgmediation y, mv(m) iv(x)What you want is not possible; to be clear once more, what you want is what sgmediation gives. However, it cannot recover the correct indirect effect because m is endogenous. One needs to instrument m with x so one cannot regress y on x and control for m because both the coefficients of x and m will be biased (because m is endogenous and this endogeneity problem will be transmitted to x because x and m correlate). See the discussion around Figure 1C and Section 3.1.1 regarding omitting a regressor (in this case "e") in the following paper to get a handle on the problem:
Antonakis, J., Bendahan, S., Jacquart, P., & Lalive, R. (2010). On making causal claims: A review and recommendations. The Leadership Quarterly, 21(6). 1086-1120. http://www.hec.unil.ch/jantonakis/Causal_Claims.pdf
When using 2SLS the direct effect of x on y is simply the reduced form of the model:
reg y xThis gives a coefficient of .2373032, which is the same as the indirect effect. It is not possible to get what you want when the mediator is endogenous.
HTH, John. __________________________________________ Prof. John Antonakis Faculty of Business and Economics Department of Organizational Behavior University of Lausanne Internef #618 CH-1015 Lausanne-Dorigny Switzerland Tel ++41 (0)21 692-3438 Fax ++41 (0)21 692-3305 http://www.hec.unil.ch/people/jantonakis Associate Editor The Leadership Quarterly __________________________________________ On 10.11.2011 16:56, Ariel Linden, DrPH wrote: > Hi John, >> While this is a relatively old thread (in statalist time a month is like a
> century), I am revisiting your code below and have a question. In your > -reg3- equation and subsequent nlcom, you recover the "total effect". How > would you recover the direct and indirect effects using -reg3-? >> In a separate set of postings dated Feb 2009, Maarten laid out an approach
> using -sureg-, but it doesn't appear that the thread ever came back to > -reg3- . The primary issue here is that one would need to have an outcome> model containing both the mediator (m) and treatment variable (x), in order
> to derive the direct effect of x on y. The -reg3- model below for the > outcome does not contain the x variable (x is treated as exogenous). > > Thanks > > Ariel > > From: owner-statalist@hsphsun2.harvard.edu > [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of John > Antonakis > Sent: Tuesday, October 18, 2011 12:11 PM > To: statalist@hsphsun2.harvard.edu > Subject: Re: st: Interpreting mediation model sobel goodman test > > Hi Meredith: > > I assume you used the -sgmediation- package; I would not use this > routine UNLESS your mediator is exogenous (and you are sure of this). If > > it is endogenous sgmedation will give you inconsistent estimates (it > estimates the system of equations with OLS, and uses the dated > Baron-Kenny methods); you do not tackle the endogeneity problem with > sgmediation. You need to estimate your system of equations with an > instrumental-variable estimator (e.g., 2SLS). > > Take a look at this podcast, where I discuss this problem in detail: > > Endogeneity: An inconvenient truth (full version) (about 32 minutes in > length) > http://www.youtube.com/watch?v=dLuTjoYmfXs > > If you just want the nitty gritty see: > > Endogeneity: An inconvenient truth (for researchers) > (Excludes the "gentle introduction" content and discusses the two-stage > least squares estimator straight away; about 16 minutes in length) > http://www.youtube.com/watch?v=yi_5M7oUceE > > See also: > > Antonakis, J., Bendahan, S., Jacquart, P., & Lalive, R. (submitted). > Causality and endogeneity: Problems and solutions. In D.V. Day (Ed.), > The Oxford Handbook of Leadership and Organizations. > http://www.hec.unil.ch/jantonakis/Causality_and_endogeneity_final.pdf > > To understand exactly the nature of the problem run the following code, > where x is endogenous with respect to y: > > clear > set seed 123 > set obs 1000 > gen x = rnormal() > gen e = rnormal() > gen m = e + .5*x + rnormal() > gen y = .5*m - e + rnormal() > reg3 (y = m) (m = x), 2sls > nlcom [m]x*[y]m > sgmediation y, mv(m) iv(x) > > From the above model, we have an instrument x, an endogenous regressor > m, and omitted cause e, and a dependent variable y. We know that the > indirect effect of x on y is .5*.5=.25. 2SLS recovers this parameter > well (.24, p>.001). However, the sgmediation program gives .03 (and p = > .04). > > > Now, let's rerun this to see when you'd get the same results with > sgmediation (if x is exogenous with respect to y): > > clear > set seed 123 > set obs 1000 > gen x = rnormal() > gen e = rnormal() > gen m = .5*x + rnormal() > gen y = .5*m + rnormal() > reg3 (y = m) (m = x), 2sls > nlcom [m]x*[y]m > reg3 (y = m) (m = x), ols > nlcom [m]x*[y]m > sgmediation y, mv(m) iv(x) > > Notice that the 2SLS model is still consistent (but less efficient). The > > OLS estimator and sgmediation pretty much give the same estimates and > standard errors. > > HTH, > John. > > > > __________________________________________ > > Prof. John Antonakis > Faculty of Business and Economics > Department of Organizational Behavior > University of Lausanne > Internef #618 > CH-1015 Lausanne-Dorigny > Switzerland > Tel ++41 (0)21 692-3438 > Fax ++41 (0)21 692-3305 > http://www.hec.unil.ch/people/jantonakis > > Associate Editor > The Leadership Quarterly > __________________________________________ > > > On 18.10.2011 19:41, Meredith T. Niles wrote: > > Hello all, > > I am working on running multiple and single mediation models to > assess > > farmer climate change perceptions and potential adoption of climate > > change practices. I am getting an odd result when running a Sobel > > goodman test in Stata with regards to the portion of total effect > that > > is mediated (5.139). Does anyone have any perspective on why this > > number is so large? Running the same test with another set of > climate > > change practices yields a proportion of total effect that is mediated > at > > 0.79 which seems much more in line with other results I've seen. > > > > > > Sobel-Goodman Mediation Tests > > > > Coef Std Err Z P>|Z| > > Sobel -.09959383 .05075882 -1.962 .04975096 > > Goodman-1 -.09959383 .05217108 -1.909 .05626401 > > Goodman-2 -.09959383 .04930612 -2.02 .04339293 > > > > Indirect effect = -.09959383 > > Direct effect = .08021537 > > Total effect = -.01937846 > > > > Proportion of total effect that is mediated: 5.1394091 > > Ratio of indirect to direct effect: -1.2415804 > > > > > > Thanks for your thoughts. > > > > Best, > > Meredith Niles > > > > > > PhD Candidate, Graduate Group in Ecology > > NSF REACH IGERT Trainee > > Deputy External Chair, Graduate Student Association > > University of California, Davis > > 2126 Wickson > > * > * For searches and help try: > * http://www.stata.com/help.cgi?search > * http://www.stata.com/support/statalist/faq > * http://www.ats.ucla.edu/stat/stata/ * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/