Chi-squared tests
Diperkenalkan
8:10
Probabilitas & Statistik Lanjutan
Dublin, seribu sembilan ratus delapan. Di dalam pabrik bir Guinness, seorang ahli kimia muda bernama William Gosset menghadapi masalah yang sangat praktis. Ia hanya dapat menguji beberapa batch dari…
Narasi bahasa Inggris · takarir bahasa Inggris dan 中文 yang dapat dipilih
Dalam pelajaran ini
| English | Makna |
|---|---|
| chi-squared/kaɪ skweəd/ | |
| observed/ɒbˈzɜːvd/ | teramati |
| expected/ekˈspektɪd/ | diharapkan |
| degrees of freedom/dɪˈɡriːz ɒv ˈfriːdəm/ | derajat kebebasan |
| critical value/ˈkrɪtɪkl ˈvæljuː/ | nilai kritis |
| goodness of fit/ˈɡʊdnəs ɒv fɪt/ | ketepatan kecocokan |
| contingency table/kənˈtɪndʒənsi ˈteɪbl/ | tabel kontingensi |
| independence/ˌɪndɪˈpendəns/ | ketergantungan |
| expected frequency/ekˈspektɪd ˈfriːkwənsi/ |
Apakah data sesuai teori?
- Anda mengharapkan dadu jatuh sama rata di setiap sisi, atau warna mata independen terhadap warna rambut. Apakah data benar-benar setuju?
- Uji $\chi^2$ (chi-squared) mengukur seberapa jauh jumlah observasi menyimpang dari apa yang diprediksi model — dan apakah kesenjangan itu terlalu besar untuk menjadi kebetulan.
Chi-squared test route
Follow observed and expected counts to a test decision.
Statistik uji
- Bandingkan setiap jumlah teramati $O$ dengan jumlah diharapkan $E$ dari model:
- Nilai $\chi^2$ kecil berarti data sesuai; nilai besar berarti tidak.
The chi-squared test statistic is:
Kesulitan 1/5 · 100 koin + bonus kecil pada penyelesaian pertama hari ini
χ² sums (observed − expected)² ÷ expected over all categories.
Daerah penolakan
- Bandingkan $\chi^2$ dengan nilai kritis dari tabel untuk derajat kebebasan kanan.
- Jika $\chi^2$ jatuh melebihi nilai kritis (di ekor atas), tolak model tersebut.

Nilai χ² yang besar jatuh di dalam ekor yang diarsir — terlalu besar untuk menjadi kebetulan, sehingga model ditolak.
A large chi-squared value (beyond the critical value) leads you to reject the model.
Kesulitan 1/5 · 100 koin + bonus kecil pada penyelesaian pertama hari ini
A large χ² means a discrepancy at least this large would be unlikely under the null hypothesis.
A 3 × 4 contingency table is tested for independence. How many degrees of freedom?
Kesulitan 2/5 · 140 koin + bonus kecil pada penyelesaian pertama hari ini
ν = (3 − 1)(4 − 1) = 6.
A Poisson model is fitted to 6 classes (after pooling), with λ estimated from the data. What is ν?
Kesulitan 1/5 · 100 koin + bonus kecil pada penyelesaian pertama hari ini
ν = 6 − 1 − 1 = 4: one for the total, one for the estimated λ.
Contoh kerja
- Frekuensi observasi $20, 30, 25, 25$, masing-masing diharapkan bernilai $25$.
- $\chi^2 = \dfrac{(20-25)^2 + (30-25)^2 + 0 + 0}{25} = \dfrac{25 + 25}{25} = 2$.
- Dibandingkan dengan nilai kritis, nilai $\chi^2$ sebesar $2$ itu kecil — data sesuai.

Observed counts 20, 30, 25, 25, each expected 25. What is χ² = Σ(O−E)²/E?
Kesulitan 2/5 · 140 koin + bonus kecil pada penyelesaian pertama hari ini
((−5)² + 5² + 0 + 0)/25 = 50/25 = 2.
Observed counts are 10, 20 and 30, and each expected count is 20. What is chi-square, and why are expected counts below 5 pooled?
Chi-square adds squared differences divided by the expected counts. The approximation needs those expected counts not to be tiny.
Dua penggunaan
- Kecocokan: apakah data mengikuti distribusi yang diusulkan (seragam, binomial, Poisson…)?
- Independensi: dalam tabel kontingensi, apakah dua klasifikasi tersebut saling bebas? (Diharapkan $= \dfrac{\text{row total} \times \text{column total}}{\text{grand total}}$.)
Gabungkan frekuensi harapan yang kecil. Jika ada frekuensi harapan di bawah 5, gabungkan kelas terlebih dahulu — pendekatan $\chi^2$ tidak dapat diandalkan untuk frekuensi harapan yang sangat kecil.
Match each chi-squared use to what it tests.
Kesulitan 2/5 · 140 koin + bonus kecil pada penyelesaian pertama hari ini
Goodness of fit checks a distribution; the independence test uses a contingency table.
Before testing, pool any class whose expected frequency is below ______.
Kesulitan 1/5 · 100 koin + bonus kecil pada penyelesaian pertama hari ini
The χ² approximation needs expected counts of at least 5; combine smaller ones.
In a contingency table with grand total 200, a row total is 80 and a column total is 45. Find the expected frequency for that cell.
Kesulitan 2/5 · 140 koin + bonus kecil pada penyelesaian pertama hari ini
80 × 45 ÷ 200 = 18.
Anda telah memahaminya
- $\chi^2 = \displaystyle\sum\frac{(O-E)^2}{E}$ — frekuensi observasi vs harapan
- Nilai $\chi^2$ yang besar (di luar nilai kritis, ekor atas) menolak model
- penggunaan: kecocokan dan independensi; gabungkan frekuensi harapan di bawah 5
Tulis berdasarkan nilai chi-square sebesar 10
- Frekuensi observasi adalah 10, 20, dan 30. Setiap frekuensi harapan adalah 20.
- Temukan chi-square. Frekuensi harapan di bawah 5 harus digabungkan sebelum pengujian.

Without looking back: a test of independence on a 2 × 2 table gives χ² = 2.9. State the hypotheses, ν, the 5% critical value and the conclusion.
Never say H₀ is proved true.
Kartu ini baru, jadi ditampilkan dalam bahasa Inggris sampai terjemahannya siap.
You've got it
- $\chi^2 = \displaystyle\sum\frac{(O-E)^2}{E}$ — observed vs expected counts
- a large $\chi^2$ (beyond the critical value, upper tail) rejects the model
- $\nu$ = classes − 1 − estimated parameters; contingency table $(r-1)(c-1)$
- uses: goodness of fit 拟合优度 and independence; pool expected counts below 5; conclude in context
Observed counts are 10, 20 and 30, and each expected count is 20. What is chi-square?
Kesulitan 1/5 · 100 koin + bonus kecil pada penyelesaian pertama hari ini
Each outer cell contributes 5, and 5 plus 5 is 10.
Apa yang salah? Hanya tim situs yang dapat melihatnya.