Announcement

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

  • Pearson/Spearman correlation table (corsp) formatting error and transfer to Excel

    Dear Statalist members,

    I am using Stata 14.2 on a Mac.

    I computed a correlation matrix with Pearson's correlation coefficients in the lower triangle and Spearman's rank correlations above the diagonal using the user-written command corsp by Daniel Klein.

    Additionally, I chose the option to report p-values below each correlation coefficient.

    My first problem: After having chosen to report p-values below each correlation coefficient, the vertical variables' names no longer fit the table. (See attached screenshot)

    Click image for larger version

Name:	Bildschirmfoto 2017-01-26 um 10.26.24.png
Views:	1
Size:	78.5 KB
ID:	1371689


    My second problem: I am not sure how about how I can transfer the full correlation table to Exel (I need to report in in Word later on). I am currently using the command esttab to transfer regression results to Excel.

    Any help is highly appreciated!

    Alina


  • #2
    For the record, corsp is (probably) from SSC.

    The first problem is a bug in corsp (thanks for reporting) that I have fixed. I will send the update to Kit Baum so it should be up on SSC in a couple of days. For now, use the (old) option pvalues instead of sig. In the example above

    Code:
    corsp TREAT MVln ROA  BTM LEVERAGE FOLLOW , pvalues
    This will also help with the second problem, as it will cause corsp to also return the combined matrix of coefficients and p-values in r(RP). This matrix is hidden in Stata version 12 and higher so you will need to type

    Code:
    return list , all
    to see it.

    I cannot comment on how to export this matrix to Excel with esttab (where is it from?). You might want to have a look at the putexcel command. I have never used it, so I cannot comment on this option either.

    Best
    Daniel
    Last edited by daniel klein; 27 Jan 2017, 09:37.

    Comment

    Working...
    X