[color=rgba(0, 0, 0, 0.5)]收录于话题
#因果识别,中介效应,计量经济学
[color=rgba(0, 0, 0, 0.5)]4个
Causal mediation analysis
Raymond Hicks,Niehaus Center for Globalization and Governance
Princeton University,Princeton, NJ,rhicks@princeton.edu
Dustin Tingley,Department of Government,Harvard University
Cambridge, MA,dtingley@gov.harvard.edu
Abstract. Estimating the mechanisms that connect explanatory variables with the explained variable, also known as “mediation analysis,” is central to a variety of social-science fields, especially psychology, and increasingly to fields like epidemiology.Recent work on the statistical methodology behind mediation analysis points to limitations in earlier methods. We implement in Stata computational approaches based on recent developments in the statistical methodology of mediation analysis. In particular, we provide functions for the correct calculation of causal mediation effects using several different types of parametric models, as well as the calculation of sensitivity analyses for violations to the key identifying assumption required for interpreting mediation results causally.
摘要:估计解释变量与被解释变量之间的联系机制,也被称为“中介分析”,是各种社会科学领域的核心,尤其是心理学,并逐渐成为流行病学等领域的核心。最近关于中介分析背后的统计方法的工作指出了早期方法的局限性。我们实现了基于中介分析统计方法的最新发展的Stata计算方法。特别是,我们提供了使用几种不同类型的参数模型来正确计算因果中介效应的函数,以及计算违反解释因果中介结果所需的关键识别假设的敏感性分析。
The mediation package is designed to estimate the role of causal mechanisms that transmit the effect of a treatment variable on an outcome. Causal mechanisms are central to many studies in the social and life sciences, and the statistical analysis of mechanisms is widespread.By positing and empirically testing causal mechanisms,scholars can explain why a relationship exists between two variables.The medeff and medsens commands contained in the mediation package implement the procedures described in Imai, Keele, and Tingley (2010a) and Imai, Keele, and Yamamoto (2010c) for a common set of statistical models.
中介包被设计用来评估因果机制的作用,即处理变量对结果的传递影响。因果机制处在许多社会科学和生命科学研究的中心,以及机制的统计分析是普遍存在。通过假设和实证检验因果机制,学者们可以解释为什么两个变量之间存在关系。中介包中包含的medeff和medsens命令实现了这些过程,在Imai, Keele, and Tingley (2010a)和Imai, Keele, and Yamamoto (2010c)等文献中描述一组通用的统计模型。
早期的中介分析方法主要依赖于结构方程建模的一种形式。不幸的是,这些早期的方法并不是从因果推理的正式框架中衍生出来的,也不允许对关键识别假设进行敏感性分析。此外,早期的方法很难正确地扩展到非线性模型,如带有二元结果变量的模型。中介包中的工具允许用户进行敏感性分析,并涵盖处理二元因变量的几种常用统计模型。中介和敏感性分析都用一行语法实现,这使得用户的过程更加简单。在本文中,我们将讨论这些方法的基础以及如何使用中介包。Imai等人(2011)提供了更长的非技术介绍。
因果中介效应、直接处理效应:
在标准设计中,平均因果处理效应ACME或平均直接效应ADE未被识别,处理是随机的或可忽略的条件预处理协变量,中介变量或结果变量是可被测量。这是因为计算间接和直接影响所需的潜在结果从未被观察到。因此需要一个额外的假设:SI。假设可以这样写:
序列可忽略假设:
假设2.1依次应用两个可忽略性假设。在第一步,给定观察到的预处理混杂因素,处理指派被假定为可忽略的统计独立于潜在的结果和潜在的中介。这种假设是常见的,也被称为无混淆性,外生性,或没有遗漏变量偏差。在实验中,因为处理是随机的,所以这个假设是成立的。第二步假设给定实际的处理状态和预处理混杂因素,观察到的中介是可忽略的。虽然第二步类似于标准的外生性假设,但有趣的是,随机化处理和中介并不能确定平均因果处理效应ACME (Imai, Tingley, and Yamamoto即将;Imai等,2011)。
Assumption 2.1 applies two ignorability assumptions sequentially. In the first step, given the observed pretreatment confounders, the treatment assignment is assumed to be ignorable statistically independent of potential outcomes and potential mediators. This assumption is common and is also called unconfoundedness, exogeneity, or no omitted variable bias. In experiments, the assumption is expected to hold because treatment is randomized. The second step assumes given the actual treatment status and pretreatment confounders the observed mediator is ignorable. While the second step is similar to standard exogeneity assumptions, it is interesting to note that randomizing both the treatment and mediator does not identify the ACME (Imai, Tingley, and Yamamoto forthcoming; Imai et al. 2011).
当中介变量和结果变量采用线性模型时,敏感性分析基于方程1和2中的线性结构方程模型。违反SI序列可忽略假设,将导致和之间的相关性,我们由ρ表示(SI下ρ= 0)。如Imai, Keele和Yamamoto (2010c)所示。
序列可忽略假设:一、处理变量分配是随机的,与结果变量和中介变量是相互独立的。二、中介变量在(2)式中满足外生性假设,即M与不相关,而是(1)式中的随机误差项,可见M与不相关等价于和不相关,所以对于序列可忽略性假设是否违反,可通过对和的相关性进行检验而判断!
实例操作:
基于模拟数据的因果中介效应估计:
*Population Valueslocal alpha_2 0.25local alpha_3 0.25local beta_2 0.25local beta_3 0.25local gamma 0.25local x_beta 0.25*Draw realizations of error terms and pretreatment covariate x assuming no correlationmatrix m = (0,0,0)matrix sd = (1,1,1)drawnorm e1 e2 x, n(`n') means(m) sds(sd)*Generate realizations of treatment (T), mediator (M), and outcome (Y)variablesgenerate T = round(runiform(), 1)drop Mgenerate M = 0.25+0.25*T+0.25*x+e1
generate Y = 0.25 + 0.25*T + 0.25*M + 0.25*x + e2*Conduct mediation analysismedeff (regress M T x) (regress Y T M x), treat(T) mediate(M) sims(1000) //Using 0 and 1 as treatment values
平均中介效应ACME为0.067,政策的平均直接效应为0.297。
估计因果中介效应的敏感性分析:
结果表明,当平均因果中介效应ACME的点估计为零时,和相关系数为必须大约为0.23。或者,可以检查R2的乘积对中介和结果模型、残差和总方差的敏感性的测量。
The results show that for the point estimate of the ACME to be zero, the correlation between ei2 and ei3 must be approximately 0.23. Alternatively, the product of R2’s measures of sensitivity for the mediator and outcome models, for the residual and total variance, may be examined.
是否可以认为相关性弱,近似外生?命令的创造者并未再说了!
也可以看这个推文怎么写的,虽然没有给出画图的命令,与这个推文一样,
敏感性检验的结果都与原始的stata文章有略微差异,不知何故!
最近老友问中介变量效应分解的问题,而上一个推文已经介绍:
面对争议,经济学人是否不再使用心理学的老中介效应模型?|stata资料\新R语言资料
还有一个说法来自于:
中介效应中的内生性问题是需要考虑的,但通常情况下,对中介效应进行检验相对困难,顶级期刊JPE和QJE有些文章考虑过中介效应,不过大部分的经济学期刊都是考虑的渠道机制,即将渠道变量作为被解释变量。基本的命令为medeff;另外ivmediate命令也可以使用,此命令与前者在原理上存在差异。当然值得注意的是,中介效应检验后,记得进行敏感性分析。以上两个命令的使用方法如下:Medeff命令:medeff (model depvar varlist) (model depvar varlist) [if] [in] [weight], mediate(varname) treat(varname [# #]) [sims(#) seed(#) vce(vcetype) level(#) interact(varname)]
例如:medeff (regress M T x) (regress Y T M x), mediate(M) treat(T) sims(1000) seed(1)
ivmediate命令:ivmediate depvar [indepvars] [if] [in], mediator(varname) treatment(varname) instrument(varname) [options]
例如:ivmediate y, mediator (m) treatment (t) instrument (z)