Free online tools to generate, calculate,
convert, format, encode, and play.
 

Chi-Square Test Calculator

Test statistical independence and goodness of fit with the chi-square test.


Chi-Square Goodness of Fit Test

Test if observed frequencies match expected frequencies

Enter observed counts separated by commas
Enter expected counts separated by commas (or leave blank for equal distribution)
Example Datasets:
Chi-Square Test of Independence

Test if two categorical variables are independent (2x2 contingency table)

Column 1 Column 2
Row 1
Row 2
Example Datasets:
Chi-Square Critical Value Lookup

Find the critical value for a given degrees of freedom and significance level

Chi-Square Distribution Table (α = 0.05):
df α = 0.10 α = 0.05 α = 0.01

📚 How It Works
What is the Chi-Square Test?

The chi-square (χ²) test is a statistical hypothesis test used to determine if there's a significant difference between observed and expected frequencies, or if two categorical variables are independent.

Chi-Square Formula

χ² = Σ [(O - E)² / E]

Where:

  • O = Observed frequency
  • E = Expected frequency
  • Σ = Sum over all categories
Goodness of Fit Test

Tests if observed data fits an expected distribution:

  • Null Hypothesis (H₀): Observed data fits expected distribution
  • Alternative (H₁): Observed data doesn't fit expected distribution
  • Degrees of Freedom: df = k - 1 (where k = number of categories)

Example: Is a die fair? Roll 60 times, expect 10 per face.

Test of Independence

Tests if two categorical variables are independent:

  • Null Hypothesis (H₀): Variables are independent
  • Alternative (H₁): Variables are dependent (associated)
  • Degrees of Freedom: df = (rows - 1) × (columns - 1)

Example: Is gender associated with product preference?

Expected Frequencies (Independence)

For a contingency table:

E = (Row Total × Column Total) / Grand Total

Interpreting Results
  1. Calculate χ²: Sum of [(O-E)²/E] for all cells
  2. Find df: Degrees of freedom
  3. Compare: χ² statistic vs. critical value
  4. Decision:
    • If χ² > critical value: Reject H₀ (significant difference)
    • If χ² ≤ critical value: Fail to reject H₀ (no significant difference)
Significance Levels
  • α = 0.05 (5%): Standard in most fields
  • α = 0.01 (1%): More stringent (reduce Type I error)
  • α = 0.10 (10%): More lenient (exploratory research)
P-Value Interpretation
  • p < 0.001: Very strong evidence against H₀
  • p < 0.01: Strong evidence against H₀
  • p < 0.05: Moderate evidence against H₀
  • p > 0.05: Weak evidence, fail to reject H₀
Assumptions
  • Data are frequencies (counts), not percentages
  • All observations are independent
  • Expected frequency in each cell should be ≥ 5
  • Sample is random
Real-World Applications
  • Genetics: Test Mendelian inheritance ratios (3:1)
  • Medicine: Treatment effectiveness vs. outcomes
  • Marketing: Product preference by demographic
  • Quality Control: Defect rates across shifts
  • Social Science: Survey response patterns
  • Gaming: Testing if dice/cards are fair
Example Calculation

Question: Is a die fair? Rolled 60 times:

Face Observed Expected (O-E)²/E
18100.4
212100.4
311100.1
49100.1
510100.0
610100.0
χ² =1.0

df = 6 - 1 = 5, critical value (α=0.05) = 11.07

Conclusion: χ² (1.0) < 11.07, fail to reject H₀. Die appears fair.



Feedback

Help us improve this page by providing feedback, and include your name/email if you want us to reach back. Thank you in advance.


Share with