Announcement

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

  • Stata 15: putdocx table from esttab/ eststo

    Hi everybody,
    I´d like to put a correlation table stored via eststo into a word document using putdocx but I receive the following error message:
    table: invalid table specification
    Code:
    eststo clear
    eststo: estpost correlate dv iv1 iv2
    esttab est1, b(%9.2fc) p(%9.2fc)
    
    putdocx begin    
    putdocx table results = table(est1)
    I also tried the following alternative
    Code:
    putdocx table results = etable
    which leads to this error message:
    Information for the estimation table not found; Please replay estimation results and try again
    Any advice welcome!
    Thanks a lot in advance for your support.
    Steve

  • #2
    I do not use putdocx, but why do you need to do this when esttab can export to MS Word?

    Code:
    esttab est1 using mydoc.doc, b(%9.2fc) p(%9.2fc)

    Comment


    • #3
      Thanks for the quick reply, Andrew!
      The reason is that the output from esttab using doc is plain text. So tables cannot be easily formatted as far as I know (see example below).


      Click image for larger version

Name:	Bildschirmfoto 2018-10-11 um 10.20.26.png
Views:	1
Size:	263.1 KB
ID:	1465438
      Last edited by Steve Johnson; 11 Oct 2018, 02:32.

      Comment


      • #4
        I rarely use MS Word, so I would not know how the formatting works. However, tying it out quickly suggests that saving the esttab output as an rtf file and opening it in MS Word may be a solution

        Code:
        esttab est1 using mydoc.rtf, b(%9.2fc) p(%9.2fc)

        Comment


        • #5
          Thank you, Andrew. It works.

          Comment


          • #6
            As an alternative, you can use asdoc (from SSC) that sends a table of correlation to Word file in one click.
            Code:
             ssc install asdoc  
             sysuse auto, clear
             asdoc cor
            For more details, you can read this blog entry.
            Regards
            --------------------------------------------------
            Attaullah Shah, PhD.
            Professor of Finance, Institute of Management Sciences Peshawar, Pakistan
            FinTechProfessor.com
            https://asdocx.com
            Check out my asdoc program, which sends outputs to MS Word.
            For more flexibility, consider using asdocx which can send Stata outputs to MS Word, Excel, LaTeX, or HTML.

            Comment


            • #7
              Thank you, Attaullah! I´m already a big fan of asdoc.
              However, as far as I see, there is no way to use asdoc to export a column containing bivariate effects (stack models) into word as in the following example, is it?
              Otherwise I would be more than happy to learn about this option!?

              Code:
              sysuse auto
              eststo clear
              eststo: estpost corr price weight mpg foreign
              eststo: estpost corr length weight mpg foreign
              esttab est1 est2, mtitles

              HTML Code:
              --------------------------------------------
                                    (1)             (2)  
                                   est1            est2  
              --------------------------------------------
              weight              0.539***        0.946***
                                                          
              
              mpg                -0.469***       -0.796***
                                                          
              
              foreign            0.0487          -0.570***
                                                          
              --------------------------------------------
              N                      74              74  
              --------------------------------------------

              Comment


              • #8
                Hello everyone, I have a challenge exporting the results fo Exporatory factor analysis in Stata 16.0 to MS Word 2016. It gives me an error about the putdocx command

                Comment


                • #9
                  Code:
                  putdocx begin
                  putdocx table
                  putdocx paragraph
                  putdocx table tbl1 = data (pattern matrix)
                  putdocx save tbl1.docx, replace
                  *Save document
                  putdocx save EFACountries

                  Error message
                  table or cell specification required

                  Comment

                  Working...
                  X