Announcement

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

  • Regression table

    Hello all

    I am trying to run the following code for regression. I need to ask please that how I can name the output of each regression so that I can use then in regression freely. like I would like to have the OLS coefficient and IV coefficients and so on.

    cap erase table3_IV.xml
    cap erase table3_IV.txt

    foreach var of varlist y1 y2 y3 {
    xi: ivreg2 `var' (x1=z) x2 x3 x4 x5 x6 x7 x8
    qui sum `var' if e(sample)
    outreg2 using table3_IV.tex, stats(coef se) bdec(3) keep(x) ctitle(`var' - IV ) addstat(Mean of Dependent Variable, r(mean), First Stage F-Test, e(widstat)) append excel nocons nor2
    }
    cap erase table3_IV.txt



    cap erase table3_OLS.xml
    cap erase table3_OLStxt

    foreach var of varlist y1 y2 y3 {
    xi: ivreg2 `var' x1 x2 x3 x4 x5 x6 x7 x8
    qui sum `var' if e(sample)
    outreg2 using table3_IV.tex, stats(coef se) bdec(3) keep(x) ctitle(`var' - IV ) addstat(Mean of Dependent Variable, r(mean), First Stage F-Test, e(widstat)) append excel nocons nor2
    }
    cap erase table3_OLS.txt

Working...
X