用循环语句试图让stata处理数据,但是既不报错也不出结果,真是奇怪,求各路大侠支招
语句如下
forvalues i = 0(1)1854783 {
if gvkey`i+1' == gvkey`i' {
gen ainvtq`i+1' = 0.5*(invtq`i+1'+invtq`i')
}
else if gvkey`i+1' != gvkey`i' {
gen ainvtq`i+1' = invtq`i+1'
}
}