Skip to main content
Calkulon
Back to Guides
3 min read6 Steps

How to Perform a Chi-Square Test: Step-by-Step Guide

Learn to calculate chi-square by hand

Skip the math — use the calculator

Step-by-Step Instructions

1

Gather Your Inputs

First, identify the observed and expected frequencies for each category. Make sure you have the correct values, as this will affect the accuracy of your results. For example, let's say we want to determine if there is a significant association between the color of a car and the gender of the driver. Our observed frequencies might look like this: | Color | Male | Female | | --- | --- | --- | | Red | 20 | 15 | | Blue | 30 | 20 | | Green | 10 | 5 | And our expected frequencies might be based on the null hypothesis that the color of the car is independent of the gender of the driver.

2

Calculate the Chi-Square Statistic

Next, plug in the observed and expected frequencies into the formula: χ² = Σ [(observed frequency - expected frequency)^2 / expected frequency]. Using the example above, let's calculate the chi-square statistic: χ² = [(20-18)^2 / 18] + [(15-17)^2 / 17] + [(30-25)^2 / 25] + [(20-25)^2 / 25] + [(10-8)^2 / 8] + [(5-7)^2 / 7] χ² = [4/18] + [4/17] + [25/25] + [25/25] + [4/8] + [4/7] χ² = 0.22 + 0.24 + 1 + 1 + 0.5 + 0.57 χ² = 3.53

3

Determine the Degrees of Freedom

The degrees of freedom (df) for a chi-square test is calculated as (number of rows - 1) * (number of columns - 1). In our example, we have 3 rows (red, blue, green) and 2 columns (male, female), so the degrees of freedom would be (3-1) * (2-1) = 2.

4

Find the p-Value

Using a chi-square distribution table or calculator, find the p-value associated with the calculated chi-square statistic and degrees of freedom. For our example, using a chi-square distribution table with 2 degrees of freedom and a chi-square statistic of 3.53, we find a p-value of approximately 0.17.

5

Interpret the Results

If the p-value is less than your chosen significance level (usually 0.05), you reject the null hypothesis and conclude that there is a significant association between the variables. Otherwise, you fail to reject the null hypothesis and conclude that there is no significant association. In our example, since the p-value is greater than 0.05, we fail to reject the null hypothesis and conclude that there is no significant association between the color of the car and the gender of the driver.

6

Common Pitfalls and Convenience

Common mistakes to avoid include using the wrong formula or incorrectly calculating the degrees of freedom. To avoid these mistakes, double-check your calculations and use a calculator or software for convenience. While it's possible to perform the calculations by hand, using a calculator or software can save time and reduce errors.

Introduction to Chi-Square Test

The chi-square test is a statistical method used to determine whether there is a significant association between two categorical variables. In this guide, we will walk you through the steps to perform a chi-square goodness of fit or independence test by hand.

Prerequisites

Before you start, make sure you have the following:

  • Observed frequencies for each category
  • Expected frequencies for each category (usually based on a null hypothesis)
  • A calculator (optional, but recommended for convenience)

Formula

The chi-square statistic (χ²) is calculated using the following formula: χ² = Σ [(observed frequency - expected frequency)^2 / expected frequency]

Step-by-Step Guide

Ready to Calculate?

Skip the manual work and get instant results.

Open Calculator

Settings

PrivacyTermsAbout© 2026 Calkulon