- Describe the chi-square test of independence, Fisher exact test, and McNemar test
- Interpret the results of each test
Lesson 8: Categorical Outcomes, Between Groups Differences
Terms that appear frequently throughout this lesson are defined below:
Term | Definition |
Discrete | Variables that have a finite number of possible values |
Chi-square | A test of observed and expected frequencies |
Fisher exact test | Similar to the chi-square test of independence; used when the expected frequencies are small |
McNemar test | A test of paired frequencies (e.g., frequency before and frequency after) |
I. Chi-Square Test
Nominal data is common in health sciences research (e.g., the presence or absence of disease, adherence or non-adherence, gender, and socio-economic status). By far, the most common approach to analyzing discrete or nominal data is the chi-square test.
The chi-square test examines the difference between the observed and expected frequencies of a variable. Consider the contingency table below (i.e., n= 300 pregnant women). If exposure had no effect, we might expect that the proportion of individuals in both groups would be the same. The chi-square test can determine if the frequencies in the “exposed” group differ from those we would expect if there were no association between exposure and pregnancy:
Complicated Pregnancy | Normal Pregnancy | Total | |
---|---|---|---|
Exposure | 75 | 50 | 125 |
No Exposure | 25 | 150 | 175 |
Total | 100 | 200 | 300 |
II. Fisher Exact Test
One limitation to the chi-square test is its inaccuracy when the expected frequency in any cell is small. As a common convention, the Fisher exact test should be used anytime that a frequency is less than 5 (n < 5).
III. McNemar Test
The chi-square and Fisher exact test are appropriate for independent, or unpaired, variables. When repeated measures are used to collect frequencies for nominal data, for example a pre- and post-test, the McNemar test should be used. Consider the table below (n=350 participants), which provides frequencies for those that agree or disagree with vaccination before an educational video and after. In this example, 150 participants agree with vaccination before and after the video, 25 agree before but disagree after the video, 160 disagree before and agree after the video, and 15 disagree with vaccination before and after the video. The McNemar Test can determine if the educational video significantly impacted agreement or disagreement with vaccination:
After Video | |||
---|---|---|---|
Agree with Vaccination | Disagree with Vaccination | ||
Before Video | Agree with Vaccination | 150 | 25 |
Disagree with Vaccination | 160 | 15 |
Example 1: Readmission Rates
Methods:
Characteristic | Intervention | Control | P |
---|---|---|---|
n | 66 | 65 | |
Age, years (mean ± SD) | 47.7 ± 10.5 | 46.5 ± 10.7 | 0.5106 |
Women (%) | 68.2 | 60.0 | 0.3290* |
White (%) | 20.0 | 55.4 | < 0.0001* |
No. medications (mean ± SD) | 8.5 ± 4.5 | 5.1 ± 2.1 | < 0.0001 |
No. diseases (mean ± SD) | 5.1 ± 2.0 | 2.3 ± 1.5 | < 0.0001 |
Hospital readmission (%) | 18.2 | 43.1 | 0.0020* |
Nominal variables:
- Group (Intervention/Control)
- Gender (Women/Not Women)
- Race/Ethnicity (White/Not White)
- Hospital readmission (Yes/No)
Chi-square analyses:
- Group vs Gender
- Group vs Race/Ethnicity
- Group vs Hospital readmission
*Chi-square results:
Example 2: Malnutrition
Methods:
In the following study, the chi-square test was used to compare nominal variables and the Fisher exact test when expected values were less than five. A p-value < 0.05 was considered significant.
Health status, n (%) | Malnutrition | Risk of Malnutrition | Normal | Total | P value |
---|---|---|---|---|---|
Physical exercises | 0.002 | ||||
Yes | 1 (7.1) | 13 (24.1) | 22 (51.2) | 36 (32.4) | |
No | 13 (92.9) | 41 (75.9) | 21 (48.8) | 75 (67.6) | |
Chronic diseases | 0.430 | ||||
Yes | 12 (85.7) | 48 (88.9) | 34 (79.1) | 94 (84.7) | |
No | 2 (14.3) | 6 (11.1) | 9 (20.9) | 17 (15.3) | |
Dental problem | 0.207 | ||||
Yes | 7 (50.0) | 19 (35.2) | 11 (25.6) | 37 (33.3) | |
No | 7 (50.0) | 35 (64.8) | 32 (74.4) | 74 (66.7) | |
Gastro-intestinal problem | 0.056 | ||||
Yes | 1 (7.1) | 22 (40.7) | 15 (34.9) | 38 (34.2) | |
No | 13 (92.9) | 32 (59.3) | 28 (65.1) | 73 (65.8) | |
Falls | 1.000 | ||||
Yes | 4 (28.6) | 17 (31.5) | 14 (32.6) | 35 (31.5) | |
No | 10 (71.4) | 37 (68.5) | 29 (67.4) | 76 (68.5) | |
Smoking | 0.611 | ||||
Yes | 4 (28.6) | 20 (37.0) | 12 (27.9) | 36 (32.4) | |
No | 10 (71.4) | 34 (63.0) | 31 (72.1) | 75 (67.6) | |
Alcohol | 0.140 | ||||
Yes | 0 (0.0) | 2 (3.7) | 6 (14.0) | 8 (7.2) | |
No | 14 (100.0) | 52 (96.3) | 37 (86.0) | 103 (92.8) |
Chi-square results (all variables in the table):
This table allows us to see the health factors that have association with the nutritional status of older adults in this sample. Physical exercises (p = 0.002), for example, showed an association with nutritional status.
For more information
- Example 1: Bellone JM, et al. Postdischarge interventions by pharmacists and impact on hospital readmission rates. Journal of the American Pharmacists Association. 2012: 52(3);358.
- Example 2: El Zoghbi M, et al. Prevalence of Malnutrition and Its Correlates in Older Adults Living in Long Stay Institutions Situated in Beirut, Lebanon. Journal of Research in Health Sciences. 2013;14:1