I have a monthly panel data for periods 1996m1 to 2018m12. Using the code below, I have estimated cross-sectional regressions for each period and saved the predicted values and residuals in variables xb and resid respectively.
Code:
rangestat (reg) flow mreturn1 netexpense noload mreturn_sd1 lsize_lag lage lagflow_19, interval(date 0 0) drop reg_* se_* gen double xb = b_mreturn1*mreturn1 + b_netexpense*netexpense + b_noload*noload + b_mreturn_sd1*mreturn_sd1 + b_lsize_lag*lsize_lag + b_lage*lage + b_lagflow_19*lagflow_19 + b_cons gen double resid = flow - xb
Code:
reghdfe simulatedflow x1 x2 x3, a(date) vce(cluster date fund_id)
Thanks
0 Response to Loop
Post a Comment