Skip to content

Chi-Square Goodness of Fit

Calculate and visualize the Chi-Square test statistic. Compare expected vs observed dice rolls across categories and plot how deviations force the P-value into the rejection region.

WHAT IS CHI-SQUARE GOODNESS OF FIT?

The **Chi-Square Goodness of Fit** test is used to determine if an observed frequency distribution matches an expected distribution. It is used for categorical data with one variable and multiple categories (e.g., checking if a bag of M&Ms matches the advertised color distribution).

THE TEST STATISTIC

The statistic measures the total discrepancy between observed and expected counts. It is calculated by summing the squared differences between observed () and expected () counts, divided by the expected counts: .

HOW TO USE THIS VISUALIZATION

1. **Set Expected Counts**: Enter the theoretical distribution you are testing against.\n2. **Input Observed Data**: Enter the actual counts you collected.\n3. **Calculate P-value**: Watch the tool calculate the statistic and find the area in the right tail of the Chi-Square distribution with .

CORE FORMULAS

Chi-Square test statistic
Degrees of freedom (k = number of categories)

AP EXAM CONNECTION

Unit: Unit 8: Inference for Categorical Data (Topic 8.2)
Learning Objective: UNC-4.K

COMMON MISCONCEPTIONS

  • Using proportions instead of counts in the formula.

KEY TAKEAWAYS

  • Tests distribution fit.
  • Uses counts, not proportions.
  • Right-skewed distribution.

PRACTICE QUESTIONS

Q1 (QUANTITATIVE): If a die is rolled 60 times and each number shows up exactly 10 times, what is the value of the Chi-Square statistic?

Show Answer & Explanation

Answer: 0

Explanation: Observed matches Expected for all categories, so for every term in the sum.

DEEP DIVE: RELATED CONCEPTS