How to export Spearman correlations

后端 未结 1 1713
野趣味
野趣味 2021-01-16 01:37

I am trying to export the Spearman correlation matrix into an rtf or Excel file using estpost and the community-contributed command

相关标签:
1条回答
  • 2021-01-16 01:39

    The spearman command does not work with estpost, which is why Stata complains.

    The following works for me:

    sysuse auto, clear
    
    spearman price mpg weight
    matrix A = r(Rho)
    
    esttab matrix(A, fmt(%5.2f)) using corrtable.rtf
    
    ---------------------------------------------------
                            A                          
                        price          mpg       weight
    ---------------------------------------------------
    price                1.00        -0.54         0.49
    mpg                 -0.54         1.00        -0.86
    weight               0.49        -0.86         1.00
    ---------------------------------------------------
    
    0 讨论(0)
提交回复
热议问题