Chi-Square Test Calculator
Statistics, Inference
Intro: Computes chi-square statistics for goodness-of-fit and independence, including degrees of freedom, p-value, and conclusion.
Worked example
- A die is rolled 60 times with observed counts: 8, 10, 9, 11, 12, 10. Test if the die is fair at α = 0.05.
- We are testing whether the die is fair, so we use a chi-square goodness-of-fit test with equal expected probabilities.
- Total rolls are $N = 8+10+9+11+12+10 = 60$.
- If the die is fair, the probability for each face is $1/6$, so the expected count for each face is $E_i = 60/6 = 10$.
- The chi-square formula is $\chi^2 = \sum \dfrac{(O_i - E_i)^2}{E_i}$ where $O_i$ are observed counts and $E_i$ expected counts.
- Compute contributions for each face: 1: $(8-10)^2/10 = 4/10 = 0.4$ 2: $(10-10)^2/10 = 0$ 3: $(9-10)^2/10 = 1/10 = 0.1$
- Continue: 4: $(11-10)^2/10 = 1/10 = 0.1$ 5: $(12-10)^2/10 = 4/10 = 0.4$ 6: $(10-10)^2/10 = 0$.
- Add them: $\chi^2 = 0.4+0+0.1+0.1+0.4+0 = 1.0$.
- Degrees of freedom are $df = k-1 = 6-1 = 5$ (k = number of categories).
- Using a chi-square distribution with df = 5, the p-value for $\chi^2 = 1.0$ is large (around $p \approx 0.96$).
- Since $p > 0.05$, we fail to reject $H_0$ and conclude there is no evidence that the die is unfair.
- Answer: $\boxed{\chi^2 = 1.0,\; df=5,\; p \approx 0.96 \Rightarrow \text{fail to reject }H_0.}$
FAQs
Can this handle any table size?
Yes, you can input any r×c contingency table for an independence test or any number of categories for a goodness-of-fit test.
Why choose MathGPT?
- Get clear, step-by-step solutions that explain the “why,” not just the answer.
- See the rules used at each step (power, product, quotient, chain, and more).
- Optional animated walk-throughs to make tricky ideas click faster.
- Clean LaTeX rendering for notes, homework, and study guides.
How this calculator works
- Type or paste your function (LaTeX like
\sin,\lnworks too). - Press Generate a practice question button to generate the derivative and the full reasoning.
- Review each step to understand which rule was applied and why.
- Practice with similar problems to lock in the method.