100 likes | 214 Views
Chi²-Test for r x s contingency tables. PD Dr. Tim Becker Institute for Medical Biometry, Informatics and Epidemiology Bonn. Question. Does smoking status depend on home country?. Null hypothesis H 0 : smoking and home country are independent. Does smoking status depend on home country?.
E N D
Chi²-Test for r x s contingency tables PD Dr. Tim Becker Institute for Medical Biometry, Informatics and Epidemiology Bonn
Question Does smoking status depend on home country? Null hypothesis H0: smoking and home country are independent
Does smoking status depend on home country? Getting closer: Ad hoc comparison: compute frequencies per group
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?
Which absolute values would be expected under the null hypothesis? Under H0 , 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.)
Which absolute values would be expected under the null hypothesis? Task: fill the table!
Which absolute values would be expected under the null hypothesis? Solution In general, expected values are computed as follows: Oij the number of observations in cell (i,j). Oi. Are the row sums and O.j the column sums. The expected Eij for cell (i,j) is Eij=O.j*Oi./N
Computation of the test statistic Rule: „(Observed –Expected)²/Expected“ T=ij(Oij-Eij)²/Eij Task: Compute T for the table!
Computation of the test statistic 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).
Test statistic: 2 – Test Simplification for 2-by-2 tables Degrees of freedom: f = 1 Quantile2 1;0.95 = 3,814 Decision: 2 3,814: H0 can not be rejected. 2 > 3,814: H0 can be rejected.