Announcement

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

  • Exporting the results of a pwcorr

    Hi everyone!
    I have asked STATA to produce a very simple correlation with the command pwcorr and now I need to export it in a doc/rtf file.
    I have installed the estout package and something very strange happened: for some reason, yesterday night I wrote the following code:

    ssc install estout, replace
    eststo m1: pwcorr U5Mortality Adult_Female_Literacy, sig
    esttab m1 using "new_table".rtf"

    and the rtf file was correctly produced (attached).
    This morning however, I ran the code again and the error message "last estimation results not found, nothing to store" appears.

    I have tried to export the data in other ways, but unsuccessfully. Does anyone know how to fix this issue?

    PS: it is my first post on this forum! Thank you very much for the help and in case let me know if you need anymore information on my side!
    Attached Files

  • #2
    estout is from SSC (FAQ Advice #12).

    and the rtf file was correctly produced (attached).
    You must be mistaken. pwcorr does not post anything to e(), so I do not think that the code you posted can result in any output. You could post the output of pwcorr to e(), but I will suggest a different approach below.

    Code:
    sysuse auto, clear
    pwcorr price headroom mpg displacement
    
    quietly estpost corr price headroom mpg displacement, matrix
    esttab ., replace b(3) unstack nonum nomtitle not noobs ///
    label compress eqlabels((1) (2) (3) (4), lhs("Variables"))
    Res.:

    Code:
    . pwcorr price headroom mpg displacement
    
                 |    price headroom      mpg displa~t
    -------------+------------------------------------
           price |   1.0000 
        headroom |   0.1145   1.0000 
             mpg |  -0.4686  -0.4138   1.0000 
    displacement |   0.4949   0.4745  -0.7056   1.0000 
    
    . 
    . quietly estpost corr price headroom mpg displacement, matrix
    
    . esttab ., replace b(3) unstack nonum nomtitle not noobs ///
    > label compress eqlabels((1) (2) (3) (4), lhs("Variables")) 
    
    --------------------------------------------------------------------
    Variables              (1)          (2)          (3)          (4)   
    --------------------------------------------------------------------
    Price                1.000                                          
    Headroom (in.)       0.115        1.000                             
    Mileage (mpg)       -0.469***    -0.414***     1.000                
    Displacem.. in.)     0.495***     0.474***    -0.706***     1.000   
    --------------------------------------------------------------------
    * p<0.05, ** p<0.01, *** p<0.001

    Comment

    Working...
    X