Chi-Square Calculator
Test statistical independence in 2×2 contingency tables and goodness-of-fit distributions with exact p-values, Cramér's V, and odds ratios.
Test independence between two categorical variables with two levels each.
Interactive, data-driven visualization computed from your current input values.
Chi-Square Sampling Distribution (df = 1)
H₀: Row and Column attributes are independent. Observed χ² = 11.43
Step-by-Step Mathematical Derivation
Detailed derivation with exact formulas, user input substitutions, and statistical interpretations.
Calculate Marginal & Grand Totals
Sums across rows and columns to establish sample marginal proportions.
Compute Expected Frequencies under Independence
All expected frequencies satisfy Cochran's rule (E ≥ 5).
Compute Chi-Square Contributions
Sums squared standard residuals across all 4 contingency cells.
P-Value & Degrees of Freedom
Comparing observed statistic to χ² critical threshold at α = 0.05: Reject H₀ at α = 0.05 (Significant Association Between Variables).
Effect Size (Cramér's V & Odds Ratio)
Cramér's V of 0.378 reflects a moderate association between attributes.
Evaluation & Analysis Guidelines
- Observations are mutually exclusive categorical counts
- Cochran's rule satisfied: all expected frequencies ≥ 5
Chi-Square Independence & Goodness of Fit Formulas
Formulas for observed vs expected frequency tables, degrees of freedom, and upper-tail incomplete gamma functions.
Pearson's Chi-Square Test of Independence
Evaluates whether two categorical attributes are statistically independent by comparing observed counts against expected counts under the independence assumption.
Chi-Square Goodness-of-Fit
Tests whether an observed categorical frequency distribution differs from a theoretical or hypothesized model.
Cramér's V Effect Size & Odds Ratio
Quantifies association strength independently of sample size N via Cramér's V (0 to 1), while Odds Ratio measures relative outcome likelihood across rows in a 2×2 table.
Step-by-Step Guide: Contingency Independence & Goodness-of-Fit Chi-Square
Evaluates relationships between categorical count variables by measuring squared normalized discrepancies between observed frequencies (O) and null-expected counts (E).
- 1
Enter Raw Count Frequencies (Not Percentages)
In 2×2 Contingency Independence mode, input the four raw cell counts (A, B, C, D). In Goodness-of-Fit mode, provide observed counts alongside expected theoretical counts.
- 2
Verify Expected Cell Frequency Rules
Each expected cell count E = (Row Total × Column Total) ÷ N represents what would occur purely by independence.
- 3
Interpret χ², P-Value, Cramér's V & Odds Ratio
Because χ² is strictly non-negative, the right tail beyond observed χ² determines significance, while Cramér's V measures association strength regardless of sample size.
Chi-Square Critical Cutoffs (α = 0.05) & Cramér's V Benchmarks
Standard right-tail χ² rejection thresholds by degrees of freedom and association strength rules.
| Degrees of Freedom (df) | Critical χ² (α = 0.10) | Critical χ² (α = 0.05) | Critical χ² (α = 0.01) | Cramér's V (df*=1) |
|---|---|---|---|---|
| df = 1 (2×2 Table) | 2.7055 | 3.8415 | 6.6349 | 0.10 = Small effect |
| df = 2 | 4.6052 | 5.9915 | 9.2103 | 0.30 = Medium effect |
| df = 3 | 6.2514 | 7.8147 | 11.3449 | 0.50 = Large effect |
| df = 4 | 7.7794 | 9.4877 | 13.2767 | Range: [0, 1] |
| df = 5 | 9.2364 | 11.0705 | 15.0863 | Sample-size invariant |
Cochran's Expected Count Rules & Data Requirements
Cochran's Rule for Small Samples
In a 2×2 contingency table, all four expected cell counts must be ≥ 5; in larger tables, ≥ 80% of cells must have E ≥ 5 and none < 1. If expected counts drop below 5, use Fisher's Exact Test.
Independent Mutually Exclusive Observations
Every observation in the contingency table must represent an independent trial belonging to exactly one row and one column category (no repeated measurements on the same individual).
Chi-Square Calculator — Worked Examples
Real-world scenarios and verified benchmark inputs for the Chi-Square Calculator.
Marketing Campaign 2×2 Association
Testing independence between landing page design (A vs B) and conversion counts (Yes vs No) across 80 visitors.
Quarterly Customer Preference Goodness-of-Fit
Comparing observed counts [30, 20, 35, 15] across 4 categories against an equal expected distribution [25, 25, 25, 25].
Six-Sided Die Fairness Validation
Testing observed roll frequencies across 6 faces against equal expectation (10 per face) over 60 throws.
Chi-Square Calculator — Frequently Asked Questions
Questions about contingency tables, Cochran's minimum cell frequency rules, Fisher's exact test, and Cramér's V.
What is Cochran's rule for minimum expected frequencies?
Cochran's rule states that for a valid chi-square test, no expected cell frequency should be below 1, and at least 80% of cells should have expected frequencies of 5 or more. In a 2×2 table, all 4 expected counts must be ≥ 5; otherwise, Fisher's Exact Test is recommended.
What does Cramér's V measure?
Cramér's V measures the strength of association between categorical variables on a scale from 0 (no association) to 1 (complete association), adjusting for sample size. For df* = 1 in a 2×2 table: 0.10 = small, 0.30 = medium, and 0.50 = large effect.
When should I use Chi-Square Goodness-of-Fit vs Chi-Square Test of Independence?
Use Goodness-of-Fit when you have one categorical variable and want to test whether its observed distribution matches expected theoretical proportions (e.g., uniform distribution or Mendelian 9:3:3:1 ratios). Use Test of Independence when examining whether two categorical variables are related across a contingency table.
Why is the Chi-Square hypothesis test always right-tailed?
Because every cell deviation (O − E)² is squared and divided by positive expected counts E, the test statistic χ² can never be negative. Zero represents an exact match between observed and expected data, whereas larger discrepancies produce strictly larger positive χ² values in the upper right tail.
Can I enter percentages instead of raw counts into a Chi-Square calculator?
No. The Chi-Square formula scales directly with sample size N. Entering percentages (which artificially sum to 100) instead of actual observed counts produces incorrect test statistics and invalid p-values.
How is Yates' continuity correction handled?
YourCalculate reports Pearson's standard unadjusted χ² statistic by default to maintain direct parity with textbook derivations, R's chisq.test(..., correct=FALSE), and large-sample contingency tables, while flagging small expected cell counts below 5.
Related Calculators
Explore connected statistics & probability and related computation tools.