Hello everyone! I would like to bootstrap samples to estimate residuals based on two first-stage regressions by the control function, the following is my code but showed errors:
Do you possibly know where it got wrong? Any comments will be highly grateful! Many thanks!
Code:
insufficient observations to compute bootstrap standard errors no results will be saved r(2000);
Do you possibly know where it got wrong? Any comments will be highly grateful! Many thanks!
Code:
xtset gvkey fyear
program boot_cf, eclass
capture drop resid
gen newid4 =gvkey
xtset newid4 fyear
reg inve iv $control i.sic3 i.year, vce(robust)
predict resid1, res
reg inve_dc iv iv_dc $control i.sic3 i.year, vce(robust)
predict resid2, res
reg ret inve_dc inve $control resid1 resid2 i.sic3 i.year, vce(robust)
drop resid1 resid2
end
bootstrap, reps(50): boot_cf
