113 年 國立政治大學統計學系碩士班《統計方法》

📄 試題原卷 免費註冊後即可對照原始考卷 PDF免費註冊

第 1 題

Please answer the following short questions.
(a) Suppose a man roll a fair 6-sided die repeatedly until he sees the number 2 appear a total of five times, at which point he stops rolling. Let X be the total number of times he sees a number other than 2. What is the expectation of X? (3%)
(b) Cars pass an intersection on the road at a Poisson rate of one per minute. Suppose 5% of the cars on the road are vans. Given that 10 vans have passed by in an hour, what is the expected number of total cars to have passed by in that time? (3%)
(c) Genotypes (AA, Aa, aa) occur with probabilities (0.3, 0.4, 0.3). For n = 3 independent observations, the observed frequencies are (n1,n2,n3n_1, n_2, n_3). What probability distribution does n2n_2 alone have? (3%)
(d) Suppose we take a random sample of 400 persons and classify each one according to their gender and color preference (red, blue, green, yellow). What hypothesis shall we want to test if we are going to perform a chi-square analysis of the resulting table? (3%)

登入後即可作答並保存紀錄。

這一題的完整詳解

第 1 題

(a)

核心觀念

每次擲骰子得到「2」的機率為 p=16p=\frac16,得到「非 2」的機率為 q=56q=\frac56。

題目停止於第 5 次出現「2」,而 XX 表示在此之前或之間出現的「非 2」次數。因此,XX 服從負二項分布:

X∼NegativeBinomial⁡(r=5,p=16)X\sim \operatorname{NegativeBinomial}(r=5,p=\tfrac16)

其中負二項分布的期望為

E(X)=r1−pp.E(X)=r\frac{1-p}{p}.

解題方法

將每次出現「2」視為成功,直到累積 5 次成功為止。每兩次成功之間,非 2 的出現次數平均為

qp=5/61/6=5.\frac{q}{p} = \frac{5/6}{1/6} =5.

總共等待 5 次「2」,故

E(X)=5×5=25.E(X)=5\times 5=25.

亦可利用負二項分布公式:

E(X)=51−1616=5⋅5=25.E(X)=5\frac{1-\frac16}{\frac16} =5\cdot 5 =25.

解題技巧

負二項分布中,若「成功」機率為 pp,直到第 rr 次成功所需的「失敗」次數期望為

r1−pp.r\frac{1-p}{p}.

本題不要把 XX 誤認為「直到第 5 次擲骰所需的總次數」;XX 只計算非 2 的次數。

【答案】E(X)=25E(X)=25。


(b)

核心觀念

Poisson 過程具有「分類後仍為 Poisson 過程」的性質。總車流量為每分鐘 1 輛,因此一小時內總車數 NN 服從

N∼Poisson⁡(60).N\sim \operatorname{Poisson}(60).

每輛車為 van 的機率為 0.050.05,非 van 的機率為 0.950.95。由 Poisson thinning:

  • van 數量 V∼Poisson⁡(60×0.05)=Poisson⁡(3)V\sim\operatorname{Poisson}(60\times 0.05)=\operatorname{Poisson}(3);
  • 非 van 車數 C∼Poisson⁡(60×0.95)=Poisson⁡(57)C\sim\operatorname{Poisson}(60\times 0.95)=\operatorname{Poisson}(57);
  • VV 與 CC 相互獨立。

解題方法

已知一小時內有 10 輛 van 通過,即 V=10V=10。總車數為

N=V+C.N=V+C.

因此

E(N∣V=10)=E(V+C∣V=10).E(N\mid V=10) = E(V+C\mid V=10).

因為 VV 已知為 10,且 CC 與 VV 獨立,

E(N∣V=10)=10+E(C)=10+57=67.E(N\mid V=10) = 10+E(C) = 10+57 = 67.

解題技巧

本題的關鍵是 Poisson 分類性,而不是直接使用一般的條件期望公式。分類後,van 與非 van 的車流量彼此獨立,因此觀察到 van 數量不會改變非 van 數量的期望。

【答案】一小時內總車數的條件期望為 6767 輛。


(c)

核心觀念

n=3n=3 次獨立觀察分別落入三種基因型,機率為

(p1,p2,p3)=(0.3,0.4,0.3).(p_1,p_2,p_3)=(0.3,0.4,0.3).

因此頻數向量 (n1,n2,n3)(n_1,n_2,n_3) 服從多項分布:

(n1,n2,n3)∼Multinomial⁡(3;0.3,0.4,0.3).(n_1,n_2,n_3)\sim\operatorname{Multinomial}(3;0.3,0.4,0.3).

多項分布中,單一類別的邊際分布為二項分布。n2n_2 表示 3 次觀察中,落入 AaAa 的次數,而每次落入 AaAa 的機率為 0.40.4。

解題方法

將每次觀察視為:

  • 成功:基因型為 AaAa,機率 0.40.4;
  • 失敗:基因型為 AAAA 或 aaaa,機率 0.60.6。

故

n2∼Binomial⁡(3,0.4).n_2\sim\operatorname{Binomial}(3,0.4).

其機率質量函數為

P(n2=k)=(3k)(0.4)k(0.6)3−k,k=0,1,2,3.P(n_2=k) = \binom{3}{k}(0.4)^k(0.6)^{3-k}, \qquad k=0,1,2,3.

各值為

P(n2=0)=0.63=0.216,P(n_2=0)=0.6^3=0.216,
🔒

後續完整解題步驟與【答案】

免費註冊,享三天全站完整詳解閱覽。

免費註冊

第 2 題8 分

The chart below records the actual high and low temperatures (unit: °F) for a selection of days in February from the weather report for a city.

Maximum85766360656863
Minimum70686365656160

Assuming that the variables are normally distributed, is there sufficient evidence to conclude that there is more than a 3°F difference between average highs and lows at the 0.10 level of significance? Using p-value approach. (8%)

登入後即可作答並保存紀錄。

這一題的完整詳解

這題考驗了配對樣本的 t 檢定(Paired t-test)以及 p-value 的應用。我們需要檢定平均溫差是否大於 3°F。

首先,計算每日的溫差(High - Low):
Day 1: 85−70=1585 - 70 = 15
Day 2: 76−68=876 - 68 = 8
Day 3: 63−63=063 - 63 = 0
Day 4: 60−65=−560 - 65 = -5
Day 5: 65−65=065 - 65 = 0
Day 6: 68−61=768 - 61 = 7
Day 7: 63−60=363 - 60 = 3

令 did_i 為第 ii 天的溫差,di=Maximumi−Minimumid_i = \text{Maximum}_i - \text{Minimum}_i。
我們有 7 個配對樣本,因此樣本數 n=7n=7。
計算溫差的樣本平均值 dˉ\bar{d}:
dˉ=17(15+8+0+(−5)+0+7+3)=17(28)=4\bar{d} = \frac{1}{7} (15 + 8 + 0 + (-5) + 0 + 7 + 3) = \frac{1}{7} (28) = 4。

計算溫差的樣本標準差 sds_d:
首先計算樣本變異數 sd2s_d^2:
sd2=1n−1∑i=1n(di−dˉ)2s_d^2 = \frac{1}{n-1} \sum_{i=1}^n (d_i - \bar{d})^2
sd2=17−1[(15−4)2+(8−4)2+(0−4)2+(−5−4)2+(0−4)2+(7−4)2+(3−4)2]s_d^2 = \frac{1}{7-1} [ (15-4)^2 + (8-4)^2 + (0-4)^2 + (-5-4)^2 + (0-4)^2 + (7-4)^2 + (3-4)^2 ]
sd2=16[112+42+(−4)2+(−9)2+(−4)2+32+(−1)2]s_d^2 = \frac{1}{6} [ 11^2 + 4^2 + (-4)^2 + (-9)^2 + (-4)^2 + 3^2 + (-1)^2 ]
sd2=16[121+16+16+81+16+9+1]s_d^2 = \frac{1}{6} [ 121 + 16 + 16 + 81 + 16 + 9 + 1 ]
sd2=16[260]=1303≈43.33s_d^2 = \frac{1}{6} [ 260 ] = \frac{130}{3} \approx 43.33。
樣本標準差 sd=1303≈43.33≈6.583s_d = \sqrt{\frac{130}{3}} \approx \sqrt{43.33} \approx 6.583。

設定虛無假設 H0H_0 和對立假設 H1H_1:
我們想檢定平均溫差是否「大於」3°F。
H0:μd≤3H_0: \mu_d \le 3 (平均溫差不大於 3°F)
H1:μd>3H_1: \mu_d > 3 (平均溫差大於 3°F)
其中 μd\mu_d 是總體平均溫差。

計算檢定統計量 tt:
t=dˉ−μ0sdnt = \frac{\bar{d} - \mu_{0}}{\frac{s_d}{\sqrt{n}}}
其中 μ0=3\mu_0 = 3 (在 H0H_0 下的假設值)。
t=4−36.5837=16.5832.646=12.488≈0.402t = \frac{4 - 3}{\frac{6.583}{\sqrt{7}}} = \frac{1}{\frac{6.583}{2.646}} = \frac{1}{2.488} \approx 0.402。

計算自由度:
自由度 df=n−1=7−1=6df = n-1 = 7-1 = 6。

使用 p-value 方法進行檢定:
我們需要找到 P(Tdf≥t)P(T_{df} \ge t),其中 TdfT_{df} 服從自由度為 6 的 t-分佈。
p-value =P(T6≥0.402)= P(T_6 \ge 0.402)。
查閱 t-分佈表(或使用統計軟體),對於自由度 6:

🔒

後續完整解題步驟與【答案】

免費註冊,享三天全站完整詳解閱覽。

免費註冊

第 3 題12 分

A medical research worker wants to study how male and female rats react the injection of a certain toxic substance. Suppose that 50 of 100 male rats and 160 of 400 female rats reacted strongly to the injection.
(a) Calculate the test statistics for testing the difference between the true percentages of male and female rats which react strongly to the injection. (4%)
(b) If analyzing the data like a 2×2 table, what test would you use for testing the difference? Also, state the hypotheses. (4%)
(c) For the test in part (b), can you calculate the associated test statistics based on the result of part (a)? If yes, calculate the value of the test statistics; otherwise, explain your answer. (4%)

登入後即可作答並保存紀錄。

這一題的完整詳解

這題考驗了兩個比例的比較檢定,涉及樣本比例的計算、Z 檢定統計量、卡方檢定以及兩者之間的關係。

(a) 計算檢定兩個獨立樣本比例差的 Z 檢定統計量。
設 p1p_1 為雄性老鼠對注射產生強烈反應的真實比例,p2p_2 為雌性老鼠對注射產生強烈反應的真實比例。
樣本數據:
雄性老鼠:樣本數 n1=100n_1 = 100,反應數 x1=50x_1 = 50。
雌性老鼠:樣本數 n2=400n_2 = 400,反應數 x2=160x_2 = 160。

樣本比例:
p^1=x1/n1=50/100=0.50\hat{p}_1 = x_1 / n_1 = 50 / 100 = 0.50
p^2=x2/n2=160/400=0.40\hat{p}_2 = x_2 / n_2 = 160 / 400 = 0.40

虛無假設 H0:p1=p2H_0: p_1 = p_2 (兩組真實比例相等)。
對立假設 H1:p1≠p2H_1: p_1 \neq p_2 (兩組真實比例不相等)。

在虛無假設下,我們使用合併樣本比例 p^\hat{p} 作為共同的真實比例估計:
p^=x1+x2n1+n2=50+160100+400=210500=0.42\hat{p} = \frac{x_1 + x_2}{n_1 + n_2} = \frac{50 + 160}{100 + 400} = \frac{210}{500} = 0.42。

合併樣本比例的標準誤(Standard Error of the Difference in Proportions):
SE(p^1−p^2)=p^(1−p^)(1n1+1n2)SE(\hat{p}_1 - \hat{p}_2) = \sqrt{\hat{p}(1-\hat{p})(\frac{1}{n_1} + \frac{1}{n_2})}
SE(p^1−p^2)=0.42(1−0.42)(1100+1400)SE(\hat{p}_1 - \hat{p}_2) = \sqrt{0.42(1-0.42)(\frac{1}{100} + \frac{1}{400})}
SE(p^1−p^2)=0.42×0.58×(4400+1400)SE(\hat{p}_1 - \hat{p}_2) = \sqrt{0.42 \times 0.58 \times (\frac{4}{400} + \frac{1}{400})}
SE(p^1−p^2)=0.2436×5400=0.2436×0.0125SE(\hat{p}_1 - \hat{p}_2) = \sqrt{0.2436 \times \frac{5}{400}} = \sqrt{0.2436 \times 0.0125}
SE(p^1−p^2)=0.003045≈0.05518SE(\hat{p}_1 - \hat{p}_2) = \sqrt{0.003045} \approx 0.05518。

Z 檢定統計量:
Z=p^1−p^2SE(p^1−p^2)Z = \frac{\hat{p}_1 - \hat{p}_2}{SE(\hat{p}_1 - \hat{p}_2)}
Z=0.50−0.400.05518=0.100.05518≈1.812Z = \frac{0.50 - 0.40}{0.05518} = \frac{0.10}{0.05518} \approx 1.812。

【答案】1.812

(b) 檢定兩個比例差異的常用方法是卡方獨立性檢定(Chi-Square Test of Independence)或 Z 檢定(Z-test for the Difference between Two Proportions)。
當數據可以組織成一個 2x2 列聯表時,卡方獨立性檢定是一個常見的選擇。
2x2 列聯表如下:

反應強烈未反應強烈總計
雄性老鼠5050100
🔒

後續完整解題步驟與【答案】

免費註冊,享三天全站完整詳解閱覽。

免費註冊

第 4 題12 分

A national council wishes to estimate the unemployment rate (π) in Taipei city. A random sample of n persons is selected from the labor force. Let X be the number of unemployed persons in the sample.
(a) How large a sample is necessary if the council wishes to be 95% certain that the error of estimation is within 3 percentage point when the true unemployment rate is between 0.2 and 0.4? (4%)
(b) If n=100 and π = 0.01, can you approximate the probability that at least one unemployed persons are in the sample? If yes, calculate the value; otherwise, explain your answer. (4%)
(c) Consider the hypothesis testing with H0:π=1/3H_0: \pi = 1/3 versus Ha:π=1/2H_a: \pi = 1/2. Suppose that the rejection region for this test is X≥kX \ge k. If n=5n = 5 and k=4k = 4, calculate the probability of Type II error. (4%)

登入後即可作答並保存紀錄。

這一題的完整詳解

本題考查比例估計所需樣本數決定、二項分佈近似計算以及假設檢定之第二類型錯誤(Type II error)機率計算。

(a) 計算所需樣本大小 nn:
目標為估計失業率 π\pi,要求 95% 信心水準下估計誤差在 3 個百分點以內,即誤差範圍 MOE≤0.03MOE \le 0.03。
信心水準 1−α=0.951-\alpha = 0.95 對應臨界值 Zα/2=Z0.025=1.96Z_{\alpha/2} = Z_{0.025} = 1.96。
樣本大小公式為:

n=Zα/22⋅π(1−π)MOE2n = \frac{Z_{\alpha/2}^2 \cdot \pi(1-\pi)}{MOE^2}

題幹給定真實失業率介於 0.2 與 0.4 之間(0.2≤π≤0.40.2 \le \pi \le 0.4)。二次函數 f(π)=π(1−π)f(\pi) = \pi(1-\pi) 在區間 [0.2,0.4][0.2, 0.4] 內遞增,最大值發生於最接近 0.5 的邊界點 π=0.4\pi = 0.4:

π(1−π)=0.4×(1−0.4)=0.4×0.6=0.24\pi(1-\pi) = 0.4 \times (1 - 0.4) = 0.4 \times 0.6 = 0.24

為了確保在該範圍內均滿足誤差要求,採取最保守之 π=0.4\pi = 0.4 計算:

n=(1.96)2×0.24(0.03)2=3.8416×0.240.0009=0.9219840.0009≈1024.43n = \frac{(1.96)^2 \times 0.24}{(0.03)^2} = \frac{3.8416 \times 0.24}{0.0009} = \frac{0.921984}{0.0009} \approx 1024.43

樣本數必須取整數且無條件進位,故所需最小樣本大小為 n=1025n = 1025。

(b) 近似計算至少有一名失業者的機率:
給定 n=100n = 100,真實失業率 π=0.01\pi = 0.01。

  • 近似適用性分析:
    若考慮常態近似,檢驗準則 nπ=100×0.01=1<5n\pi = 100 \times 0.01 = 1 < 5,不符合常態近似條件,故不可使用常態近似。
    然而,由於試驗次數 n=100n = 100 較大且成功機率 π=0.01\pi = 0.01 甚小,完全符合卜瓦松近似(Poisson approximation)之條件,參數為 λ=nπ=100×0.01=1\lambda = n\pi = 100 \times 0.01 = 1。
  • 計算近似機率:
    令 Y∼Poisson(λ=1)Y \sim \text{Poisson}(\lambda = 1),則至少一名失業者的近似機率為:
P(X≥1)≈P(Y≥1)=1−P(Y=0)=1−e−1100!=1−e−1≈1−0.3679=0.6321P(X \ge 1) \approx P(Y \ge 1) = 1 - P(Y = 0) = 1 - \frac{e^{-1} 1^0}{0!} = 1 - e^{-1} \approx 1 - 0.3679 = 0.6321

(若以二項分佈精確值對照計算:P(X≥1)=1−(1−0.01)100=1−(0.99)100≈1−0.3660=0.6340P(X \ge 1) = 1 - (1-0.01)^{100} = 1 - (0.99)^{100} \approx 1 - 0.3660 = 0.6340)。
因此,本題可以採用卜瓦松分佈進行良好近似,求得近似值約為 0.6321(精確值約為 0.6340)。

(c) 計算第二類型錯誤機率:
檢定假說為 H0:π=1/3H_0: \pi = 1/3 對上 Ha:π=1/2H_a: \pi = 1/2。
樣本數 n=5n = 5,拒絕域為 X≥4X \ge 4。

🔒

後續完整解題步驟與【答案】

免費註冊,享三天全站完整詳解閱覽。

免費註冊

第 4(d) 題8 分

Refer to part (c). Using the Central Limit Theorem, find n and k such that the probability of Type I error is 0.05 and the probability of Type II error is 0.1. (8%)

登入後即可作答並保存紀錄。

這一題的完整詳解

核心觀念

本題利用中央極限定理(Central Limit Theorem, CLT)近似樣本平均數的分配,並同時控制:

  • 第一類錯誤:P(拒絕 H0∣H0 為真)=0.05P(\text{拒絕 }H_0\mid H_0\text{ 為真})=0.05
  • 第二類錯誤:P(不拒絕 H0∣H1 為真)=0.10P(\text{不拒絕 }H_0\mid H_1\text{ 為真})=0.10

由於題目未附上第 (c)(c) 題的假設、母體平均數與變異數,以下依第 (c)(c) 題為單尾檢定

H0:μ=μ0,H1:μ=μ1,μ1>μ0H_0:\mu=\mu_0,\qquad H_1:\mu=\mu_1,\quad \mu_1>\mu_0

且拒絕域為 Xˉ≥k\bar X\ge k、母體標準差為已知的 σ\sigma 進行推導。


解題方法

設 X1,…,XnX_1,\ldots,X_n 為隨機樣本,則

Xˉ=1n∑i=1nXi.\bar X=\frac{1}{n}\sum_{i=1}^nX_i.

依中央極限定理,

Xˉ∼˙N(μ,σ2n).\bar X\mathrel{\dot\sim}N\left(\mu,\frac{\sigma^2}{n}\right).

其中 Xˉ\bar X 的標準誤為

SE⁡(Xˉ)=σn.\operatorname{SE}(\bar X)=\frac{\sigma}{\sqrt n}.

1. 控制第一類錯誤率

當 H0H_0 為真時,μ=μ0\mu=\mu_0,因此

Xˉ∼˙N(μ0,σ2n).\bar X\mathrel{\dot\sim}N\left(\mu_0,\frac{\sigma^2}{n}\right).

第一類錯誤率為

Pμ0(Xˉ≥k)=0.05.P_{\mu_0}(\bar X\ge k)=0.05.

標準化得

P(Z≥k−μ0σ/n)=0.05.P\left( Z\ge \frac{k-\mu_0}{\sigma/\sqrt n} \right)=0.05.

因為 z0.95=1.645z_{0.95}=1.645,所以

k−μ0σ/n=1.645.\frac{k-\mu_0}{\sigma/\sqrt n}=1.645.

因此臨界值 kk 必須滿足

k=μ0+1.645σn.(1)k=\mu_0+1.645\frac{\sigma}{\sqrt n}. \tag{1}

2. 控制第二類錯誤率

當 H1H_1 為真時,μ=μ1\mu=\mu_1。第二類錯誤是未能拒絕 H0H_0,故

Pμ1(Xˉ<k)=0.10.P_{\mu_1}(\bar X<k)=0.10.

標準化得

P(Z<k−μ1σ/n)=0.10.P\left( Z<\frac{k-\mu_1}{\sigma/\sqrt n} \right)=0.10.

因為 z0.10=−1.282z_{0.10}=-1.282,所以

k−μ1σ/n=−1.282.\frac{k-\mu_1}{\sigma/\sqrt n}=-1.282.

因此

k=μ1−1.282σn.(2)k=\mu_1-1.282\frac{\sigma}{\sqrt n}. \tag{2}

3. 解出樣本數 nn

將式 (1)(1) 與式 (2)(2) 相等:

μ0+1.645σn=μ1−1.282σn.\mu_0+1.645\frac{\sigma}{\sqrt n} = \mu_1-1.282\frac{\sigma}{\sqrt n}.

整理得

μ1−μ0=(1.645+1.282)σn.\mu_1-\mu_0 = (1.645+1.282)\frac{\sigma}{\sqrt n}.

因此

n=(1.645+1.282)σμ1−μ0,\sqrt n = \frac{(1.645+1.282)\sigma}{\mu_1-\mu_0},

故

n=[2.927σμ1−μ0]2.\boxed{ n= \left[ \frac{2.927\sigma}{\mu_1-\mu_0} \right]^2 }.

樣本數必須為整數,實際設計時取

n=⌈[2.927σμ1−μ0]2⌉.\boxed{ n= \left\lceil \left[ \frac{2.927\sigma}{\mu_1-\mu_0} \right]^2 \right\rceil }.

再將此 nn 代回式 (1)(1),得到臨界值

k=μ0+1.645σn.\boxed{ k=\mu_0+1.645\frac{\sigma}{\sqrt n} }.

也可代回式 (2)(2)計算,兩者在未取整的理論值下相同。


若第 (c)(c) 題為二項分配的比例檢定

若第 (c)(c) 題設定為

H0:p=p0,H1:p=p1,p1>p0,H_0:p=p_0,\qquad H_1:p=p_1,\quad p_1>p_0,

且拒絕域為 p^≥k\hat p\ge k,則依 CLT,

p^∼˙N(p,p(1−p)n).\hat p\mathrel{\dot\sim} N\left(p,\frac{p(1-p)}{n}\right).
🔒

後續完整解題步驟與【答案】

免費註冊,享三天全站完整詳解閱覽。

免費註冊

第 5 題8 分

The following table is the distribution of the number of bears spotted on 60 sightseeing tours in a national park. (Hint: e-0.5 = 0.607, e-0.65 = 0.522, e-0.75 = 0.472)

Number of tours0123
Number of bears321594

Test whether the data come from a Poisson distribution using a 1% significance level. (8%)

登入後即可作答並保存紀錄。

這一題的完整詳解

本題考查使用卡方適合度檢定(Chi-Square Goodness-of-Fit Test)檢驗資料是否服從卜瓦松分佈(Poisson Distribution)。

  1. 樣本資料與參數估計:
    總旅遊次數為 N=60N = 60 次。
    觀察次數分佈如下:
  • 看到 0 隻熊:32 次
  • 看到 1 隻熊:15 次
  • 看到 2 隻熊:9 次
  • 看到 3 隻熊:4 次
    總看到熊的隻數為:
∑xifi=(0×32)+(1×15)+(2×9)+(3×4)=0+15+18+12=45\sum x_i f_i = (0 \times 32) + (1 \times 15) + (2 \times 9) + (3 \times 4) = 0 + 15 + 18 + 12 = 45

利用樣本平均數估計卜瓦松參數 λ\lambda:

λ^=4560=0.75\hat{\lambda} = \frac{45}{60} = 0.75
  1. 計算理論機率與期望頻率:
    已知提示給定 e−0.75=0.472e^{-0.75} = 0.472。卜瓦松機率質量函數為 P(X=x)=e−λλxx!P(X=x) = \frac{e^{-\lambda} \lambda^x}{x!}:
  • P(X=0)=e−0.75=0.472P(X=0) = e^{-0.75} = 0.472
    E0=60×0.472=28.32E_0 = 60 \times 0.472 = 28.32
  • P(X=1)=e−0.75×0.75=0.472×0.75=0.354P(X=1) = e^{-0.75} \times 0.75 = 0.472 \times 0.75 = 0.354
    E1=60×0.354=21.24E_1 = 60 \times 0.354 = 21.24
  • P(X=2)=e−0.75×(0.75)22=0.472×0.28125=0.13275P(X=2) = \frac{e^{-0.75} \times (0.75)^2}{2} = 0.472 \times 0.28125 = 0.13275
    E2=60×0.13275=7.965E_2 = 60 \times 0.13275 = 7.965
  • P(X≥3)=1−P(X=0)−P(X=1)−P(X=2)=1−0.472−0.354−0.13275=0.04125P(X \ge 3) = 1 - P(X=0) - P(X=1) - P(X=2) = 1 - 0.472 - 0.354 - 0.13275 = 0.04125
    E≥3=60×0.04125≈2.475E_{\ge 3} = 60 \times 0.04125 \approx 2.475
  1. 類別合併:
    在卡方適合度檢定中,標準準則要求各類別之期望頻率不得小於 5(即 Ei≥5E_i \ge 5)。
    因 E≥3≈2.475<5E_{\ge 3} \approx 2.475 < 5,故將 X=2X=2 與 X≥3X \ge 3 合併為「X≥2X \ge 2」單一類別:
  • 觀察頻率:O≥2=9+4=13O_{\ge 2} = 9 + 4 = 13
  • 理論機率:P(X≥2)=1−P(X=0)−P(X=1)=1−0.472−0.354=0.174P(X \ge 2) = 1 - P(X=0) - P(X=1) = 1 - 0.472 - 0.354 = 0.174
  • 期望頻率:E≥2=60×0.174=10.44E_{\ge 2} = 60 \times 0.174 = 10.44(已符合 ≥5\ge 5 之準則)

合併後的類別共有 3 類(X=0,X=1,X≥2X=0, X=1, X \ge 2):

  • X=0X = 0:O0=32O_0 = 32,E0=28.32E_0 = 28.32
  • X=1X = 1:O1=15O_1 = 15,E1=21.24E_1 = 21.24
  • X≥2X \ge 2:O≥2=13O_{\ge 2} = 13,E≥2=10.44E_{\ge 2} = 10.44
🔒

後續完整解題步驟與【答案】

免費註冊,享三天全站完整詳解閱覽。

免費註冊

第 6 題24 分

Suppose that a scientist has a bivariate dataset with n = 5 subjects, and suppose the sample variance of Y1, Y2,..., Yn is 2.5, the sample variance of X1, X2, ..., Xn is 2.5, x = 3, and the sample correlation coefficient is 0.9. A simple linear regression Y = β₀ + β₁X + ε with ε ~ N(0, σ²) is fit using computer software. However unfortunately a large portion of the computer outputs is missing and the scientist only has the following estimate left: Σyᵢ = 25.
(a) Fill in the entries (1) - (6) for the following table of coefficients. (6%)
(b) Test whether there is a linear association between the variables using F test with α = 0.05. (8%)
(c) Construct a 95% confidence interval for the slope. Based on this interval, would the scientist reject that β₁ = 1 at the 5% significance level? (8%)
(d) Suppose the scientist compute three confidence intervals for an individual value of Y when X = 1, X = 2, and X = 4. Which of the three confidence intervals gives the most precise prediction? Explain your answer. (4%)

登入後即可作答並保存紀錄。

這一題的完整詳解

這題考驗了簡單線性迴歸的相關概念,包括迴歸係數估計、標準誤、t 檢定、F 檢定、信賴區間以及預測區間。

已知資訊:
樣本數 n=5n = 5。
YY 的樣本變異數 sY2=2.5s_Y^2 = 2.5。
XX 的樣本變異數 sX2=2.5s_X^2 = 2.5。
XX 的樣本平均值 xˉ=3\bar{x} = 3。
樣本相關係數 r=0.9r = 0.9。
∑yi=25\sum y_i = 25。
迴歸模型:Y=β0+β1X+ϵY = \beta_0 + \beta_1 X + \epsilon,其中 ϵ∼N(0,σ2)\epsilon \sim N(0, \sigma^2)。

首先,我們需要計算一些基本量:
YY 的樣本平均值 yˉ=∑yin=255=5\bar{y} = \frac{\sum y_i}{n} = \frac{25}{5} = 5。
XX 的樣本標準差 sX=sX2=2.5s_X = \sqrt{s_X^2} = \sqrt{2.5}。
YY 的樣本標準差 sY=sY2=2.5s_Y = \sqrt{s_Y^2} = \sqrt{2.5}。

迴歸係數的估計:
斜率 β^1=rsYsX=0.9×2.52.5=0.9\hat{\beta}_1 = r \frac{s_Y}{s_X} = 0.9 \times \frac{\sqrt{2.5}}{\sqrt{2.5}} = 0.9。
截距 β^0=yˉ−β^1xˉ=5−(0.9)(3)=5−2.7=2.3\hat{\beta}_0 = \bar{y} - \hat{\beta}_1 \bar{x} = 5 - (0.9)(3) = 5 - 2.7 = 2.3。

殘差平方和 SSESSE (Sum of Squared Errors):
SSE=∑(yi−y^i)2=∑ei2SSE = \sum (y_i - \hat{y}_i)^2 = \sum e_i^2。
我們知道 r2=SSRSST=1−SSESSTr^2 = \frac{SSR}{SST} = 1 - \frac{SSE}{SST}。
SST=∑(yi−yˉ)2=(n−1)sY2=(5−1)×2.5=4×2.5=10SST = \sum (y_i - \bar{y})^2 = (n-1) s_Y^2 = (5-1) \times 2.5 = 4 \times 2.5 = 10。
r2=(0.9)2=0.81r^2 = (0.9)^2 = 0.81。
0.81=1−SSE10  ⟹  SSE10=1−0.81=0.19  ⟹  SSE=0.19×10=1.90.81 = 1 - \frac{SSE}{10} \implies \frac{SSE}{10} = 1 - 0.81 = 0.19 \implies SSE = 0.19 \times 10 = 1.9。

估計的誤差變異數 σ^2=se2=SSEn−2=1.95−2=1.93≈0.6333\hat{\sigma}^2 = s_e^2 = \frac{SSE}{n-2} = \frac{1.9}{5-2} = \frac{1.9}{3} \approx 0.6333。

(a) 填充係數表格:
表格包含:Coefficient (Intercept, X), Estimate, Std. Error, t value。
Estimate:
(1) Intercept (β^0\hat{\beta}_0): 2.3
(4) X (β^1\hat{\beta}_1): 0.9

Std. Error:
標準誤是迴歸係數估計量的標準差。
斜率 β^1\hat{\beta}_1 的標準誤:SE(β^1)=σ^2∑(xi−xˉ)2SE(\hat{\beta}_1) = \sqrt{\frac{\hat{\sigma}^2}{\sum (x_i - \bar{x})^2}}。
∑(xi−xˉ)2=(n−1)sX2=(5−1)×2.5=4×2.5=10\sum (x_i - \bar{x})^2 = (n-1) s_X^2 = (5-1) \times 2.5 = 4 \times 2.5 = 10。
SE(β^1)=1.9/310=1.930≈0.06333≈0.2517SE(\hat{\beta}_1) = \sqrt{\frac{1.9/3}{10}} = \sqrt{\frac{1.9}{30}} \approx \sqrt{0.06333} \approx 0.2517。
(5) X Std. Error: 0.2517

截距 β^0\hat{\beta}_0 的標準誤:SE(β^0)=σ^2(1n+xˉ2∑(xi−xˉ)2)SE(\hat{\beta}_0) = \sqrt{\hat{\sigma}^2 (\frac{1}{n} + \frac{\bar{x}^2}{\sum (x_i - \bar{x})^2})}。
SE(β^0)=1.93(15+3210)=1.93(15+910)=1.93(2+910)=1.93×1110=1.9×1.13=2.093≈0.6967≈0.8347SE(\hat{\beta}_0) = \sqrt{\frac{1.9}{3} (\frac{1}{5} + \frac{3^2}{10})} = \sqrt{\frac{1.9}{3} (\frac{1}{5} + \frac{9}{10})} = \sqrt{\frac{1.9}{3} (\frac{2+9}{10})} = \sqrt{\frac{1.9}{3} \times \frac{11}{10}} = \sqrt{\frac{1.9 \times 1.1}{3}} = \sqrt{\frac{2.09}{3}} \approx \sqrt{0.6967} \approx 0.8347。
(2) Intercept Std. Error: 0.8347

t value:
tt 值是估計量除以其標準誤。
tt value for β^0\hat{\beta}_0: β^0SE(β^0)=2.30.8347≈2.755\frac{\hat{\beta}_0}{SE(\hat{\beta}_0)} = \frac{2.3}{0.8347} \approx 2.755。
(3) Intercept t value: 2.755
tt value for β^1\hat{\beta}_1: β^1SE(β^1)=0.90.2517≈3.575\frac{\hat{\beta}_1}{SE(\hat{\beta}_1)} = \frac{0.9}{0.2517} \approx 3.575。
(6) X t value: 3.575

填充表格:

CoefficientEstimateStd. Errort value
Intercept2.3 (1)0.8347 (2)2.755 (3)
X0.9 (4)0.2517 (5)3.575 (6)

【答案】
(1) 2.3
(2) 0.8347
(3) 2.755
(4) 0.9
(5) 0.2517
(6) 3.575

(b) 使用 F 檢定檢定變數之間是否存在線性關聯。
F 檢定用於檢定迴歸模型是否顯著,即檢定斜率 β1\beta_1 是否等於 0。
H0:β1=0H_0: \beta_1 = 0 (沒有線性關聯)
H1:β1≠0H_1: \beta_1 \neq 0 (存在線性關聯)
F 檢定的統計量是 F=MSRMSEF = \frac{MSR}{MSE},其中 MSR=SSRdfRMSR = \frac{SSR}{df_R},MSE=SSEdfEMSE = \frac{SSE}{df_E}。
SSR=SST−SSE=10−1.9=8.1SSR = SST - SSE = 10 - 1.9 = 8.1。
dfR=1df_R = 1 (迴歸的自由度)。
SSE=1.9SSE = 1.9。
dfE=n−2=5−2=3df_E = n-2 = 5-2 = 3 (誤差的自由度)。
MSR=8.11=8.1MSR = \frac{8.1}{1} = 8.1。
MSE=1.93≈0.6333MSE = \frac{1.9}{3} \approx 0.6333。
F=8.10.6333≈12.789F = \frac{8.1}{0.6333} \approx 12.789。

F 檢定統計量與 t 檢定統計量的關係:對於簡單線性迴歸,F 統計量等於斜率 t 統計量的平方。
tβ^1=3.575t_{\hat{\beta}_1} = 3.575。
tβ^12=(3.575)2≈12.780625t_{\hat{\beta}_1}^2 = (3.575)^2 \approx 12.780625。
兩者非常接近(由於四捨五入的誤差)。我們使用 F≈12.79F \approx 12.79。

顯著水準 α=0.05\alpha = 0.05。
自由度:dfR=1df_R = 1, dfE=3df_E = 3。
查 F 分佈表,臨界值 F1,3,0.05≈10.13F_{1, 3, 0.05} \approx 10.13。

比較:
計算出的 F≈12.79F \approx 12.79。
臨界值 F1,3,0.05≈10.13F_{1, 3, 0.05} \approx 10.13。
由於 F>FcriticalF > F_{critical} (12.79>10.1312.79 > 10.13),我們拒絕虛無假設 H0H_0。

結論:在 α=0.05\alpha = 0.05 的顯著水準下,有足夠的證據支持變數之間存在線性關聯。

【答案】
F 檢定統計量 F=MSRMSE=SSR/1SSE/(n−2)=8.11.9/3≈12.79F = \frac{MSR}{MSE} = \frac{SSR/1}{SSE/(n-2)} = \frac{8.1}{1.9/3} \approx 12.79。
自由度為 (1,3)(1, 3)。
臨界值 F1,3,0.05≈10.13F_{1, 3, 0.05} \approx 10.13。
由於 12.79>10.1312.79 > 10.13,我們拒絕 H0H_0,結論是變數之間存在顯著的線性關聯。

(c) 建構斜率的 95% 信賴區間,並判斷是否拒絕 β1=1\beta_1 = 1。
95% 信賴區間 (CI) 的公式為:β^1±tα/2,n−2×SE(β^1)\hat{\beta}_1 \pm t_{\alpha/2, n-2} \times SE(\hat{\beta}_1)。

🔒

後續完整解題步驟與【答案】

免費註冊,享三天全站完整詳解閱覽。

免費註冊

第 7 題14 分

An experiment is conducted and the resulting data is provided.

Treatment1234
6544
8556
7656

(a) Assuming that the data are generated from a randomized block experiment, fill in the entries (1) - (10) in the partially completed ANOVA table given below. (10%)
(b) Assuming now that the experimental data are generated from a one-way (independent samples) experiment, calculate the F test statistics to determine whether the treatment means differ at the 5% significance level. (4%)

登入後即可作答並保存紀錄。

這一題的完整詳解

核心觀念

本題評量變異數分析(ANOVA)之兩種基本實驗設計架構與其平方和分割原理:

  1. 隨機完全區集設計(Randomized Block Design, RBD):

    • 資料包含兩個因子:處理(Treatment, 欄)與區集(Block, 列)。
    • 總平方和(SSTSST)分解為三部分:處理平方和(SSTRSSTR)、區集平方和(SSBLSSBL)與隨機誤差平方和(SSESSE)。
    SST=SSTR+SSBL+SSESST = SSTR + SSBL + SSE
    • 自由度分割:
      • 總自由度:dfT=n−1=bk−1df_T = n - 1 = bk - 1
      • 處理自由度:dfTR=k−1df_{TR} = k - 1
      • 區集自由度:dfBL=b−1df_{BL} = b - 1
      • 誤差自由度:dfE=(k−1)(b−1)df_E = (k - 1)(b - 1)
        其中 kk 為處理數(欄數),bb 為區集數(列數)。
    • 檢定處理效果之檢定統計量:
    F=MSTRMSE=SSTR/(k−1)SSE/((k−1)(b−1))∼F(k−1,(k−1)(b−1))F = \frac{MSTR}{MSE} = \frac{SSTR / (k - 1)}{SSE / ((k - 1)(b - 1))} \sim F(k - 1, (k - 1)(b - 1))
  2. 單因子完全隨機設計(One-Way Completely Randomized Design, CRD):

    • 視為 kk 組獨立樣本,不考慮區集控制。
    • 總平方和分解為兩部分:處理平方和(SSTRSSTR)與組內誤差平方和(SSECRDSSE_{\text{CRD}})。
    • 其誤差平方和本質上即為 RBD 中的區集平方和與誤差平方和之和:
    SSECRD=SSBL+SSERBDSSE_{\text{CRD}} = SSBL + SSE_{\text{RBD}}
    • 自由度:dfE,CRD=n−k=(b−1)+(k−1)(b−1)=k(b−1)df_{E,\text{CRD}} = n - k = (b - 1) + (k - 1)(b - 1) = k(b - 1)。
    • 檢定統計量:
    F=MSTRMSECRD=SSTR/(k−1)SSECRD/(n−k)∼F(k−1,n−k)F = \frac{MSTR}{MSE_{\text{CRD}}} = \frac{SSTR / (k - 1)}{SSE_{\text{CRD}} / (n - k)} \sim F(k - 1, n - k)

解題方法

一、原始數據整理

設區集數(列數)b=3b = 3,處理數(欄數)k=4k = 4,總觀測值個數 n=bk=12n = bk = 12。

數據矩陣如下(列表示 Block,行表示 Treatment):

  • Block 1: 6,5,4,46, 5, 4, 4(列和 B1=19B_1 = 19)
  • Block 2: 8,5,5,68, 5, 5, 6(列和 B2=24B_2 = 24)
  • Block 3: 7,6,5,67, 6, 5, 6(列和 B3=24B_3 = 24)

各處理的行和(TjT_j):

  • Treatment 1: T1=6+8+7=21T_1 = 6 + 8 + 7 = 21
  • Treatment 2: T2=5+5+6=16T_2 = 5 + 5 + 6 = 16
  • Treatment 3: T3=4+5+5=14T_3 = 4 + 5 + 5 = 14
  • Treatment 4: T4=4+6+6=16T_4 = 4 + 6 + 6 = 16

全體總和:

G=∑i=13∑j=14Xij=21+16+14+16=67G = \sum_{i=1}^3 \sum_{j=1}^4 X_{ij} = 21 + 16 + 14 + 16 = 67

校正項(Correction Factor, CFCF):

CF=G2n=67212=448912≈374.0833CF = \frac{G^2}{n} = \frac{67^2}{12} = \frac{4489}{12} \approx 374.0833

各觀測值平方和:

∑i=13∑j=14Xij2=(36+25+16+16)+(64+25+25+36)+(49+36+25+36)=93+150+146=389\sum_{i=1}^3 \sum_{j=1}^4 X_{ij}^2 = (36 + 25 + 16 + 16) + (64 + 25 + 25 + 36) + (49 + 36 + 25 + 36) = 93 + 150 + 146 = 389

二、各項平方和(Sum of Squares)計算

  1. 總平方和(SSTSST):

    SST=∑∑Xij2−CF=389−448912=4668−448912=17912≈14.9167SST = \sum \sum X_{ij}^2 - CF = 389 - \frac{4489}{12} = \frac{4668 - 4489}{12} = \frac{179}{12} \approx 14.9167
  2. 處理平方和(SSTRSSTR):

    SSTR=∑j=14Tj2b−CF=212+162+142+1623−448912=441+256+196+2563−448912=11493−448912=383−374.0833=8.9167(=10712)SSTR = \sum_{j=1}^4 \frac{T_j^2}{b} - CF = \frac{21^2 + 16^2 + 14^2 + 16^2}{3} - \frac{4489}{12} = \frac{441 + 256 + 196 + 256}{3} - \frac{4489}{12} = \frac{1149}{3} - \frac{4489}{12} = 383 - 374.0833 = 8.9167 \quad \left(=\frac{107}{12}\right)
  3. 區集平方和(SSBLSSBL):

    SSBL=∑i=13Bi2k−CF=192+242+2424−448912=361+576+5764−448912=15134−448912=4539−448912=5012≈4.1667SSBL = \sum_{i=1}^3 \frac{B_i^2}{k} - CF = \frac{19^2 + 24^2 + 24^2}{4} - \frac{4489}{12} = \frac{361 + 576 + 576}{4} - \frac{4489}{12} = \frac{1513}{4} - \frac{4489}{12} = \frac{4539 - 4489}{12} = \frac{50}{12} \approx 4.1667
  4. 隨機誤差平方和(SSESSE):

    SSE=SST−SSTR−SSBL=17912−10712−5012=2212=116≈1.8333SSE = SST - SSTR - SSBL = \frac{179}{12} - \frac{107}{12} - \frac{50}{12} = \frac{22}{12} = \frac{11}{6} \approx 1.8333

三、題分子題推導與解答

(a) 隨機區集設計 ANOVA 表填空

標準隨機區集設計之 ANOVA 表對應格位通常依序包含:

  • 自由度:dfdf
  • 平方和:SSSS
  • 均方:MS=SS/dfMS = SS / df
  • 統計量:F=MS/MSEF = MS / MSE

對應題目表格(1)至(10)項之數值填列如下:

  • Treatment 列:

    • 自由度:dfTR=k−1=4−1=3df_{TR} = k - 1 = 4 - 1 = 3
    • 平方和:SSTR=10712≈8.917SSTR = \frac{107}{12} \approx 8.917
    • 均方:MSTR=SSTRdfTR=107/123=10736≈2.972MSTR = \frac{SSTR}{df_{TR}} = \frac{107 / 12}{3} = \frac{107}{36} \approx 2.972
    • 檢定統計量:FTR=MSTRMSE=107/3611/36=10711≈9.727F_{TR} = \frac{MSTR}{MSE} = \frac{107 / 36}{11 / 36} = \frac{107}{11} \approx 9.727
  • Block 列:

    • 自由度:dfBL=b−1=3−1=2df_{BL} = b - 1 = 3 - 1 = 2
    • 平方和:SSBL=5012≈4.167SSBL = \frac{50}{12} \approx 4.167
    • 均方:MSBL=SSBLdfBL=50/122=2512≈2.083MSBL = \frac{SSBL}{df_{BL}} = \frac{50 / 12}{2} = \frac{25}{12} \approx 2.083
    • 檢定統計量:FBL=MSBLMSE=25/1211/6=2522≈1.136F_{BL} = \frac{MSBL}{MSE} = \frac{25 / 12}{11 / 6} = \frac{25}{22} \approx 1.136
  • Error 列:

    • 自由度:dfE=(k−1)(b−1)=3×2=6df_E = (k - 1)(b - 1) = 3 \times 2 = 6
    • 平方和:SSE=2212=116≈1.833SSE = \frac{22}{12} = \frac{11}{6} \approx 1.833
    • 均方:MSE=SSEdfE=11/66=1136≈0.306MSE = \frac{SSE}{df_E} = \frac{11 / 6}{6} = \frac{11}{36} \approx 0.306
  • Total 列:

    • 自由度:dfT=n−1=12−1=11df_T = n - 1 = 12 - 1 = 11
    • 平方和:SST=17912≈14.917SST = \frac{179}{12} \approx 14.917

隨機區集 ANOVA 彙整表:

Source of VariationdfdfSSSSMSMSFF
Treatment338.9178.9172.9722.9729.7279.727
Block224.1674.1672.0832.0831.1361.136
Error661.8331.8330.3060.306—
Total111114.91714.917——

(b) 單因子完全隨機設計之 FF 檢定

當假設資料來自單因子(獨立樣本)實驗設計時,不提取區集效果,原區集變異併入隨機誤差中:

  1. 虛無假說與對立假說:
🔒

後續完整解題步驟與【答案】

免費註冊,享三天全站完整詳解閱覽。

免費註冊

其他考古題