stats enthusiasts!
I'm having trouble with a manual calculation of Kendall's tau-b. My result differs from the SPSS output, and I can't figure out where I went wrong. Here's my process:
I'm analyzing the association between exercise levels (0,1,2) and optimism levels (0,1,2) with this data:
Optimism(y): 0,0,0,1,1,1,1,1,2,2,2,2,1,2,1
Exercise(x): 0,0,0,0,0,1,1,1,1,1,2,2,2,2,2
I calculated:
Concordant pairs (C): 49
Discordant pairs (D): 4
Ties in y (Ty): 34
Ties in x (Tx): 30
I used this formula:
τb = (Nc - Nd) / √(Nc + Nd + Tx) * √(Nc + Nd + Ty)
Plugging in the values:
τb = (49 - 4) / √(49 + 4 + 30) * √(49 + 4 + 34) ≈ 0.5295
However, SPSS gives a result of about 0.617.
I've double-checked my calculations for C, D, Tx, and Ty using online calculators(https://statpages.info/ordinal.html), and they seem correct. So, I'm wondering:
Are my parentheses wrong in the formula?
Did I miscalculate concordant or discordant pairs?
Is there an error in my tie calculations?
I'd really appreciate any insights on where I might have gone wrong.