The Chi-Square (χ²) test is one of the most commonly used statistical tests in medical research. It is applied whenever you want to examine whether there is a significant association between two categorical variables. This guide explains everything you need to know — from assumptions to SPSS execution and results interpretation.
What is the Chi-Square Test?
The Chi-Square test compares the observed frequencies in a contingency table with the frequencies you would expect if there were no association between the variables (expected frequencies under the null hypothesis).
- Tests for association between two categorical variables
- Null hypothesis (H0): No association between the variables
- Alternative hypothesis (H1): A significant association exists
- Output: χ² statistic, degrees of freedom, p-value
- Does not indicate strength or direction of association — only whether it exists
- For strength of association, use Cramer's V, Phi coefficient, or Odds Ratio
When to Use Chi-Square
- Both variables are categorical (nominal or ordinal)
- Examples: Gender vs disease presence (Yes/No), Smoking status vs lung cancer, Blood group vs severity
- Comparing proportions between two or more independent groups
- Data is from a simple random sample (observations are independent)
- Do NOT use for continuous data (use t-test or ANOVA instead)
- Do NOT use for paired/matched data (use McNemar's test)
Statistical Analysis Support for Your Thesis
Our biostatisticians perform chi-square, t-test, ANOVA, and all other analyses for MD/MS/DNB thesis.
Chi-Square Assumptions
Violating these assumptions invalidates the chi-square result:
- Independence: Each observation must belong to only one cell — no repeated measures
- Expected cell frequency: At least 80% of cells must have expected frequency ≥ 5
- No cell with expected frequency < 1: Any cell with expected n < 1 violates assumptions
- Sample size: Total n ≥ 20 recommended
- If assumptions are violated, use Fisher's Exact Test instead
- For 2×2 tables with any cell < 5, always use Fisher's Exact Test
How to Calculate Chi-Square
Chi-Square formula: χ² = Σ [(O - E)² / E]
- O: Observed frequency in each cell
- E: Expected frequency = (Row total × Column total) / Grand total
- Calculate E for each cell, then compute (O-E)²/E for each cell
- Sum all values to get the χ² statistic
- Degrees of freedom = (Rows - 1) × (Columns - 1)
- Compare χ² to critical value table or use software to get p-value
- Example: 2×2 table → df = (2-1)×(2-1) = 1
Running Chi-Square in SPSS
- Go to: Analyze → Descriptive Statistics → Crosstabs
- Move row variable to "Row(s)" and column variable to "Column(s)"
- Click "Statistics" → check Chi-Square, Phi and Cramer's V, Risk
- Click "Cells" → check Observed, Expected, Row percentages
- Click OK to run analysis
- Check the "Chi-Square Tests" table for χ² value, df, and Asymptotic Significance (p)
- Check the "Symmetric Measures" table for Cramer's V (effect size)
- If any expected count < 5, SPSS will warn you — switch to Fisher's Exact Test
SPSS Analysis & Thesis Results Chapter
Get expert SPSS analysis with complete results tables and interpretation for your thesis.
Interpreting Chi-Square Results
- If p < 0.05: Reject null hypothesis — significant association between variables
- If p ≥ 0.05: Fail to reject null — no significant association found
- Report as: χ²(df) = value, p = value. Example: χ²(1) = 8.42, p = 0.004
- Effect size (Cramer's V): 0.1 = small, 0.3 = medium, 0.5 = large association
- A significant chi-square does not tell you which groups differ — use standardized residuals
- Cells with |standardized residual| > 2.0 contribute most to the significant chi-square
Chi-Square vs Fisher's Exact Test
- Use Fisher's Exact Test when: sample is small, any expected cell count < 5, 2×2 table only
- Use Chi-Square when: large sample, all expected cells ≥ 5, 2×2 or larger tables
- Fisher's exact test calculates exact p-value — more accurate for small samples
- For tables larger than 2×2 with small samples: use Freeman-Halton extension of Fisher's test
- SPSS reports Fisher's Exact automatically for 2×2 tables — check this when expected counts < 5
❓ Frequently Asked Questions
Quick answers to common questions about the chi-square test in medical research
The chi-square test is used to determine whether there is a significant association between two categorical variables. Common examples include: comparing disease rates between male and female patients, examining whether smoking is associated with lung cancer diagnosis, or testing whether blood group is associated with disease severity.
There is no strict minimum, but the chi-square assumption requires that at least 80% of cells have expected frequency ≥ 5, and no cell has expected frequency < 1. For a 2×2 table, this generally means you need at least 20-30 total observations. With smaller samples, use Fisher's Exact Test instead.
Chi-square can be applied to ordinal data, but it ignores the ordering information. For ordinal data, the Mantel-Haenszel chi-square (test for trend) or Spearman's correlation may be more appropriate as they use the ordinal ranking. For example, comparing disease severity (mild/moderate/severe) between two groups.
Report in this format: "There was a statistically significant association between smoking status and lung disease (χ²(1) = 12.34, p = 0.002, Cramer's V = 0.35)." Include the chi-square statistic, degrees of freedom in parentheses, exact p-value, and an effect size measure. Present the data in a well-formatted crosstabulation table.
Chi-square test of independence tests for association between two categorical variables (most common in medical research). Chi-square goodness-of-fit tests whether observed frequencies in one variable match an expected distribution (e.g., whether blood group frequencies in your sample match known population frequencies). Both use the same χ² formula but serve different purposes.