108 年 國立政治大學統計學系碩士班《統計方法》
第 1 題25 分
The following table shows the contingency table of sales for paper towels.
| Loaction | Package type | |
|---|---|---|
| Two rolls | Dozen rolls | |
| Rural | 89 | 111 |
| Suburban | 75 | 125 |
| Urban | 82 | 118 |
Let , , and denote the population proportions of sales of two-roll packages in rural, suburban, and urban locations, respectively. Use the 0.05 level of significance.
(1) Test versus . (8%)
(2) Test versus , and are not all equal. (10%)
(3) Construct the 95% confidence interval for . (7%)
登入後即可作答並保存紀錄。
此題考驗對比例的假設檢定與信賴區間的計算。
首先,我們需要整理數據並計算各組的樣本比例。
總樣本數 。
Rural: 樣本數 ,樣本比例
Suburban: 樣本數 ,樣本比例
Urban: 樣本數 ,樣本比例
(1) 檢定 versus 。
這是兩個比例的獨立樣本 Z 檢定。
在虛無假設成立下,合併比例 。
檢定統計量為:
顯著水準 ,雙尾檢定。臨界值為 。
因為 ,我們無法拒絕 。
【答案】無法拒絕 , 與 沒有顯著差異。
(2) 檢定 versus 不全相等。
這是三個比例的卡方檢定(Chi-squared test for independence / homogeneity)。
我們需要計算期望次數。
Rural: 期望
Rural: 期望
Suburban: 期望
Suburban: 期望
Urban: 期望
第 2 題25 分
A traffic engineering study on traffic delay was conducted at intersections with signal on urban streets. Three types of traffic signals were utilized and five intersections were used for each type of signal. The measure of traffic delay was the average stopped time per vehicle at each of the interactions (seconds/vehicle) as follows:
| Type of signal | |||
|---|---|---|---|
| Pretimed | Semi-actuated | Fully actuated | |
| 36.6 | 17.5 | 15.0 | |
| 39.2 | 20.6 | 10.4 | |
| 30.4 | 18.7 | 18.9 | |
| 37.1 | 25.7 | 10.5 | |
| 34.1 | 22.0 | 15.2 | |
| mean | 35.48 | 20.90 | 14.00 |
| variance | 11.357 | 10.185 | 12.915 |
(1) Write the linear statistical model for this study. Explain the model components and state the necessary assumptions for your model. (8%)
(2) Compute the analysis of variance table for the data. (10%)
(3) Compute the 95% confidence interval of the mean traffic delays for Pretimed. (7%)
登入後即可作答並保存紀錄。
此題考驗單因子變異數分析 (One-Way ANOVA) 的線性模型、ANOVA 表計算,以及特定群組的信賴區間。
核心觀念: 單因子變異數分析用於比較三個或更多獨立群組的平均數是否存在顯著差異。
(1) 線性統計模型:
此研究屬於單因子變異數分析,其中「訊號類型」是因子,有三個水準(Pretimed, Semi-actuated, Fully actuated)。「交通延遲時間」是反應變數。
模型可以寫成:
其中:
- :代表第 種訊號類型下,第 個觀察值的交通延遲時間。
- :代表第 種訊號類型的總體平均交通延遲時間。
- :代表隨機誤差項,表示第 種訊號類型下,第 個觀察值與其群體平均數之間的差異。
更常見的線性統計模型寫法是考慮每個群體的平均數和誤差:
其中:
- :同上。
- :總體平均數(或稱 Overall Mean)。
- :第 種訊號類型的效應(Effect),表示第 群體的平均數相較於總體平均數的偏差。通常假設 。
- :隨機誤差項。
模型組成元件解釋:
- 反應變數 (Response Variable): ,即交通延遲時間(秒/車輛)。
- 因子 (Factor): 訊號類型,有三個水準 (Pretimed, Semi-actuated, Fully actuated)。
- 群體平均數 ( 或 ): 各訊號類型下的平均交通延遲時間。
- 誤差項 (): 隨機變異,由未被模型解釋的因素引起。
必要假設:
- 獨立性 (Independence): 各觀察值之間是獨立的。這意味著一個觀察值的延遲時間不會影響另一個觀察值的延遲時間。在這個研究中,五個觀察值是來自五個不同的交叉路口,因此假設獨立性是合理的。
- 常態性 (Normality): 各群體的誤差項 服從平均數為 0、變異數為 的常態分佈。也就是說,在每一種訊號類型下,交通延遲時間的數據分佈近似於常態分佈。
- 變異數同質性 (Homogeneity of Variances): 各群體的誤差項具有相同的變異數 。即 對於所有 都成立。這意味著不同訊號類型的交通延遲時間的離散程度應該是相似的。
【答案】
線性統計模型: 或 。
模型元件: 為反應變數, (或 ) 為群體平均數, 為誤差項。
必要假設:獨立性、常態性、變異數同質性。
(2) 計算變異數分析表 (ANOVA Table):
我們需要計算總變異數 (SST)、因子變異數 (SSG 或 SSA) 和誤差變異數 (SSE)。
樣本數 (群體數),每組樣本數 。總觀察數 。
先計算總平均數 :
計算組間離差平方和 (SSG - Sum of Squares Group):
, ,
第 3 題50 分
The following table shows a sample of 30 purchase transactions for houses in an area in three-month period.
| Price | SqFeet | Bathrooms | Fireplace | Price | SqFeet | Bathrooms | Fireplace |
|---|---|---|---|---|---|---|---|
| 200 | 3.7 | 1 | yes | 172 | 3.8 | 2 | no |
| 121 | 2.3 | 1 | yes | 301 | 2.4 | 2 | yes |
| 192 | 2.8 | 1 | no | 243 | 2.9 | 2 | no |
| 111 | 2.2 | 1 | yes | 345 | 4.0 | 3 | no |
| 209 | 3.7 | 1 | yes | 298 | 5.7 | 3 | yes |
| 265 | 2.9 | 1 | no | 429 | 4.1 | 3 | no |
| 484 | 7.9 | 2 | yes | 285 | 4.6 | 3 | yes |
| 207 | 3.1 | 2 | yes | 459 | 5.9 | 3 | yes |
| 256 | 3.4 | 2 | yes | 380 | 4.9 | 3 | no |
| 203 | 2.1 | 2 | no | 452 | 5.0 | 3 | yes |
| 260 | 2.3 | 2 | no | 523 | 9.6 | 4 | yes |
| 345 | 5.3 | 2 | no | 531 | 6.4 | 4 | yes |
| 275 | 4.5 | 2 | yes | 408 | 6.5 | 4 | yes |
| 284 | 5.4 | 2 | no | 317 | 6.1 | 4 | yes |
| 202 | 2.3 | 2 | no | 371 | 6.1 | 4 | yes |
Price: price of the home (in thousand US dollars)
SqFeet: area of the home (in thousand square feet)
Bathrooms: number of bathrooms
Fireplace: with or without fireplaces in the home
Consider the regression model using Price as the response variable and the remaining variables are explanatory variables. The following table shows the estimation output.
| Estimate | Std Error | |
|---|---|---|
| Constant | 58.65 | 32.18 |
| SqFeet | 37.15 | 9.27 |
| Bathrooms | 41.06 | 16.32 |
| Fireplace | -24.77 | 25.06 |
Assume Price follow a normal distribution. Use the 0.05 level of significance if required.
(1) Construct the 95% confidence interval for the proportion of homes with fireplaces. (8%)
(2) Assume the variances of home prices are equal or not for houses with or without a fireplace. Test whether the mean home prices are equal or not for houses with or without a fireplace. (12%)
(3) Please use the result from part (2) and the estimation output to define the dummy variable for Fireplace in the regression model. What is the interpretation of the estimated coefficient for Fireplace in the regression model? (6%)
(4) Examine which variables could be able to form the regression analysis. (9%)
(5) If , then construct the ANOVA table for the regression analysis. (5%)
(6) Compute the adjusted . (5%)
登入後即可作答並保存紀錄。
核心觀念
本題整合以下觀念:
- 二項母體比例的信賴區間。
- 兩獨立樣本、等變異數下的 pooled two-sample 檢定。
- 類別變數的 dummy variable 編碼與迴歸係數解釋。
- 迴歸係數的部分 檢定。
- 迴歸 ANOVA 表與調整後決定係數。
(1) 有壁爐房屋比例的 95% 信賴區間
由表中資料:
- 有壁爐: 間
- 無壁爐: 間
- 總樣本數:
樣本比例為
採用大樣本比例信賴區間:
因此
所以 95% 信賴區間為
亦即母體中有壁爐房屋的比例約為 至 。
(2) 有無壁爐房屋平均價格是否相同
令
- :有壁爐房屋的平均價格
- :無壁爐房屋的平均價格
檢定假設為
由資料計算:
| 房屋類型 | 平均價格 | 樣本變異數 | |
|---|---|---|---|
| 有壁爐 | |||
| 無壁爐 |
題目假設兩組母體變異數相等,因此使用 pooled variance:
平均數差的標準誤為
檢定統計量為
在 的雙尾檢定下,
因為
所以不拒絕 。
結論:在 5% 顯著水準下,沒有充分證據認為有壁爐與無壁爐房屋的平均價格不同。
(3) Fireplace 虛擬變數與係數解釋
定義虛擬變數
迴歸模型為
在 與 相同的條件下:
- 無壁爐房屋的預測價格為基準組;
- 有壁爐房屋的預測價格平均比無壁爐房屋低 千美元。
因此, 的估計係數 表示控制房屋面積與浴室數量後,有壁爐與預測價格降低 千美元相關。這是條件平均差異,不代表因果效果。
(4) 檢查可省略的變數
迴歸模型共有 個解釋變數,因此誤差自由度為
在 雙尾檢定下,
各係數的檢定統計量如下: