Announcement

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

  • Spearman rank correlation matrix output in word

    I need spearman correlation matrix output in word. Actually, I get this table in word through “asdoc” but the table looks like this shown in the picture as under which need a lot of manual work.
    I also used this command “spearman X1 X2 X3 matrix A = r(Rho) esttab matrix(A, fmt(%5.2f)) using corrtable.rtf
    But these codes provide the values on the upper part of correlation matrix as will. However, I need a blank upper part.
    Click image for larger version

Name:	pic1.png
Views:	1
Size:	20.3 KB
ID:	1632528

  • #2
    See #3 in https://www.statalist.org/forums/for...ort-into-excel for an esttab solution. esttab is part of the estout package and can be installed from SSC.

    Comment


    • #3
      sorry, its not woriking

      Comment


      • #4
        You need to be more specific about your issue if you want to move this forward. From FAQ Advice #12:

        12. What should I say about the commands and data I use?



        Help us to help you by producing self-contained questions with reproducible examples that explain your data, your code, and your problem. This helps yet others too, as they will find it easier to learn from your questions and the answers to them. 12.1 What to say about your commands and your problem

        Never say just that something "doesn't work" or "didn't work", but explain precisely in what sense you didn't get what you wanted.
        Also, read the FAQ Advice in its entirety to see how you should post more effectively.

        Comment


        • #5
          Originally posted by Andrew Musau View Post
          You need to be more specific about your issue if you want to move this forward. From FAQ Advice #12:



          Also, read the FAQ Advice in its entirety to see how you should post more effectively.
          Thanks for your reply, when I run this code compress eqlabels((1) (2) (3), lhs("Variables")) . I received this error "factor variables and time-series operators not allowed."

          Comment


          • #6
            You need to run the code in a do-file or eliminate the line breaks in case you are copying and pasting directly into the command window. I eliminate the line breaks below.

            Code:
            webuse states2, clear
            spearman mrgrate divorce_rate medage
            preserve
            foreach var in mrgrate divorce_rate medage{
                egen `var's= rank(`var')
                cap lab var `var's "`: var label `var''"
                drop `var'
                rename `var's `var'    
            }
            estpost corr  mrgrate divorce_rate medage, matrix
            esttab ., b(3) unstack nonum nomtitle not noobs label compress eqlabels((1) (2) (3), lhs("Variables"))
            restore

            Comment

            Working...
            X