108 年 國立成功大學交通管理研究所乙組《統計學》
第 1 題
- Consider a routine screening test for a disease. Suppose the frequency of the disease in the population (base rate) is 0.5%. The test is highly accurate with a 5% false positive rate and a 10% false negative rate.
(a - 5 points) Draw the Venn diagram of the events in this problem.
(b - 5 points) Draw the tree diagram of the probabilities in this problem.
(c - 5 points) You take the test and it comes back positive. What is the probability that you have the disease?
(d - 5 points) What theorem do you use to calculate (c)? Briefly describe the theorem.
登入後即可作答並保存紀錄。
本題主要在考驗貝氏定理的應用,透過定義事件與給定的條件機率,計算在檢測結果為陽性時,真正罹患疾病的機率。
首先,我們定義以下事件:
: 罹患疾病 (Disease)
: 未罹患疾病 (No Disease)
: 檢測結果為陽性 (Test Positive)
: 檢測結果為陰性 (Test Negative)
根據題目敘述,我們可得知以下機率:
疾病的基礎發生率 (Base rate):
因此,未罹患疾病的機率為:
檢測的準確度:
5% 的偽陽性率 (False positive rate):指未罹患疾病者,檢測結果卻為陽性的機率。
10% 的偽陰性率 (False negative rate):指已罹患疾病者,檢測結果卻為陰性的機率。
由此可推導出:
真實陽性率 (True positive rate 或 Sensitivity):指已罹患疾病者,檢測結果為陽性的機率。
真實陰性率 (True negative rate 或 Specificity):指未罹患疾病者,檢測結果為陰性的機率。
(a) Venn Diagram
Venn Diagram 展示事件之間的關係,這裡可以繪製表示疾病狀態與檢測結果的區域。
[請在此處繪製 Venn Diagram,通常會包含兩個主要圓圈代表 D 和 D^c,以及另兩個圓圈代表 T+ 和 T-,並標示各區域的機率。由於此處為純文字輸出,無法繪製圖形,請自行參照以下概念繪製:
一個大矩形代表樣本空間。
兩個不重疊的大圓分別代表 D 和 D^c,它們共同填滿整個樣本空間。
在 D 圓圈內,又畫一個 T+ 的圓圈,其與 D 的交集區域代表 (True Positive),T+ 但不在 D 的區域代表 (False Positive)。
在 D^c 圓圈內,也可以畫 T+ 的圓圈,與 D 的相對位置類似。
或者,可以畫兩個可能重疊的圓圈,一個代表 D,一個代表 T+。
- : 真正陽性 (True Positive)
- : 偽陰性 (False Negative)
- : 偽陽性 (False Positive)
- : 真正陰性 (True Negative)
]
(b) Tree Diagram
Tree Diagram 可以視覺化條件機率的計算流程。
[請在此處繪製 Tree Diagram。通常會從第一個分支開始,代表疾病狀態 (D 或 D^c),然後從每個分支延伸出第二個分支,代表檢測結果 (T+ 或 T-)。
第一層分支:
- D (機率 )
- D^c (機率 )
第二層分支 (從 D 分支出):
- T+ (機率 ) → 路徑機率
- T- (機率 ) → 路徑機率
第二層分支 (從 D^c 分支出):
- T+ (機率 ) → 路徑機率
- T- (機率 ) → 路徑機率
檢查所有路徑機率總和:
]
(c) Probability of having the disease given a positive test result
第 2 題
- The data for this problem consists of pulse rate measurements on 68 males assigned at random to 6 different work tasks (Task). Here is a summary of the data in each group:
Task | n | mean | sd
---|---|---|---
1 | 13 | 31.923 | 4.958
2 | 12 | 31.083 | 5.664
3 | 10 | 35.800 | 5.308
4 | 10 | 38.000 | 6.600
5 | 12 | 29.500 | 6.008
6 | 11 | 28.818 | 4.750
(a - 3 points) Do the standard deviations satisfy the rule of thumb for safe use of ANOVA?
(b - 3 points) Is this a balanced design (yes or no)?
(c - 5 points) How many dummy variables would be required to fit the ANOVA as a multiple regression? Write out the dummy variables using an effect coding scheme.
(d - 5 points) Fill in the five pieces of missing information in the following ANOVA table.
| Source | Df | Sum Sq | Mean Sq | F value |
|---|---|---|---|---|
| Task | 694.44 | |||
| Residuals | 1916.08 | |||
| (e - 4 points) Label the means for the different tasks . State the null and alternative hypotheses for the ANOVA. | ||||
| (f - 5 points) Report the conclusions of the test at the 5% level. (You will not find the necessary denominator d.f. in the table attached, so use the nearest d.f. that is less than your denominator d.f.) |
登入後即可作答並保存紀錄。
核心觀念:單因子變異數分析(One-way ANOVA)之變異數同質性經驗法則、平衡設計判別、效果編碼(Effect Coding)與 檢定。
解題方法:
(a) 檢驗標準差是否滿足 ANOVA 經驗法則
ANOVA 要求各組母體變異數齊一,常用的經驗法則為「最大組標準差與最小組標準差之比值不超過 」:
滿足經驗法則,可安全使用 ANOVA。
(b) 是否為平衡設計(Balanced Design)
平衡設計要求各組樣本數完全相同。本題 組樣本數分別為 ,並不相等,故否(非平衡設計)。
(c) 以效果編碼(Effect Coding)建立虛擬變數
共有 個水準(Task ),需使用 個虛擬變數 。若以 Task 6 作為參考組(編碼為 ),各組編碼如下:
- Task 1:
- Task 2:
- Task 3:
- Task 4:
- Task 5:
- Task 6:
對應的多元迴歸模型為:
其中 代表各組均數的未加權總平均,()代表第 組平均與總平均的差,。
(d) 填寫 ANOVA 表
已知總樣本數 ,組數 :
-
自由度:,。
-
均方:
-
統計量:
| Source | Df | Sum Sq | Mean Sq | F value |
|---|---|---|---|---|
| Task |
第 3 題
- The economic structure of Major League Baseball (MLB) allows some teams to make substantially more money than others, which in turn allows some teams to spend much more on player salaries. These teams might therefore be expected to have better players and win more games on the field as a result. Over the course of the last 4 years (2012-2015), each of the 30 MLB teams were measured each year and the following data were collected for these 120 observations.
wins: number of games the team won for a specific year
payroll: opening day payroll, in millions of dollars, for the team for a specific year
AL: a binary variable for whether the team is in the American League (AL) (14 of the 30 teams are in the AL...the rest are in the National League (NL))
year: the year in which the measurement was t
A regression model, Model 1, was run to predict the number of wins a team had from the ln(payroll), and the results in R are shown below, along with some summary statistics:
Coefficients:
| | Estimate | Std. Error | t value | Pr(>|t|) |
|---|---|---|---|---|
| Intercept | 44.076 | 11.654 | 3.782 | 0.000246 |
| log(payroll) | 7.963 | 2.505 | 3.179 | 0.001887 |
Residual standard error: 10.5649 on 118 degrees of freedom
Multiple R-squared: 0.07889, Adjusted R-squared: 0.07109
F-statistic: 10.11 on 1 and 118 DF, p-value: 0.001887
Mean of (log(mlbpayroll)) = 0.386
(a - 3 points) What is the estimated correlation between wins and log(payroll)?
(b - 5 points) Interpret the slope coefficient in this model. Be specific.
(c - 5 points) Briefly describe the general meaning of a p-value.
(d - 5 points) Calculate , the mean number of wins, and , the standard deviation for the number of wins among the 120 observations.
(e - 5 points) The Red Sox are projected to spend about $180 million dollars on payroll in 2016 (next year). Provide a 95% interval for the number of games they will win next year. (t value is 1.984)
(f - 8 points) Below are the residual graphs for this model. List out all of the assumptions for this regression model, and comment on whether they are reasonable. Be specific.
(g - 4 points) Propose a different transformation on payroll to be used as a predictor. Provide 1-2 sentences of justification for why this may be a better choice for a transformation.
登入後即可作答並保存紀錄。
核心觀念
本題考查單一線性迴歸模型:
其中:
- :球隊勝場數 wins
- :薪資總額的自然對數
- :截距
- :斜率
- :誤差項
單一迴歸中有下列重要關係:
且相關係數的正負號與斜率相同。
(a)估計 wins 與 的相關係數
題目給出:
因此:
由於迴歸斜率 ,相關係數取正號:
表示勝場數與薪資對數之間具有弱度正相關。
(b)解釋斜率係數
迴歸模型為:
斜率為 ,表示在其他條件相同下,當 增加 1 單位時,預測勝場數平均增加 場。
由於薪資使用自然對數, 增加 1,代表薪資乘上 ,因此也可解釋為:
薪資約增加為原來的 倍時,預測勝場數平均增加約 場。
更實用的解釋是,若薪資由 增加至 百萬美元,預測勝場數的改變為:
例如薪資加倍時:
所以預測勝場數約增加 場。
注意:這是關聯性解釋,不代表增加薪資必然造成勝場數增加。
(c) 值的一般意義
值是在虛無假設 為真的前提下,觀察到目前統計量或比目前結果更極端結果的機率。
本題檢定斜率時:
表示若薪資對數與勝場數在母體中沒有線性關係,仍然觀察到目前如此極端迴歸結果的機率約為 。
因此在常用顯著水準 下,拒絕 ,認為 與勝場數之間存在顯著線性關係。
值不是「虛無假設為真的機率」,也不是「結果由偶然造成的機率」。
(d)計算 與
1. 計算平均勝場數
在單一迴歸中,迴歸線必經過 ,所以:
代入:
因此:
2. 計算勝場數標準差
單一迴歸中:
因此:
代入:
所以:
(e)預測 2016 年紅襪隊勝場數的 95% 區間
1. 計算預測勝場數
紅襪隊預計薪資為 百萬美元,因此:
預測值為:
因此預測紅襪隊約勝:
2. 建立預測區間
題目要求預測下一年度實際勝場數,因此使用「個別新觀測值的預測區間」:
其中:
先計算槓桿項:
所以:
誤差範圍為:
故 95% 預測區間為:
因此可寫為:
紅襪隊 2016 年勝場數的 95% 預測區間約為 至 場。
這裡使用的是預測區間,而不是平均反應值的信賴區間,因為題目詢問的是單一球隊下一年度的實際勝場數。
(f)迴歸模型假設與合理性判斷
1. 線性關係
假設:
也就是勝場數的平均值與 之間呈線性關係。
判斷方法是觀察「殘差對預測值圖」:
- 若殘差在 0 附近隨機散布,線性假設合理。
- 若呈現彎曲、U 型或倒 U 型,表示仍有非線性關係。
題幹文字未附實際殘差圖,因此無法進行圖形特有的判斷;若圖中殘差無明顯彎曲,則此假設可接受。
2. 誤差彼此獨立
假設:
彼此獨立。
本資料包含相同 30 支球隊連續 4 年的資料,因此同一球隊不同年度的表現可能相關,例如球隊管理、教練、主力球員與財務文化具有延續性。
因此,獨立性假設並不完全合理。較嚴謹的分析應考慮球隊的重複測量,例如使用固定效果模型、隨機效果模型或群聚標準誤。
3. 誤差變異數固定
假設:
判斷方法是觀察殘差圖:
第 4 題
- The followings are multiple choice problems. Please select the most appropriate answer and write down your analytical steps to get full points if necessary.
(1 - 4 points) Based on responses of 1467 respondents, a 95% confidence interval for the mean number of traffic accidents equals (6.8, 8.0). Which of the following interpretations is correct?
(a) There will be 95% probability that is between 6.8 and 8.0.
(b) Ninety-five percent of the values of number of accidents (for this sample) are between 6.8 and 8.0.
(c) If random samples of size 1467 were repeatedly selected, then 95% of the time would be between 6.8 and 8.0.
(d) We can be 95% confident that is between 6.8 and 8.0.
(2 - 4 points) Which of the following statement is Correct?
(a) A continuous random variable can assume any value in a single point.
(b) The probability density function of a real-valued random variable X is the probability that X will take a value less than or equal to x.
(c) A random variable is uniformly distributed whenever the probability is proportional to the interval's length.
(d) The area under the graph of CDF and probability are identical.
(3 - 4 points) Which one of the following statements about the sample correlation coefficient, r, between two variables X and Y is false?
(a) A value of r close to 1 implies a causal relationship exists between X and Y.
(b) A value of r = 0 does not necessarily mean that X and Y are unrelated.
(c) A value of r = 0 indicates that no linear relationship exists between X and Y.
(d) A value of r = 1 indicates that a perfect positive linear relationship exists between X and Y.
登入後即可作答並保存紀錄。
本題為選擇題,主要考驗對信賴區間解釋、機率論基本概念、相關係數意義的理解。
Problem 4.1: Confidence Interval Interpretation
給定 95% 信賴區間為 (6.8, 8.0),目標是找出正確的解釋。
-
選項 (a): "There will be 95% probability that is between 6.8 and 8.0."
- 這是常見的誤解。母體平均數 是一個固定的值,它不是隨機的。信賴區間是在統計推論中,根據樣本數據建構出來的一個區間,該區間有 95% 的機率包含真實的母體平均數。一旦樣本被選定,信賴區間也就確定了, 要嘛在這個區間內,要嘛不在。因此,不能說「有 95% 的機率 在這個區間內」。
-
選項 (b): "Ninety-five percent of the values of number of accidents (for this sample) are between 6.8 and 8.0."
- 這是對信賴區間的誤解,它混淆了樣本數據的分布與母體參數的信賴區間。信賴區間是關於母體平均數的,而不是關於樣本數據本身的。
-
選項 (c): "If random samples of size 1467 were repeatedly selected, then 95% of the time would be between 6.8 and 8.0."
- 這句話描述的是抽樣分布的特性,而不是信賴區間的解釋。雖然與信賴區間的建構有關,但不是信賴區間的直接解釋。信賴區間是在給定的樣本下,對 的估計。
-
選項 (d): "We can be 95% confident that is between 6.8 and 8.0."
- 這是對 95% 信賴區間最準確的解釋。它表示我們對建構這個區間的方法有 95% 的信心,這個方法能夠包含真實的母體平均數 。換句話說,如果我們重複這個抽樣和建構區間的過程很多次,大約 95% 的區間會包含真實的 。
【答案】(d) We can be 95% confident that is between 6.8 and 8.0.
Problem 4.2: Probability Concepts
-
選項 (a): "A continuous random variable can assume any value in a single point."
- 這是錯誤的。連續隨機變數可以取值於一個區間,而不是僅僅一個點。在一個點上的機率對於連續隨機變數是零。
-
選項 (b): "The probability density function of a real-valued random variable X is the probability that X will take a value less than or equal to x."
- 這是錯誤的。這是累積分布函數 (CDF) 的定義,而不是機率密度函數 (PDF)。PDF 的值本身不是機率,而是機率的「密度」。
-
選項 (c): "A random variable is uniformly distributed whenever the probability is proportional to the interval's length."
- 這是正確的。均勻分布 (Uniform Distribution) 的定義就是在此區間內,任何等長度的子區間具有相同的機率,也就是說,機率與區間長度成正比。
-
選項 (d): "The area under the graph of CDF and probability are identical."
- 這是錯誤的。CDF 的值 本身就是機率。CDF 的圖形是累積機率的曲線。
第 5 題
(4 - 4points) Suppose we wish to test vs . Which of the following possible sample results gives the most evidence to support ?
(a) ,
(b) ,
(c) ,
(d) ,
(5 - 4 points) A chi-square test involves a set of counts called "expected counts." What are the expected counts?
(a) Hypothetical counts that would occur of the alternative hypothesis were true.
(b) Hypothetical counts that would occur if the null hypothesis were true.
(c) The actual counts that did occur in the observed data.
(d) The long-run counts that would be expected if the observed counts are representative.
登入後即可作答並保存紀錄。
本題考驗對假設檢定中「證據強度」的判斷,以及卡方檢定中「期望次數」的定義。
Problem 5.4: Evidence for Alternative Hypothesis
我們要檢定 vs 。
我們的目標是尋找最能支持 (即 ) 的樣本結果。
支持 的證據,意味著樣本平均數 應該遠小於 21,或者說,樣本結果「不太可能」出現在 為真的情況下。
我們可以考慮計算一個檢定統計量,例如 t 統計量,它衡量樣本平均數 相對於虛無假設的中心值 21 的偏離程度,並考慮樣本變異性。
t 統計量的公式為:,其中 是虛無假設下的參數值(在此我們以 21 為基準)。
雖然我們沒有 和 的具體值,但我們可以比較 相對於 21 的位置,並考慮 的大小。
為了支持 ,我們希望 盡量小,且離 21 越遠越好。
讓我們計算各選項的 t 統計量,假設 相同(因為題目沒有給 ,且選項只提供了 和 )。
我們關心的是 相對於 21 的位置,以及 對於標準誤 的影響。較小的 和較大的 (相對於 的大小) 會提供更強的證據支持 。
-
選項 (a): ,
- 遠大於 21,這強烈支持 ,而 不支持 。
-
選項 (b): ,
- 小於 21。
- 如果我們假設一個樣本大小,例如 ,則標準誤為 。
- 。
-
選項 (c): ,
- 小於 21。
- 如果我們假設 ,則標準誤為 。
- 。
-
選項 (d): ,
- 小於 21。
- 如果我們假設 ,則標準誤為 。
- 。
比較選項 (b), (c), (d) 支持 的程度:
- 越小,越支持 。17 < 18 < 19。
- 標準誤越小,t 統計量的絕對值越大,證據越強。
- (b) ,
- (c) ,
- (d) ,
我們需要一個綜合的考量。選項 (c) 的 是最小的,這本身就提供了強有力的證據。雖然它的標準差 較大,但我們不能僅看 。
讓我們直接比較 和 相對於 21 的關係。
支持 的證據越強,表示樣本結果越「不可能」在 為真時發生。
考慮計算一個標準化的值,例如 。這個值越大,表示 相對於 21 的距離,用樣本標準差來衡量,越顯著。
- (a) (負值,不支持 )
- (b)
- (c)
- (d)
第 5 題
(4 - 4points) Suppose we wish to test vs . Which of the following possible sample results gives the most evidence to support ?
(a) ,
(b) ,
(c) ,
(d) ,
(5 - 4 points) A chi-square test involves a set of counts called "expected counts." What are the expected counts?
(a) Hypothetical counts that would occur of the alternative hypothesis were true.
(b) Hypothetical counts that would occur if the null hypothesis were true.
(c) The actual counts that did occur in the observed data.
(d) The long-run counts that would be expected if the observed counts are representative.
登入後即可作答並保存紀錄。
本題為選擇題,但因題目編號重複,此處依據原卷順序將此題編為 Problem 5.4 和 Problem 5.5。
Problem 5.4: Evidence for Alternative Hypothesis
我們要檢定 vs 。
我們的目標是尋找最能支持 (即 ) 的樣本結果。
支持 的證據,意味著樣本平均數 應該遠小於 21,或者說,樣本結果「不太可能」出現在 為真的情況下。
我們可以考慮計算一個檢定統計量,例如 t 統計量,它衡量樣本平均數 相對於虛無假設的中心值 21 的偏離程度,並考慮樣本變異性。
t 統計量的公式為:,其中 是虛無假設下的參數值(在此我們以 21 為基準)。
雖然我們沒有 和 的具體值,但我們可以比較 相對於 21 的位置,並考慮 的大小。
為了支持 ,我們希望 盡量小,且離 21 越遠越好。
讓我們計算各選項的 t 統計量,假設 相同(因為題目沒有給 ,且選項只提供了 和 )。
我們關心的是 相對於 21 的位置,以及 對於標準誤 的影響。較小的 和較大的 (相對於 的大小) 會提供更強的證據支持 。
-
選項 (a): ,
- 遠大於 21,這強烈支持 ,而 不支持 。
-
選項 (b): ,
- 小於 21。
- 如果我們假設一個樣本大小,例如 ,則標準誤為 。
- 。
-
選項 (c): ,
- 小於 21。
- 如果我們假設 ,則標準誤為 。
- 。
-
選項 (d): ,
- 小於 21。
- 如果我們假設 ,則標準誤為 。
- 。
比較選項 (b), (c), (d) 支持 的程度:
- 越小,越支持 。17 < 18 < 19。
- 標準誤越小,t 統計量的絕對值越大,證據越強。
- (b) ,
- (c) ,
- (d) ,
我們需要一個綜合的考量。選項 (c) 的 是最小的,這本身就提供了強有力的證據。雖然它的標準差 較大,但我們不能僅看 。
讓我們直接比較 和 相對於 21 的關係。
支持 的證據越強,表示樣本結果越「不可能」在 為真時發生。
考慮計算一個標準化的值,例如 。這個值越大,表示 相對於 21 的距離,用樣本標準差來衡量,越顯著。
- (a) (負值,不支持 )
- (b)
- (c)
- (d)