Skip to main content
Commonmark migration
Source Link

I am trying to calculate Kendall’s tau coefficient for example given by [Scipy in python][1]Scipy in python. It is for tied ranks with tau-b version. The tau should be -0.47140452079103173 but I get a different result. I use formulas in "Handbook of Parametric and Nonparametric. Statistical Procedures. David J. Sheskin. Chapman & Hall/CRC." page 900.

$$x = [12, 2, 1, 12, 2]$$ $$y = [1, 4, 7, 1, 0]$$

rank the data: $$rank x = [4.5, 2.5, 1, 4.5, 2.5]$$ $$rank y = [2.5, 4, 5, 2.5, 1]$$

dimensions: $n=5, m=2 $ $$rank x+rank y = [7, 6.5, 6, 7, 3.5]$$ $$T=7+6.5+6+7+3.5=30$$ $$U=7^2+6.5^2+6^2+7^2+3.5^2=188.5$$

calculate the tie correlation(${\displaystyle\sum_{i=1}^m}{\displaystyle\sum_{a=1}^s}(t^3-t)$):

in x there are 2 tied groups each with 2 members: $(2^3-2)+(2^3-2)=12$

in y there is 1 tied group with 2 members: $(2^3-2)= 6$

total tie correlations: $12+6=18$

$$W=\frac{12U-3m^2n(n+1)^2}{m^2n(n^2-1)-m{\displaystyle\sum_{i=1}^m}{\displaystyle\sum_{a=1}^s}(t^3-t)}=\frac{12(188.5)-3\times 2^2\times 5(5+1)^2}{2^2\times5(5^2-1)-2(18)}=0.22973$$

Sorry for the low-quality question. there are not many numeric questions for tau-b. I hope this question can be helpful also for others who review python's example. [1]: https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.kendalltau.html

I am trying to calculate Kendall’s tau coefficient for example given by [Scipy in python][1]. It is for tied ranks with tau-b version. The tau should be -0.47140452079103173 but I get a different result. I use formulas in "Handbook of Parametric and Nonparametric. Statistical Procedures. David J. Sheskin. Chapman & Hall/CRC." page 900.

$$x = [12, 2, 1, 12, 2]$$ $$y = [1, 4, 7, 1, 0]$$

rank the data: $$rank x = [4.5, 2.5, 1, 4.5, 2.5]$$ $$rank y = [2.5, 4, 5, 2.5, 1]$$

dimensions: $n=5, m=2 $ $$rank x+rank y = [7, 6.5, 6, 7, 3.5]$$ $$T=7+6.5+6+7+3.5=30$$ $$U=7^2+6.5^2+6^2+7^2+3.5^2=188.5$$

calculate the tie correlation(${\displaystyle\sum_{i=1}^m}{\displaystyle\sum_{a=1}^s}(t^3-t)$):

in x there are 2 tied groups each with 2 members: $(2^3-2)+(2^3-2)=12$

in y there is 1 tied group with 2 members: $(2^3-2)= 6$

total tie correlations: $12+6=18$

$$W=\frac{12U-3m^2n(n+1)^2}{m^2n(n^2-1)-m{\displaystyle\sum_{i=1}^m}{\displaystyle\sum_{a=1}^s}(t^3-t)}=\frac{12(188.5)-3\times 2^2\times 5(5+1)^2}{2^2\times5(5^2-1)-2(18)}=0.22973$$

Sorry for the low-quality question. there are not many numeric questions for tau-b. I hope this question can be helpful also for others who review python's example. [1]: https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.kendalltau.html

I am trying to calculate Kendall’s tau coefficient for example given by Scipy in python. It is for tied ranks with tau-b version. The tau should be -0.47140452079103173 but I get a different result. I use formulas in "Handbook of Parametric and Nonparametric. Statistical Procedures. David J. Sheskin. Chapman & Hall/CRC." page 900.

$$x = [12, 2, 1, 12, 2]$$ $$y = [1, 4, 7, 1, 0]$$

rank the data: $$rank x = [4.5, 2.5, 1, 4.5, 2.5]$$ $$rank y = [2.5, 4, 5, 2.5, 1]$$

dimensions: $n=5, m=2 $ $$rank x+rank y = [7, 6.5, 6, 7, 3.5]$$ $$T=7+6.5+6+7+3.5=30$$ $$U=7^2+6.5^2+6^2+7^2+3.5^2=188.5$$

calculate the tie correlation(${\displaystyle\sum_{i=1}^m}{\displaystyle\sum_{a=1}^s}(t^3-t)$):

in x there are 2 tied groups each with 2 members: $(2^3-2)+(2^3-2)=12$

in y there is 1 tied group with 2 members: $(2^3-2)= 6$

total tie correlations: $12+6=18$

$$W=\frac{12U-3m^2n(n+1)^2}{m^2n(n^2-1)-m{\displaystyle\sum_{i=1}^m}{\displaystyle\sum_{a=1}^s}(t^3-t)}=\frac{12(188.5)-3\times 2^2\times 5(5+1)^2}{2^2\times5(5^2-1)-2(18)}=0.22973$$

Sorry for the low-quality question. there are not many numeric questions for tau-b. I hope this question can be helpful also for others who review python's example.

edited tags
Link
ttnphns
  • 58.8k
  • 53
  • 287
  • 512
added 20 characters in body
Source Link
Sadegh
  • 205
  • 1
  • 4
  • 15

I am trying to calculate Kendall’s tau coefficient for example given by [Scipy in python][1]. It is for tied ranks with tau-b version. The tau should be -0.47140452079103173 but I get a different result. I use formulas in "Handbook of Parametric and Nonparametric. Statistical Procedures. David J. Sheskin. Chapman & Hall/CRC." page 900.

$$x = [12, 2, 1, 12, 2]$$ $$y = [1, 4, 7, 1, 0]$$

rank the data: $$x = [4.5, 2.5, 1, 4.5, 2.5]$$$$rank x = [4.5, 2.5, 1, 4.5, 2.5]$$ $$y = [2.5, 4, 5, 2.5, 1]$$$$rank y = [2.5, 4, 5, 2.5, 1]$$

dimensions: $n=5, m=2 $ $$x+y = [7, 6.5, 6, 7, 3.5]$$$$rank x+rank y = [7, 6.5, 6, 7, 3.5]$$ $$T=7+6.5+6+7+3.5=30$$ $$U=7^2+6.5^2+6^2+7^2+3.5^2=188.5$$

calculate the tie correlation(${\displaystyle\sum_{i=1}^m}{\displaystyle\sum_{a=1}^s}(t^3-t)$):

in x there are 2 tied groups each with 2 members: $(2^3-2)+(2^3-2)=12$

in y there is 1 tied group with 2 members: $(2^3-2)= 6$

total tie correlations: $12+6=18$

$$W=\frac{12U-3m^2n(n+1)^2}{m^2n(n^2-1)-m{\displaystyle\sum_{i=1}^m}{\displaystyle\sum_{a=1}^s}(t^3-t)}=\frac{12(188.5)-3\times 2^2\times 5(5+1)^2}{2^2\times5(5^2-1)-2(18)}=0.22973$$

Sorry for the low-quality question. there are not many numeric questions for tau-b. I hope this question can be helpful also for others who review python's example. [1]: https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.kendalltau.html

I am trying to calculate Kendall’s tau coefficient for example given by [Scipy in python][1]. It is for tied ranks with tau-b version. The tau should be -0.47140452079103173 but I get a different result. I use formulas in "Handbook of Parametric and Nonparametric. Statistical Procedures. David J. Sheskin. Chapman & Hall/CRC." page 900.

$$x = [12, 2, 1, 12, 2]$$ $$y = [1, 4, 7, 1, 0]$$

rank the data: $$x = [4.5, 2.5, 1, 4.5, 2.5]$$ $$y = [2.5, 4, 5, 2.5, 1]$$

dimensions: $n=5, m=2 $ $$x+y = [7, 6.5, 6, 7, 3.5]$$ $$T=7+6.5+6+7+3.5=30$$ $$U=7^2+6.5^2+6^2+7^2+3.5^2=188.5$$

calculate the tie correlation(${\displaystyle\sum_{i=1}^m}{\displaystyle\sum_{a=1}^s}(t^3-t)$):

in x there are 2 tied groups each with 2 members: $(2^3-2)+(2^3-2)=12$

in y there is 1 tied group with 2 members: $(2^3-2)= 6$

total tie correlations: $12+6=18$

$$W=\frac{12U-3m^2n(n+1)^2}{m^2n(n^2-1)-m{\displaystyle\sum_{i=1}^m}{\displaystyle\sum_{a=1}^s}(t^3-t)}=\frac{12(188.5)-3\times 2^2\times 5(5+1)^2}{2^2\times5(5^2-1)-2(18)}=0.22973$$

Sorry for the low-quality question. there are not many numeric questions for tau-b. I hope this question can be helpful also for others who review python's example. [1]: https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.kendalltau.html

I am trying to calculate Kendall’s tau coefficient for example given by [Scipy in python][1]. It is for tied ranks with tau-b version. The tau should be -0.47140452079103173 but I get a different result. I use formulas in "Handbook of Parametric and Nonparametric. Statistical Procedures. David J. Sheskin. Chapman & Hall/CRC." page 900.

$$x = [12, 2, 1, 12, 2]$$ $$y = [1, 4, 7, 1, 0]$$

rank the data: $$rank x = [4.5, 2.5, 1, 4.5, 2.5]$$ $$rank y = [2.5, 4, 5, 2.5, 1]$$

dimensions: $n=5, m=2 $ $$rank x+rank y = [7, 6.5, 6, 7, 3.5]$$ $$T=7+6.5+6+7+3.5=30$$ $$U=7^2+6.5^2+6^2+7^2+3.5^2=188.5$$

calculate the tie correlation(${\displaystyle\sum_{i=1}^m}{\displaystyle\sum_{a=1}^s}(t^3-t)$):

in x there are 2 tied groups each with 2 members: $(2^3-2)+(2^3-2)=12$

in y there is 1 tied group with 2 members: $(2^3-2)= 6$

total tie correlations: $12+6=18$

$$W=\frac{12U-3m^2n(n+1)^2}{m^2n(n^2-1)-m{\displaystyle\sum_{i=1}^m}{\displaystyle\sum_{a=1}^s}(t^3-t)}=\frac{12(188.5)-3\times 2^2\times 5(5+1)^2}{2^2\times5(5^2-1)-2(18)}=0.22973$$

Sorry for the low-quality question. there are not many numeric questions for tau-b. I hope this question can be helpful also for others who review python's example. [1]: https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.kendalltau.html

edited body
Source Link
Sadegh
  • 205
  • 1
  • 4
  • 15
Loading
added 95 characters in body; edited tags
Source Link
Sadegh
  • 205
  • 1
  • 4
  • 15
Loading
Post Migrated Here from math.stackexchange.com (revisions)
Source Link
Sadegh
  • 205
  • 1
  • 4
  • 15
Loading