The chi-squared (χ²) test is a statistical method used to determine whether there is a significant difference between two categorical variables or if a sample distribution fits an expected distribution. It compares the observed frequencies in each category to the expected frequencies, assuming no relationship between the variables.
The test is commonly applied in hypothesis testing, where a low p-value indicates that the observed data significantly deviates from the expected values. The chi-squared test is widely used in fields like social sciences, genetics, and market research to analyze contingency tables and goodness-of-fit models.
In a Chi-square test, the null and alternative hypotheses are formulated based on the type of Chi-square test you’re conducting—either a goodness-of-fit test or a test of independence.
Chi-Square Goodness-of-Fit Test (a.k.a. 1-way chi-square test)
Null Hypothesis (H₀): The observed data fits the expected distribution. In other words, there is no significant difference between the observed and expected frequencies.
Alternative Hypothesis (H₁): The observed data does not fit the expected distribution, implying a significant difference between observed and expected frequencies.
Notes:
The following presentation shows how to perform a one-way chi-square test using a sample scenario.
In this video, you will learn how to conduct a one-way chi-square test using a spreadsheet.
Chi-Square Test of Independence (a.k.a. 2-way chi-square test)
Null Hypothesis (H₀): The two categorical variables are independent of each other. There is no association between the variables.
Alternative Hypothesis (H₁): The two categorical variables are dependent, meaning there is a significant association between them.
Notes:
In both cases, the goal is to assess whether the observed data aligns with the null hypothesis. If the Chi-square test statistic exceeds a critical value, the null hypothesis is rejected in favor of the alternative.
The chi-square test is used when a parametric test (that assumes normality in the population) can not be used. Data will be categorical in nature (i.e. nominal or ordinal (ranked)). Chi-squared is one of many nonparametric tests of significance that does not require normality.
The following presentation shows how to perform a two-way chi-square test using a sample scenario.
Here is a copy of the two-way chi-square spreadsheet used in the video above:
In this video, you will learn how to conduct a two-way chi-square test using a spreadsheet.
The following video presents the steps required to conduct a two-way chi-square test using Rstudio:
Here are the complete notes related to all the chi-square examples and resources shared on this page:
© Unity Environmental University 2025. “America’s Environmental University.™”