Calculator Suite

Chi-Square Test Calculator

Chi-Square Analysis

Perform chi-square goodness of fit tests and tests of independence with comprehensive statistical analysis

Analysis Settings
Test Configuration
Choose your chi-square test type and analysis parameters
Goodness of Fit Data
Enter observed and expected frequencies for each category

Enter the actual counts for each category

Enter the theoretical expected counts for each category

Labels for each category (leave empty for auto-generated labels)

Educational Resources

Chi-Square Formulas
Mathematical foundations of chi-square testing

Test Statistic

χ2=i(OiEi)2Ei\chi^2 = \sum_{i} \frac{(O_i - E_i)^2}{E_i}

OiO_i = Observed frequency in cell i

EiE_i = Expected frequency in cell i

χ2\chi^2 = Chi-square test statistic

Expected Frequency (Independence)

Eij=Ri×CjNE_{ij} = \frac{R_i \times C_j}{N}

RiR_i = Row i total

CjC_j = Column j total

NN = Grand total

Degrees of Freedom

Goodness of Fit: df=k1df = k - 1
Independence: df=(r1)(c1)df = (r-1)(c-1)

kk = Number of categories

rr = Number of rows, cc = Number of columns

TL;DR — Chi-Square Test Explained

Chi-square tests analyze categorical data frequencies. Use Goodness of Fit to test if observed frequencies match an expected distribution. Use Test of Independence to examine if two categorical variables are related. If p-value < 0.05, the result is statistically significant.

How to Use This Calculator: Step-by-Step
1

Select Test Type

Goodness of Fit (one variable) or Test of Independence (two variables).

2

Enter Your Data

For GoF: observed and expected frequencies. For Independence: contingency table.

3

Run the Test

Click "Run Chi-Square Test" to calculate χ² statistic and p-value.

4

Interpret Results

Check p-value, degrees of freedom, and Cramér's V (for independence tests).

📊 Example: Dice Fairness Test (Goodness of Fit)

Roll a die 60 times. If fair, expect 10 per side. Observed: [8, 12, 11, 9, 10, 10]

χ² statistic

1.20

df

5

p-value

0.945

Result

Not Significant

Interpretation: p = 0.945 > 0.05, so we cannot reject the hypothesis that the die is fair.

⚠️ Assumptions & Limitations

Key Assumptions:

  • • Data from random sampling
  • • Expected frequencies ≥ 5 in most cells
  • • Independent observations
  • • Categorical (not continuous) data

When to Use Alternatives:

  • • Small expected frequencies: Fisher's exact test
  • • 2×2 tables with small n: Yates' correction
  • • Continuous data: Use t-test or ANOVA
  • • Paired/matched data: McNemar's test
Frequently Asked Questions

When should I use a chi-square test?

Use chi-square for categorical data to test if observed frequencies differ from expected (goodness of fit) or if two categorical variables are related (independence).

What are degrees of freedom in chi-square?

For goodness of fit: df = k - 1 (k = categories). For independence: df = (rows - 1) × (columns - 1).

What if expected frequencies are less than 5?

The chi-square approximation becomes unreliable. Consider combining categories or using Fisher's exact test.

What does Cramér's V tell me?

Cramér's V measures association strength (0-1). ~0.1 = weak, ~0.3 = moderate, ~0.5+ = strong association.

How is chi-square different from a t-test?

Chi-square analyzes categorical frequencies. T-tests compare means of continuous data. Use chi-square for categories, t-test for measurements.

📺 Video Tutorials