Setting Up a Goodness-of-Fit Test (Extension)
แนะนำใหม่
7:48
การอนุมานสำหรับข้อมูลเชิงประเภtsy: Chi-Square
โยนลูกเต๋าที่ยุติธรรม 60 ครั้ง ทุกด้านควรออก 10 ครั้ง แต่ไม่ได้เป็นเช่นนั้น — บางด้านออก 8 ครั้ง บางด้านออก 13 ครั้ง ความแตกต่างเหล่านี้มีอยู่เสมอ ดังนั้นลองโยนอีก...
บรรยายภาษาอังกฤษ · สลับคำบรรยายภาษาอังกฤษและภาษาจีนได้
ในบทเรียนนี้
| English | ความหมาย |
|---|---|
| goodness-of-fit/ˈɡʊdnəs ɒv fɪt/ | A test of whether one categorical variable fits a claimed distribution. |
| hypotheses | |
| variable/ˈveərɪəbl/ | A characteristic recorded for each individual, such as height or eye colour. |
| distribution/ˌdɪstrɪˈbjuːʃn/ | The pattern of values or outcomes and their frequencies or probabilities. |
| proportions | |
| expected count/ekˈspektɪd kaʊnt/ | จำนวนที่คาดหวัง |
| category/ˈkætɪɡəri/ | A group in a categorical variable. |
| null model | |
| chi-square statistic/kaɪ skweə stəˈtɪstɪk/ | |
| observed counts/ɒbˈzɜːvd kaʊnts/ | |
| Random/ˈrændəm/ | |
| random sample/ˈrændəm ˈsæmpl/ | A sample chosen by a chance process. |
| randomized process | |
| sampling without replacement | |
| chi-square approximation | |
| simulation method | |
| Degrees of freedom/dɪˈɡriːz ɒv ˈfriːdəm/ | |
| probabilities | |
| parameters/pəˈræmɪtəz/ | Values that specify a model or function, or named inputs that a subroutine receives. |
| chi-square curve | |
| 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. |
| sample size/ˈsæmpl saɪz/ | |
| independent observations |
สมมติฐานของความสอดคล้องของรูปแบบ
- การทดสอบ ความสอดคล้องของรูปแบบ (goodness-of-fit) ตรวจสอบตัวแปรหนึ่งเทียบกับรูปแบบที่อ้างถึง
- สมมติฐานศูนย์ $H_0$: รูปแบบที่อ้างถึงนั้นถูกต้อง (เช่น สัดส่วนทั้งหมดตามที่ระบุ)
- สมมติฐานทางเลือก $H_a$: รูปแบบ ไม่ใช่ ตามที่อ้างถึง (อย่างน้อยหนึ่งสัดส่วนแตกต่างกัน)
- $H_a$ เป็นข้อความ "มี Something ผิดพลาด" แบบเดียว — ไม่ใช่ทิศทาง

จำนวนที่คาดหวัง
- จำนวนที่คาดหวัง สำหรับหมวดหมู่ใด = $n \times$ (สัดส่วนที่อ้างถึงของมัน)
- สำหรับ $100$ เม็ดขนมหวาน ที่มี $25\%$ ต่อเม็ด: จำนวนที่คาดหวังคือ $= 100 \times 0.25 = 25$ ต่อสี
- จำนวนที่คาดหวัง ไม่จำเป็นต้อง เป็นจำนวนเต็ม — รักษาค่าให้แม่นยำ
- คือสิ่งที่โมเดลศูนย์ (null model) คาดหวังไว้ โดยเฉลี่ย
ตรวจสอบเงื่อนไข
- สุ่ม: ข้อมูลมาจากตัวอย่างสุ่มหรือกระบวนการสุ่ม
- 10%: $n \le 0.10N$ หากสุ่มโดยไม่แทนที่
- จำนวนมาก: จำนวนที่คาดหวังทุกตัว $\ge 5$ (นี่คือเวอร์ชันของ chi-square)
- จำนวนที่คาดหวังทั้งหมดต้องผ่าน $5$ มิฉะนั้นโมเดล $\chi^2$ จะไม่น่าเชื่อถือ
Degrees of freedom
- สำหรับความสอดคล้องของรูปแบบ, $df = (\text{number of categories}) - 1$.
- สี่สีของขนมหวาน → $df = 4 - 1 = 3$.
- ค่า $df$ จะเลือกเส้นโค้ง chi-square ที่ใช้ในการหา p-value
- ขึ้นอยู่กับจำนวนหมวดหมู่ ไม่ใช่ ขนาดตัวอย่าง
เงื่อนไขจำนวนการสังเกตที่มากสำหรับ chi-square คือ "ทุกจำนวนที่คาดหวัง $\ge 5$," ไม่ใช่ที่สังเกตได้จริง ตรวจสอบจำนวนที่คาดหวัง และตรวจสอบให้ครบ ทั้งหมด — จำนวนที่คาดหวังเพียงค่าเดียวที่มีค่าน้อยจะทำให้การทดสอบไม่ถูกต้อง และ $df = \text{categories} - 1$ ที่นี่ (ข้อผิดพลาดที่พบบ่อยคือการใช้ $n-1$ ซึ่งใช้สำหรับ $t$ ไม่ใช่การทดสอบความสอดคล้องของ chi-square)
ทดสอบว่าลูกเต๋ามีความเป็นธรรมหรือไม่ ด้วย $60$ ครั้งโยน $H_0$: แต่ละหน้ามีโอกาสเกิด $1/6$
- จำนวนที่คาดหวัง ต่อหน้า: $60 \times \tfrac{1}{6} = 10$ (ทุก $\ge 5$ ✓)
- $df$: $6 - 1 = 5$ (หน้าลูกเต๋าทั้งหมด 6 หน้า)
- $H_a$: ลูกเต๋ามีความไม่ยุติธรรม — อย่างน้อยหนึ่งหน้ามีความน่าจะเป็นต่างไป
การทดสอบ ความสอดคล้อง มี $H_0$: การแจกแจงที่อ้างว่าเป็นจริง, เทียบกับ $H_a$: ไม่เป็นจริง จำนวนที่คาดหวัง $= n \times$ (สัดส่วนที่อ้าง); ตรวจสอบ สุ่ม, 10%, และ ทุกจำนวนที่คาดหวัง $\ge 5$ ระดับอิสระ คือ $(\text{categories}) - 1$
เขียนจากค่าที่คาดไว้ 20
- โมเดลความสอดคล้องมีสี่ประเภทที่มีความน่าจะเป็นเท่ากัน
- มี 80 รายการ จำนวนตัวอย่างที่Implemented หาค่าคาดหวัง 10 และ 5 เป็นขนาดตัวอย่างอีกชุดหนึ่ง
A null goodness-of-fit model specifies four equally likely categories for 80 independent observations. Find each expected count and check the expected-count condition.
Equal categories share the sample size.
A null goodness-of-fit model specifies four equally likely categories for 80 independent observations. Find each expected count and check the expected-count condition.
ความยาก 1/5 · 100 เหรียญ + บอนัสน้อยๆ เมื่อทำสำเร็จครั้งแรกในวันนี้
80 divided by 4 is 20. Other options — 10 (the other sample); 5 (the minimum condition).
The claimed distribution
Expected counts come from the null distribution's proportions.
A fair die is rolled 60 times. What is the expected count for each face (60 × 1/6)?
ความยาก 2/5 · 140 เหรียญ + บอนัสน้อยๆ เมื่อทำสำเร็จครั้งแรกในวันนี้
60 × 1/6 = 10.
For a goodness-of-fit test with 6 categories, what are the degrees of freedom?
ความยาก 2/5 · 140 เหรียญ + บอนัสน้อยๆ เมื่อทำสำเร็จครั้งแรกในวันนี้
df = categories − 1 = 6 − 1 = 5.
The large counts condition for a chi-square test requires...
ความยาก 1/5 · 100 เหรียญ + บอนัสน้อยๆ เมื่อทำสำเร็จครั้งแรกในวันนี้
All EXPECTED counts must be at least 5.
Expected counts must always be whole numbers.
ความยาก 1/5 · 100 เหรียญ + บอนัสน้อยๆ เมื่อทำสำเร็จครั้งแรกในวันนี้
Keep them exact — they need not be integers.
The alternative hypothesis for a goodness-of-fit test says...
ความยาก 1/5 · 100 เหรียญ + บอนัสน้อยๆ เมื่อทำสำเร็จครั้งแรกในวันนี้
Ha is a non-directional 'the distribution isn't as claimed'.
เกิดปัญหาอะไรขึ้น? เฉพาะทีมเว็บไซต์เท่านั้นที่เห็นข้อมูลนี้