Announcement

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

  • landscape rtf output with esttab?

    This is the code I am using to get my results into an rtf doc. But given the number of hierarchical models I am running, they do not fit in the portrait orientation in MS Word, and I keep changing it manually each time I open the Word doc for a new results file I created. It would be very useful if there was an option to write the output in landscape format (I couldn't find one searching here or online) that I can specify into the following code I am running.. Please let me know if you know of one. I do not use Latex, so I need it to be with the Stata commands, and rtf or similar output docs.

    eststo: ....
    eststo: ....
    esttab using results.rtf, compress nogap ar2(2) b(a2) se(2) star(* 0.1 ** 0.05 *** 0.01) drop(_Iyear*) scalars (F "hasrep1 Year Dummies") varwidth(25) modelwidth(6) nonumbers mtitles ("Model 1" "Model 2" "Model 3" "Model 4" "Model 5" "Model 6" "Model 7") replace

    PS: any links to useful hints for output creation docs would be helpful as well. I guess this would be useful to most people..
    Last edited by Omer Gokalp; 23 Aug 2017, 10:03.

  • #2
    I am not sure that I agree with your view regarding the complexity of this task. Dig deep into the help files, it is all documented.



    Code:
    *Stacked
    eststo clear
    sysuse auto
    qui reg price trunk foreign weight
    esttab using "auto1.rtf", b(%4.2f) p star(* 0.10 ** 0.05 *** 0.01) stats(n1 N r2_a, fmt(%9.0f %9.0g %9.2f) labels ("Obs" "Adjusted R-Squared")) nogap brackets
    qui reg mpg trunk foreign weight
    esttab using "auto1.rtf", b(%4.2f) p star(* 0.10 ** 0.05 *** 0.01) stats(n1 N r2_a, fmt(%9.0f %9.0g %9.2f) labels ("Obs" "Adjusted R-Squared")) nogap brackets append replace

    Code:
      
    (1)
    Price
    Trunk space (cu. ft.) -88.31
    [0.263]
    Car type 3686.45***
    [0.000]
    Weight (lbs.) 3.66***
    [0.000]
    Constant -4781.59***
    [0.001]
    Obs
    Adjusted R-Squared 74
    r2_a 0.49
    p-values in brackets * p < 0.10, ** p < 0.05, *** p < 0.01
    (1)
    Mileage (mpg)
    Trunk space (cu. ft.) -0.08
    [0.510]
    Car type -1.60
    [0.143]
    Weight (lbs.) -0.01***
    [0.000]
    Constant 41.83***
    [0.000]
    Obs
    Adjusted R-Squared 74
    r2_a 0.65
    p-values in brackets * p < 0.10, ** p < 0.05, *** p < 0.01




    Code:
    *Unstacked
    eststo clear
    sysuse auto
    eststo: qui reg price trunk foreign weight
    eststo: qui reg mpg trunk foreign weight
    esttab using "auto2.rtf", b(%4.2f) p star(* 0.10 ** 0.05 *** 0.01) stats(n1 N r2_a, fmt(%9.0f %9.0g %9.2f) labels ("Obs" "Adjusted R-Squared")) nogap brackets drop(_cons) unstack replace

    Code:
     
    (1) (2)
    Price Mileage (mpg)
    Trunk space (cu. ft.) -88.31 -0.08
    [0.263] [0.510]
    Car type 3686.45*** -1.60
    [0.000] [0.143]
    Weight (lbs.) 3.66*** -0.01***
    [0.000] [0.000]
    Obs
    Adjusted R-Squared 74 74
    r2_a 0.49 0.65
    p-values in brackets * p < 0.10, ** p < 0.05, *** p < 0.01

    Comment


    • #3
      I think I wasn't clear in the question. I can create the rtf file as unstacked as in the example you showed above, but what I wanted was a way to open the rtf file in landscape format on the Word automatically. The default is they open as portrait when you click on the rtf file that is created, and when you have too many models some of them don't fit in the view on the portrait mode. So I manually change it on Word>Page Layout>Orientation to landscape to fit more models in the document view. Not a major issue, but I was just wondering if there was a simple code that can be added to esttab line to make the file orientation as "landscape" on MS Word when you click on it.

      Comment


      • #4
        I do not use Word, at least not regularly. But even with latex, you need a package to do this so this is a word processor formatting issue. A tip is to postpone all formatting to the very end, so that you don't spend too much time doing so every time you open your word processor.

        Comment

        Working...
        X