其他
倾向得分匹配:teffects psmatch
1
命令简介
Stata没有一个内置的倾向评分匹配的命令,一种非实验性的抽样方法,它产生一个控制组,它的协变量分布与被处理组的分布相似。但是,这个方法有几个用户编写的模块。以下是最受欢迎的模块(主要有如下几个外部命令)
psmatch2.ado
pscore.ado
nnmatch.ado
在 Stata 命令中,psmatch2 是较早出现的PSM非官方命令。本文主要介绍如何使用Stata官方的PSM命令Teffects psmatch。
2
语法格式
teffects语法格式为:
help teffects
teffects psmatch (ovar) (tvar tmvarlist [, tmodel]) [if] [in] [weight] [, stat options]
选项含义为:
ovar 结果变量
tvar 处理变量
tmvarlist 预测变量
logit指定使用logit模型进行拟合,默认的是probit模型;
选择项“atet”表示估计“参与者平均处理效应”(Average Treatment Effect on the Treated),默认为ATE。
ATE表示估计所有个体的“平均处理效应”
nneighbor(#)指定每个观察的匹配数量;默认是nneighbor (1),即一对一匹配
3
操作应用
下面以 Stata 自带的数据集 cattaneo2.dta 为例。
1、导入数据
use "C:\Users\admin\Desktop\cattaneo2.dta", clear
2、查看数据
. desc
Contains data from C:\Users\admin\Desktop\cattaneo2.dta
obs: 4,642 Excerpt from Cattaneo (2010) Journal of Econometrics 155: 138-154
vars: 23 14 Jan 2015 09:49
size: 116,050
--------------------------------------------------------------------------------------------------------------------------------------
storage display value
variable name type format label variable label
--------------------------------------------------------------------------------------------------------------------------------------
bweight int %9.0g 婴儿出生体重
mmarried byte %10.0g mmarried 母亲是否结婚
mhisp byte %9.0g 1 if mother hispanic
fhisp byte %9.0g 1 if father hispanic
foreign byte %9.0g 1 if mother born abroad
alcohol byte %9.0g 1 if alcohol consumed during pregnancy
deadkids byte %9.0g previous births where newborn died
mage byte %9.0g 母亲年龄
medu byte %9.0g 母亲的教育年限
fage byte %9.0g father's age
fedu byte %9.0g father's education attainment
nprenatal byte %9.0g number of prenatal care visits
monthslb int %9.0g months since last birth
order byte %9.0g order of birth of the infant
msmoke byte %27.0g smoke2 cigarettes smoked during pregnancy
mbsmoke byte %9.0g mbsmoke 怀孕期母亲是否抽烟
mrace byte %9.0g 1 if mother is white
frace byte %9.0g 1 if father is white
prenatal byte %9.0g trimester of first prenatal care visit
birthmonth byte %9.0g month of birth
lbweight byte %9.0g 1 if low birthweight baby
fbaby byte %9.0g YesNo 是否第一胎
prenatal1 byte %9.0g YesNo 1 if first prenatal visit in 1 trimester
--------------------------------------------------------------------------------------------------------------------------------------
Sorted by:
3、描述性分析
. tabstat bweight ,statistics(count mean sd min max) by(mbsmoke )
Summary for variables: bweight
by categories of: mbsmoke (怀孕期母亲是否抽烟)
mbsmoke | N mean sd min max
----------+--------------------------------------------------
nonsmoker | 3778 3412.912 570.6871 340 5500
smoker | 864 3137.66 560.8931 397 5018
----------+--------------------------------------------------
Total | 4642 3361.68 578.8196 340 5500
-------------------------------------------------------------
4、下面进行一对一匹配
teffects psmatch (bweight) (mbsmoke mmarried c.mage##c.mage fbaby medu)
结果为: