Announcement

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

  • How to flip coefficients in Stata output tables?

    Dear Stata users,

    I have Stata output having income outcomes in the columns and different treatment groups and control variables in the rows. Is there any command to flip the variable coefficients in the final tables e.g. any command to add with outreg2 to get a wider version of the outputs?

    Cheers,
    Azreen.

  • #2
    Hi Azreen,

    Look into esttab and the help file for outreg2.

    Good luck!

    Comment


    • #3
      Thanks for your response.I was trying to use esttab but not sure why the command has not been working. Am I missing anything (I am using Stata 12). Just not finding anything in outreg2 help file. Can you help with the specific codes in either esttab or outreg2? It would be much appreciated.

      Thanks and regards,
      Azreen.

      Comment


      • #4
        As far as I know, outreg2 does not do what you want. What you could do is write the output as an excel file and then copy and paste the output transposed.

        Comment


        • #5
          Originally posted by Azreen Karim View Post
          I was trying to use esttab but not sure why the command has not been working.
          Please show the commands that you tried, as explained in the FAQ.

          Comment


          • #6
            Another possibility, you could use outreg2 to write the output as a data file and then reshape or transpose that data file.

            Code:
             
            *read dta file"
            use "C:\Phil\1__Papers\Myopia\Multi Theory Comparison\results_dta.dta", clear
             
            "create variables to write into - my dta file has 33 rows and 5 variables
            
             forvalues j=1/33 {
             g str s`j'="   "
             }
            *write from original v1 to v5 variables into new s1 to s33 variables
             forvalues i=1/5 {
             forvalues j=1/33  {
             
             replace s`j' = v`i'[`j'] in `i'/`i'
             }
             }

            Comment


            • #7
              Thanks a lot, Phil. Cheers :-)

              Comment

              Working...
              X