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.
Bahasa Indonesia
Uji chi-squared membandingkan hasil yang sebenarnya Anda hitung (angka diamati, $O$) dengan hasil yang Anda harapkan dari diagram genetik (angka diharapkan, $E$). Ini memberi tahu Anda apakah perbedaannya cukup kecil karena kebetulan, atau cukup besar untuk berarti ada sesuatu yang lain yang terjadi.
Anda menjumlahkan, untuk setiap kelompok, kuadrat perbedaan antara diamati dan diharapkan, dibagi dengan yang diharapkan:
$$\chi^2 = \sum \frac{(O - E)^2}{E}$$
Kemudian Anda membandingkan nilai $\chi^2$ ini dengan nilai kritis dari sebuah tabel. Baris yang Anda gunakan ditentukan oleh derajat kebebasan (jumlah kelompok dikurangi 1). Jika $\chi^2$ kurang dari nilai kritis, perbedaannya tidak signifikan — hasil sesuai dengan rasio yang diharapkan, dan perbedaan apa pun hanyalah kebetulan. Jika $\chi^2$ lebih besar dari nilai kritis, perbedaannya signifikan, sehingga faktor lain terlibat.
Contoh terpecahkan. Persilangan $\text{Tt} \times \text{Tt}$ menghasilkan $160$ keturunan: $114$ tinggi dan $46$ pendek. Uji apakah ini sesuai dengan rasio $3:1$ yang diharapkan.
Jumlah yang diharapkan adalah $\tfrac{3}{4} \times 160 = 120$ tinggi dan $\tfrac{1}{4} \times 160 = 40$ pendek. Maka:
$$\chi^2 = \frac{(114 - 120)^2}{120} + \frac{(46 - 40)^2}{40} = \frac{36}{120} + \frac{36}{40} = 0.30 + 0.90 = 1.20.$$
Terdapat $2$ kelompok, sehingga derajat kebebasan $= 2 - 1 = 1$. Nilai kritis pada $p = 0.05$ adalah $3.84$. Karena $1.20 < 3.84$, perbedaannya tidak signifikan: hasil sesuai dengan rasio $3:1$, dan perbedaan kecil disebabkan oleh kebetulan.