全部版块 我的主页
论坛 计量经济学与统计论坛 五区 计量经济学与统计软件
10951 9
2020-06-30
倾向性得分匹配PSM怎么控制行业和年份?怎么把PSM和fixed effect模型合并在一起呢?

我一开始写的code是这样的:
psmatch2 gender x1 x2 x3 x4 i.year i.industry, outcome(Y) n(4) cal(0.01) ate ties logit common


但是我导师说不能用i.year i.industry ,要用if。他的原话是这样的:
Your PSM matching (logistic) regression needs some fine tuning: you are not matching correctly on industry and year. As per your current code, the closest year and industry match will be sought, which is wrong because in case of these two variables we want an EXACT match. For this you need to write a loop and use and “if” statement for an exact match on industry and year.  

于是我上网查了一下,是不是要把code改成这样?  但是跑不出结果,求大神指教!!
forvalues i =1/48{
quietly psmatch2 gender x1 x2 x3 x4 if indsutry == `i', outcome(Y) n(4) ate ties logit common                  
}




二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

全部回复
2020-6-30 18:28:19
更正一下,这个应该不是控制行业和年份,应该是叫做按行业和年份分组,我查了一下官方给的code是这样的:
The following code illustrates how to match within exact cells and then calculate the average effect for the whole population.

        g att = .
        egen g = group(groupvars)
        levels g, local(gr)
        qui foreach j of local gr {
                psmatch2 treatvar varlist if g==`j', out(outvar)
                replace att = r(att) if  g==`j'
        }
        sum att


但是我还是跑不数来结果,结果显示 qui foreach j of local gr {
no observations
r(2000);

求会的大神指教啊!
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2020-7-2 17:13:55
6825000514 发表于 2020-6-30 18:28
更正一下,这个应该不是控制行业和年份,应该是叫做按行业和年份分组,我查了一下官方给的code是这样的:
...
请问您解决了吗
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2020-7-2 17:17:20
我也需要固定年份行业,但我不知道怎么办
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2020-8-2 13:44:23
楼主可以加你微信么,我的 17824831376,想请教你
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2020-8-20 11:37:45
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

点击查看更多内容…
相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群