Code:
gen alpha = . forvalues j = 1/`=_N' { capture ereturn clear capture regress return risk_premium if UniqueID == UniqueID[`j'] /// & inrange(monthyear, monthyear[`j']-23, monthyear[`j']) capture replace alpha = _b[_cons] in `j' }
Code:
gen alpha = . forvalues j = 1/`=_N' { capture ereturn clear capture regress return risk_premium if UniqueID == UniqueID[`j'] capture replace alpha = _b[_cons] in `j' }
Code:
gen alpha = . levelsof UniqueID1, local(fundnum) foreach id of local fundnum { capture quietly regress return risk_premium if UniqueID1 == `id' capture replace alpha = _b[_cons] if e(sample) }
I'm trying to save the intercept/constant of a few hundred regressions
Comment