109 年 國立政治大學統計學系碩士班《統計方法》
第 1 題20 分
A box contains 5 black balls and 10 white balls. Each of Player A and Player B is asked to draw 3 balls from the box and record the number of black balls obtained. Each of them does this 100 times, with the following results:
| Observed Outcomes | 0 | 1 | 2 | 3 |
|---|---|---|---|---|
| Player A | 25 | 40 | 25 | 10 |
| Player B | 40 | 40 | 15 | 5 |
(a) (10%) Use to test the hypothesis that Player A drew the balls without replacement and Player B drew the balls with replacement.
(b) (10%) Use to test the hypothesis that the two multinomial populations are the same.
登入後即可作答並保存紀錄。
核心觀念
本題考查兩種卡方檢定:
-
適合度檢定(goodness-of-fit test)
檢查觀察到的次數是否符合指定的理論機率分布。 -
同質性檢定(test of homogeneity)
檢查兩個多項分布的母體機率是否相同。
卡方統計量為
其中 為觀察次數, 為虛無假設下的期望次數。
(a)檢定 A 不放回、B 放回
解題方法
對 Player A 與 Player B 分別建立理論分布,再進行適合度檢定。
虛無假設為
對立假設為
Player A:不放回抽球
盒中共有 顆球,其中黑球 顆、白球 顆。一次抽出 顆,得到 顆黑球的機率服從超幾何分布:
因此
A 重複試驗 次,期望次數如下:
| 黑球數 | 觀察次數 | 期望次數 |
|---|---|---|
| 0 | 25 | |
| 1 | 40 | |
| 2 | 25 | |
| 3 | 10 |
所以
若理論機率完全指定,類別數為 ,故自由度為
在 下,
由於
拒絕 A 不放回抽球的假設。
Player B:放回抽球
每次抽球後放回,因此每一球抽到黑球的機率固定為
一次抽 球,黑球數服從二項分布:
因此
各類別機率為
B 的期望次數為:
| 黑球數 | 觀察次數 | 期望次數 |
|---|---|---|
| 0 | 40 | |
| 1 | 40 | |
| 2 | 15 | |
| 3 | 5 |
因此
第 2 題20 分
The following data were collected from a training program. 3 persons participated in this study and 3 courses were used to evaluate their resulting performances. The grades are shown below.
| Person 1 | Person 2 | Person 3 | |
|---|---|---|---|
| Course A | 84 | 83 | 85 |
| Course B | 79 | 77 | 81 |
| Course C | 80 | 74 | 77 |
(a) (8%) At 95% confidence using the p-value approach, do persons perform differently?
(b) (8%) Using the critical value approach and , are there any significant differences among the 3 courses?
(c) (4%) A researcher said "one-way ANOVA cannot be applied to the problem in (b)." Do you agree with this comment? Please give your reason.
登入後即可作答並保存紀錄。
這是一道關於變異數分析 (ANOVA) 的題目,涵蓋了單因子變異數分析的應用、p-value 方法判斷以及對 ANOVA 適用性的討論。
核心觀念:
- 變異數分析 (ANOVA):用於比較三個或三個以上群體平均數的統計方法。
- 單因子變異數分析 (One-way ANOVA):當影響結果的因子只有一個時使用。
- 因子 (Factor):在此題中,因子是「參與者 (Person)」和「課程 (Course)」。
- 因子水準 (Levels of Factor):
- 參與者因子有 3 個水準:Person 1, Person 2, Person 3。
- 課程因子有 3 個水準:Course A, Course B, Course C。
- p-value approach:透過計算統計量出現的機率 (p-value),與顯著水準 比較來做決策。
- Critical Value approach:透過計算統計量與預先設定的臨界值比較來做決策。
(a) 檢定參與者表現是否不同 (Person Factor)
題意分析:
我們要檢定的是,這三位參與者 (Person 1, Person 2, Person 3) 的整體表現是否有顯著差異。這裡的「課程」是干擾因子,我們需要排除課程的影響,或者說,我們關注的是在所有課程下,三位參與者的平均表現是否不同。這是一個典型的單因子變異數分析問題,因子是「參與者」,其水準為 Person 1, Person 2, Person 3。
1. 建立假設:
: 三位參與者的平均表現相同。()
: 至少有一位參與者的平均表現不同。
2. 識別模型與參數:
這是一個單因子 ANOVA 模型,因子為「參與者」,有 3 個水準。
觀察值 表示第 位參與者在第 門課程的成績。
,其中 是第 位參與者的平均成績, 是隨機誤差,假設 獨立同分布。
在我們的數據中,我們實際上無法直接估計 因為每個參與者只在每個課程下被評估一次。
這題應該是要我們將「參與者」視為一個因子,而「課程」是另一個因子。由於題目問的是「參與者表現是否不同」,我們需要進行一個雙因子 ANOVA (Two-way ANOVA),或者,如果我們忽略課程的影響,將數據重新整理。
重新架構問題:
題目數據格式是:
| Person 1 | Person 2 | Person 3 | |
|---|---|---|---|
| Course A | 84 | 83 | 85 |
| Course B | 79 | 77 | 81 |
| Course C | 80 | 74 | 77 |
我們可以將「參與者」視為一個因子,其觀察值是該參與者在所有課程下的成績。
- Person 1 的成績:{84, 79, 80}
- Person 2 的成績:{83, 77, 74}
- Person 3 的成績:{85, 81, 77}
計算平均數與總變異數:
-
Person 1 平均 () = (84+79+80)/3 = 243/3 = 81
-
Person 2 平均 () = (83+77+74)/3 = 234/3 = 78
-
Person 3 平均 () = (85+81+77)/3 = 243/3 = 81
-
所有成績總平均 () = (81+78+81)/3 = 240/3 = 80
或者 (84+83+85+79+77+81+80+74+77)/9 = 720/9 = 80
進行單因子 ANOVA (因子:參與者):
-
組間平方和 (SSB - Sum of Squares Between groups):衡量各組平均數與總平均數之間的差異。
其中 (參與者數), (每位參與者觀察的次數)。
-
組內平方和 (SSW - Sum of Squares Within groups) / 誤差平方和 (SSE):衡量各組內觀察值與該組平均數的差異。
- Person 1:
- Person 2:
- Person 3:
-
總平方和 (SST - Total Sum of Squares):
3. 計算均方 (Mean Squares):
-
組間均方 (MSB):
-
組內均方 (MSW) / 誤差均方 (MSE):
4. 計算 F 統計量:
5. 決定自由度:
- 分子自由度
- 分母自由度
6. 使用 p-value approach 進行檢定:
我們需要找到 。
查 F 分布表,對於 :
由於我們的 F 統計量 非常小,遠小於常用顯著水準 (如 0.05 或 0.10) 的臨界值,所以 p-value 會非常大,遠大於 0.10。
例如,查 F 表可以發現,當 值很小時,其右尾機率 (p-value) 就會很大。
的值通常大於 1 才會顯著。
7. 下結論:
因為 p-value 很大 (p-value > 0.10),大於顯著水準 95% confidence (即 )。
或者,因為 F 統計量 小於臨界值 。
我們無法拒絕虛無假設 。
結論: 在 95% 的信心水準下,沒有足夠證據顯示三位參與者的平均表現有顯著差異。
【答案】:** 在 95% 信心水準下,參與者表現沒有顯著差異。
(b) 檢定課程表現是否不同 (Course Factor)
第 3 題25 分
Let , and , be two sets of independent observations where , are fixed constants. Suppose we fit the model to the first data set and the model to the second data set. Suppose that and are independently distributed with mean zero and variance .
(a) (15%) Find the least squares estimates of and .
(b) (10%) Following Part (a), how to use t test to test vs. ? Please state your testing procedure(s) clearly to get full credits.
登入後即可作答並保存紀錄。
核心觀念
本題考查「兩組獨立資料共用同一斜率、但具有不同截距」的最小平方法估計,以及共同誤差變異數下的迴歸斜率 檢定。
模型為
其中兩組資料共用斜率 ,但截距分別為 與 。
令
並定義
假設 ,亦即所有 不完全相同。
解題方法
最小平方法是使兩組資料的殘差平方和最小:
分別對 微分並令其為零。
(a)最小平方法估計量
1. 的估計量
對 微分:
因此
得到
2. 的估計量
同理,對 微分:
因此
3. 的估計量
對 微分:
代入
可將兩組資料分別中心化,得到
因此
亦即
其中
最後,
以及
(b)檢定 對上
1. 計算殘差平方和
使用估計出的參數後,兩組資料的殘差平方和為
第 4 題25 分
Bowl A contains 100 red balls and 200 white balls; Bowl B contains 200 red balls and 100 white balls. Let denote the probability of drawing a red ball from a bowl, but say is unknown, since it is unknown whether Bowl A or Bowl B is being used. We shall test the null hypothesis against .
(a) (4%) First, we draw three balls at random, one at a time and with replacement, from the selected bowl. Let be the number of red balls drawn. Then we decide to reject if . Please give a reason to explain the rejection area should be rather than .
(b) (6%) Please find the probabilities of making type I and type II errors in (a).
(c) (15%) As you can see in (b), the errors are too large, so we decide to draw more balls, say balls, and the rejection area is , where is the number of red balls from the draws and is the proportion and between 0 and 1. Please find the values of and , so that the type I error probability is 5% and the power is 90%. (Ps. Use the central limit theorem to find the approximate type I and II errors.)
登入後即可作答並保存紀錄。
核心觀念
本題考查:
- 二項分配:。
- 型一錯誤與型二錯誤:
- 型一錯誤: 正確卻拒絕 。
- 型二錯誤: 正確卻未拒絕 。
- Neyman–Pearson 準則:當 從 增加至 時,觀察到較多紅球較支持 。
- 中央極限定理近似二項分配。
(a)拒絕域為 的理由
在 與 下, 分別服從:
因為 的紅球機率較高,所以觀察到的紅球數 越大,越支持 。
更正式地,似然比為:
由於 隨 遞增,因此 越大時,越應拒絕 ,拒絕域應取為大於某一臨界值的區域,即:
若取 ,反而會把「紅球數較少」視為支持 ,與備擇假設的方向相反。
(b)型一錯誤與型二錯誤
型一錯誤機率
型一錯誤為在 下拒絕 :
因此:
所以型一錯誤機率約為:
型二錯誤機率
型二錯誤為在 成立時未拒絕 。由於拒絕域為 ,未拒絕域為 :
因此:
所以型二錯誤機率約為:
相對應的檢定力為:
(c)利用中央極限定理決定 與
解題方法
令:
拒絕域為:
要求:
因此在 下:
對二項分配使用中央極限定理:
第 5 題10 分
Let be a random sample from the normal distribution , and let and denote the sample mean and sample variance respectively. Find each of the following:
(a) (5%)
(b) (5%)
登入後即可作答並保存紀錄。
核心觀念
本題使用常態母體下的兩個重要抽樣分配:
- 母體為 時,
- 樣本變異數 滿足:
本題中
因此自由度皆為
(a)計算
解題方法
因為樣本來自常態分配,且母體平均數與變異數均已知其真值,但題目使用樣本標準差 ,所以應直接套用 分配:
因此
查自由度 的 分配表:
其中 ,所以右尾機率為
(b)計算
解題方法
常態母體下,