温馨提示: 定期 清理浏览器缓存,可以获得最佳浏览体验。
作者:秦利宾 (厦门大学)
邮箱:qlb150@163.com
Heckman 模型:你用对了吗?
目录
社会科学数据大部分都是非随机分配,使得选择模型在研究中的作用越来越重要,编辑和审稿人也通常会要求作者控制内生性和选择偏差。但是,学者在使用中也存在一些问题,如忽视了排他性约束变量的重要性。选择模型通常很脆弱,任意或不设排他性约束变量,会使得结论非常不稳健。接下来,将针对该问题予以说明,并提供一些有益的建议。
选择模型有两种主要应用,一是 处理效应 (treatment effect model),即回归模型中包含一个内生的指示变量 (
处理效应模型 (treatment effect model) 如下:
其中,
如果
通常,式 (1) 和式 (2) 的随机误差项
如果随机误差项
其中,
此时,式 (3) 中随机误差项
上述为处理效应模型 (treatment effect model),除式 (3) 是以子样本回归外,样本选择模型与处理效应模型 (sample selection model)类似。例如,对管理层预测精确度 (
或者,对于
选择模型式 (3) 与 OLS 模型式 (1) 的区别在于前者加入了逆米尔斯比率 (
其中,
排他性约束变量,也就是
找到一个好的
由于只能通过
在式 (3) 中,
进一步,高的共线性会产生以下两个问题:
高共线性会使得系数的标准差变大,降低了系数的显著性。
在模型被正确设定下,即使存在高的共线性问题,系数也可以被无偏的估计。但是,事实上,选择模型被错误设定概率是很高的。若模型被错误设定,共线性会吸收这种偏差,导致系数估计有偏。
接下来,以审计机构是否是前 5 大对审计费用的研究为例,说明 没有排他性约束变量 和 任意排他性约束变量 对结果的影响。为了说明前者,将第一阶段回归中所有自变量都包括在第二阶段回归中。为了说明后者,将第一阶段中企业规模从第二阶段排除。
下表为选择模型第一阶段回归结果,其中被解释变量为是否是前五大审计机构,Model 1 是以总资产自然对数衡量公司规模,Model 2 是以营业收入自然对数衡量公司规模。
下表 (1)-(4)为选择模型第二阶段回归结果,(5) 和 (6) 普通 OLS 回归结果,其中,被解释变量为审计费用自然对数,(1) 和 (2) 中的
从结果可以看出,在选择模型第二阶段,
下表为 2000-2009 年会计顶级期刊使用选择模型情况的描述统计。在选择模型第二阶段,有 54 篇具有一个或多个排除约束变量,有 6 篇同时报告了具有和不具有排他性约束变量结果;有 3 篇报告了使用不同排除约束变量的稳健性结果;有3篇报告了排除约束变量经济机制;有3篇报告了内生性变量和
以工作和教育经历对女性工资影响研究为例,只有参加工作的女性工资数据才能被观察到,而未参加的工作女性工资数据缺失,因此在研究女性工资影响因素时存在偏差。为克服该问题,采用选择模型进行处理。第一阶段,选择女性是否结婚 (married) 和孩子数量 (children) 作为排他性约束
* 下载数据值当前工作路径
* 网址: https://gitee.com/arlionn/data
. copy "https://gitee.com/arlionn/data/raw/master/data01womenwk.dta" womenwk.dta
*-调入数据
. use womenwk.dta, clear
/* 也可以在线导入数据
. use "https://gitee.com/arlionn/data/raw/master/data01/womenwk.dta", clear
*/
*ols
reg wage educ age
est store OLS
*heckman maximum likelihood
heckman wage educ age, select(married children educ age) //默认最大似然估计
est store HeckMLE
*heckman two-step all-in-one 不可以进行cluster调整
heckman wage educ age, select(married children educ age) twostep
est store Heck2s
*heckman two-step step-by-step 可以进行cluster调整
probit work married children educ age
est store First
predict y_hat, xb
gen pdf = normalden(y_hat) //概率密度函数
gen cdf = normal(y_hat) //累积分布函数
gen imr = pdf/cdf //计算逆米尔斯比率
reg wage educ age imr if work == 1 //女性工作子样本
est store Second
vif //方差膨胀因子
*对比结果
local m "OLS HeckMLE Heck2s First Second"
esttab `m', mtitle(`m') nogap compress pr2 ar2
---------------------------------------------------------------------------
(1) (2) (3) (4) (5)
OLS HeckMLE Heck2s First Second
---------------------------------------------------------------------------
main
education 0.897*** 0.990*** 0.983*** 0.0584*** 0.983***
(18.00) (18.59) (18.23) (5.32) (19.46)
age 0.147*** 0.213*** 0.212*** 0.0347*** 0.212***
(7.83) (10.34) (9.61) (8.21) (10.25)
married 0.431***
(5.81)
children 0.447***
(15.56)
imr 4.002***
(6.93)
_cons 6.085*** 0.486 0.734 -2.467*** 0.734
(6.84) (0.45) (0.59) (-12.81) (0.63)
---------------------------------------------------------------------------
select
married 0.445*** 0.431***
(6.61) (5.81)
children 0.439*** 0.447***
(15.79) (15.56)
education 0.0557*** 0.0584***
(5.19) (5.32)
age 0.0365*** 0.0347***
(8.79) (8.21)
_cons -2.491*** -2.467***
(-13.16) (-12.81)
---------------------------------------------------------------------------
/
athrho 0.874***
(8.62)
lnsigma 1.793***
(64.95)
---------------------------------------------------------------------------
/mills
lambda 4.002***
(6.60)
---------------------------------------------------------------------------
N 1343 2000 2000 2000 1343
adj. R-sq 0.252 0.278
pseudo R~q 0.189
---------------------------------------------------------------------------
t statistics in parentheses
* p<0.05, ** p<0.01, *** p<0.001
. vif //方差膨胀因子
Variable | VIF 1/VIF
-------------+----------------------
imr | 1.39 0.719868
age | 1.31 0.764000
education | 1.10 0.906166
-------------+----------------------
Mean VIF | 1.27
以女性工会成员身份对工资影响研究为例。女性是否加入工会是一种自选择行为,会受到许多因素影响。为克服该问题,采用选择模型进行处理。第一阶段,选择女性是否生活在南方州 (south) 作为排他性约束
*--------------处理效应模型-------------
* 下载数据值当前工作路径
* 网址: https://gitee.com/arlionn/data
. copy "https://gitee.com/arlionn/data/raw/master/data01/union3.dta" union3.dta
*-调入数据
. use union3.dta, clear
/* 也可以在线导入数据
. use "https://gitee.com/arlionn/data/raw/master/data01/union3.dta", clear
*/
*ols
reg wage age grade smsa black tenure union
est store OLS
*etregress maximum likelihood
etregress wage age grade smsa black tenure, ///
treat(union = south black tenure) twostep
est store etrMLE
*etregress two-step all-in-one 不可以进行cluster调整
etregress wage age grade smsa black tenure, ///
treat(union = south black tenure) twostep
est store etr2s
*etregress two-step step-by-step 可以进行cluster调整
probit union south black tenure
est store First
predict y_hat, xb
gen pdf = normalden(y_hat)
gen cdf = normal(y_hat)
gen imr1 = pdf/cdf //union = 1算法
gen imr2 = (-pdf) / (1 - cdf) //union = 0算法
gen imr = imr1
replace imr = imr2 if union == 0
reg wage age grade smsa black tenure union imr
est store Second
vif
*对比结果
local m "OLS etrMLE etr2s First Second"
esttab `m', mtitle(`m') nogap compress pr2 ar2
---------------------------------------------------------------------------
(1) (2) (3) (4) (5)
OLS etrMLE etr2s First Second
---------------------------------------------------------------------------
main
age 0.148*** 0.154*** 0.154*** 0.154***
(7.56) (7.92) (7.92) (7.94)
grade 0.437*** 0.423*** 0.423*** 0.423***
(14.82) (14.56) (14.56) (14.35)
smsa 0.975*** 0.863*** 0.863*** 0.863***
(7.79) (6.71) (6.71) (6.79)
black -0.618*** -0.921*** -0.921*** 0.440*** -0.921***
(-4.94) (-5.19) (-5.19) (4.52) (-6.45)
tenure 0.212*** 0.100 0.100 0.0998*** 0.100*
(6.26) (1.93) (1.93) (4.22) (2.37)
union 1.004*** 4.564*** 4.564*** 4.564***
(7.50) (4.53) (4.53) (5.45)
south -0.490***
(-5.24)
imr -2.093***
(-4.31)
_cons -4.326*** -4.670*** -4.670*** -0.968*** -4.670***
(-8.14) (-8.65) (-8.65) (-12.97) (-8.75)
---------------------------------------------------------------------------
union
south -0.490*** -0.490***
(-5.24) (-5.24)
black 0.440*** 0.440***
(4.52) (4.52)
tenure 0.0998*** 0.0998***
(4.22) (4.22)
_cons -0.968*** -0.968***
(-12.97) (-12.97)
---------------------------------------------------------------------------
hazard
lambda -2.093*** -2.093***
(-3.61) (-3.61)
---------------------------------------------------------------------------
N 1210 1210 1210 1210 1210
adj. R-sq 0.337 0.346
pseudo R~q 0.046
---------------------------------------------------------------------------
t statistics in parentheses
* p<0.05, ** p<0.01, *** p<0.001
. vif
Variable | VIF 1/VIF
-------------+----------------------
union | 40.76 0.024532
imr | 39.72 0.025173
tenure | 1.79 0.558305
black | 1.37 0.730327
age | 1.14 0.878075
grade | 1.08 0.928859
smsa | 1.06 0.939479
-------------+----------------------
Mean VIF | 12.42
关于选择模型 all-in-one 和 step-by-step 两种方法差别,参考 Heckman Two-Step Model 和 Stata commands to do Heckman two steps。关于选择模型第一阶段是否要包含第二阶段全部外生解释变量,请参考 工具变量法(五): 为何第一阶段回归应包括所有外生解释变量,值得注意的是,选择模型中
选择模型要有排他性约束变量,即在第一阶段回归中包含,而在第二阶段回归中排除。
选择模型要报告第一阶段回归结果,否则不清楚哪个变量是排他性约束变量或评估排他性约束变量的解释能力。
需要证明为什么排他性约束变量,即
由于选择模型是脆弱的,敏感性分析是必要的,如与不同排他性约束变量结果和OLS 结果对比、以及报告内生性变量和逆米尔斯比率的 VIF 值。
在使用过程中,可以综合借鉴 Lennox and Francis(2012)1,Kim and Zhang(2016)2,李小荣和刘行 (2012)3。
最后,借用文章作者原话予以总结。
In short, researchers are faced with the following trade-off. On the one hand, selection models can be fragile and suffer from multicollinearity problems, which hinder their reliability. On the other hand, the selection model potentially provides more reliable inferences by controlling for endogeneity bias if the researcher can find good exclusion restrictions, and if the models are found to be robust to minor specification changes. The importance of these advantages and disadvantages depends on the specific empirical setting, so it would be inappropriate for us to make a general statement about when the selection model should be used. Instead, researchers need to critically appraise the quality of their exclusion restrictions and assess whether there are problems of fragility and multicollinearity in their specific empirical setting that might limit the effectiveness of selection models relative to OLS.
[3] 李小荣, 刘行. CEO vs CFO: 性别与股价崩盘风险[J]. 世界经济, 2012, 12: 102-129.
连享会-直播课 上线了!
http://lianxh.duanshu.com
免费公开课:
直击面板数据模型 - 连玉君,时长:1小时40分钟 Stata 33 讲 - 连玉君, 每讲 15 分钟. 部分直播课 课程资料下载 (PPT,dofiles等)
支持回看,所有课程可以随时购买观看。
专题 | 嘉宾 | 直播/回看视频 |
---|---|---|
⭐ 最新专题 ⭐ | DSGE, 因果推断, 空间计量等 | |
⭕ Stata数据清洗 | 游万海 | 直播, 2 小时,已上线 |
研究设计 | 连玉君 | 我的特斯拉-实证研究设计,-幻灯片- |
面板模型 | 连玉君 | 动态面板模型,-幻灯片- |
面板模型 | 连玉君 | 直击面板数据模型 [免费公开课,2小时] |
Note: 部分课程的资料,PPT 等可以前往 连享会-直播课 主页查看,下载。
关于我们
课程, 直播, 视频, 客服, 模型设定, 研究设计, stata, plus, 绘图, 编程, 面板, 论文重现, 可视化, RDD, DID, PSM, 合成控制法
等
连享会小程序:扫一扫,看推文,看视频……
扫码加入连享会微信群,提问交流更方便
✏ 连享会学习群-常见问题解答汇总:
✨ https://gitee.com/arlionn/WD