Chi-Square Independence

Calculate Chi-Square Independence instantly with the exact formula and a worked example.

Chi-Square Independence

Row 1, column 1
Row 1, column 2
Row 1, column 3 (0 = no column)
Row 2, column 1
Row 2, column 2
Row 2, column 3 (0 = no column)
χ²
3.111
Calculate Chi-Square Independence instantly with the exact formula and a worked example.
At α = 0.05
Not significant
p-value
0.2111
Degrees of freedom
2
Cramér's V
0.125

The chi-square test of independence checks whether two categorical variables are associated — for example, customer segment and chosen plan. This calculator handles contingency tables with two rows and two or three columns.

How the calculation works

Enter observed counts (not percentages) in the cells: the two rows are your two groups and the columns are the outcome categories. For a 2×2 table leave both column-3 cells at zero; a column whose two cells are both 0 is dropped from the calculation.

For each cell the calculator computes the count expected under independence, E = row total × column total ÷ N, where N is the grand total. Pearson’s statistic is χ² = Σ (O − E)² ÷ E, with degrees of freedom df = (rows − 1) × (columns − 1): 1 for a 2×2 table, 2 for 2×3. The p-value comes from the chi-square distribution with df degrees of freedom, and the tool flags the result as significant or not at α = 0.05.

Effect size is reported as Cramér’s V = √(χ² ÷ (N × (min(r, c) − 1))), which for two rows reduces to √(χ² ÷ N). Zero means no association; values toward 1 mean a strong one. If any expected count is below 5 you get a warning, because the chi-square approximation becomes unreliable.

Worked example

Defaults: group 1 — 20, 30, 50; group 2 — 30, 30, 40 (100 people each, N = 200). Column totals are 50, 60, 90, so expected counts in each row are 25, 30, 45. χ² = 2 × [(20 − 25)²/25 + 0 + (50 − 45)²/45] = 2 × (1 + 0.556) ≈ 3.111. With df = 2, p ≈ 0.211, above 0.05, so the association is not significant. Cramér’s V = √(3.111 ÷ 200) ≈ 0.125.

Things to keep in mind

  • Use raw counts. Percentages or averages produce a meaningless χ².
  • Each subject must fall into exactly one cell. Paired or repeated measurements on the same people need a different test, such as McNemar’s.
  • For 2×2 tables the calculator uses the uncorrected Pearson χ² (no Yates continuity correction). With small expected counts, Fisher’s exact test is the safer choice.
  • Significance is not strength: with a large sample, even V ≈ 0.05 can be “significant” while being practically negligible.
  • The test detects association, not causation.

More about: Chi-Square Independence

What it calculates

The “Chi-Square Independence” calculator computes χ² from 6 parameters: row 1, column 1, row 1, column 2, row 1, column 3 (0 = no column), row 2, column 1, row 2, column 2, row 2, column 3 (0 = no column).

A core calculation for studying, engineering tasks, and checking solutions.

Example calculation

With parameters Row 1, column 1 = 20, Row 1, column 2 = 30, Row 1, column 3 (0 = no column) = 50, Row 2, column 1 = 30, Row 2, column 2 = 30, Row 2, column 3 (0 = no column) = 40 the result is 3.11.

How to use

  1. Enter row 1, column 1, row 1, column 2, row 1, column 3 (0 = no column), row 2, column 1, row 2, column 2 and row 2, column 3 (0 = no column) — each field above is adjustable with a slider.
  2. χ² is calculated automatically as you type.
  3. Check the worked example below to see the formula applied to real numbers.
  4. Copy the result or bookmark this calculator.

Related calculators

FAQ

How do I read the p-value?
It is the probability of a χ² at least this large if the two variables were truly independent. If p < 0.05, you reject independence at the 5% level.
What if an expected count is below 5?
Combine sparse categories, collect more data, or use Fisher’s exact test for a 2×2 table. Cochran’s rule of thumb asks for expected counts of at least 5.
Can I analyze a 3×3 table?
No. This calculator supports two rows with two or three columns only.
How is this different from a chi-square goodness-of-fit test?
Goodness of fit compares one variable’s distribution with a theoretical one; the independence test looks at the joint distribution of two variables in a contingency table.

More calculators in this category

Explore related free tools

Logistic RegressionR² Coefficient of DeterminationStandard Error of EstimateVIF (multicollinearity)Effect Size (Cohen's d)Sample Size for MeanMargin of ErrorConfidence LevelMultivariate Test (MVT)Max DrawdownInformation RatioTracking Error