Announcement

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

  • Generated regressors problem when estimating a series of local projections

    Hi all, I would need help in bootstrapping the residuals to overcome the "generated regressors problem" when estimating a series of local projections. This is what I currently have:

    Code:
    forvalues i = 1/16 {
    
    ivreg2 f`i'g `instrument1' `instrument2' L(1/4).`instrument1' L(1/4).`instrument2', robust bw(auto)
    predict double shock`i'
    
    ivreg2 f`i'var`dep' shock`i' L(1/4).shock`i', robust bw(auto)
    }

  • #2
    Alessandro:
    see https://www.statalist.org/forums/for...-bootstrapping
    Kind regards,
    Carlo
    (StataNow 18.5)

    Comment


    • #3
      Thank you Carlo, I saw different posts on the issue but I can't figure it out how I can bootstrap both stages in my framework.

      When I try the following:
      Code:
       forvalues i = 1/16 {
      capture program drop one_rep
      program define one_rep
      
      ivreg2 f`i'g `instrument1' `instrument2' L(1/4).`instrument1' L(1/4).`instrument2', robust bw(auto
      capture drop shock`i'
      predict double shock`i'
      
      ivreg2 f`i'var`dep' shock`i' L(1/4).shock`i', robust bw(auto)
      exit
      end }
      I get an "end of do-file" --Break-- r(1)

      Comment

      Working...
      X