What the relationship means
Observations must be independent and categories unambiguous. Inputs are absolute counts, not percentages substituted for observations. Null probabilities are positive and sum to 1. The p-value is an asymptotic approximation. The calculator is limited to three categories fully specified in advance and sufficiently large expected counts.
Quality control or inheritance models can test a fixed predicted ratio. With a binomial distribution, define categories and any estimated parameters carefully. Conditional probability clarifies the null assumption; expectation explains the predicted counts. This is not an independence test of a two-dimensional contingency table.
Derive it step by step
Under the null hypothesis, category i has expected count N·pi. An absolute discrepancy of 5 is more notable against an expectation of 10 than 1000. Each squared discrepancy is therefore divided by its expected count. Their sum is nonnegative; large values provide evidence against the specified distribution.
- Specify disjoint, exhaustive categories and null probabilities pi. Sum observed counts to obtain N.
- Calculate Ei=Npi and check applicability of the χ2 approximation. The calculator requires Ei≥5 in every category.
- Sum (Oi−Ei)2/Ei. With the fixed total, only k−1 discrepancies are free for k fully specified categories.
- Use the upper tail of χ2 with ν=k−1−m degrees of freedom when m appropriately estimated parameters must be subtracted. Our three-category mode estimates no parameters and uses ν=2, giving p=exp(−X2/2).
Visualize the model
Observed and expected counts
Free with a Quanta account. Your download stays ready after registration.
Two worked examples
Small discrepancy from a fixed ratio
- Given
- Author calculation: O=(18,32,50), p=(0.2,0.3,0.5), N=100.
- Find
- Calculate the statistic and p-value.
Expected counts are (20,30,50); all are at least 5.
Contributions are 4/20=0.2, 4/30=2/15 and 0. Their sum is 1/3.
With ν=2, the upper-tail p-value is exp(−1/6)≈0.846481725.
Result: At α=0.05 the fixed ratio is not rejected. This does not prove it correct.
Check: Both count vectors sum to 100; the statistic is nonnegative and the p-value lies between 0 and 1.
Large discrepancy with the same expectation
- Given
- Author calculation: O=(10,40,50), still p=(0.2,0.3,0.5).
- Find
- Assess the larger discrepancy.
N remains 100 and E=(20,30,50).
Contributions 100/20 and 100/30 sum to 25/3.
p=exp(−25/6)≈0.015503854; reject at α=0.05.
Result: The larger discrepancy gives a larger statistic and smaller p-value.
Check: Only the data changed, not the null model or categories after inspection.
Recall the method later with the formula’s flashcards.
10 flashcards · English materials
Already have an account? Sign in for flashcardsAvailable from Essential. A ready-made formula set, no AI credits required. Article exercises are not all included.
Limits and result checks
A high p-value does not prove the null hypothesis, and a low p-value does not measure practical effect size. With small expected counts the χ2 approximation may be inaccurate; do not merge categories opportunistically after seeing the result. Parameter fitting, dependent observations or incomplete categories change the testing problem. The simple exponential p-value formula applies only with two degrees of freedom.
- Percentages replace observed counts. Use actual whole counts and the correct N.
- Degrees of freedom are left unchanged after fitting. Account for normalization and regularly estimated parameters.
- p>α proves the null hypothesis. Only fail to reject; power and assumptions remain relevant.
Five exercises with solutions
Calculate · Foundation
O=(25,25,50), p=(0.2,0.3,0.5). Calculate X2 for N=100.
Show hint
Expectations are 20,30,50.
Learning goal: Pearson statistic from three counts
Show solution and calculation
X2=25/20+25/30+0=25/12≈2.083333.
Check the total N=100 before calculating.
Rearrange · Application
For df=2, p=exp(−X2/2). What critical value corresponds to α=0.05?
Show hint
Take logarithms of both sides.
Learning goal: Derive the df=2 critical value
Show solution and calculation
ln α=−c/2, hence c=−2ln α=−2ln(0.05)≈5.991464547.
X2>c gives p<0.05.
This formula does not apply unchanged to other degrees of freedom.
Interpret · Application
A test gives p=0.85. Does that prove the specified ratio is correct?
Show hint
A p-value assumes the null hypothesis.
Learning goal: Interpret failure to reject
Show solution and calculation
No.
Under the null assumption, discrepancies at least this large are not unusual.
This does not prove the assumption and may also reflect low power.
It does not give P(H0|data).
Error analysis · Application
Four categories are fitted to a model with one parameter estimated from the same data. Is df=3 correct?
Show hint
Account for normalization and the fitted parameter.
Learning goal: Check degrees of freedom after fitting
Show solution and calculation
In the regular Pearson setting, df=4−1−1=2.
Normalization and the fitted parameter each consume one freedom.
The fixed three-category calculator must not silently substitute for this different model.
Transfer · Challenge
For N=20 and p=(0.02,0.18,0.80), expectations are 0.4,3.6,16. Is this calculator mode appropriate?
Show hint
Check expected rather than observed counts.
Learning goal: Recognize limits of the approximation
Show solution and calculation
No.
Two expected counts fall below the mode’s threshold of 5.
An exact multinomial or justified simulation approach may be more appropriate.
Merging categories afterward merely to obtain a desired p-value is not a valid remedy.
Check your understanding with the formula’s reference test.
8 test questions · English materials
Already have an account? Sign in for the testAvailable from Essential. A ready-made formula set, no AI credits required. Article exercises are not all included.
Sources for this explanation
Quanta · Updated November 8, 2026
Editorial responsibility: Quanta Study editorial team
Review scope
This explanation, 2 worked examples and 5 exercises are available in German and English. Structure, source references and mathematical notation undergo automated checks. Calculations, model assumptions and both language versions receive a separate AI review.
An independent, named human subject review has not yet been documented. Our exercise numbers are worked examples, rather than measurements published by the cited sources.
Editorial responsibility, sources and methodsChange history
- Added a full article with model limits, independently calculated examples, five exercise paths and source references.
Cite this reference page
Quanta. Chi-Square Goodness-of-Fit Test. Updated November 8, 2026. https://quanta-study.de/en/formula-sheet/chi-quadrat-anpassungstest
When citing a specific scientific statement, also cite the specialist source linked to that statement.