倾向性得分匹配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
}