gen policy = year - year1
replace policy = -4 if policy <= -4
replace policy = 7 if policy >= 7
gen policy_d = policy + 4
xtreg IDProportion ib4.policy_d i.year, fe vce(cluster id)
forvalues i = 0/3{
gen b_`i' = _b[`i'.policy_d]
}
gen avg_coef = (b_0+b_3+b_2+b_1)/4
su avg_coef
coefplot, baselevels
drop(*.wrkyr _cons policy_d)
出现错误
factor-variable and time-series operators not allowed
r(101);
是为什么呀?