Announcement

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

  • How to export regression results into two separate sheets in the same Excel file?

    Hi could someone please help me on this simple question?

    I have following two regressions, and I want to use outreg2 to export the two into one Excel file but two separate sheets, e.g., regression y on x into sheet1, and regression y on z into sheet2. could someone help me to fix my codes?

    I really appreciate!

    xtreg y x1 x2 x3, i(id) fe robust
    outreg2 using "tables/1.xls", replace ctitle (model1)
    xtreg y x1 x2 x3 x4, i(id) fe robust
    outreg2 using "$tables/1.xls", append ctitle (model2) keep (x1 x2 x3 x4)

    xtreg y z1 z2 z3, i(id) fe robust
    outreg2 using "tables/1.xls", replace ctitle (model1)
    xtreg y z1 z2 z3 z4, i(id) fe robust
    outreg2 using "$tables/1.xls", append ctitle (model2) keep (z1 z2 z3 z4)

  • #2
    outreg2 (SSC) does not support exporting tables to separate sheets in one MS Excel file, however putexcel does, but it lacks all the formatting options. Therefore, you must export the results as separate files using outreg2 command, and then merge the files manually or use putexcel and format the table by yourself.

    Comment


    • #3
      Originally posted by Oded Mcdossi View Post
      outreg2 (SSC) does not support exporting tables to separate sheets in one MS Excel file, however putexcel does, but it lacks all the formatting options. Therefore, you must export the results as separate files using outreg2 command, and then merge the files manually or use putexcel and format the table by yourself.
      I see, I'll merge the files together. Thank you Oded!

      Comment

      Working...
      X