Statistics

Chi-Square Test of Independence

Test association in a 2 × 2 count table and inspect the smallest expected cell count.

Data stays on this deviceConvention explained below
Data explorer
Data explorer

Check the dataset and sample convention before interpreting results.

See the method

Add your observations

Runs on your device

Your statistical summary

Your result

Let’s calculate.

Use the Calculate button to see your result.

Review the method below for assumptions and conventions.

How to use this tool

  1. Enter row 1, column 1, row 1, column 2, row 2, column 1, row 2, column 2, significance level.
  2. Select Calculate to view the result.
  3. Check the method and assumptions below before using the result.

Input reference and sample values

Use the units and choices shown for each field. Sample values are provided for practice, not as recommendations.

InputFormat and unitsSample
Row 1, column 1Whole numbers only. Zero or positive. Maximum: 1000000.30
Row 1, column 2Whole numbers only. Zero or positive. Maximum: 1000000.10
Row 2, column 1Whole numbers only. Zero or positive. Maximum: 1000000.20
Row 2, column 2Whole numbers only. Zero or positive. Maximum: 1000000.40
Significance levelNumeric value. Minimum: 0.0001. Maximum: 0.2.0.05

Result for these sample inputs

0.0000445570906 probability
Test statistic
16.6666667
Degrees of freedom
1
Decision at chosen alpha
Reject the null hypothesis
Smallest expected count
20
Cramér’s V
0.40824829

The p-value is not the probability that the null hypothesis is true. Choose the hypothesis and significance level before inspecting the result; statistical significance does not measure practical importance.

Select Try the example in the form to load these values and calculate them again. This replaces the current form inputs. Compare the result with the method and worked explanation below.

The method, explained

Expected count = row total × column total / grand total. Pearson χ² = sum[(O−E)²/E], with one degree of freedom. No Yates continuity correction is applied.

A WORKED EXAMPLE

Using row 1, column 1 = 30, row 1, column 2 = 10, row 2, column 1 = 20, row 2, column 2 = 40, significance level = 0.05, the result is 0.0000445570906 probability. Change these example inputs to match your task; use the method above to check each step.

What to keep in mind

Independent observations, each counted once. Approximation can be poor with sparse cells. Association does not establish causation. A descriptive or probability calculation under the stated assumptions. Check the sample design and model before interpreting results.

Reference: NIST: statistical methods handbook

Common questions

What goes into the four cells?

Enter counts for two categories of one variable crossed with two categories of another. Each observation belongs in exactly one cell. Do not enter percentages or row totals.

Is Yates correction applied?

No. This is the uncorrected Pearson test. The result also shows the smallest expected count so you can assess whether the asymptotic approximation is appropriate.

Methodology maintained by ClarityKit. How these tools are built and checked.