命令和数据都一样,但是前后两次运行结果不一致怎么办?请高手赐教。做平行趋势检验,命令如下,第一次做出来是符合平行趋势检验的,第一次运行的结果是试过很多遍的,按理说也是很稳定的。但中间有事隔了将近一个多月才开始写论文,结果再次运行的时候发现出问题了,运行不出以前的结果了,下面的图片是两次的结果,好像整个样本量都不一致了,但是我并没有动数据,请问到底是哪里出了问题,怎么解决呢?
gen x=0
replace x=1 if year>=policy_year
gen treat=0
replace treat=1 if policy_year!=.
set more off
xtset id year
gen distance=year-policy_year
tab distance, missing
forvalues i=1/6 {
gen d_`i' = 0
replace d_`i' = 1 if treat== 1 & distance== -`i'
}
forvalues i=1/6 {
gen d`i' = 0
replace d`i' = 1 if treat== 1 & distance== `i'
}
gen current = 0
replace current = 1 if treat== 1 & distance== 0
xtreg gdp d_5 d_3 d_4 d_2 d_1 current d1 d2 d3 d4 d5 d6 i.year uni_student road lnfin invest lntrade lnloan, fe r
第一次结果:
第二次结果: