Example Of Chi Square Test For Goodness Of Fit

4 min read

Example of Chi Square Test for Goodness of Fit

The chi‑square goodness‑of‑fit test is a fundamental statistical tool used to determine whether observed categorical data follow a expected distribution. Consider this: researchers and analysts apply this test when they want to compare the frequencies of categories observed in a sample with the frequencies predicted by a theoretical model. This leads to in this article we walk through a complete example of chi square test for goodness of fit, explain the underlying theory, detail each computational step, and discuss how to interpret the results. By the end, you will have a clear, practical understanding of when and how to employ this test in your own work.

And yeah — that's actually more nuanced than it sounds And that's really what it comes down to..

Understanding the Chi‑Square Goodness‑of‑Fit Test

Before diving into the numerical example, it helps to grasp the core concepts that underlie the test Simple, but easy to overlook..

What the Test Evaluates

The null hypothesis (H₀) for a goodness‑of‑fit test states that the observed frequencies in each category match the expected frequencies derived from a specified distribution. The alternative hypothesis (H₁) asserts that at least one category deviates from what the model predicts. The test statistic, denoted χ² (chi‑square), measures the squared difference between observed and expected counts, weighted by the expected count.

Formula and Degrees of Freedom

The chi‑square statistic is calculated as

[ \chi^{2} = \sum_{i=1}^{k} \frac{(O_i - E_i)^2}{E_i} ]

where (O_i) is the observed frequency for category i, (E_i) is the expected frequency, and k is the number of categories Not complicated — just consistent..

Degrees of freedom (df) for a goodness‑of‑fit test equal k − 1 − m, where m is the number of parameters estimated from the data to compute the expected frequencies. That said, if no parameters are estimated (i. e., the expected proportions are fully specified), df = k − 1 Small thing, real impact..

Decision Rule

After computing χ², we compare it to the critical value from the chi‑square distribution table for the chosen significance level (α, commonly 0.05) and the appropriate df. Alternatively, we can compute the p‑value: the probability of obtaining a χ² as extreme as, or more extreme than, the observed value under H₀. If p < α, we reject H₀; otherwise, we fail to reject it.

Honestly, this part trips people up more than it should.

Step‑by‑Step Example: Testing a Fair Die

Suppose you roll a six‑sided die 60 times and record the outcomes. You want to know whether the die is fair, meaning each face should appear with equal probability (1/6). This scenario is a classic example of chi square test for goodness of fit.

Not the most exciting part, but easily the most useful.

1. State the Hypotheses

  • H₀: The die is fair; each face appears with probability 1/6.
  • H₁: The die is not fair; at least one face has a different probability.

2. Collect Observed Frequencies

After 60 rolls, you obtain the following counts:

Face (i) Observed (O_i)
1 8
2 12
3 9
4 11
5 10
6 10
Total 60

3. Determine Expected Frequencies

If the die is fair, each face should appear (60 \times \frac{1}{6} = 10) times. Thus, (E_i = 10) for all six faces.

4. Compute the Chi‑Square Statistic

Apply the formula to each category:

Face (O_i) (E_i) ((O_i - E_i)^2) (\frac{(O_i - E_i)^2}{E_i})
1 8 10 (−2)² = 4 4 / 10 = 0.Because of that, 10
4 11 10 (1)² = 1 1 / 10 = 0. 00
6 10 10 (0)² = 0 0 / 10 = 0.40
3 9 10 (−1)² = 1 1 / 10 = 0.Consider this: 10
5 10 10 (0)² = 0 0 / 10 = 0. 40
2 12 10 (2)² = 4 4 / 10 = 0.00
Sum **χ² = 1.

Thus, the calculated chi‑square statistic is χ² = 1.00.

5. Determine Degrees of Freedom

We have k = 6 categories and no estimated parameters, so df = 6 − 1 = 5.

6. Find the Critical Value or p‑Value

Using a chi‑square distribution table with df = 5 and α = 0.And 05, the critical value is approximately 11. 07 Easy to understand, harder to ignore..

Alternatively, many

Hot Off the Press

Out Now

Others Explored

From the Same World

Thank you for reading about Example Of Chi Square Test For Goodness Of Fit. We hope the information has been useful. Feel free to contact us if you have any questions. See you next time — don't forget to bookmark!
⌂ Back to Home