Calculator form
Example data table
Sample dihybrid cross with a 9:3:3:1 expectation and 160 total offspring.
| Category | Observed | Ratio part | Expected | Observed - Expected | χ² Component |
|---|---|---|---|---|---|
| A-B- | 87 | 9 | 90 | -3 | 0.100 |
| A-bb | 34 | 3 | 30 | 4 | 0.533 |
| aaB- | 28 | 3 | 30 | -2 | 0.133 |
| aabb | 11 | 1 | 10 | 1 | 0.100 |
| Total | 160 | 16 | 160 | - | 0.866 |
With df = 3, the p-value is high, so this sample fits the expected dihybrid ratio well.
Formula used
Expected count for each category:
Expected = Total observed × (Category ratio part ÷ Sum of all ratio parts)
Chi-square statistic:
χ² = Σ ((Observed - Expected)² ÷ Expected)
Degrees of freedom:
df = Number of active categories - 1 - Estimated parameters
When you enable Yates correction for a one-degree-of-freedom test, each component becomes:
( |Observed - Expected| - 0.5 )² ÷ Expected
How to use this calculator
- Choose a preset ratio or select a custom hypothesis.
- Set the number of phenotype classes you want to test.
- Enter each category label, expected ratio part, and observed offspring count.
- Pick the significance level that matches your experiment design.
- Add estimated parameters if your model was fitted from the sample.
- Enable Yates correction only for two-class tests with one degree of freedom.
- Press Calculate to see χ², p-value, interpretation, and category contributions.
- Use the CSV and PDF buttons to export the summary and detail table.
FAQs
1. What does this genetics chi-square test evaluate?
It checks whether observed offspring counts differ from an expected inheritance ratio more than random sampling would usually produce.
2. When should I use a preset ratio?
Use a preset when your cross follows a standard Mendelian expectation, such as 3:1, 1:1, 9:3:3:1, or another familiar ratio.
3. What if my experiment uses a custom inheritance model?
Select Custom ratio, set the number of phenotype classes, and enter the exact ratio parts that your hypothesis predicts.
4. Why do expected counts matter?
Expected counts define the comparison baseline. The calculator scales your ratio to the total observed sample before computing each chi-square component.
5. What does the p-value tell me?
The p-value estimates how likely a deviation this large would appear if the expected genetic ratio were actually correct.
6. Why is there a warning for expected counts below 5?
Very small expected counts can weaken the chi-square approximation, so you should interpret results more carefully or combine categories when justified.
7. When should I apply Yates correction?
Use it only for one-degree-of-freedom goodness-of-fit tests, usually when there are two categories and sample size is limited.
8. What does the largest contributor field mean?
It identifies the phenotype class with the biggest chi-square component, helping you spot where the strongest deviation occurred.