Interval Estimation
Interval Estimation Overview
假設有 random sample: (X1,…,Xn)
Parameter of interest: μ=E(Xi)
對 μ 的估計可以分成:
Point estimation: 用單一數值估計 parameter
Interval estimation: Point estimator ± margin of error
對 population mean: μ^=Xˉ
Confidence interval 的基本形式: Xˉ±margin of error
- Z interval: σ² known
- T interval: σ² unknown,用 S² 估計
Confidence Level
設定 confidence level: (1−α)100%
常見情況:
| Confidence Level |
α |
α/2 |
Critical Z |
| 90% |
0.10 |
0.05 |
1.645 |
| 95% |
0.05 |
0.025 |
1.96 |
| 99% |
0.01 |
0.005 |
2.575 |
Critical value zα/2 滿足: P(−zα/2≤Z≤zα/2)=1−α
等價地: P(Z>zα/2)=α/2
Z Interval for Population Mean μ
使用條件
若 Xi∼iidN(μ,σ2)
且 population variance σ2 已知,則 Xˉ∼N(μ,nσ2)
所以 σ/nXˉ−μ∼N(0,1)
若 population 非 Normal,但 n 足夠大,也可以利用 large-sample approximation。
(1−α)100% confidence interval: Xˉ±zα/2nσ
也就是: [Xˉ−zα/2nσ, Xˉ+zα/2nσ]
Margin of error: ME=zα/2nσ
Margin of Error
對 μ 的 Z interval:
ME=zα/2nσ
影響因素:
- Population Variability σ
- Sample Size n
- n 越大,margin of error 越小。
- Confidence Level
- Confidence level 越高,需要更大的 critical value。
Given Margin of Error,求最小 Sample Size
若希望 margin of error 不超過 m: zα/2nσ≤m
整理: n≥(mzα/2σ)2
求最小 sample size 時,最後一定要 round up。
Sample Size 與 Margin of Error
由 ME=zα/2nσ
可知 ME∝n1
因此 sample size 增加時,margin of error 下降,但不是線性下降。
例如想把 margin of error 縮成原本的一半,需要將 sample size 增加到約 4 倍。
Confidence Interval for Population Proportion p
假設: Xi∼iidBernoulli(p)
- Sample proportion: p^=n1∑i=1nXi
- E(p^)=p
- Var(p^)=np(1−p)
- 這裡的變異數是 Xi 的,而不是總和的變異數
當 n 很大,由 CLT: p(1−p)/np^−p≈N(0,1)
Approximated Z Interval for p
因為真正的 p 未知,因此在 standard error 中使用 p^ 代替。
(1−α)100% confidence interval:
p^±zα/2np^(1−p^)
也就是: [p^−zα/2np^(1−p^), p^+zα/2np^(1−p^)]
Standard error: SEp^=np^(1−p^)
Margin of error: ME=zα/2np^(1−p^)
T Distribution
若 population standard deviation σ 未知,使用 sample standard deviation: S2=n−1∑i=1n(Xi−Xˉ)2 代替 σ2。
注意 sample variance 的 denominator: n−1
此時不能再直接使用 σ/nXˉ−μ
而是改成 S/nXˉ−μ
若 Xi∼iidN(μ,σ2)
且 σ 未知,則 S/nXˉ−μ∼Tn−1
Degree of freedom: df=n−1
T Interval for μ
若 σ 未知,(1−α)100% confidence interval 為: Xˉ±tα/2,n−1nS
也就是: [Xˉ−tα/2,n−1nS, Xˉ+tα/2,n−1nS]
Margin of error: ME=tα/2,n−1nS
T distribution 的 tails 比 N(0,1) 更 heavy。
固定 confidence level 時: tα/2,n−1>zα/2
若 S 與 σ 的數值接近: T interval 通常比 Z interval 寬。
當 degree of freedom 增加: Tv→N(0,1),因此 tα/2,v→zα/2
Sample size 很大時,T interval 與 Z interval 會越來越接近。
Z Interval vs. T Interval
| 情況 |
方法 |
結果 |
| Normal population,σ known |
Z interval |
Exact |
| Normal population,σ unknown |
T interval |
Exact |
| Non-normal,n large,σ known |
Z approximation |
Approximate |
| Non-normal,n large,σ unknown |
T / Normal approximation |
Approximate |
| Non-normal,small n,roughly symmetric |
T interval |
Approximate |
| Non-normal,small n,skewed |
T interval 不適合 |
不準確 |
Z Interval for μ vs. Z Interval for p
|
Mean μ |
Proportion p |
| Point estimator |
Xˉ |
p^ |
| SE |
σ/n |
p^(1−p^)/n |
| Critical value |
zα/2 |
zα/2 |
| CI |
Xˉ±zα/2σ/n |
p^±zα/2p^(1−p^)/n |
| 主要條件 |
σ known |
Large n approximation |