In: Statistics and Probability
In this question, we will formulate a measure to quantify the level of association between the two categorical variables. Such a measure is often used in a statistical test called Chi-square test for assessing whether there is an association between two categorical variables. This question is also used to motivate the learning of independence and to connect the concept back to what we have learnt in the course.
Let's revisit the example we have looked at in the course. How is diet type (high cholesterol diet versus low cholesterol diet) related to the risk of coronary heart disease? Data of 23 individuals:
High cholesterol dietLow cholesterol dietHeart disease(i) 11(ii) 213No heart disease(iii) 4(iv) 610Total15823Heart diseaseNo heart diseaseTotalHigh cholesterol diet(i) 11(iii) 415Low cholesterol diet(ii) 2(iv) 68131023
From the table we find that the probability of having heart disease is 13/2313/23 and the probability of having high cholesterol diet is 15/2315/23. Similarly, we can find the probability of not having heart disease and the probability of having low cholesterol diet.
Part a
If there is no association between the two variables (i.e., the two are independent), the probability of having heart disease and high cholesterol diet is: [Round to four decimal places].
Part b
If the two variables are independent, we should expect the number of individuals with heart disease and high cholestoral diet to be the probability in Part a multiplied by 23 individuals, which is: [Round to two decimal places].
Part c
Repeating Part b, we find that the expected number of individuals for the cells (ii), (iii), (iv) respectively on the table are: 4.52, 6.52, 3.48.
The following measure (called Chi-square test statistic):
?2=∑(Observed−Expected)2Expectedχ2=∑(Observed−Expected)2Expected
quantifies the level of association between two categorical variables. The symbol ∑∑ means a sum. "Observed" here refers to the observed counts on the table, while "Expected" refers to the expected counts given independence for the two variables is true. The sum is taken across all the cells (i) to (iv) on the table.
If there is no association, the observed counts should not differ very much from the expected counts, which results in a relatively small value of ?2χ2. A large ?2χ2 value indicates disagreement between the expected and observed counts which suggests the assumption of independence does not hold and the two variables are likely to be associated.
Compute ?2χ2. [Round to two decimal places].
Of course, how large is large is another problem and this is beyond the scope of this course.
Part a
(13/23)*(15/23) = 0.3686
Part b
13*15/23 = 8.48
Part c
Col 1 | Col 2 | Col 3 | Total | ||
Row 1 | Observed | 11 | 4 | 15 | 30 |
Expected | 8.48 | 6.52 | 15.00 | 30.00 | |
O - E | 2.52 | -2.52 | 0.00 | 0.00 | |
(O - E)² / E | 0.75 | 0.98 | 0.00 | 1.73 | |
Row 2 | Observed | 2 | 6 | 8 | 16 |
Expected | 4.52 | 3.48 | 8.00 | 16.00 | |
O - E | -2.52 | 2.52 | 0.00 | 0.00 | |
(O - E)² / E | 1.41 | 1.83 | 0.00 | 3.23 | |
Row 3 | Observed | 13 | 10 | 23 | 46 |
Expected | 13.00 | 10.00 | 23.00 | 46.00 | |
O - E | 0.00 | 0.00 | 0.00 | 0.00 | |
(O - E)² / E | 0.00 | 0.00 | 0.00 | 0.00 | |
Total | Observed | 26 | 20 | 46 | 92 |
Expected | 26.00 | 20.00 | 46.00 | 92.00 | |
O - E | 0.00 | 0.00 | 0.00 | 0.00 | |
(O - E)² / E | 2.16 | 2.80 | 0.00 | 4.96 | |
4.96 | chi-square |
χ2 = 4.96