The Chi Square Test: An Introduction
Clinical Research Foundations and the Nature of Categorical Data
Medical research continuously collates clinical data, which presents in various formats depending on the nature of the clinical measurement.
Quantitative data is the most recognizable form of clinical data, characterized by continuous numerical measurements:
For example, straight leg raising (SLR) measurements in subjects capable of raising their legs greater than allow researchers to determine average SLR values across two groups.
Such continuous quantitative measurements permit comparative hypothesis testing using standard parametric methods, specifically the Student's -test.
Non-quantitative data cannot be evaluated using standard parametric tests:
In clinical assessments, interest frequently centers on subjective outcomes, such as a patient reporting improvement as a binary categorical response ( or ) following one of two distinct treatment interventions.
For binary categorical outcomes, calculating an arithmetic mean improvement for each group is mathematically impossible.
Performing a -test on categorical proportions is invalid.
It is not possible to directly calculate differences between levels of improvement or compute ratios of improvement using continuous scale mechanics.
Alternative statistical methodologies are necessary to evaluate categorical data, with the Chi-Square () test of association serving as the primary analytical tool.
A working knowledge of categorical association tests is essential for chiropractors and osteopaths to critically appraise clinical and biomedical literature.
Mathematical Framework of the 2x2 Contingency Table
The simplest structural framework for evaluating categorical data involves two variables across two categories each, arrayed in a contingency (frequency) table:
Category I constitutes the row variable, divided into type and type .
Category II constitutes the column variable, divided into type and type .
The fundamental cell frequencies and marginal totals of a generic contingency table are defined as follows:
: The number of individuals who are of type in Category I and type in Category II.
: The number of individuals who are of type in Category I and type in Category II.
: The number of individuals who are of type in Category I and type in Category II.
: The number of individuals who are of type in Category I and type in Category II.
: The total number of individuals classified as type in Category I, where .
: The total number of individuals classified as type in Category I, where .
: The total sample size across all categories, where .
Transition from arithmetic means to categorical proportions:
: The proportion of individuals who are type in Category I and type in Category II.
: The proportion of individuals who are type in Category I and type in Category II.
: The proportion of individuals who are type in Category I and type in Category II.
: The proportion of individuals who are type in Category I and type in Category II.
Proportional constraints and distribution across categories:
The values and represent the proportional distribution of individuals of type in Category I across the levels of Category II.
The values and represent the proportional distribution of individuals of type in Category I across the levels of Category II.
Null hypothesis formulation:
In statistical hypothesis testing, the primary hypothesis evaluated is the null hypothesis (), which asserts that nothing happens or that no association exists.
In the context of the table, the null hypothesis posits that and .
This formulation specifies that the distribution of individuals across Category II is identical across all levels of Category I, meaning Category II is statistically independent of Category I.
Binary Clinical Trial Analysis: SMT versus IMT for Sciatica
Trial structure and clinical cohort parameters:
Study cohort: Patients suffering from sciatica allocated to two active management interventions.
Intervention 1: Spinal manipulative therapy (SMT) administered over a duration of weeks.
Intervention 2: Intermittent motorized traction (IMT) administered over a duration of weeks.
Investigative question: Determine whether a statistically significant association exists between subjective clinical improvement and the specific modality of treatment received.
Sample allocation: A total of sciatica patients participate in the trial, with patients allocated to IMT and patients allocated to SMT.
Observed patient improvement counts:
After weeks, patients report binary subjective improvement ( versus ).
The text initial narrative mentions that for IMT, reply and reply , while for SMT, reply and reply .
The formal contingency table tabulation (Table 2) records the observed frequencies as:
IMT / Improved (): cell
IMT / Not Improved (): cell
IMT Row Total:
SMT / Improved (): cell
SMT / Not Improved (): cell
SMT Row Total:
Total Improved ():
Total Not Improved ():
Grand Total:
Calculation of expected frequencies under the null hypothesis:
Testing the null hypothesis requires comparing observed values against the values expected if the null hypothesis of no association were true.
Overall improvement proportion: Across the entire trial cohort, out of patients improved, representing a baseline rate of approximately
If no association exists between treatment type and clinical outcome, exactly of patients in each treatment cohort are expected to improve regardless of the therapy received.
Expected improvement in IMT cohort: of
Expected improvement in SMT cohort: of
Overall non-improvement proportion: Across the entire trial cohort, out of patients did not improve, representing a baseline rate of approximately
If no association exists, of patients in both treatment groups are expected not to improve.
Expected non-improvement in IMT cohort: of
Expected non-improvement in SMT cohort: of
General algebraic formula for expected cell values:
Demonstration for the IMT / Improved cell:
Table 4 Observed and Expected Contingency Table (Expected values in parentheses):
IMT / Improved ():
IMT / Not Improved ():
IMT Row Total:
SMT / Improved ():
SMT / Not Improved ():
SMT Row Total:
Column Total Improved ():
Column Total Not Improved ():
Grand Total:
Structural properties of expected frequencies:
The sum of expected cell frequencies across any row equals the corresponding observed row total.
The sum of expected cell frequencies down any column equals the corresponding observed column total.
Expected frequencies are derived strictly under the null hypothesis assumption that treatment type and clinical improvement are independent.
Computational Mechanics and Statistical Inference in 2x2 Tables
Mathematical formula for the Chi-Square () test statistic:
Procedure: For every individual cell in the contingency table, subtract the expected value from the corresponding observed value, square the resulting difference, divide this squared value by the expected value, and sum these quotients across all cells.
Step-by-step computation for the sciatica clinical trial (Table 5):
Cell 1 (IMT / Improved):
Observed () =
Expected () =
Cell 2 (IMT / Not Improved):
Observed () =
Expected () =
Cell 3 (SMT / Improved):
Observed () =
Expected () =
Cell 4 (SMT / Not Improved):
Observed () =
Expected () =
Summation of individual cell components:
Behavioral characteristics of the statistic:
When the null hypothesis is true, observed frequencies align closely with expected values, causing the difference terms to remain small, yielding a small overall value.
When the null hypothesis is false, observed values diverge substantially from expected values, resulting in large difference terms and a correspondingly large statistic.
Degrees of Freedom () formulation:
The calculated statistic belongs to a Chi-Square distribution defined by a single parameter known as degrees of freedom.
Degrees of freedom depend entirely on the dimensional size of the table being analyzed:
For any standard contingency table:
The Chi-Square distribution with degree of freedom:
Ranges along the horizontal axis continuously from .
The associated -value corresponds directly to the total area under the probability density curve lying to the right of the calculated test statistic.
Inference and critical threshold evaluation:
In a Chi-Square distribution with degree of freedom, the area under the curve to the right of is less than (representing a probability of less than
Because the calculated test statistic substantially exceeds , the associated -value is confirmed to be .
Statistical conclusion: The null hypothesis is rejected.
Clinical interpretation: The proportion of individuals who received IMT and improved is significantly different from the proportion of individuals who received SMT and improved.
Multi-Category Contingency Tables: The 2x5 Clinical Trial
Clinical trial design with multi-level ordinal responses:
Many clinical trials employ scales that incorporate more than two levels of improvement.
Comparative clinical trial: Evaluation of treatments for acute low back pain.
Treatment 1 (): Spinal manipulation combined with the application of hot packs.
Treatment 2 (): Spinal manipulation combined with the application of cold packs.
Outcome measurement: A -point categorical improvement scale comprising five discrete levels: None, Mild, Noticeable, Definite, and Complete.
Observed frequency matrix and marginal totals (Table 6):
: None = , Mild = , Noticeable = , Definite = , Complete = ; Row Total =
: None = , Mild = , Noticeable = , Definite = , Complete = ; Row Total =
Column Total for None:
Column Total for Mild:
Column Total for Noticeable:
Column Total for Definite:
Column Total for Complete:
Grand Total of patients studied:
Null hypothesis for the multi-category scenario:
: The proportional distribution of clinical improvement across all five outcome levels is identical for both treatments.
Expected cell value computations:
Expected value for :
Expected value for :
The remaining expected values are calculated systematically using the same formula: .
Comprehensive calculation of the multi-category test statistic (Table 7):
: Observed = , Expected = , , ,
: Observed = , Expected = , , ,
: Observed = , Expected = , , ,
: Observed = , Expected = , , ,
: Observed = , Expected = , , ,
: Observed = , Expected = , , ,
: Observed = , Expected = , , ,
: Observed = , Expected = , , ,
: Observed = , Expected = , , ,
: Observed = , Expected = , , ,
Sum of all cell contributions:
Degrees of Freedom determination for the table:
Statistical decision and -value evaluation:
The -value is the area beneath the Chi-Square curve with degrees of freedom lying to the right of .
The calculated -value is .
Utilizing a standard significance threshold of , the -value exceeds the threshold ().
Statistical decision: Fail to reject the null hypothesis.
Conclusion: There is no statistically significant difference between the outcomes of the two treatments.
Proportional transformation and evaluation of random error (Table 8):
Conversion of raw cell frequencies into within-treatment row percentages:
: None = , Mild = , Noticeable = , Definite = , Complete =
: None = , Mild = , Noticeable = , Definite = , Complete =
Nominal comparison shows minor apparent differences between individual percentage categories (, , , , ).
When the data is evaluated with respect to random error and sampling variability, the observed numerical differences do not provide sufficient statistical evidence of a true underlying difference between spinal manipulation with hot packs versus spinal manipulation with cold packs.
Core Methodological Assumptions and Constraints
The Chi-Square test of association relies upon three mandatory structural and probabilistic assumptions that must be strictly satisfied:
Assumption 1: Exclusivity of classification. Each observed individual subject must appear in the contingency table once and only once (categories must be mutually exclusive and exhaustive).
Assumption 2: Independent observations. The experimental or clinical outcome for each individual subject must be completely independent of all other individual subjects in the sample.
Assumption 3: Minimum expected cell count threshold. In the generated table of expected values, at least of all expected cell values must be strictly greater than .
Provenance and Bibliographic Citations
Authorship and institutional affiliations:
Antony Ugoni, B.Sc. (Hons), Department of Public Health & Community Medicine, The University of Melbourne, Parkville, Victoria, 3052, Australia.
Bruce F. Walker, D.C., M.P.H., Private Practice, 33 Wantirna Road, Ringwood, Victoria, 3134, Australia (Telephone: 03 879 5555).
Publication data:
Published in COMSIG Review, Volume 4, Number 3, November 1995, pages 61–64.
Key indexing terms: Chi square, chiropractic, osteopathy.
Formal literature citations:
Ugoni A. On the subject of hypothesis testing. COMSIG Review, 1993; 2(2): 45–48.
Neave HR. Statistics Tables for Mathematicians, Engineers, Economists, and the Behavioural and Management Sciences. Unwin Hyman Ltd, 1988: 42–43.