Chi-Square Calculator

Work out the chi-square statistic, degrees of freedom and p-value for a 2 by 2 contingency table. It tests whether two categorical variables are associated.

1 Fill in the boxes

2 Your answer

Your answer shows here as you type.

How to use the Chi-Square Calculator

  1. Enter the four counts of a 2 by 2 table: a and b in the first row, c and d in the second.
  2. Tick Yates correction if you are working through a textbook method that asks for it.
  3. A p-value below 0.05 usually means the two variables are associated.

Frequently asked questions

What does the chi-square statistic measure?

It measures how far the observed counts are from the counts expected if the two variables were independent. A larger value means a bigger gap.

How is the chi-square value calculated for a 2 by 2 table?

With N as the total count, chi-square = N(ad - bc)^2 / (row 1 total x row 2 total x column 1 total x column 2 total). The expected count for each cell is its row total times its column total, divided by N.

What is Yates continuity correction?

It subtracts N/2 from the absolute value of ad - bc before squaring. It is applied to 2 by 2 tables and makes the test more conservative, and it is often used when counts are small.

What p-value counts as significant?

A p-value below 0.05 is the most common cutoff. The right threshold depends on the field and the study design.

Wrote something with AI? Slop Monkey rewrites it so it sounds like you, and keeps your facts.