我最近也在学习PSM,以下是我的步骤,还请各位大神多多指教
1、确定可以做PSM后,选择协变量
一阶协变量:psestimate treat,totry(x1 x2 x3 x4) noquad
假设得到一阶协变量为x1 x2 x3
二阶协变量:psestimate treat x1 x2 x3,totry (x1 x2 x3 x4) nolin
得到二阶协变量
最后确定的协变量为一阶+二阶的所有变量,下文以Z代替
2、psmatch2 treat Z, outcome(Y) n(1) ate ties logit common 这里以一对一匹配为例
3、pstest Z, both graph 均衡性检验
4、psgraph 共同支撑检验
5、kdensity _pscore if treat==1,addplot (kdensity _pscore if treat==0) 匹配前核密度函数图
kdensity _pscore if treat==1,addplot (kdensity _pscore if _wei!=.) 匹配后核密度函数图
6、敏感性检验(目前还不会,还请大家多多指教)
|