I am trying to export the Spearman correlation matrix into an rtf
or Excel file using estpost
and the community-contributed command
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
---------------------------------------------------