Chi-Square
Purpose:
Chi-square tests examine categorical data. There are two types:
- Goodness of Fit: Tests whether the observed frequency distribution of ONE categorical variable matches an expected distribution.
- Test of Independence: Tests whether TWO categorical variables are associated with each other.
Context Used:
- Goodness of Fit: ONE categorical variable with 2+ levels; comparing observed frequencies to expected frequencies.
- Test of Independence: TWO categorical variables; testing whether they are associated.
Do NOT use chi-square if: Your variables are continuous → use correlation or regression | You want to compare means → use t-test or ANOVA | Expected cell frequencies are below 5 in more than 20% of cells → use Fisher's Exact Test
Assumptions:
- Categorical data: Both variables must be categorical. Chi-square cannot be used with continuous variables.
- Independence of observations: Each participant contributes to only one cell in the frequency table.
- Expected cell frequency: Expected frequencies in each cell should be at least 5. If violated, use Fisher's Exact Test (available in Jamovi under the same menu).
Chi-square does not assume normality — that assumption applies to tests with continuous DVs only.
Jamovi Walkthrough:
Goodness of Fit:
- Click "Frequencies" → "One Sample Proportion Tests" → "N outcomes: χ²"
- Move the categorical variable into the "Variable" box
- Under "Expected Proportions," enter the expected proportion for each level
- Check "χ² test"
Test of Independence:
- Click "Frequencies" → "Independent Samples" → "χ² test of association"
- Move one variable into "Rows" and the other into "Columns"
- Check "χ²" under "Statistics"
- Check "Phi and Cramér's V" for effect size
R Walkthrough:
Goodness of Fit:
observed <- table(df$variable)
expected_prop <- c(0.55, 0.25, 0.15, 0.05)
chisq.test(x = observed, p = expected_prop)
Test of Independence:
tbl <- table(df$variable1, df$variable2)
chisq.test(tbl)
cramerV(tbl) # Cramer's V — DescTools package
Output Interpretation:
p-value:
- If p < .05 → reject the null hypothesis. There IS a significant difference or association.
- If p > .05 → retain the null hypothesis. No significant difference or association.
Effect size — Cramér's V (Test of Independence only): Ranges from 0 to 1. Benchmarks for a 2×2 table (Cohen, 1988):
| Cramér's V | Interpretation |
|---|---|
| ≈ .10 | Small effect |
| ≈ .30 | Medium effect |
| ≈ .50 | Large effect |
Cramér's V benchmarks shift for larger tables (more categories). The values above apply to 2×2 tables. Cramér's V is not applicable for Goodness of Fit tests.
APA Format:
Sample write-ups:
Goodness of Fit:
A chi-square goodness of fit test examined whether attachment style was equally distributed in the sample. Observed frequencies were: secure (n = 48), anxious (n = 27), and avoidant (n = 25). The test was statistically significant, χ²(, N = ) = , p = , indicating that attachment styles were not equally distributed in this sample.
Test of Independence:
A chi-square test of independence examined whether biological sex was associated with anxiety disorder diagnosis. The association was statistically significant, χ²(, N = ) = , p = , Cramér's V = , indicating a [small/medium/large] association between sex and anxiety diagnosis.
Note: For Test of Independence, always report Cramér's V alongside χ², df, N, and p.