查看原文
其他

Generalized分位数回归, 新的前沿因果推断方法

计量经济圈 计量经济圈 2019-06-30

欢迎投稿(荐稿)计量经济圈,计量相关都行

箱:econometrics666@sina.cn

copyrights@计量经济圈(ID: econometrics666); 相关do文件和重要材料都放在咱们的知识社群, 可以进入社群提取直接使用。

在经济学研究中,参与一个培训项目会对不同的收入群体产生不同的影响,那我们该怎么去测度这个异质性呢?(这只是一个简单二值政策变量,后面我们还要说到多值政策效应的问题。)当然,我们会想到分位数回归,因为传统的mean回归就是分位数回归的一个特例。


那如果我们参与一个培训项目是具有内生性或者自选择性,因为高收入群体有时候更有可能参与一个培训项目,那这种heckman类型的自选择性问题就出现了。当然,我们会想到使用工具变量分位数回归,可以给这个内生的政策虚拟变量找到一个工具变量。你可以使用ivqreg


可有个问题是,我们传统的分位数回归实际上是条件期望回归,就是说我们需要基于在模型中的协变量这个条件来解释我们的系数。一旦我们改变协变量,比如增加或减少某个协变量,那我们对这个回归方程的系数解释就需要发生变化。尽管在实证中很多人用条件分位数进行回归,但解释仍然用无条件期望那一套进行解释。


理解一下这个slide说的道理:

看看下面的Table 3,上面是通过条件IVQR估计的政策效应,而下面是通过GQR估计的政策效应,是不是有很大的区别。


还有很多圈友问了,那如果我的政策变量不止一个,比如培训项目是一个政策变量,那失业保险金也是一个政策变量,二个政策变量同时对一个人的收入产生影响,该怎么去评估这些政策效应呢?又或者我的政策变量不是一个二元虚拟变量,它可能是一个有序变量或者干脆是连续变量,那咋办呢?


这些问题在因果推断或政策评估中都是需要解决的。下面将要引入的这个generalized quantile regression就是对上面问题提出一般化解决思路。它是一个无条件期望回归,就是说不管你的协变量增加了多少,我得到的依然是无条件的政策处理效应。它还可以去处理你的政策变量是有序的或者连续的情形,也可以处理你的多个政策变量的情形。毕竟这是广义分位数回归,它还可以处理面板分位数回归。广义分位数回归压根就不太理会你是把协变量当成政策变量,还是把政策变量当成协变量。


看看这个论文的解释:genqreg can be used to fit the generalized quantile regression estimator developed in Powell (2016).  The generalized quantile estimator addresses a fundamental problem posed by traditional quantile estimators: inclusion of additional covariates alters the interpretation of the estimated coefficient on the treatment variable. 


As detailed in Powell (2016), the generalized quantile estimator implemented by genqreg addresses this problem and produces unconditional quantile treatment effects even in the presence of additional control variables. A special case of generalized quantile regression is quantile regression with panel data (see Powell (2015)); quantile regression with panel data can also be estimated using genqreg.


Numerical optimization proceeds via a Nelder-Mead algorithm. As estimation and calculation of standard errors can sometimes pose numerical challenges, the user can estimate generalized quantile regressions using Markov Chain Monte Carlo methods or grid-search methods.


下面我们来执行一下这个命令,看到底是什么样子的结果。


**安装一下这个命令

ssc install genqreg  //如果这种方式不行,那就使用这个链接:https://ideas.repec.org/c/boc/bocode/s458158.html


**获得数据

use "http://fmwww.bc.edu/repec/bocode/j/jtpa.dta"

keep if sex==1  // 性别男性


**主要是看参与培训项目是不是对不同区间的人造成了不同的收入效应

qreg earnings training hsorged black hispanic married wkless13 class_tr ojt_jsa ///

age2225 age2629 age3035 age3644 age4554 f2sms, q(85) vce(robust) //第85分位数的回归


**用了MCMC优化方法求解

genqreg earnings training hsorged black hispanic married wkless13 class_tr ojt_jsa ///

age2225 age2629 age3035 age3644 age4554 f2sms, q(85) optimize(mcmc) noisy draws(10000) burn(3000) arate(.5)


**这里使用了工具变量assignment来处理training的内生性问题,注意所有的协变量也放到了instrument,这与ivregress原理一样

genqreg earnings training hsorged black hispanic married wkless13 class_tr ///

ojt_jsa age2225 age2629 age3035 age3644 age4554 f2sms, q(85)instruments(assignmt hsorged black ///

hispanic married wkless13 class_tr ojt_jsa age2225 age2629 age3035 age3644 age4554 f2sms)


比较一下条件分位数回归和广义分位数回归的结果:

可以把后面这几段话读一下,再领会一下“广义分位数回归”的一般化到底体现在哪些地方。


We introduce a new flexible framework for estimation of unconditional quantile treatment effects and a corresponding generalized quantile regression estimator. The estimator provides consistent estimates of quantile treatment effects, even in the presence of covariates, for one of more treatment variables, which may be discrete or continuous. These properties distinguish the estimator from alternatives found in the literature. Conditional quantile estimators require altering the structural quantile function to include additional covariates. 


The GQR estimator allows one to condition on a separate set of covariates without altering the quantile function. Conditional quantile models assume that the relationship between the treatment variables and the outcome varies based only on unobserved factors and,consequently, the interpretation of the parameters changes as some of these factors become observed (i.e., covariates are added to the quantile function). This paper’s model assumes

that the treatment effects vary based on a nonseparable term which is a function of both  observed and unobserved factors. Similar to mean regression, adding covariates when using GQR does not drastically alter the interpretation of the estimates (beyond their effect on

the plausibility of the identification assumptions).


Typically, researchers include control variables for the purposes of identification and do not necessarily want the interpretation of the estimates to change. In fact, much empirical work interprets conditional QTEs as the impact of the treatment variables on the unconditional outcome distribution. GQR provides a straightforward method to estimate unconditional QTEs when the treatments or instruments are conditionally exogenous. QR and IVQR are special cases of the estimator introduced in this paper. Furthermore, distri-

bution regression can also be nested in the framework.


Simulation results illustrate the usefulness of the GQR estimator given simple data generating processes with properties that likely resonate with applied researchers. I also apply the estimator to study the effect of temporary and direct-hire job placement on labor earnings. Given that the quantile function includes two endogenous variables, existing methods estimating unconditional QTEs for a single binary treatment are not applicable (or potentially difficult to apply). The literature has estimated conditional QTEs for this application, but the unconditional QTEs suggest that these understate the positive effects

of direct-hire placements on the lower part of the earnings distribution.


Many economic models imply heterogeneous effects of policies, motivating analysis which permits the treatment effects to vary throughout the outcome distribution. GQR provides an appropriate method to estimate quantile treatment effects and counterfactual distributions under different policies and should be useful broadly to estimate such heterogeneity.


面板数据分位数回归qregpd主要是解决了additive fixed effect带来的问题,在这里不进行详细介绍了,do文件里和相应材料都放在计量社群里,可以提取使用。


计量经济圈是中国计量第一大社区,我们致力于推动中国计量理论和实证技能的提升,圈子以海内外高校研究生和教师为主。计量经济圈六多精神:计量资料多,社会科学数据多,科研牛人多,名校人物多,热情互助多,前沿趋势多。如果你热爱计量并希望长见识,那欢迎你加入到咱们这个大家庭戳这里,要不然你只能去其他那些Open access圈子了。注意:进去之后一定要看小鹅社群“群公告”,不然接收不了群息,也不知道怎么进入咱们的微信群和计量论坛。


帮点击一下下面的小广告,谢谢支持!

    您可能也对以下帖子感兴趣

    文章有问题?点此查看未经处理的缓存