The Chi-square test (ฯยฒ) is one of the most versatile and widely used statistical tools in psychology and social science research. Its power lies in a single, focused question: do the frequencies we observe in our data match what we expected? Whether you’re studying patterns of absenteeism, testing attitudes across groups, or exploring whether two variables are related, the Chi-square test provides a rigorous, non-parametric method for drawing conclusions from categorical data. This guide walks through its four major applications – goodness of fit, equal probability testing, independence testing, and 2 ร 2 contingency table analysis – with worked examples at each step.
Table of Contents
- What the Chi-square test actually does
- Application 1: Chi-square as a test of goodness of fit
- Example: student absenteeism
- Application 2: Testing hypotheses of equal probability
- Example: day-of-week absenteeism
- Application 3: Chi-square as a test of independence
- Example: attitude toward statistics and learning preference
- Measuring the strength of association
- Application 4: The 2 ร 2 fold contingency table
- Simplified formula for 2 ร 2 tables
- Example: gender and voting behaviour
- When to use Fisher’s exact test instead
- Reading and interpreting your Chi-square result
- Key assumptions and limitations
What the Chi-square test actually does
The Chi-square test is a statistical test for categorical data – data organised into distinct groups or categories rather than measured on a continuous scale. It compares observed frequencies (what your data actually shows) against expected frequencies (what theory or hypothesis predicts). The larger the gap between these two, the larger the ฯยฒ statistic – and the more likely your result is statistically significant.
The core formula is:
ฯยฒ = ฮฃ [(O โ E)ยฒ / E]
Where O is the observed frequency and E is the expected frequency for each category. You sum this calculation across all categories to get the final ฯยฒ value, which is then compared against a critical value from the Chi-square distribution table based on your degrees of freedom and significance level (typically 0.05).
Unlike parametric tests like the t-test or ANOVA, the Chi-square test does not rely on assumptions about population distributions, making it especially useful when data don’t meet the conditions for parametric analysis. The test is applied in four main ways, each suited to a different research scenario.
Application 1: Chi-square as a test of goodness of fit
The goodness of fit test asks whether the distribution of a single categorical variable matches a hypothesised distribution. In other words: does your observed data “fit” what you expected?
The null hypothesis for this test states that the sample data follow the hypothesised distribution. The alternative hypothesis states that they do not. The test is almost always right-tailed – if observed and expected values diverge significantly, the ฯยฒ statistic grows large and falls in the right tail of the distribution.
Example: student absenteeism
A classic psychology-adjacent example involves student absenteeism in mathematics courses, where researchers test whether the actual absence pattern fits what faculty members expected. Suppose faculty predicted that out of 100 students, absences would be distributed across four frequency categories (e.g., 0-2, 3-5, 6-8, 9+). A survey then records the actual number of students in each category. The null hypothesis is: student absenteeism fits faculty perception. The Chi-square statistic is calculated using the formula above, comparing each observed cell frequency against its expected value.
An important assumption: each expected frequency must be at least five for the test to be valid. If any cell falls below this, you must merge adjacent categories before proceeding. Degrees of freedom are calculated as df = k โ 1, where k is the number of categories.
If the resulting ฯยฒ value is less than the critical value at your chosen significance level, you fail to reject the null hypothesis – meaning the observed data are consistent with faculty expectations. If ฯยฒ exceeds the critical value, the distribution significantly departs from what was predicted.
Application 2: Testing hypotheses of equal probability
A special and very common case of the goodness of fit test involves the hypothesis that all categories are equally likely. Here, the expected frequency for each category is simply the total sample size divided by the number of categories.
The expected values for ฯยฒ tests correspond to the null hypothesis of equal representation across categories – the distribution you would expect if categorisation were completely random. If the observed frequencies deviate significantly from this equal distribution, the test indicates that some categories are more prevalent than others.
Example: day-of-week absenteeism
Consider a scenario where employers want to know whether employee absences are equally distributed across a five-day work week. A random sample of 60 managers is asked which day had the highest number of absences. If absences are equally probable across five days, the expected frequency for each day is 60 รท 5 = 12.
The null hypothesis is: absences occur equally across all five weekdays. Degrees of freedom = 5 โ 1 = 4. If the computed ฯยฒ falls below the critical value for df = 4 at ฮฑ = 0.05 (which is 9.488), we do not reject the null hypothesis – and conclude there is no significant day-of-week effect on absenteeism. This type of test is particularly relevant in organisational and occupational psychology research, where identifying patterns in workplace behaviour often relies on comparing observed distributions against theoretical baselines.
Application 3: Chi-square as a test of independence
When a researcher has two categorical variables and wants to know whether they are related or independent of each other, the Chi-square test of independence is the right tool. This test assesses whether belonging to a certain group on one variable affects the likelihood of belonging to a particular group on another variable.
The data are arranged in a contingency table – a cross-tabulation where rows represent one variable and columns represent another. Expected frequencies for each cell are calculated as:
E = (Row Total ร Column Total) / Grand Total
Degrees of freedom for the independence test are: df = (Rows โ 1) ร (Columns โ 1)
Example: attitude toward statistics and learning preference
Suppose you survey 200 psychology students about two variables: their attitude toward statistics (positive or negative) and their preferred learning format (traditional classroom or online). The data might look like this:
- 60 students: positive attitude, traditional classroom
- 40 students: positive attitude, online
- 30 students: negative attitude, traditional classroom
- 70 students: negative attitude, online
You calculate the expected frequency for each cell using row and column totals, then apply the ฯยฒ formula across all four cells. The null hypothesis states that the two variables are independent – that knowing a student’s attitude tells you nothing about their learning preference. The alternative hypothesis states that they are related.
If the computed ฯยฒ exceeds the critical value at the chosen significance level, you reject the null hypothesis and conclude that attitude and learning preference are significantly associated. Importantly, a significant result indicates association, not causation – the test does not tell you which variable influences the other.
Measuring the strength of association
Knowing that an association is statistically significant doesn’t tell you how strong it is. Cramer’s V is a widely used effect size measure for Chi-square tests. Like Pearson’s r, its benchmarks are: small = .10, medium = .30, and large = .50. It is calculated as:
V = โ[ฯยฒ / N(k โ 1)]
Where N is the total sample size and k is the smaller of the number of rows or columns. Always report Cramer’s V alongside your ฯยฒ result to give readers a full picture of your findings.
Application 4: The 2 ร 2 fold contingency table
The 2 ร 2 contingency table – also called a fourfold contingency table – is the simplest and most frequently encountered form of the independence test in psychology research. It involves two categorical variables each with exactly two levels, producing four cells (A, B, C, D).
Simplified formula for 2 ร 2 tables
While the standard ฯยฒ formula applies here too, a dedicated shortcut formula is available for 2 ร 2 tables. If the four cell frequencies are labelled A (top-left), B (top-right), C (bottom-left), and D (bottom-right), and N is the total sample size, then:
ฯยฒ = N(AD โ BC)ยฒ / [(A + B)(C + D)(A + C)(B + D)]
Degrees of freedom for a 2 ร 2 table are always df = (2 โ 1)(2 โ 1) = 1, and the critical value at ฮฑ = 0.05 is 3.84.
Example: gender and voting behaviour
In a psychology research context, a 2 ร 2 table might compare gender (male/female) against therapy outcome (improved/not improved). You enter the four cell counts, calculate expected frequencies using row and column totals, apply either the standard or shortcut ฯยฒ formula, and compare the result to the critical value of 3.84.
When to use Fisher’s exact test instead
Fisher’s exact test should be used as an alternative to the Chi-square test for 2 ร 2 tables when the total sample size is fewer than 20, or when any expected cell frequency falls below five. Under these conditions, the Chi-square approximation becomes unreliable, and the exact test provides a more accurate p-value. For larger samples, Pearson’s Chi-square remains the standard approach.
Reading and interpreting your Chi-square result
Once you have your ฯยฒ statistic, interpretation follows a consistent logic across all four applications:
If ฯยฒ > critical value โ Reject Hโ. The observed and expected frequencies differ significantly. There is a statistically significant pattern or association.
If ฯยฒ โค critical value โ Fail to reject Hโ. The observed data are consistent with the null hypothesis. No significant pattern is detected.
The Chi-square test does not measure the strength or practical importance of an association – it only indicates whether a significant relationship exists. This is why effect size measures like Cramer’s V or the phi coefficient must be reported alongside the test statistic. Additionally, in very large samples, even trivial differences between observed and expected frequencies can produce statistically significant results – a reminder to always interpret statistical significance alongside practical or clinical significance.
Key assumptions and limitations
The Chi-square test works well under the right conditions, but three assumptions must be met:
Independence of observations: Each data point must belong to only one cell. Repeated measures or matched-pair data violate this assumption – in such cases, McNemar’s test is more appropriate.
Adequate expected frequencies: Each expected cell frequency should generally be at least 5. When this is violated, exact tests or alternative methods are preferred.
Categorical data only: The Chi-square test is designed for nominal or ordinal category counts. It cannot be applied to continuous numerical data without first grouping observations into discrete categories (a process called data binning).
Understanding these limitations helps you choose the right test for your research question and avoid common misinterpretations – particularly the temptation to read causation into association, or to treat statistical significance as equivalent to practical importance.
What do you think? In a psychology study you’re familiar with, could the relationship between two variables have been tested more rigorously using a Chi-square test of independence rather than simply comparing percentages? And when a Chi-square result is statistically significant, what additional information do you think researchers should be required to report before drawing conclusions?
References
- https://www.scribbr.com/statistics/chi-square-tests/
- https://www.simplypsychology.org/chi-square.html
- https://www.scribbr.com/statistics/chi-square-goodness-of-fit/
- https://openstax.org/books/introductory-statistics-2e/pages/11-2-goodness-of-fit-test
- https://open.maricopa.edu/psy230mm/chapter/chapter-18-chi-square/
- https://ecampusontario.pressbooks.pub/introstats/chapter/10-4-the-goodness-of-fit-test/
- https://statisticsbyjim.com/hypothesis-testing/chi-square-goodness-of-fit-test/
- https://en.wikipedia.org/wiki/Chi-squared_test
- https://stats.libretexts.org/Courses/Kennesaw_State_University/Statistical_Applications_in_Psychological_Sciences_with_Multimedia/15:_Chi-square/15.01:_Chi-Square_Goodness_of_Fit_Test
- https://www.statsdirect.com/help/chi_square_tests/22.htm
- https://web.pdx.edu/~newsomj/uvclass/ho_chisq.pdf
Leave a Reply