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%)
登入後即可作答並保存紀錄。
核心觀念
本題為類別資料分析(Categorical Data Analysis)之典型題型,涵蓋雙母體比例差之假設檢定、多個母體比例齊一性之卡方檢定,以及雙母體比例差之信賴區間估計:
- 雙母體比例差之檢定(Two-Sample -Test for Proportions):
檢定兩個獨立二項母體比例是否相等()。在虛無假設成立下,兩母體比例相同,需計算合併樣本比例(Pooled Proportion) 作為共同比例之不偏估計量,建立大樣本標準常態檢定統計量 :
- 多個母體比例齊一性檢定(Chi-Square Test of Homogeneity):
檢定 個獨立母體(本題為 Rural、Suburban、Urban 三個地區)在同一類別變數各水準(Two rolls 與 Dozen rolls)的分布比例是否全數相等。虛無假設為 。檢定統計量採用皮爾森卡方統計量(Pearson's Chi-Square Statistic):
其中 為觀察次數, 為各細格期望次數( 為列總和、 為行總和、 為總樣本數)。
- 雙母體比例差之信賴區間(Confidence Interval for ):
在估計未知母體比例差 時,由於未假設兩者相等,標準誤必須採用未合併(Unpooled)的各組個別樣本比例變異數估計:
解題方法
考卷原頁第 1 題附有 之列聯表,顯示三個地區各抽取 200 筆紙巾銷售紀錄(總樣本數 ),包含兩捲裝(Two rolls)與打裝(Dozen rolls)之銷售件數。
依原卷數據彙整邊際次數與樣本比例:
- Rural(鄉村,):,購買兩捲裝次數 ,樣本比例 。
- Suburban(郊區,):,購買兩捲裝次數 ,樣本比例 。
- Urban(市區,):,購買兩捲裝次數 ,樣本比例 。
- 邊際總和:
- Two rolls 行總和:
- Dozen rolls 行總和:
- 全體總樣本數:
(1) 檢定 vs (顯著水準 )
- 建立假設計畫:
- 計算合併樣本比例(Pooled Proportion):
在 成立下,兩母體比例相等,合併比例估計量為:
對應之 。
- 計算檢定統計量 :
代入檢定統計量:
- 決策法則與結論:
給定 ,雙尾檢定之臨界值為 。
拒絕域為 。
因計算所得 (對應雙尾 ),檢定統計量未落入拒絕域,故不拒絕 。
結論:在 5% 顯著水準下,無充分統計證據顯示鄉村與郊區購買兩捲裝紙巾的母體比例有顯著差異。
(2) 檢定 vs 不全相等()
- 建立假設計畫:
- 計算各細格期望次數 :
在 成立下,所有地區購買兩捲裝的共同比例為 。
因各地區之樣本數均為 ,故各列期望次數相同:
所有細格期望次數均大於 5,滿足卡方大樣本近似條件。
- 計算皮爾森卡方統計量 :
列聯表各細格之 :- Rural:;
- Suburban:;
- Urban:;
- 決策法則與結論:
自由度 。
給定 ,查卡方分配臨界值:。
拒絕域為 。
因 (),統計量未落入拒絕域,故不拒絕 。
結論:在 5% 顯著水準下,無充分證據顯示三個地區購買兩捲裝紙巾的母體比例存在差異。
(3) 建構 之 95% 信賴區間
- 點估計值(Point Estimate):
- 計算標準誤(Standard Error, Unpooled):
建構信賴區間時未假設兩母體比例相同,需採用未合併標準誤:
第 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)的理論模型、計算與推論:
- 單因子固定效應線性模型(Single-Factor Fixed-Effects Model):
- 效應模型(Effects Model):,其中 。
- 組平均模型(Cell Means Model):。
- 模型三大基本假設:誤差項具常態性(Normality)、變異數同質性(Homoscedasticity)、相互獨立性(Independence),即 。
- 變異數分析表(ANOVA Table)計算:
- 總平方和分解:。
- 處理間平方和:。
- 誤差平方和:。
- 檢定統計量:。
- 特定處理平均數之信賴區間(Confidence Interval for Treatment Mean):
- 依據 ANOVA 變異數同質性假設,採用結合誤差均方()作為 的不偏估計量,其自由度為 。信賴區間公式為 。
解題方法
從考卷原頁圖中可完整讀出:本實驗包含 種號誌型式(Pretimed、Semi-actuated、Fully actuated),每種型式各取 個路口觀測(平衡設計,);各組平均數依序為 、、,樣本變異數依序為 、、。
(1) 線性統計模型、模型組成與必要假設
-
線性統計模型(Linear Statistical Model):
採用單因子固定效應模型(Effects Model):
其中指標為 (分別對應三種號誌型式:Pretimed、Semi-actuated、Fully actuated);(各組下的第 個路口)。
亦可等價表述為組平均模型(Cell Means Model):
-
模型組成成分說明(Model Components):
- :在第 種號誌型式下,第 個路口每輛車的平均停等時間(單位:秒/輛)。
- :所有號誌型式的總體平均停等時間(整體平均數,Overall Mean)。
- :第 種號誌型式對停等時間的處理效應(Treatment Effect),滿足限制條件 。
- :隨機誤差項(Random Error),代表未受控制的隨機環境因素或路口間的個別隨機差異。
-
模型必要假設(Necessary Assumptions):
- 常態性(Normality):各處理組別內的母體皆服從常態分配,即誤差項服從常態分配:
- 變異數同質性(Homoscedasticity):各處理組別具有共同且相等的母體變異數:
- 獨立性(Independence):各路口間的觀測值彼此相互獨立,即隨機誤差項互為獨立:
- 綜合上述,誤差項之聯合假設為獨立同常態分配:
- 常態性(Normality):各處理組別內的母體皆服從常態分配,即誤差項服從常態分配:
(2) 計算變異數分析表(ANOVA Table)
-
基本統計量計算:
- 組數 ,各組樣本數 ,總樣本數 。
- 總平均數(Grand Mean):
-
平方和(Sum of Squares)與自由度(Degrees of Freedom):
-
處理間平方和(Treatment Sum of Squares, SSTR):
處理自由度 。 -
誤差平方和(Error Sum of Squares, SSE):
誤差自由度 。 -
總平方和(Total Sum of Squares, SST):
總自由度 。
-
-
平均平方和(Mean Squares)與 統計量:
- 處理均方:
- 誤差均方:
- 檢定統計量:
- 處理均方:
-
變異數分析表彙整:
| 變異來源 (Source of Variation) | 平方和 (SS) | 自由度 (df) | 平均平方和 (MS) | 值 (-statistic) | 值 (-value) |
|---|---|---|---|---|---|
| 處理 (Treatments / Signal Type) | |||||
| 誤差 (Error) | |||||
| 總和 (Total) |
(3) 計算 Pretimed 號誌平均停等時間的 95% 信賴區間
第 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) 檢查可省略的變數
迴歸模型共有 個解釋變數,因此誤差自由度為
在 雙尾檢定下,
各係數的檢定統計量如下:
| 變數 | 判斷 | |
|---|---|---|
| 顯著,保留 | ||
| 顯著,保留 | ||
| 不顯著,可省略 |
因此,在 5% 顯著水準下, 可由迴歸模型中省略; 與 應保留。截距通常維持在模型中,不因其個別檢定不顯著而逕行刪除。
(5) 迴歸 ANOVA 表
由全部 30 筆價格資料:
總平方和為
已知
所以