Chi-Square Independence Test

Enter observed counts in a contingency table to compute the chi-square statistic, degrees of freedom, and p-value for testing independence.

Contingency Table

Fill in the table and click Run Test to see results.

Summary

Enter observed counts in a contingency table to compute the chi-square statistic, degrees of freedom, and p-value for testing independence.

How it works

  1. Choose the number of rows and columns for your contingency table (default 2x2).
  2. Enter the observed frequency counts in each cell.
  3. Click "Run Test" to compute row and column totals.
  4. The tool calculates expected counts using the formula: (row total × column total) / grand total.
  5. The chi-square statistic is the sum of (observed - expected)^2 / expected across all cells.
  6. Degrees of freedom = (rows - 1) × (columns - 1). The p-value is derived from the chi-square distribution.

Use cases

  • Test whether a marketing campaign response rate differs across age groups.
  • Determine if product preference is independent of gender.
  • Analyze whether disease occurrence is associated with a risk factor.
  • Evaluate whether survey responses differ between regions.
  • Check independence of two classification variables in a research dataset.
  • Validate assumptions before applying further statistical models.

Frequently Asked Questions

Last updated: 2026-06-10 · Reviewed by Nham Vu