Announcement

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

  • -esttab- to .rtf and results window at once?

    Dear all,

    I'm wondering if there is a way to use -esttab- to display regression results in stata's results window and save them in .rtf file at once.
    I'm aware that -esttab using filename.rtf- generates .rtf file containing regression results. To check the results, I should open the .rtf file because the results do not appear in stata's results window. Is there such an option to achieve these two at once?

    Thanks in advance.

  • #2
    The output of
    Code:
    help esttab
    suggests the type option may do what you want.

    Comment


    • #3
      I've gone through -help esttab-, but still don't know the answer.

      Comment


      • #4
        Did you not find the type option in the output of help esttab? The section of help esttab at
        Code:
        help esttab##output
        describes the output options, including
        Code:
                +--------+
            ----+ Output +--------------------------------------------------
        
            ...
        
            type specifies that the assembled table be printed in the
                results window and the log file. This is the default unless
                using is specified.
        
            ...
        Thus, try
        Code:
        esttab using filename.rtf, type
        and see if it does what you want.

        Comment


        • #5
          William Lisowski
          Thanks for your suggestion. I got your point now. But adding the option prints something that looks like code (not table) in results view.

          A part of what I got in results view:

          Code:
          {\trowd\trgaph108\trleft-108\clbrdrt\brdrw10\brdrs

          Comment


          • #6
            Ah, that's not as helpful of esttab. as I'd hoped it would be. I'm sorry for the incorrect advice.

            The solution is to use the Stata shell command to run a command-line command to open filename.rtf in an application.

            On Stata for Mac running
            Code:
            sysuse auto, clear
            quietly regress price weight
            esttab using filename.rtf, replace
            shell open filename.rtf
            shell open filename.rtf -a "Microsoft Word"
            first opens filename.rtf in the default application (TextEdit, ugh) and then opens filename.rtf using the application specified after the -a. Assuming you are a Microsoft Windows user, I'd guess that Microsoft Word is the default application for opening rtf files, but maybe not.

            Comment

            Working...
            X