Download presentation
Presentation is loading. Please wait.
1
Lesson #29 2 2 Contingency Tables
2
In general, contingency tables are used to present data that has been “cross-classified” by two categorical variables. Begin with a 2 2 table, where both variables are dichotomous.
3
ab cd a+cb+d a+b c+d Variable 2 Variable 1 n = a+b+c+d In the table, we have observed frequencies (a, b, c, and d). These can also be denoted by: O i i = 1, 2, 3, 4
4
3591 82115 117206 126 197 323 Arthritis Exercise High Low Yes No OR = (35)(115) (91)(82) = 0.54
5
We can also test for an association between the two independent variables. The null hypothesis is: This is called a test of independence, or a test of homogeneity. - no association between the two variables - the two variables are independent - the distributions of one variable are homogeneous over levels of the other or
6
To perform the test, we first need to calculate expected frequencies, E i, in each cell. Recall that if two events are independent, P(A and B) = P(A) P(B) This indicates how many observations we expect to see, if the null hypothesis is true.
7
P(an observation being in any cell) = P(being in that row and being in that column) = P(being in that row) P(being in that column) Then, “under H 0 ” Thus, under H 0, we can estimate this by
8
To get the expected number in any cell, multiply the probability of being in that cell by n. This is done for all 4 cells in the 2 2 table
9
The test statistic is then: OiOi - E i ( ) 2 EiEi ~ under H 0 Reject H 0 if
10
3591 82115 117206 126 197 323 High Low YesNo Observed Expected 117206 126 197 323 High Low YesNo E1E1 = (126)(117) 323 = 45.64 45.6480.36 71.36125.64
11
Reject H 0 if = 3.841 = 6.38 Reject H 0 Arthritis is less likely among those who exercised
12
For a 2 2 table, there is a “shortcut” method: ab cd a+cb+d a+b c+d Variable 2 Variable 1 n = a+b+c+d
13
3591 82115 117206 126 197 323 Arthritis Exercise High Low Yes No = 6.38
Similar presentations
© 2024 SlidePlayer.com Inc.
All rights reserved.