Announcement

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

  • Storing loop regression outputs

    Hello everyone,

    I'm trying to run the below loop and store the estimates of each regression model; however, for some reason, the regression outputs are not stored. There is also no error, but simply as if the est store command is not being performed. Could anyone perhaps help out on this?

    foreach j of varlist r_SMALLL - r_BIGH {
    reg `j' r_a b c, robust
    est store model_`j'
    }

    Thank you in advance!

  • #2
    Welcome to Stata list. A couple of etiquette issues - we use our real names on this list. We also recommend following the FAQ on asking questions - provide Stata code in code delimiters, readable Stata output, and sample data using dataex. Replicating your problem is often essential to helping you.

    Off hand, I can't see why this doesn't work. When I ran it using some data I had available:
    Code:
    foreach j of varlist arriveBritish NZAfricans {
    reg `j' arriveIndian ,robust
    est store model_`j'
    }
    est dir
    It worked fine.

    You can run it after issuing set trace on and you'll see how Stata is interpreting your macros etc.

    Comment

    Working...
    X