Page 1 of 2 ChiSquare 2 x 2 Contingency Table The proportions of two alternatively nominal scaled variables are represented in a contingency table. The ChiSquare test examines whether there is an interrelation between the two variables or not. Requirements: Every observation must be assignable unambiguously to exactly one cell. The expected frequency should not fall below 7 for each cell. If there are expected frequencies below 7 the Fisher’s exact test should be used instead. Hypothesis: H0: The two variables are independent H1: The two variables are dependent For the assumption that the two variables are independent (H0) the following holds for the probabilities of the four cells: The expected frequencies under H0 can be obtained by multiplication of the cell probability by the total number of observations. Probability Table:  Variable B   Category 1  Category 2  Variable A  Category 1  p(A_{1}B_{1})  p(A_{1}B_{2})  p(A_{1})  Category 2  p(A_{2}B_{1}  p(A_{2}B_{2})  p(A_{2})   p(B_{1})  p(B_{2})   Frequency Table:  Variable B   Category 1  Category 2  Variable A  Category 1  f_{o}(A_{1}B_{1}) f_{e}(A_{1}B_{1})  f_{o}(A_{1}B_{2}) f_{e}(A_{1}B_{2})  f_{o}(A_{1})  Category 2  f_{o}(A_{2}B_{1}) f_{e}(A_{2}B_{1})  f_{o}(A_{2}B_{2}) f_{e}(A_{2}B_{2})  f_{o}(A_{2})   f_{o}(B_{1})  f_{o}(B_{2})  f_{total}  For each cell the expected frequency is estimated in the following way: whereas f_{e} means expected frequency, f_{o} means observed frequency. The following term is a measure for the deviation between the observed and expected frequencies, and it is approximately ChiSquare distributed: ChiSquare is the sum over all cells of the squared cells’ residual (f_{o}  f_{e} ) divided by the cells’ expected frequency f_{e}. Degrees of freedom are determined as follows:  If , , and are known
df = number of cells  1 = 3  If , , and are estimated from the sample
df = (number of rows  1)*(number of columns  1) = 1 Continuity Correction after Yates: The continuity correction after Yates considers the fact that frequency and ChiSquare values are different, the first being discrete the second being continuous. The ChiSquare value is corrected the following way: Interpretation of a significant result: The interrelation between the two variables is expressed by the deviance of the cells observed percentages from the row or column percentages and . The standardized residual is another measure for the strength of the deviance of the cells observed frequency from its expected frequency. For each cell it is calculated as follows: For sufficient big sample sizes the standardized residual is comparable to a zvalue. As a rule of thumb a standardized residual of –2 or less indicates that the cells observed frequency is significantly lower than its expected frequency and a standard residual of +2 or more indicates that the cells observed frequency is significantly higher than its expected frequency.
