Announcement

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

  • Bootstrap two stages

    Hello everyone,

    I have a small question. I have a for loop that runs twice (when a variable is == 0 and == 1), and there is a regression inside this loop. I store this loop in a program like this:

    cap program drop bootstrap_regression
    program define bootstrap_regression, eclass
    preserve

    The idea is to bootstrap these two regressions that are generated. I do it like this:
    bootstrap, rep(50) nodrop: bootstrap_two_steps But I only get the results of one regression from the loop, not both. It seems to be the last (second) iteration of the loop. How can I get the results of the bootstrap for both regressions?

    Your assistance would be greatly appreciated. Thank you very much in advance!

  • #2
    Originally posted by Diego Zambrano Leyva View Post
    I have a for loop that runs twice (when a variable is == 0 and == 1), and there is a regression inside this loop. . . . The idea is to bootstrap these two regressions that are generated.
    Why not form interaction terms of this variable and the other predictors? Then you'd have just one regression model to bootstrap.

    Comment

    Working...
    X