gen Indcd=1 if strmatch( Industry,"A")
replace Indcd=2 if strmatch( Industry,"B")
replace Indcd=3 if strmatch( Industry,"C0")
replace Indcd=4 if strmatch( Industry,"C1")
replace Indcd=5 if strmatch( Industry,"C2")
replace Indcd=6 if strmatch( Industry,"C3")
replace Indcd=7 if strmatch( Industry,"C4")
replace Indcd=8 if strmatch( Industry,"C5")
replace Indcd=9 if strmatch( Industry,"C6")
replace Indcd=10 if strmatch( Industry,"C7")
replace Indcd=11 if strmatch( Industry,"C8")
replace Indcd=12 if strmatch( Industry,"C9")
replace Indcd=13 if strmatch( Industry,"D")
replace Indcd=14 if strmatch( Industry,"E")
replace Indcd=15 if strmatch( Industry,"F")
replace Indcd=16 if strmatch( Industry,"G")
replace Indcd=17 if strmatch( Industry,"H")
replace Indcd=18 if strmatch( Industry,"J")
replace Indcd=19 if strmatch( Industry,"K")
replace Indcd=20 if strmatch( Industry,"L")
replace Indcd=21 if strmatch( Industry,"M")
gen inv=.
forvalues i=2008/2012 {
forvalues j=1/21 {
reg NewInvt TobinQ AReturn Cash Age LagInvest SIZE LEV,if year=='i' & Indcd=='j'
predict e,resid
replace inv=e if year=='i' & Indcd=='j'
drop e
}
}
循环的时候现实“option if not allowed”
哪里出问题了啊?