Chi Square Genetics Calculator

Test Mendelian hypotheses with flexible phenotype ratios. See expected counts, test values, p levels, instantly. Export results, inspect graphs, and explain inheritance outcomes confidently.

Calculator form

Category 1
Category 2
Category 3
Category 4

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

  1. Choose a preset ratio or select a custom hypothesis.
  2. Set the number of phenotype classes you want to test.
  3. Enter each category label, expected ratio part, and observed offspring count.
  4. Pick the significance level that matches your experiment design.
  5. Add estimated parameters if your model was fitted from the sample.
  6. Enable Yates correction only for two-class tests with one degree of freedom.
  7. Press Calculate to see χ², p-value, interpretation, and category contributions.
  8. 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.

Related Calculators

inbreeding coefficient calculatorpolygenic risk score calculatorhardy weinberg equilibrium calculatormendelian inheritance calculatorpopulation genetics calculator

Important Note: All the Calculators listed in this site are for educational purpose only and we do not guarentee the accuracy of results. Please do consult with other sources as well.