Announcement

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

  • How to calculate the correlation between two ordinal variables?

    Hi,
    I want to calculate the correlation between two ordinal variables, one is skill level for occupations (4 levels in order) and the other is education level (6 levels in order, 1 <primary, 2=primary, 3=secondary high school, 4=post-secondary <3 years, 5=post-secondary >=3 years, 6=PhD). These two variables are ordinal but cannot say that they are interval variables as the education year difference between each education level is different. Is it right to use "polychoric" in stata?
    Thanks a lot!
    Best
    Yannu



  • #2
    Try help ktau for Kendall's rank correlation coefficients

    Comment


    • #3
      polychoric correlations are typically used for the estimation of correlations between ordinal scaled variables. Stas Kolenikov wrote a Stata program to estimate these correlation coefficients a while ago, but you can find more information in his slides from this year's Stata conference.

      Comment


      • #4
        There is also the Spearman correlation, -help spearman-. And there is Goodman-Kruskal gamma, too. -help tabulate twoway-

        Comment


        • #5
          Hello Yannu,


          You may type something like this:

          Code:
           . webuse dose
          
          . tab dose function
          
                     |             Function
              Dosage |    < 1 hr     1 to 4         4+ |     Total
          -----------+---------------------------------+----------
               1/day |        20         10          2 |        32
               2/day |        16         12          4 |        32
               3/day |        10         16          6 |        32
          -----------+---------------------------------+----------
               Total |        46         38         12 |        96
          
          
          . ktau dose function, stats(p taub)
          
            Number of obs =      96
          Kendall's tau-a =       0.1518
          Kendall's tau-b =       0.2378
          Kendall's score =     692
              SE of score =     270.100   (corrected for ties)
          
          Test of Ho: dose and function are independent
               Prob > |z| =       0.0105  (continuity corrected)
          
          . */ check it with the taub option of tabulate
          
          . tabulate dose function, taub
          
                     |             Function
              Dosage |    < 1 hr     1 to 4         4+ |     Total
          -----------+---------------------------------+----------
               1/day |        20         10          2 |        32
               2/day |        16         12          4 |        32
               3/day |        10         16          6 |        32
          -----------+---------------------------------+----------
               Total |        46         38         12 |        96
          
                    Kendall's tau-b =   0.2378  ASE = 0.086
          Best,

          Marcos
          Best regards,

          Marcos

          Comment


          • #6
            • Hi all,

              Thanks so much for all of your kind help! I decide to use Goodman and Kruskal Gamma now as there are many ties in the data

              Best

              Yannu

            Comment

            Working...
            X