0

How can I get outreg results in separate tables on the same document while I have the outreg in a loop.

I provided the answer I found below.

1 Answer 1

1

Need to install outreg from http://fmwww.bc.edu/RePEc/bocode/o 'OUTREG': module to write estimation tables to a Word or TeX file (note that you need to uninstall any previous updates of outreg if found)

The documentation of the above is found here. It provides examples on the following:

  1. Placing additional tables in same document using addtable
  2. Merging multiple estimation results in a loop in which you loop over outreg without outputting the results then replay over the outreg results saved in memory to output the table. Example:

    outreg, clear
    forvalues r = 2/5 {
       quietly reg mpg price weight if rep78==`r'
       outreg, merge varlabels ctitle("", "`r'") nodisplay
    }
    outreg using auto, replay replace title(Regressions by Repair Record)
    
  3. Merging the estimation results in a loop into two separate outreg tables: declare different tables to save in at first, then use addtable after the loops to output two seperate tables into word. Example:

    outreg, clear(iv)
    outreg, clear(first)
    forvalues r = 1/4 {
       quietly ivreg2 rent pcturban (hsngval = faminc) if reg`r', savefirst
       outreg, merge(iv) varlabels ctitle("","Region `r'") nodisplay
       quietly estimates restore _ivreg2_hsngval
       outreg, merge(first) varlabels ctitle("","Region `r'") nodisplay
    }
    outreg using iv, replay(first) replace title(First Stage Regressions)
    outreg using iv, replay(iv) addtable title(Variables Regression)
    
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.