English
The chi-squared test 卡方检验 compares the results you actually counted (the observed numbers, $O$) with the results you expected from the genetic diagram (the expected numbers, $E$). It tells you whether the difference is small enough to be due to chance, or large enough to mean something else is going on.
You add up, for every group, the squared difference between observed and expected, divided by the expected:
$$\chi^2 = \sum \frac{(O - E)^2}{E}$$
Then you compare this $\chi^2$ value with a critical value from a table. The row you use is set by the degrees of freedom (the number of groups minus 1). If $\chi^2$ is less than the critical value, the difference is not significant — the results fit the expected ratio, and any difference is just chance. If $\chi^2$ is greater than the critical value, the difference is significant, so some other factor is involved.
Worked example. A $\text{Tt} \times \text{Tt}$ cross gives $160$ offspring: $114$ tall and $46$ short. Test whether this fits the expected $3:1$ ratio.
The expected numbers are $\tfrac{3}{4} \times 160 = 120$ tall and $\tfrac{1}{4} \times 160 = 40$ short. Then:
$$\chi^2 = \frac{(114 - 120)^2}{120} + \frac{(46 - 40)^2}{40} = \frac{36}{120} + \frac{36}{40} = 0.30 + 0.90 = 1.20.$$
There are $2$ groups, so degrees of freedom $= 2 - 1 = 1$. The critical value at $p = 0.05$ is $3.84$. Because $1.20 < 3.84$, the difference is not significant: the results fit a $3:1$ ratio, and the small difference is due to chance.
العربية
اختبار كاي-تربيع يقارن النتائج التي عدّتها فعلياً (الأرقام الملاحظة، $O$) مع النتائج التي توقعتها من المخطط الوراثي (الأرقام المتوقعة، $E$). إنه يخبرك ما إذا كان الفرق صغيراً بما يكفي ليكون بسبب الصدفة، أم كبيراً بما يكفي لي mean أن شيئاً آخر يحدث.
تجمع، لكل مجموعة، مربع الفرق بين الملاحظ والمتوقع، مقسوماً على المتوقع:
$$\chi^2 = \sum \frac{(O - E)^2}{E}$$
ثم تقارن هذه القيمة $\chi^2$ مع قيمة حرجة من جدول. يُحدد الصف الذي تستخدمه بواسطة درجات الحرية (عدد المجموعات ناقص 1). إذا كانت $\chi^2$ أقل من القيمة الحرجة، فإن الفرق غير مهم إحصائياً — وتطابق النتائج النسبة المتوقعة، وأي فرق هو مجرد صدفة. أما إذا كانت $\chi^2$ أكبر من القيمة الحرجة، فإن الفرق مهم إحصائياً، مما يعني وجود عامل آخر مشارك.
مثال محلول. يعطي التزاوج $\text{Tt} \times \text{Tt}$ $160$ نسل: $114$ طويل و$46$ قصير. اختبر ما إذا كانت هذه النتائج تطابق النسبة المتوقعة $3:1$.
الأرقام المتوقعة هي $\tfrac{3}{4} \times 160 = 120$ طويلة و$\tfrac{1}{4} \times 160 = 40$ قصيرة. إذن:
$$\chi^2 = \frac{(114 - 120)^2}{120} + \frac{(46 - 40)^2}{40} = \frac{36}{120} + \frac{36}{40} = 0.30 + 0.90 = 1.20.$$
يوجد $2$ مجموعة، لذا فإن درجات الحرية تساوي $= 2 - 1 = 1$. القيمة الحرجة عند $p = 0.05$ هي $3.84$. وبما أن $1.20 < 3.84$، فإن الفرق غير ذات دلالة إحصائية: تتوافق النتائج مع نسبة $3:1$، والفرق الصغير ناتج عن الصدفة.