首页 > 编程知识 正文

倾向性匹配评分的样本量,倾向得分匹配法 理解

时间:2023-05-03 07:02:58 阅读:11050 作者:3710

原题:一文解读倾向得分匹配法(PSM )例及stata实现(一) ) ) ) )。

一、趋势一致得分应用训练对工资的效果

政策背景:国家支持工作示范项目(National Supported Work,NSW ) )。

研究目的:验证接受或不接受该项(培训)对工资的影响。 基本思想:分析接受培训组(处理组、培训组)接受培训行为与不接受培训行为的工资绩效差异。 但是,现实中可以观测到的是处理组正在接受培训的事实,无法观测到处理组没有接受培训会怎么样,这种状态也将成为相反的事实(counterfactual )。

匹配法是解决这种不可观测事实的方法。 在趋势得分匹配方法(Propensity Score Matching )中,基于处理指示变量将样本分为处理组,在本例中为在NSW实施后接受训练组这两组; 二是对照组(comparison group ),在本例中为NSW实施后不接受训练的组。 倾向分数匹配方法的基本思路是:处理组与对照组样本按一定方法匹配后,在其他条件完全相同的情况下,根据接受培训组(处理组)与未接受培训组(对照组)的工资绩效差异,进行培训的行为和工资

注:本例为CameronTrivedi 《微观计量经济学:方法与应用》 (中译,上海财经大学出版社,2010 ) pp794-800的所有数据和步骤均为本文档的辅助网站(http://Cameron.econ.UC Davis.edu/MMA

二.变量介绍

说明性分析

tabulate t,summarize(re78 ) means标准

三.趋势匹配得分操作

数据介绍: datausedbylalonde(1986 )。 weareinterestedinthepossibleectofparticipationinajobtrainingprogramonindividualsearningsin 1978 thisdatasethasbeenusedbymanyayau tin

四.详细介绍

set seed 20180105 //生成随机数种子

gen u=runiform

sort u //排序

或订单u

这是因为上述指令生成伪随机数,满足0.1的均匀分布

localv1 't '

local v2 ' ageedublackhispmarriedre 74 re 75 u 74 u 75 '

globalx '`v1' `v2 ' '

psmatch2 $x,out(re78 ) neighbor(1)1) ate ties logit common //1:1匹配

$表示引用宏变量,

psmatch2 $x,out(re78 ) neighbor(1)1) ate ties logit common //1:1只

中选择所需的墙类型

PS匹配2 tageedublackhispmarriedre 74 re 75 u 74 u 75,out(re78 ) neighbor(1) ate ties logit common

让我们使用pstest来检查匹配效果是否平衡了数据

PS匹配2 tageedublackhispmarriedre 74 re 75 u 74 u 75,out(re78 ) neighbor(1) ate ties logit common //1:1只

pstestageedublackhispmarriedre 74 re 75 u 74 u 75,both graph

PS图形

五. PSM命令介绍

statadoesnothaveabuilt-incommandforpropensityscorematching,a

non-experimental method of sampling that produces a control group whose distribution of covariates is similar to that of the treated group. However, there are several user-written modules for this method. The following modules are among the most popular:

Stata没有一个内置的倾向评分匹配的命令,一种非实验性的抽样方法,它产生一个控制组,它的协变量分布与被处理组的分布相似。但是,这个方法有几个用户编写的模块。以下是最受欢迎的模块(主要有如下几个外部命令)

psmatch2.ado

pscore.ado

nnmatch.ado

psmatch2.ado was developed by Leuven and yydzjy (2003) and pscore.ado by Becker and Ichino (2002). More recently, Abadie, Drukker, Herr, and Imbens (2004) introduced nnmatch.ado. All three modules support pair-matching as well as subclassification.

You can find these modules using the .net command as follows:

net search psmatch2

net search pscore

net search nnmatch

You can install these modules using the .ssc or .net command, for example:

ssc install psmatch2, replace

After installation, read the help files to find the correct usage, for example:

help psmatch2

上述主要介绍了如何获得PSM相关的命令,总结一下目前市面上用的较好的命令为psmatch2.

PSM 相关命令

help psmatch2

help nnmatch

help psmatch

help pscore

持续获取最新的 PSM 信息和程序

findit propensity score

findit matching

psmatch2 is being continuously improved and developed. Make sure to keep your version up-to-date as follows

ssc install psmatch2, replace

where you can check your version as follows:

which psmatch2

语法格式

help psmatch2

psmatch2 depvar [indepvars] [if exp] [in range] [, outcome(varlist)

pscore(varname) neighbor(integer) radius caliper(real)

mahalanobis(varlist) ai(integer) population altvariance

kernel llr kerneltype(type) bwidth(real) spline

nknots(integer) common trim(real) noreplacement

descending odds index logit ties quietly w(matrix) ate]

where indepvars and mahalanobis(varlist) may contain factor variables;

see fvvarlist.

psmatch2 D x1 x2 x3, outcome(y)

pscore(varname) neighbor(integer) radius caliper(real)

mahalanobis(varlist) ai(integer) population altvariance

kernel llr kerneltype(type) bwidth(real) spline

nknots(integer) common trim(real) noreplacement

descending odds index logit ties quietly w(matrix) ate]

核匹配 (Kernel matching)

其他匹配方法

广义精确匹配(Coarsened Exact Matching) || help cem

局部线性回归匹配 (Local linear regression matching)

样条匹配 (Spline matching)

马氏匹配 (Mahalanobis matching)

◆◆◆◆

点击上图查看:

Stata寒假研讨班_2020年1月15日——1月18日_第14届“高级计量经济学及stata应用”研讨班@北京专场返回搜狐,查看更多

责任编辑:

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。