egen t = group(year)
sum t
local Nt = r(max)
egen s = group(sic)
sum s
local Ns = r(max)
gen DAC= .
global X invA DS_DAR PPE2
forvalues t = 1/ `Nt'{
forvalues s = 1/ `Ns'{
cap qui reg TA2 $X if (t==`t' & s==`s'),nocons
cap qui predict e if e(sample),res
cap qui replace DAC = e if e(sample)
cap drop e
}
}