Sunday, December 3, 2017

The Chi-Square Test and Kendall’s Tau

The Chi-Square Test and Kendall’s Tau

The post here is answer to question two on my list of contingency table problems.   The complete list is found here.



Question Two:   Test whether there is a significant relationship between stock price movement categories and S&P 500 movement categories for these two firm?   How do the Kendall's Tau statistics differ for these two companies?  

Discuss differences in Pearson’s chi square and Kendall’s Tau for these two companies.

Discuss how Pearson’s chi-square and Kendall’s Tau are calculated.

Data:  The Contingency Tables summarizing the movement between company stock prices and market stock prices are below:

Co=movement of Stock Price with S&P 500
Company One
Stock Close<Prior Low
Stock Close Between Prior Low and High
Stock Close>Prior High
S&P Close < Prior Low
12
18
4
S&P Close Between Prior Low & High
26
80
28
S&P Close > Prior High
5
31
48
Company Two
Stock Close<Prior Low
Stock Between Prior Low and High
Stock Close>Prior High
S&P Close < Prior  Low
10
21
3
S&P Close
 Between Prior Low & High
19
68
47
S&P Close
> Prior High
14
48
22



Results of Pearson Chi-Square Test and Kendall’s Tau B test from STATA

Nonparametric Tests on Association Between 
Company and Market Returns
Company One
Company Two
Pearson Chi Square
44.7
11.3
p value for chi square test
0.000
0.024
Kendall's Tau B
0.367
0.060





Discussion of results; Company one is Apple, a high-beta company.   Company two is Duke Power a low beta company.    The Pearson’ chi square test reveals a significant association between company and index stock movements for both companies; although, the difference is larger for Apple than for Duke Power.


Kendall Tau’s B is over 6 times higher for Apple than for Duke, which suggests these non-parametric statistics are good measures of systematic risk.


Discussion of calculations of Pearson’s Chi-square in Excel.

Below is a presentation of the calculation of Pearson’s Chi-square statistic for independence in Excel.  

Calculation of Pearson's Chi-Square Statistic for Company One in Excel
Observed
Expected
(O-E)2/e
A
12
5.802
6.62
B
18
17.405
0.02
C
4
10.794
4.28
D
26
22.865
0.43
E
80
68.595
1.90
F
28
42.540
4.97
G
5
14.333
6.08
H
31
43.000
3.35
I
48
26.667
17.07
Sum
44.71


Discussion of calculation of Kendall’s Tau

Kendall’s Tau B is difficult to calculate in Excel.   The formula for Kendall’s Tau A is a lot simpler.   (Kendall’s Tau B incorporates information on ties.    Kendall’s Tau A does not do so.)

The formula for Kendall’s Tau A is (C-D)/(C+D) where C is total concordant pairs and D is total discordant pairs. 

The observations that are concordant to a pair are down and to the right of the pair.  Below is a picture of the cells that are concordant to the top right cell of a contingency matrix.


12
80
28
31
48



The total number of pairs that are concordant to the top right cell is 12 (80+28+31+48)  = 2244


There are three other cells with concordant cells

Number of concordant pairs for top row middle column is.18*(28+48) or 1368

Number of concordant pairs for middle row right column cell is 26*(31+48) or 2054.

Number of concordant cells for middle row center column cell is 80*48 or 3840

The total number of concordant cells is 5894.


The observations that are discordant to a cell in a contingency table are down and left to the cell.   Here is a picture of cells that are discordant to the top left cell.

4
26
80
5
31

The number of discordant cells from the top left is 4*(80+26+5+31) or 568


Discordant pairs for the other three cells with discordant pairs are:

Middle column center top row 18 *(26+5) or 558.

Left column center row 28 x (5+31) or 1008.

Middle column center row is 80 x 5 or 400.

The total number of discordant cells is 1408.


Our estimate of Tau A for company one is (5894-1408)/(5804+1408) or 0.614.


I’ll leave it to the reader to find Pearson’s chi square and Tau A for the second company.

At this point of time I really appreciate my STATA program.

Go back to this file for more contingency table problems







No comments:

Post a Comment