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+ (機率 ) → 路徑機率
第 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) 的概念與應用,包含對設計的判斷、與迴歸模型的連結、ANOVA 表格的填寫、假設檢定的建立與結論。
資料摘要:
共有 6 組實驗條件 (Task),總樣本數 。
各組樣本數 () 與標準差 () 如表所示。
(a) Standard Deviations Rule of Thumb for ANOVA
ANOVA 的一個常用規則是,各組的標準差之間不應有過大的差異,通常要求最大標準差與最小標準差的比值不超過 2。
從表中可以看出:
最小標準差 (sd) 約為 4.750 (Task 6)。
最大標準差 (sd) 約為 6.600 (Task 4)。
計算比值:
由於 1.389 2,這個比值小於 2,因此標準差滿足這個規則的經驗法則,表示各組的變異程度大致相似,可以使用 ANOVA。
【答案】是,標準差的比值約為 1.389,小於 2。
(b) Balanced Design
平衡設計 (Balanced Design) 指的是在實驗設計中,每個處理 (treatment) 或因子水平 (factor level) 下的觀察值數量 (樣本數) 都相等。
在此問題中,各 Task 的樣本數分別為:13, 12, 10, 10, 12, 11。
這些樣本數並不相等。
【答案】否。
(c) Dummy Variables for ANOVA as Multiple Regression
將 ANOVA 視為多重迴歸模型時,我們需要引入虛擬變數 (dummy variables)。
對於一個具有 個水平的因子,我們通常需要引入 個虛擬變數來進行迴歸分析。
在這個問題中,因子是 Task,共有 個水平。因此,我們需要 個虛擬變數。
Effect Coding Scheme (效果編碼):
效果編碼是一種特殊的編碼方式,其中每個虛擬變數的係數代表該水平的平均值與總平均值之間的差異。
通常,一個水平會被指定為參考水平,其對應的虛擬變數值為 -1。其他水平的虛擬變數值為 1 或 0。
假設我們將 Task 6 作為參考水平。我們需要 5 個虛擬變數:。
定義:
if Task=1, if Task=6, 0 otherwise.
if Task=2, if Task=6, 0 otherwise.
if Task=3, if Task=6, 0 otherwise.
if Task=4, if Task=6, 0 otherwise.
if Task=5, if Task=6, 0 otherwise.
這個定義在某些教材中會將參考組設為 0,而效果編碼通常使用 -1 來表示參考組,以使迴歸係數直接代表該組與總平均值的偏差。
另一種常見的定義方式如下,確保總和為零:
Let's define the dummy variables for the 6 tasks using effect coding. We need dummy variables. Let the tasks be indexed from 1 to 6.
Let be the -th observation for task .
We can define the dummy variables for tasks 1 through 5, and task 6 will be the reference category, represented by a vector of -1s for the dummy variables.
Let be the dummy variables for observation .
If Task = 1:
If Task = 2:
If Task = 3:
If Task = 4:
If Task = 5:
If Task = 6:
The regression model would be:
Here, represents the grand mean. represents the difference between the mean of Task 1 and the grand mean, and so on. The mean for Task 6 can be estimated as .
第 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. 建立預測區間
題目要求預測下一年度實際勝場數,因此使用「個別新觀測值的預測區間」:
其中:
先計算槓桿項:
所以:
第 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.
第 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) ,
第 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) ,