请注明:姓名-公司-职位
以便审核进群资格,未注明则拒绝
对每个id,样本期间均为2000-2003年。想得到连续3年ex=1; 连续2年ex=1的id个数。
fgleric 发表于 2012-12-16 04:58 如果你panel data 是balance的,可以尝试下面的方法 input id year ex
sungmoo 发表于 2012-12-16 10:02 bys id (year): egen s=mean(ex[1]+ex[2]*2+ex[3]*4+ex[4]*8) collapse s,by(id) count if s==7|s==14| ...