Difference between revisions of "Kendall's Tau Test"

From ZCubes Wiki
Jump to navigation Jump to search
 
(18 intermediate revisions by the same user not shown)
Line 1: Line 1:
<div style="font-size:25px">'''KENDALLSTAUTEST(Range1,Range2,alpha,NewTableFlag)'''</div><br/>
+
<div style="font-size:25px">'''KENDALLSTAUTEST(Range1, Range2, alpha, NewTableFlag)'''</div>
*<math>Range1</math> is the array of x values.
+
*'''<math>Range1</math> is the array of x values.
*<math>Range2</math> is the array of y values.
+
*'''<math>Range2</math> is the array of y values.
*<math>alpha</math>  is the value from 0 to 1.
+
*'''<math>alpha</math>  is the value from 0 to 1.
*<math>NewTableFlag</math> is either TRUE or FALSE. TRUE for getting results in a new cube. FALSE will display results in the same cube.
+
*'''<math>NewTableFlag</math> is either TRUE or FALSE. TRUE for getting results in a new cube. FALSE will display results in the same cube.<br></br>
  
==Description==
+
==='''DESCRIPTION===
* It is a statistic test used to measure the ordinal association between two measured quantities.
+
*'''It is a statistic test used to measure the ordinal association between two measured quantities.
* It is a measure of rank correlation: the similarity of the orderings of the data when ranked by each of the quantities.
+
*'''It is a measure of rank correlation: the similarity of the orderings of the data when ranked by each of the quantities.
* Kendall correlation between two variables will be high when observations have a similar rank.
+
*'''Kendall correlation between two variables will be high when observations have a similar rank.
* It will be low when observations have a dissimilar rank between the two variables.
+
*'''It will be low when observations have a dissimilar rank between the two variables.
  
Let (x1, y1), (x2, y2), …, (xn, yn) be a set of observations of the joint random variables X and Y respectively,  
+
'''Let (x1, y1), (x2, y2), …, (xn, yn) be a set of observations of the joint random variables X and Y respectively, such that all the values of <math>(x_i)</math> and <math>(y_i)</math> are unique.
such that all the values of <math>(x_i)</math> and <math>(y_i)</math> are unique.
+
  '''concordant if <math>(x_i > x_j)</math> & <math>(y_i > y_j)</math> or <math>(x_i < x_j)</math> & <math>(y_i < y_j)</math>
  * concordant if <math>(x_i > x_j)</math> & <math>(y_i > y_j)</math> or <math>(x_i < x_j)</math> & <math>(y_i < y_j)</math>
+
  '''discordant if <math>(x_i > x_j)</math> & <math>(y_i < y_j)</math> or <math>(x_i < x_j)</math> & <math>(y_i > y_j)</math>
  * discordant if <math>(x_i > x_j)</math> & <math>(y_i < y_j)</math> or <math>(x_i < x_j)</math> & <math>(y_i > y_j)</math>
+
  '''neither if <math>(x_i = x_j)</math> or <math>(y_i = y_j)</math> (i.e. ties are not counted).
  * neither if <math>(x_i = x_j)</math> or <math>(y_i = y_j)</math> (i.e. ties are not counted).
 
  
The Kendall's Tau statistic is:
+
'''The Kendall's Tau statistic is:
<math>\tau=1-\frac{4D}{n(n-1)}</math>.
+
:<math>\tau=1-\frac{4D}{n(n-1)}</math>.
* C is the number of concordant pairs.
+
* '''C is the number of concordant pairs.
* D is the number of discordant pairs.
+
* '''D is the number of discordant pairs.<br></br>
 +
 
 +
==='''RESULT===
 +
* '''If number of values in a set is <15, critical tables are used to calculate <math>\tau</math>.
 +
* '''If number of values in a set is >=15, Normal approximation is used for calculation.
 +
* '''If <math>\tau</math> > critical value from the Kendall's Tau Critical table, then reject the null hypothesis that there is no correlation.
 +
* '''else if, <math>\tau</math> <critical value, correlation exists.
 +
 
 +
==='''EXAMPLE===
 +
{| class="wikitable"
 +
|+Spreadsheet
 +
|-
 +
! !! A !! B       
 +
|-
 +
! 1
 +
| 80 || 5
 +
|-
 +
! 2
 +
| 78 || 23
 +
|-
 +
! 3
 +
| 60 || 25
 +
|-
 +
! 4
 +
| 53 || 48
 +
|-
 +
! 5
 +
| 85 || 17
 +
|-
 +
! 6
 +
| 84 || 8
 +
|-
 +
! 7
 +
| 73 || 4
 +
|-
 +
! 8
 +
| 79 || 26
 +
|-
 +
! 9
 +
| 81 || 11
 +
|-
 +
! 10
 +
| 75 || 19
 +
|-
 +
! 11
 +
| 68 || 14
 +
|-
 +
! 12
 +
| 72 || 35
 +
|-
 +
! 13
 +
| 58 || 29
 +
|-
 +
! 14
 +
| 92 || 3
 +
|-
 +
! 15
 +
| 65 || 24
 +
|}
 +
='''KENDALLSTAUTEST(A1:A15,B1:B15, 0.05, true)
 +
 
 +
{| class="wikitable"
 +
|+KENDALL'S TAU TEST USING NORMAL APPROXIMATION
 +
|-
 +
!RANGE1 SORT!!RANGE2 SORT!!CONCORDANT !!DISCORDANT
 +
|-
 +
|53||48||0||14
 +
|-
 +
|58||29||1||12
 +
|-
 +
|60||25||2||10
 +
|-
 +
|65||24||2||9
 +
|-
 +
|68||14||5||5
 +
|-
 +
|72||35||0||9
 +
|-
 +
|73||4||7||1
 +
|-
 +
|75||19||2||5
 +
|-
 +
|78||23||1||5
 +
|-
 +
|79||26||0||5
 +
|-
 +
|80||5||3||1
 +
|-
 +
|81||11||1||2
 +
|-
 +
|84||8||1||1
 +
|-
 +
|85||17||0||1
 +
|-
 +
|92||3||0||0
 +
|}
 +
 
 +
{| class="wikitable"
 +
|+SUMMARY
 +
|-
 +
!VARIABLE      !!RESULT
 +
|-
 +
|COUNT          || 15
 +
|-
 +
|C              || 105
 +
|-
 +
|SUM CONCORDANT || 25
 +
|-
 +
|SUM DISCORDANT || 80
 +
|-
 +
|KENDALL'S TAU  || -0.52381
 +
|-
 +
|STDERROR      || 0.19245
 +
|-
 +
|Z-VALUE        || -2.7218
 +
|-
 +
|ZCRITICAL      || 1.95996
 +
|-
 +
|P-VALUE        || 0.00649
 +
|-
 +
|RESULT        || REJECT NULL HYPOTHESIS, NO CORRELATION
 +
|}
 +
*'''CONCLUSION:''' REJECT NULL HYPOTHESIS, NO CORRELATION

Latest revision as of 10:51, 19 August 2020

KENDALLSTAUTEST(Range1, Range2, alpha, NewTableFlag)
  • Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle Range1} is the array of x values.
  • Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle Range2} is the array of y values.
  • Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle alpha} is the value from 0 to 1.
  • Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle NewTableFlag} is either TRUE or FALSE. TRUE for getting results in a new cube. FALSE will display results in the same cube.

DESCRIPTION

  • It is a statistic test used to measure the ordinal association between two measured quantities.
  • It is a measure of rank correlation: the similarity of the orderings of the data when ranked by each of the quantities.
  • Kendall correlation between two variables will be high when observations have a similar rank.
  • It will be low when observations have a dissimilar rank between the two variables.

Let (x1, y1), (x2, y2), …, (xn, yn) be a set of observations of the joint random variables X and Y respectively, such that all the values of Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle (x_i)} and Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle (y_i)} are unique.

concordant if  & Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle (y_i > y_j)}
 or Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle (x_i < x_j)}
 & Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle (y_i < y_j)}

discordant if Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle (x_i > x_j)}
 & Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle (y_i < y_j)}
 or Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle (x_i < x_j)}
 & Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle (y_i > y_j)}

neither if Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle (x_i = x_j)}
 or Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle (y_i = y_j)}
 (i.e. ties are not counted).

The Kendall's Tau statistic is:

Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle \tau=1-\frac{4D}{n(n-1)}} .
  • C is the number of concordant pairs.
  • D is the number of discordant pairs.

RESULT

  • If number of values in a set is <15, critical tables are used to calculate Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle \tau} .
  • If number of values in a set is >=15, Normal approximation is used for calculation.
* If Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle \tau}
 > critical value from the Kendall's Tau Critical table, then reject the null hypothesis that there is no correlation.
* else if, Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle \tau}
 <critical value, correlation exists.

EXAMPLE

Spreadsheet
A B
1 80 5
2 78 23
3 60 25
4 53 48
5 85 17
6 84 8
7 73 4
8 79 26
9 81 11
10 75 19
11 68 14
12 72 35
13 58 29
14 92 3
15 65 24

=KENDALLSTAUTEST(A1:A15,B1:B15, 0.05, true)

KENDALL'S TAU TEST USING NORMAL APPROXIMATION
RANGE1 SORT RANGE2 SORT CONCORDANT DISCORDANT
53 48 0 14
58 29 1 12
60 25 2 10
65 24 2 9
68 14 5 5
72 35 0 9
73 4 7 1
75 19 2 5
78 23 1 5
79 26 0 5
80 5 3 1
81 11 1 2
84 8 1 1
85 17 0 1
92 3 0 0
SUMMARY
VARIABLE RESULT
COUNT 15
C 105
SUM CONCORDANT 25
SUM DISCORDANT 80
KENDALL'S TAU -0.52381
STDERROR 0.19245
Z-VALUE -2.7218
ZCRITICAL 1.95996
P-VALUE 0.00649
RESULT REJECT NULL HYPOTHESIS, NO CORRELATION
  • CONCLUSION: REJECT NULL HYPOTHESIS, NO CORRELATION