全部版块 我的主页
论坛 计量经济学与统计论坛 五区 计量经济学与统计软件 Stata专版
6521 4
2016-04-07
处理变量rank==1与控制组变量rank==0,想要实现rank==1的一对一匹配。如何控制年份、行业后再依据其他变量得到pscore值进行匹配?
match.xlsx
大小:(3.54 MB)

 马上下载

具体的stata要怎么写呢?用了psmatch2 lev ta mtv growth roa q return,outcome(rank) n(1) ate ties logit common ,但结果有时候会显示outcome does not vary; remember:
                                  0 = negative outcome,
        all other nonmissing values = positive outcome
是什么意思?有时候没有,但是如果ATT做出来不显著怎么办,自助匹配bootstrap得出的ATT以及ATU都不显著怎么办?谢谢!
二维码

扫码加我 拉你入群

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

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

全部回复
2016-4-8 00:58:07
逆风的人人人 发表于 2016-4-7 16:33
处理变量rank==1与控制组变量rank==0,想要实现rank==1的一对一匹配。如何控制年份、行业后再依据其他变量得 ...
问问题还卖论坛币,我也是醉了
二维码

扫码加我 拉你入群

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

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

2016-4-8 11:56:47
问了别人,说是在logit后者是probit回归的时候控制了年份跟行业,psmatch2就不用再控制了
二维码

扫码加我 拉你入群

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

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

2016-4-8 11:57:22
颦兮蹙兮 发表于 2016-4-8 00:58
问问题还卖论坛币,我也是醉了
还好只是醉了,乱点的哈哈
二维码

扫码加我 拉你入群

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

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

2016-4-9 19:39:56
最后还是不知道如何用pamatch2来解决问题,helo psmatch2里有如下一段Matching within strata

    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
但我还是没改好,应该是能实现分组匹配的。由于我想实现的是1:1匹配,在论坛上看到不错的帖子,改了变量就能用了。
bys year ind rank (stkcd):g exp=_n if rank
bys year ind :egen s=max(exp)
drop if s==.
expandcl s if !rank,cl(year stkcd) gen(g)
bys year stkcd:replace exp=_n if !rank
bys year ind exp:egen r=sum(pscore*rank)
g q=abs((pscore-r)/r) if !rank

su exp
loc m=r(max)
forv i=1/`m'{
bys year ind rank (q exp stkcd): g exps=exp[`i'] if !rank
bys year ind rank (q exp stkcd): g stkcds=stkcd[`i'] if !rank
bys year ind rank (q exp stkcd): replace q=. if exp==exps&_n>`i'
bys year ind rank (q exp stkcd): replace q=. if stkcd==stkcds&_n>`i'
drop exps stkcds
}
drop if q==.&!rank

bys year ind exp:egen u=min(q) if !rank
drop if u!=q&!rank
egen mat=group(year ind exp)
drop exp-u
sort mat rank
详情见https://bbs.pinggu.org/thread-498689-2-1.html。希望stata大神能把分组匹配的语句给举例说明下。
二维码

扫码加我 拉你入群

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

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

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

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