Use of the Pearson χ2 involves the following assumptions (Daniel, 2000):
1. Only one datum entry is made for each subject in the sample. Therefore, if repeated measures from the same subject are being used for analysis, such as pretests and posttests, χ2 is not an appropriate test.
2. The variables must be categorical (nominal), either inherently or transformed to categorical from quantitative values.
3. For each variable, the categories are mutually exclusive and exhaustive. No cells may have an expected frequency of zero. In the actual data, the observed cell frequency may be zero. However, the Pearson χ2 test is sensitive to small sample sizes, and other tests, such as the Fisher’s exact test, are more appropriate when testing very small samples (Daniel, 2000; Yates, 1934).
The test is distribution-free, or nonparametric, which means that no assumption has been made for a normal distribution of values in the population from which the sample was taken (Daniel, 2000).
The formula for a two-way χ2 is:
χ 2 =n[(A)(D)−(B)(C)] 2 (A+B)(C+D)(A+C)(B+D)
The contingency table is labeled as follows. A contingency table is a table that displays the relationship between two or more categorical variables (Daniel, 2000):
A | B |
C | D |
With any χ2 analysis, the degrees of freedom (df) must be calculated to determine the significance of the value of the statistic. The following formula is used for this calculation:
df=(R−1)(C−1)
where
R=Number of rows
C=Number of columns
A retrospective comparative study examined whether longer antibiotic treatment courses were associated with increased antimicrobial resistance in patients with spinal cord injury (Lee et al., 2014). Using urine cultures from a sample of spinal cord–injured veterans, two groups were created: those with evidence of antibiotic resistance and those with no evidence of antibiotic resistance. Each veteran was also divided into two groups based on having had a history of recent (in the past 6 months) antibiotic use for more than 2 weeks or no history of recent antibiotic use.
The data are presented in Table 35-1. The null hypothesis is: “There is no difference between antibiotic users and non-users on the presence of antibiotic resistance.”
TABLE 35-1
ANTIBIOTIC RESISTANCE BY ANTIBIOTIC USE
Antibiotic Use | No Recent Use | |
Resistant | 8 | 7 |
Not resistant | 6 | 21 |
The computations for the Pearson χ2 test are as follows:
Step 1: Create a contingency table of the two nominal variables:
Used Antibiotics | No Recent Use | Totals | ||
Resistant | 8 | 7 | 15 | |
Not resistant | 6 | 21 | 27 | |
Totals | 14 | 28 | 42 | ←Total n |
Step 2: Fit the cells into the formula:
χ 2 =n[(A)(D)−(B)(C)] 2 (A+B)(C+D)(A+C)(B+D)
χ 2 =42[(8)(21)−(7)(6)] 2 (8+7)(6+21)(8+6)(7+21)
χ 2 =666,792158,760
χ 2 =4.20
Step 3: Compute the degrees of freedom:
df=(2−1)(2−1)=1
Step 4: Locate the critical χ2 value in the χ2 distribution table (Appendix D) and compare it to the obtained χ2 value.
The obtained χ2 value is compared with the tabled χ2 values in Appendix D. The table includes the critical values of χ2 for specific degrees of freedom at selected levels of significance. If the value of the statistic is equal to or greater than the value identified in the χ2 table, the difference between the two variables is statistically significant. The critical χ2 for df = 1 is 3.84, and our obtained χ2 is 4.20, thereby exceeding the critical value and indicating a significant difference between antibiotic users and non-users on the presence of antibiotic resistance.
Furthermore, we can compute the rates of antibiotic resistance among antibiotic users and non-users by using the numbers in the contingency table from Step 1. The antibiotic resistance rate among the antibiotic users can be calculated as 8 ÷ 14 = 0.571 × 100% = 57.1%. The antibiotic resistance rate among the non-antibiotic users can be calculated as 7 ÷ 28 = 0.25 × 100% = 25%.