Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Bootstrap on residuals using Control function

    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:


    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
    Last edited by Jae Li; 09 Aug 2022, 09:40.
Working...
X