Carrying Out a Goodness-of-Fit Test (Extension)
แนะนำใหม่
7:48
การอนุมานสำหรับข้อมูลเชิงประเภtsy: Chi-Square
โยนลูกเต๋าที่ยุติธรรม 60 ครั้ง ทุกด้านควรออก 10 ครั้ง แต่ไม่ได้เป็นเช่นนั้น — บางด้านออก 8 ครั้ง บางด้านออก 13 ครั้ง ความแตกต่างเหล่านี้มีอยู่เสมอ ดังนั้นลองโยนอีก...
บรรยายภาษาอังกฤษ · สลับคำบรรยายภาษาอังกฤษและภาษาจีนได้
ในบทเรียนนี้
| English | ความหมาย |
|---|---|
| random sample/ˈrændəm ˈsæmpl/ | A sample chosen by a chance process. |
| chance variation | |
| chi-square goodness-of-fit test/kaɪ skweə ˈɡʊdnəs ɒv fɪt test/ | |
| two-way tests | |
| chi-square statistic/kaɪ skweə stəˈtɪstɪk/ | ค่าสถิติ chi-square |
| category/ˈkætɪɡəri/ | A group in a categorical variable. |
| observed count/ɒbˈzɜːvd kaʊnt/ | The number actually seen in a category. |
| expected count/ekˈspektɪd kaʊnt/ | The count expected in a category if the null hypothesis is true. |
| p-value/piː ˈvæljuː/ | The probability, assuming the null model, of a test statistic at least as extreme as the observed one in the direction or directions tested. |
| right-tail area | |
| chi-square distribution/kaɪ skweə ˌdɪstrɪˈbjuːʃn/ | A right-skewed distribution used for chi-square tests. |
| skewed right/skjuːd raɪt/ | |
| right-tailed | |
| proportions | |
| Large counts | |
| fail to reject/feɪl tə rɪˈdʒekt/ | |
| significant result | |
| probability/ˌprɒbəˈbɪlɪti/ | A numerical measure of how likely an event is, ranging from zero to one. |
| Hypotheses | |
| denominator/dɪˈnɒmɪneɪtə/ | The lower part of a fraction, indicating the divisor or the number of equal parts in a whole. |
| categorical variable/ˌkætɪˈɡɒrɪkl ˈveərɪəbl/ | A variable that places individuals in groups. |
สถิติ chi-square
- สถิติ chi-square เป็นผลรวมของความแตกต่างที่ปรับมาตรฐานAcross ทุกหมวดหมู่:
-
$$\chi^2 = \sum \frac{(\text{observed} - \text{expected})^2}{\text{expected}}$$
- แต่ละพจน์เปรียบเทียบจำนวนที่สังเกตได้และจำนวนที่คาดหวังของแต่ละหมวดหมู่
- การยกกำลังสองทำให้ความแตกต่างทุกค่าเป็นบวก; การหารด้วยจำนวนที่คาดหวังเป็นการปรับสเกล
ความแตกต่างใหญ่ขึ้น ค่า chi-square ก็มากขึ้น
- If observed $\approx$ expected everywhere, each term is tiny → $\chi^2$ is small.
- ความคลาดเคลื่อนขนาดใหญ่ทำให้พจน์มีค่ามาก → $\chi^2$ มีค่ามาก
- So a large $\chi^2$ is evidence against the claimed distribution.
- $\chi^2$ เสมอจะมีค่า ≥ $\ge 0$ (ผลรวมของกำลังสองเหนือจำนวนบวก)

การแจกแจง chi-square: รูปร่างขึ้นอยู่กับ df และค่า p คือส่วนหางด้านขวา
One category has observed 8, expected 10. Compute (observed − expected)²/expected.
ความยาก 2/5 · 140 เหรียญ + บอนัสน้อยๆ เมื่อทำสำเร็จครั้งแรกในวันนี้
(8−10)²/10 = 4/10 = 0.4.
A large chi-square statistic is evidence against the claimed distribution.
ความยาก 1/5 · 100 เหรียญ + บอนัสน้อยๆ เมื่อทำสำเร็จครั้งแรกในวันนี้
Big gaps → big χ² → evidence against H0.
In the chi-square formula, each denominator is the ___ count.
ความยาก 1/5 · 100 เหรียญ + บอนัสน้อยๆ เมื่อทำสำเร็จครั้งแรกในวันนี้
Divide the squared gap by the expected count.
The chi-square statistic can be negative.
ความยาก 1/5 · 100 เหรียญ + บอนัสน้อยๆ เมื่อทำสำเร็จครั้งแรกในวันนี้
It's a sum of squares over positive expecteds — always ≥ 0.
หาค่า p-value
- ค่า p-value คือพื้นที่ทาง ขวา ของ $\chi^2$ ภายใต้กราฟ chi-square ที่ $df$ ที่ถูกต้อง
- Chi-square เป็นการทดสอบ หางขวา — เฉพาะค่าที่ใหญ่เท่านั้นที่ถือว่า " extreme"
- A big $\chi^2$ sits far right → small p-value → strong evidence against $H_0$.
- ใช้เทคโนโลยีหรือตาราง $df = \text{categories} - 1$

A chi-square test is...
ความยาก 1/5 · 100 เหรียญ + บอนัสน้อยๆ เมื่อทำสำเร็จครั้งแรกในวันนี้
Only large χ² is extreme → right tail only.
A goodness-of-fit test compares the colours of 300 candies with a claimed distribution over 6 colours. What are the degrees of freedom?
ความยาก 2/5 · 140 เหรียญ + บอนัสน้อยๆ เมื่อทำสำเร็จครั้งแรกในวันนี้
df = number of categories − 1 = 6 − 1 = 5. The sample size does not affect df.
การ์ดนี้ได้รับการแก้ไขแล้ว จึงแสดงเป็นภาษาอังกฤษจนกว่าคำแปลจะได้รับการอัปเดต
Worked test: State and Plan
State. $H_0$: the colour distribution of the tulip mix is as labelled ($p_{\text{red}}=0.40$, $p_{\text{yellow}}=0.35$, $p_{\text{white}}=0.25$). $H_a$: at least one of these proportions 比例 is different. Use $\alpha=0.05$.
Plan. Chi-square test for goodness of fit.
- Random: the 200 bulbs are a random sample.
- 10%: Assume there are at least 2,000 bulbs of this mix, so 200 is no more than 10% of them.
- Large counts 大频数条件: expected counts are $200(0.40)=80$, $200(0.35)=70$, $200(0.25)=50$, all at least 5.
A claim gives a category probability of 0.02. What is the smallest sample size that gives this category an ที่คาดหวัง count of at least 5?
ความยาก 1/5 · 100 เหรียญ + บอนัสน้อยๆ เมื่อทำสำเร็จครั้งแรกในวันนี้
Expected count = $n(0.02)\ge5$, so $n\ge250$.
Chi-square เป็นทดสอบด้านขวาเสมอ — ห้ามคูณสองหาง ค่า $\chi^2$ ที่ใหญ่เท่านั้นที่เป็นความประหลาดใจ ดังนั้นค่า p จึงเป็น พื้นที่ด้านขวาเท่านั้น (ต่างจากการทดสอบสองข้าง $z$ หรือ $t$) นอกจากนี้ ให้ใส่ จำนวนนับ ในสูตร ไม่ใช่สัดส่วน และใช้ค่าที่คาดหวัง (ไม่ใช่ค่าสังเกต) ในตัวส่วนแต่ละตัว

The claimed distribution
Expected counts come from the null distribution's proportions.
A spinner should land on A, B and C equally often. In 90 spins: A 40, B 25, C 25. Calculate $\chi^2$.
ความยาก 2/5 · 140 เหรียญ + บอนัสน้อยๆ เมื่อทำสำเร็จครั้งแรกในวันนี้
Expected 30 each. $\frac{(40-30)^2}{30}+\frac{(25-30)^2}{30}+\frac{(25-30)^2}{30}=\frac{100+25+25}{30}=5$.
ลูกเต๋า: สังเกต $8, 12, 9, 11, 10, 10$; คาดหวัง $10$ แต่ละหน้า; $df = 5$.
- $\chi^2 = \tfrac{(8-10)^2}{10} + \tfrac{(12-10)^2}{10} + \cdots = \tfrac{4+4+1+1+0+0}{10} = 1.0$.
- p-value: พื้นที่หางขวาเกิน $1.0$ ที่ $df=5$ มีค่ามาก ($\approx 0.96$).
- ตัดสินใจ: $0.96 > 0.05$ → ไม่ปฏิเสธ; ไม่มีหลักฐานว่าลูกเต๋ามีความไม่ยุติธรรม
ค่าสถิติ chi-square $\chi^2 = \sum \frac{(\text{observed} - \text{expected})^2}{\text{expected}}$ วัดความไม่สอดคล้องรวม p-value ของมันคือพื้นที่ หางขวา ที่ $df = \text{categories} - 1$ เปรียบเทียบกับ $\alpha$: ปฏิเสธ $H_0$ ถ้า p $\le \alpha$ (โมเดลเข้ากันไม่ดี) หรือ ไม่ปฏิเสธ — ระบุในบริบท
เขียนจากส่วนประกอบของ 1.6
- เซลล์หนึ่งมีจำนวนสังเกต 14 และจำนวนคาดหวัง 10
- ส่วนประกอบบทเรียน 0.4 เป็นเซลล์อื่นอีกเซลล์หนึ่ง
A goodness-of-fit test gives p-value = 0.03. Which interpretation is correct?
ความยาก 1/5 · 100 เหรียญ + บอนัสน้อยๆ เมื่อทำสำเร็จครั้งแรกในวันนี้
A p-value is computed assuming $H_0$ is true. It is never the probability that $H_0$ is true.
การ์ดนี้เป็นการ์ดใหม่ จึงแสดงเป็นภาษาอังกฤษจนกว่าคำแปลจะพร้อม
How an FRQ is scored
- Hypotheses 假设 in context, with the claimed proportions.
- Test named and all three conditions checked: random, 10%, expected counts at least 5 (show the numbers).
- Mechanics: $\chi^2$, df and p-value all correct.
- Conclusion linked to the p-value and $\alpha$, in context, with no claim that $H_0$ is proved.
การ์ดนี้เป็นการ์ดใหม่ จึงแสดงเป็นภาษาอังกฤษจนกว่าคำแปลจะพร้อม
- Use counts, not percentages, in the formula, and the expected count in each denominator 分母.
- Check expected counts, not observed counts, for the large-counts condition.
- Never double the tail. Chi-square p-values are right-tail areas 右尾面积 only.
- "Fail to reject" is not "the label is correct"; it means the evidence is not strong enough to say it is wrong.
การ์ดนี้เป็นการ์ดใหม่ จึงแสดงเป็นภาษาอังกฤษจนกว่าคำแปลจะพร้อม
A chi-square goodness-of-fit test checks one categorical variable 分类变量 against a claimed distribution. $H_0$: the claimed proportions are correct. Conditions: random, 10%, all expected counts $\ge5$. $\chi^2=\sum\frac{(\text{O}-\text{E})^2}{\text{E}}$ with $df=\text{categories}-1$; the p-value is the right-tail area. Conclude in context, and look at the largest term to see where the data differ most.
เกิดปัญหาอะไรขึ้น? เฉพาะทีมเว็บไซต์เท่านั้นที่เห็นข้อมูลนี้