Download presentation
Presentation is loading. Please wait.
Published byAlexandra Hill Modified over 9 years ago
2
Chi²-Test for r x s contingency tables PD Dr. Tim Becker Institute for Medical Biometry, Informatics and Epidemiology Bonn
3
Question Null hypothesis H 0 : smoking and home country are independent Does smoking status depend on home country?
4
Getting closer: Ad hoc comparison: compute frequencies per group
5
Does smoking status depend on home country? Impression: Greek and Indonesian people seem to smoke more. Which absolute values would be expected under the null hypothesis?
6
Under H 0, the portion of Italians (Germans, Greek, Indonesian) shoulb be equal within the group of smokers and non-smokers! Portion of Italians in complete sample: (27+73)/(158+232)=0.2564 -> Expected number of smokers among Italians: 158*0.2564 (Here the portion of Italians in smokers and non-smokers are set equal to the portion in the complete sample.)
7
Which absolute values would be expected under the null hypothesis? Task: fill the table!
8
Which absolute values would be expected under the null hypothesis? Solution In general, expected values are computed as follows: O ij O i. O.j O ij the number of observations in cell (i,j). O i. Are the row sums and O.j the column sums. E ij E ij =O.j *O i. /N The expected E ij for cell (i,j) is E ij =O.j *O i. /N
9
Computation of the test statistic Rule: „(Observed –Expected)²/Expected“ T= ij (O ij -E ij )²/E ij Task: Compute T for the table!
10
Computation of the test statistic rs T is Chi-Square ( ²) distributed with (r-1)*(s-1) degrees of freedom, where r is the number of rows and s is the number of columns. In the example: 3 degrees of freedom (3 df).
11
2 – Test Simplification for 2-by-2 tables trait 1 trait 2 outcome 1outcome 2 outcome 1aba+b outcome 2cdc+d a+cb+dn=a+b+c+d Test statistic: Degrees of freedom: f = 1 Quantile 2 1;0.95 = 3,814 Decision: 2 3,814:H 0 can not be rejected. 2 > 3,814:H 0 can be rejected.
Similar presentations
© 2025 SlidePlayer.com Inc.
All rights reserved.