Chi-squared tests
แนะนำใหม่
8:10
ความน่าจะเป็นและสถิติเพิ่มเติม
เดลินบ์, สิบเก้า-โอ-เอท. ภายในโรงงานเบียร์กินเนสส์ นักเคมีหนุ่มชื่อ วิลเลียม กอสเซต กำลังเผชิญกับปัญหาเชิงปฏิบัติมาก เขาสามารถทดสอบเพียงไม่กี่ล็อตของ…
บรรยายภาษาอังกฤษ · สลับคำบรรยายภาษาอังกฤษและภาษาจีนได้
ในบทเรียนนี้
| English | ความหมาย |
|---|---|
| chi-squared/kaɪ skweəd/ | 卡方 (chi-squared) |
| observed/ɒbˈzɜːvd/ | ค่าที่สังเกตได้ |
| expected/ekˈspektɪd/ | ค่าคาดหวัง |
| degrees of freedom/dɪˈɡriːz ɒv ˈfriːdəm/ | ดีกรีของอิสรภาพ |
| critical value/ˈkrɪtɪkl ˈvæljuː/ | ค่าวิกฤต |
| goodness of fit/ˈɡʊdnəs ɒv fɪt/ | ความเหมาะสมของการจัดวาง |
| contingency table/kənˈtɪndʒənsi ˈteɪbl/ | ตารางผลรวมร่วม |
| independence/ˌɪndɪˈpendəns/ | ความเป็นอิสระ |
ข้อมูลตรงตามทฤษฎีหรือไม่?
- คุณคาดหวังว่าลูกเต๋าจะตกหน้าต่างๆ เท่ากัน หรือสีตาไม่สัมพันธ์กับสีผม ข้อมูลจริงสอดคล้องกันหรือไม่?
- The $\chi^2$ (chi-squared) test measures how far observed counts stray from what a model predicts — and whether that gap is too big to be chance.
Chi-squared test route
Follow observed and expected counts to a test decision.
สถิติทดสอบ
- เปรียบเทียบค่าที่สังเกตได้ $O$ กับค่าที่คาดไว้ $E$ จากโมเดล:
- ค่า $\chi^2$ ที่น้อยหมายความว่าข้อมูลเข้ากับแบบจำลอง ส่วนค่าที่มากหมายความว่าไม่เข้ากัน
The chi-squared test statistic is:
ความยาก 1/5 · 100 เหรียญ + บอนัสน้อยๆ เมื่อทำสำเร็จครั้งแรกในวันนี้
χ² sums (observed − expected)² ÷ expected over all categories.
พื้นที่ปฏิเสธ
- เปรียบเทียบ $\chi^2$ กับ ค่าวิกฤต จากตารางสำหรับ องศาอิสระ ด้านขวา
- หาก $\chi^2$ อยู่เกินกว่าค่าวิกฤต (อยู่ในหางบน) ให้ ปฏิเสธ โมเดลนั้น

ค่า χ² ที่สูงมากตกอยู่ในส่วนที่ทึบสี — มีขนาดใหญ่เกินกว่าจะเกิดจากความบังเอิญ จึงปฏิเสธโมเดล

A large chi-squared value (beyond the critical value) leads you to reject the model.
ความยาก 1/5 · 100 เหรียญ + บอนัสน้อยๆ เมื่อทำสำเร็จครั้งแรกในวันนี้
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?
ความยาก 2/5 · 140 เหรียญ + บอนัสน้อยๆ เมื่อทำสำเร็จครั้งแรกในวันนี้
ν = (3 − 1)(4 − 1) = 6.
A Poisson model is fitted to 6 classes (after pooling), with λ estimated from the data. What is ν?
ความยาก 1/5 · 100 เหรียญ + บอนัสน้อยๆ เมื่อทำสำเร็จครั้งแรกในวันนี้
ν = 6 − 1 − 1 = 4: one for the total, one for the estimated λ.
ตัวอย่างวิธีทำ
- จำนวนที่สังเกตได้ $20, 30, 25, 25$, แต่ละตัวมีค่าคาดหวัง $25$
- $\chi^2 = \dfrac{(20-25)^2 + (30-25)^2 + 0 + 0}{25} = \dfrac{25 + 25}{25} = 2$.
- เมื่อเทียบกับค่าวิกฤต ค่า $\chi^2$ ที่เท่ากับ $2$ นั้นน้อย — ข้อมูลสอดคล้องกับโมเดล

Observed counts 20, 30, 25, 25, each expected 25. What is χ² = Σ(O−E)²/E?
ความยาก 2/5 · 140 เหรียญ + บอนัสน้อยๆ เมื่อทำสำเร็จครั้งแรกในวันนี้
((−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.
การใช้งานสองแบบ
- Goodness of fit: does the data follow a proposed distribution (uniform, binomial, Poisson…)?
- ความเป็นอิสระ: ใน ตารางความถ่วง, การจำแนกประเภททั้งสองเป็นอิสระต่อกันหรือไม่? (ค่าคาดหวัง $= \dfrac{\text{row total} \times \text{column total}}{\text{grand total}}$.)
รวมความถี่คาดหวังที่ต่ำ. หากมีความถี่คาดหวังใด ต่ำกว่า 5 ให้รวมกลุ่มก่อน — การประมาณค่า $\chi^2$ จะไม่เชื่อถือได้เมื่อความถี่คาดหวังมีค่าน้อยเกินไป
Match each chi-squared use to what it tests.
ความยาก 2/5 · 140 เหรียญ + บอนัสน้อยๆ เมื่อทำสำเร็จครั้งแรกในวันนี้
Goodness of fit checks a distribution; the independence test uses a contingency table.
Before testing, pool any class whose expected frequency is below ______.
ความยาก 1/5 · 100 เหรียญ + บอนัสน้อยๆ เมื่อทำสำเร็จครั้งแรกในวันนี้
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.
ความยาก 2/5 · 140 เหรียญ + บอนัสน้อยๆ เมื่อทำสำเร็จครั้งแรกในวันนี้
80 × 45 ÷ 200 = 18.
คุณเข้าใจแล้ว
- $\chi^2 = \displaystyle\sum\frac{(O-E)^2}{E}$ — ความถี่ที่สังเกตได้ vs ความถี่คาดหวัง
- ค่า $\chi^2$ ที่ใหญ่ (เกินกว่าค่าวิกฤต, หางบน) ปฏิเสธ โมเดล
- การใช้งาน: ความเหมาะสมของการจับคู่ และ ความเป็นอิสระ; รวมค่าคาดหวังที่ต่ำกว่า 5
เขียนจากค่าไคสแควร์ 10
- จำนวนที่สังเกตได้คือ 10, 20 และ 30 โดยจำนวนที่คาดไว้แต่ละค่าคือ 20
- หาไคสแควร์ หากจำนวนที่คาดไว้ต่ำกว่า 5 ควรรวมกลุ่มก่อนทำการทดสอบ

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.
การ์ดนี้เป็นการ์ดใหม่ จึงแสดงเป็นภาษาอังกฤษจนกว่าคำแปลจะพร้อม
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?
ความยาก 1/5 · 100 เหรียญ + บอนัสน้อยๆ เมื่อทำสำเร็จครั้งแรกในวันนี้
Each outer cell contributes 5, and 5 plus 5 is 10.
เกิดปัญหาอะไรขึ้น? เฉพาะทีมเว็บไซต์เท่านั้นที่เห็นข้อมูลนี้