Upload
azriel
View
42
Download
10
Embed Size (px)
DESCRIPTION
社會統計. 第五講 信賴區間. Interval Estimation 區間估計. 觀念. 在前章中我們介紹了各種估計母體參數的方法 (point estimator) 。例如我們發現樣本平均數 X 為母體平均數 μ 的一個不偏估計式。 雖然平均而言, X 能正確的代表 μ ,但每一次觀察到的 X 不會剛好等於 μ ,而是隨著抽到的樣本不同有高有低:. Interval Estimation 區間估計. 觀念. - PowerPoint PPT Presentation
Citation preview
©Ming-chi Chen 社會統計
社會統計
第五講信賴區間
©Ming-chi Chen 社會統計
Interval Estimation 區間估計• 在前章中我們介紹了各種估計母體參數的方法 (point estimator) 。例如我們發現樣本平均數 X 為母體平均數 μ 的一個不偏估計式。
• 雖然平均而言, X 能正確的代表 μ ,但每一次觀察到的 X 不會剛好等於 μ ,而是隨著抽到的樣本不同有高有低:
觀念觀念
error sampling X
©Ming-chi Chen 社會統計
Interval Estimation 區間估計• 因此除了點估計外,我們還想進一步知道從樣本中得到的估計值有多可靠,由於樣本的估計值本身也是一個隨機變數,不一定會剛好等於母體參數,因此我們問:估計值與母體參數有多接近?
觀念觀念
©Ming-chi Chen 社會統計
Interval Estimation 區間估計
• 從估計式的抽樣分配中,我們可以建立一套系統性的方法來表達估計式的精確度。
觀念觀念
error) sampling(
ˆ
ˆ
稱為抽樣誤差
為估計的誤差,則
的估計式為假設
©Ming-chi Chen 社會統計
Interval Estimation 區間估計
• 我們通常以建構信賴區間 (confidence intervals) 來顯示估計式的準確度。
觀念觀念
所形成的區間中。落於
在某種特定的機率下,使母體參數和來建構出兩個數值用
)ˆ,ˆ(
ˆˆˆ
21
21
©Ming-chi Chen 社會統計
Interval Estimation 區間估計觀念觀念
1)(
,
),(
21
21
21
P
xxx n
為兩個統計量,使得假設為欲估計的母體參數,
樣本為由某母體抽出的隨機設
)或信賴係數(
的信賴度稱為信賴區間;信賴區間的為則稱
tcoefficien
confidence)confidence of level(
),()1(intervals)
confidence()%1(100),(
21
21
©Ming-chi Chen 社會統計
Interval Estimation 區間估計• 在估計的問題中,我們希望估計式具有以下兩個性質:
• 1. 估計式為不偏估計 (unbiased estimator) ,即估計式不會系統性的高估或低估母體參數。
• 2. 我們希望估計式的抽樣分配集中於母體參數的周圍,即估計式的變異數愈小愈好。
©Ming-chi Chen 社會統計
Interval Estimation 區間估計
• 在估計的問題中,我們希望估計式具有以下兩個性質:
θ
θ̂
Unbiased(何謂不偏?) small is )ˆvar(
©Ming-chi Chen 社會統計
Value of Zα
• 令 Z 為一個標準常態隨機變數,並令 α 是滿足 0<α<1 的任意數,則 zα是符合下列條件的任意數:
• P(Z z≧ α) = α
©Ming-chi Chen 社會統計
Value of Zα
• 例題: α=.025 ,求 zα?
• P(Z z≧ α) =.025
0 zα
Area=.025
Area=0.5-.025=.475
zα=1.96
©Ming-chi Chen 社會統計
Value of Zα
• 例題:求 z.05?
• P(Z z≧ .05) =.05
0 z.05
Area=.05
Area=0.5-.05=.45
zα=1.645
©Ming-chi Chen 社會統計
Value of Zα
• 例題:求 z.005?
• P(Z z≧ .005) =.005
0 z.005
Area=.005
Area=0.5-.005=.495
zα=2.58
©Ming-chi Chen 社會統計
Value of Zα
• P(Z z≧ α/2) =α/2 • P(Z -z≦ α/2) =α/2 • P(-zα/2 Z z≦ ≦ α/2) =(1-α)
α/2
1-α
©Ming-chi Chen 社會統計
Confidence intervals for the mean with know population variance
• 假設我們從 N(μ, σ2) 的母體中抽取樣本數為n 的樣本。其樣本平均數的抽樣分配為 :
),(~2
nNX
)1,0(~
/N
n
uXZ
©Ming-chi Chen 社會統計
Confidence intervals for the mean with know population variance
)/
(1
)(1
2/2/
2/2/
zn
uXzP
zZzP
• 根據先前的結果:
)//( 2/2/ nzuXnzP
)//( 2/2/ nzXunzXP
)//( 2/2/ nzXunzXP
©Ming-chi Chen 社會統計
Confidence intervals for the mean with know population variance
• 這個結果告訴我們:• 母體參數 μ 落在下列隨機區間
)/,/( 2/2/ nzXnzX
的機率為 (1-α)或者可以說上述隨機區間包含母體參數 μ 的機率為 (1-α)
©Ming-chi Chen 社會統計
Level of Confidence
• The level of confidence (1-α) of a confidence interval measures the probability that a population parameter will be contained in an interval calculated after a random sample has been selected from a population.
• 信賴水準或信賴係數衡量從母體中抽取隨機樣本所建構出的信賴區間會含括母體參數的機率。
• α 為母體參數落在信賴區間外的機率。如α=.05,則信賴度1-α=.95,表示有5%的機率母體參數會落在信賴區間之外。
©Ming-chi Chen 社會統計
母體變異數已知的信賴區間
• 假設我們從一個均數為 μ 變異數為 σ2的常態母體裡選包含 n 個觀察值的隨機樣本。如果 σ2 已知,而樣本的均數為 x ,則均數的 100(1-α)% 信賴區間由下列公式計算:
)/,/( 2/2/ nzXnzX
• Where zα/2is the number for which
• P(Z z≧ α/2) =α/2
©Ming-chi Chen 社會統計
例題
• 學校想估計去年畢業的學生第一年的年薪。假設薪資分佈為常態分配,且母體的標準差為 $2000 。取隨機樣本 25 名校友得到平均月薪為 $19,500 ,求 95% 的信賴區間。
)25/200096.119500,25/200096.119500(
• σ= $2000, n=25, x=$19500• 1-α=95%, α= .05 , α/2=.025, zα/2=1.96
)20284 ,18716(
©Ming-chi Chen 社會統計
例題
• 我們之所以計算出 95% 的信賴區間為 (18,716, 20,284) 完全是因為樣本的平均數為 $19,500 。如果我們再抽取一個 25 人的樣本,則可能得到不同的區間。
• 如果我們一直不斷的重複取樣本 1000 次,則有 950 次 (95%) 所建構出的信賴區間會含括母體的平均數。
©Ming-chi Chen 社會統計
μ
的抽樣分配X
母體參數:
Mean = μ
Variance =σ2
每個區間 =
nx
96.1
間為隨機區間變化,所以區的平均值會有因為每個樣本
x
©Ming-chi Chen 社會統計
Confidence intervals for the mean with know population variance
• 母體參數 μ 不是一個隨機函數,不會隨著樣本的不同而有差異。
• X 為會隨著樣本而變的隨機函數,因此信賴區間也會隨著樣本的不同而有差異。
• 100(1-α)% 的機率,上述的隨機區間會含括母體參數 μ 。
)//(1 2/2/ nzXunzXP
©Ming-chi Chen 社會統計
Confidence intervals for the mean with know population variance
• 一般所謂 95% 的信賴區間估計,乃是表示重複抽取樣本數為 n 的所有可能樣本所建立的全部區間估計中,有 95% 的區間將會包含真正的母體平均數,而僅有 5% 沒有包含母體平均數。
• 但實際上我們通常僅抽取一個樣本,且 μ 通常為未知,因此無法確切知道此樣本是否包含 μ ,但我們可以說此區間有 95% 的機率會包含 μ 。
©Ming-chi Chen 社會統計
Formula for commonly constructed confidence intervals
• 經常在使用的信賴區間
)96.1 ,96.1(n
xn
x
(1-α) α α/2 zα/2
0.90 0.10 0.050 1.650.95 0.05 0.025 1.960.99 0.01 0.005 2.58
Level of Confidence
)58.2 ,58.2(n
xn
x
)645.1 ,645.1(n
xn
x
©Ming-chi Chen 社會統計
Desirable Properties of Confidence Intervals
• 好的信賴區間有兩個特性:• 信賴度愈高愈好 The interval should have a h
igh level of confidence (1-)
• 信賴區間愈小愈好 The interval should have narrow width
©Ming-chi Chen 社會統計
The width of a confidence interval for u
• 母體平均數的信賴區間寬度 W :
nzW
2/2
• 信賴區間的寬度 W 決定於幾個因素:• (1) 信賴區間的信賴係數 (1-α)
• (2) 母體標準差• (3) 樣本規模 n
©Ming-chi Chen 社會統計
Comparing Width of Confidence Intervals
• Suppose we take a random sample of size n from population having known variance 2. Construct 99%, 95%, 90% CI for the population mean and compare their widths.
nW
)58.2(21
nW
)96.1(22
nW
)645.1(23
32.12
1 W
W
19.13
2 W
W
W1 比 W2 的寬度多 32%
W2 比 W3 的寬度多 19%
©Ming-chi Chen 社會統計
比較信賴區間的寬度• 如果要縮小信賴區間的寬度,我們有什麼選擇?
• 比較低的信賴水準 (1-) ,或• 增加樣本大小
©Ming-chi Chen 社會統計
x
99%
95%90%
80%
50%
©Ming-chi Chen 社會統計
續例題 10.3
• 學校想估計去年畢業的學生第一年的年薪。假設薪資分佈為常態分配,且母體的標準差為 $2000 。取隨機樣本 25 名校友得到平均薪資為 $19,500 ,求 99% 的信賴區間 ,並與 95%CI 做比較。
)25/200058.219500,25/200058.219500(
• σ= $2000, n=25, x=$19500• 1-α=99%, α= .01 , α/2=.005, zα/2=2.58
2064$ )20532 ,18486( 1 W
1568$ )20284 ,18716( 2 W=1.32
©Ming-chi Chen 社會統計
Confidence intervals for large samples
• CI 的建構必須有兩個條件:• (1) 母體必須為常態分配。• (2) 母體的變異數為已知數。• 當樣本數 n30 ,根據中央極限定律,樣本平均數的抽樣分配會趨近於常態分配,且樣本標準差會愈來愈趨近於母體標準差,所以條件 (1)(2)皆能滿足。
©Ming-chi Chen 社會統計
例題• 郵局的人事部門想要瞭解郵差請病假的情況,取樣 1
00 人來觀察,母體的分配及標準差皆為未知數,假設樣本平均數為 8.2 , s=2.7天,建構 95% CI 。
05.,95.)1(,7.2,2.8,100 sXn
30,96.1,025.2/ 2/ nz
),( 2/2/n
szx
n
szxCI
)7292.8,6708.7()100
7.296.12.8,
100
7.296.12.8( CI
©Ming-chi Chen 社會統計
One-sided confidence intervals for the mean
• Suppose that we wish to find the lower confidence limit (LCL) such that the probability (1-)that u exceeds LCL. The one-sided interval (LCL, ) is a left-sided confidence interval. The lower confidence limit is given by
nzxLCL
• Suppose that we wish to find the upper confidence limit (UCL) such that the probability (1-)that u is less than UCL. The one-sided interval (-, UCL) is a right-sided confidence interval. The upper confidence limit is given by
nzxUCL
©Ming-chi Chen 社會統計
One-sided confidence intervals for the mean
• 單邊信賴區間的意義:假設重複取樣本數為 n 的隨機樣本,每次計算 (LCL, ) ,則在所有樣本所建構出的左邊信賴區間中,將有 1- 的機率會包含 u 。
©Ming-chi Chen 社會統計
One-sided confidence intervals for the mean
• 郵局的人事部門想要瞭解郵差請病假的情況,取樣 100人來觀察,母體的分配及標準差皆為未知數,假設樣本平均數為 8.2 , s=2.7天,建構母體參數 μ 的單(左)邊 95% 信賴區間。
05.,95.)1(,7.2,2.8,100 sXn,645.1z
75585.7100
7.2645.12.8
),(
n
szxLCL
我們有 95% 的信心 u 會超過7.7558
©Ming-chi Chen 社會統計
Student’s t distribution
• 先前透過 Z-score 來建構 CI :• (1) 母體必須為常態分配,母體的變異數為已知數。
• (2) n30
• 當母體標準差為未知數,且樣本數很小時,如何建構 CI ?
©Ming-chi Chen 社會統計
Student’s t distribution
• 若母體~ N(, 2) ,則
),(~2
nNX
)1,0(~/
Nn
uXZ
• 若母體 2 未知,則以 S 來取代,我們得到 t-score:
nS
uXt
/
• 樣本數愈大, S 愈接近, t 分配愈接近標準常態分配 Z:
?
©Ming-chi Chen 社會統計
不偏估計式 Unbiased Estimator
計式。,則該估計式為不偏估)(
母體參數值若估計式的平均數等於
E
的不偏估計式。是由此知,
?來估計為何選
X
nn
XEnn
XEXE
1)(
1)()(
X
©Ming-chi Chen 社會統計
不偏估計式 Unbiased Estimator
22
222222
22
222222
22
2222222
22222
22
22
22
22
])1[(1
1
][1
1)]()([
1
1
])()]([)([
)]()([1
1
2)(2
2)2()(
]1
[
]1
)([)(
1
)(
nn
nnnnn
nnn
XEXEXE
XnEXEn
XnXXnXnXXnXnXX
XnXXXXXXXXX
n
XnXE
n
XXESE
n
XXS
S
而
樣本變異數為:
的不偏估計式嗎?是母體變異數樣本變異數
樣本自由度
©Ming-chi Chen 社會統計
t 分配的一些特性
• t 分配為中心點為零,介於 - 至的對稱分配 .
• t 分配的形狀為類似標準常態分配的鐘形分配
• t distribution 的平均值為 0.• t 分配的機率密度函數決定於參數 (讀
nu), 即自由度 (degree of freedom) 。建構平均值的信賴區間時,自由度為樣本數減一 degrees of freedom is (讀音 nu ) =(n-1) 。
©Ming-chi Chen 社會統計
Characteristics of t distribution
• t distribution 的變異數為 /(-2) for >2 ,其值永遠大於 1 。 愈大(樣本越大),變異數越接近 1 ,其形狀越接近標準常態分配。
©Ming-chi Chen 社會統計
Characteristics of t distribution
• t 分配是一群機率分配的組合,不同自由度對應不同的 t distribution 的密度函數,由於變異數較標準常態分配大,所以形狀較為矮胖。
0.399
1.338104
f x( )
44 x4 3 2 1 0 1 2 3 4
0
0.2
0.4Standard normal (d.f.=)
d.f. =4
d.f. =2
d.f. =1
©Ming-chi Chen 社會統計
Value of t,
• The symbol t,denotes the value of t such that the area to its right is and t has degree of freedom. The value t, satisfies the equation:
• P(t > t, )=
• Where the random variable t has the t distribution with degrees of freedom.
©Ming-chi Chen 社會統計
例題• Consider the t distribution having =9 degrees of
freedom. Find the value t.05, 9 such that the area in the right tail of the t distribution is .05.
0 t.05=1.83
Area = .05
t distribution with d.f. = 9
©Ming-chi Chen 社會統計
例題• Consider the t distribution having =9 degrees of
freedom. Find the value t.025, 9 and -t.025, 9 such that each tail of the t distribution contains area .025.
0 t.025= 2.262
Area = .025
t distribution with d.f. = 9
-t.025= -2.262
©Ming-chi Chen 社會統計
例題• Consider the t distribution having =20 degrees of
freedom. Find the value t.025, 20 such that the right tail of the distribution contains area .025.
0 t.025= 2.086
Area = .025
t distribution with d.f. = 20
©Ming-chi Chen 社會統計
Confidence intervals for the mean with unknown population variance
• 若母體~ N(, 2) ,則
),(~2
nNX
)1,0(~/
Nn
XZ
• 若母體 2 未知,則以 S 來取代,我們得到 t-score:
nS
Xt
/
has the t distribution with v = (n-1) degrees of freedom.
©Ming-chi Chen 社會統計
Constructing confidence intervals using the t distribution
• The area to the right of tα/2,υis α/2 for the t distribution having v degrees of freedom. Similarly, the area to the left of -tα/2,υ is α/2 . Thus, we obtain:
)/
(1
)(1
,2/,2/
,2/,2/
vv
vv
tns
uXtP
tttP
©Ming-chi Chen 社會統計
Constructing confidence intervals using the t distribution
)/
(1 ,2/,2/ vv tns
uXtP
)(1 ,2/,2/ nStuX
nStP vv
)(1 ,2/,2/ nStXu
nStXP vv
©Ming-chi Chen 社會統計
Constructing confidence intervals using the t distribution
)(1 ,2/,2/ nStXu
nStXP vv
這個結果告訴我們,如果從常態分配中抽取樣本,則母體 u 在 1-α 的機率下會落於以下區間
),( ,2/,2/ nStX
nStX vv
©Ming-chi Chen 社會統計
常態分配母體未知變異數其均數的信賴區間
我們從均數 μ 變異數 σ2未知的常態分配母體中抽出大小為 n 的樣本,如果抽出的樣本均數為 x 而其標準差為 s ,那麼母體樣本 100(1-α)% 的信賴區間可以用下列公式來計算:
),( ,2/,2/ nStX
nStX vv
定義定義
©Ming-chi Chen 社會統計
例題一工程師要估計某種鋼鐵的平均強度,假設該鋼條的強度為常態分配,他做了四個試驗,得到的強度如下 844, 847, 845, 844 ,計算該鋼條平均強度的 95% 信賴區間。
例題例題
8454
844845847844
X
2])844845(...)845844[(3
1)(
1
1 2222
i i xxn
S
)42845,4
2845( 3,025.03,025.0 tt
©Ming-chi Chen 社會統計
兩種信賴區間的比較
由 t 值所建構出的 CI 的區間比由 Z-score 所建構出的 CI 區間要寬,因為母體的變異數必須估計,誤差較大。
樣本數愈大, CI 的寬度愈小。因為(1) n 在分母 (2) t 值隨著 degree of freedom 的增加而減小。
觀念觀念
©Ming-chi Chen 社會統計
兩種信賴區間的比較CI 隨著 d.f. 增加而減小的情形:
觀念觀念
sample size d.f. 95% CIn n-15 410 920 1930 29
∞ ∞
)/(776.2 nsx
)/(262.2 nsx
)/(093.2 nsx
)/(045.2 nsx
)/(96.1 nsx 當 d.f. 大於 30時,用 t 值所計算的 CI 與用標準常態分配所計算出的 CI 幾乎相同。
©Ming-chi Chen 社會統計
例題N=121, X = $20,000 S=$4,000 construct two CI, one using t, the other using z.
υ= n-1 =120, t0.025, 120 = 1.984 (可用 Excel 求, α= .05)
例題例題
),( ,2/,2/ nStX
nStX vv
)121
4000984.1000,20,121
4000984.120000(
)121
400096.1000,20,121
400096.120000( 值用z
©Ming-chi Chen 社會統計
例題n=10, we want to construct 95% IC using z and t.
If the variance is known, we use z =1.96
If the variance is unknown, we use t.025, 9 = 2.262
2.262/1.96=15%. The confidence interval based on the t value will be 15% wider than that based on the z value.
例題例題
©Ming-chi Chen 社會統計
One-sided confidence intervals for the mean
Take a random sample of n observations from some normal population having unknown mean u and unknown standard deviation σ.
Suppose that we wish to find the lower confidence interval (LCL, ∞) is a left-sided confidence interval.
The lower confidence limit is given by:nstxLCL /
Suppose that we wish to find the upper confidence interval (-∞, UCL) is a right-sided confidence interval
nstxLCL /
©Ming-chi Chen 社會統計
One-sided confidence intervals for the mean
n=10, σ = unknown, x=14.5, s = 2.5. Construct 95% left-sided CI for the population mean u.
例題例題
nstxLCL /
The 95% left-sided confidence interval for u is (13.051, ∞)
051.1310
5.2833.15.14
©Ming-chi Chen 社會統計
比例的區間估計 ( 大樣本 )Let p denote the proportion of items in a population that possess a certain characteristic (unemployed, income below poverty level).
To estimate p, we take a random sample of n observation from the population and count the number X of items in the sample that possess the characteristic.
The sample proportion p^ = X/n is used to estimate the population proportion p.
©Ming-chi Chen 社會統計
比例的區間估計 ( 大樣本 )From lecture 4, we know that p^ ~N(p, pq/n) , where q = 1-p and np 5 and nq 5) ≧ ≧
)1,0(~/
ˆN
npq
ppZ
)/
ˆ(1 2/2/
z
npq
ppzP
)(1 2/2/ zZzP
)/ˆ/ˆ(1 2/2/ npqzppnpqzpP
)/ˆ,/ˆ( 2/2/ npqzpnpqzp 因為沒有 p 與 q 的資訊,所以:
)/ˆˆˆ,/ˆˆˆ( 2/2/ nqpzpnqpzp
©Ming-chi Chen 社會統計
Confidence interval for the population proportion p
Let p denote the population proportion. Suppose we take a large random sample of n observations and obtain the sample proportion p^. A confidence interval for the population proportion having level of confidence 100(1-α)% is given by
)/ˆˆˆ,/ˆˆˆ( 2/2/ nqpZpnqpZp
定義定義
©Ming-chi Chen 社會統計
Confidence interval for the population proportion p
政府想要估計月收入低於 $25,000 的家庭。 500個家庭接受訪問,其中有 200戶人家月收入少於 25000. 求 p 的 95% 信賴區間?
4.500/200/ˆ nxp
例題例題
6.ˆ1ˆ pq
)500/)6)(.4(.96.14,.500/)6)(.4(.96.14(.
(.3570, .4429)
©Ming-chi Chen 社會統計
One-sided confidence intervals for the population proportion
Suppose that we take a random sample of n observations from some population having unknown proportion p. Suppose we wish to find the lower confidence limit LCL such that the probability is (1-) that p exceeds LCL.
The one-sided interval (LCL, 1.00) is a left-sided confidence interval.
The LCL is given by: nqpZpLCL /ˆˆˆ
©Ming-chi Chen 社會統計
One-sided confidence intervals for the population proportion
從某一機器所生產的產品中隨機抽出 100 個來作檢驗,其中 16 個不合格,試建構其 95%的右側信賴區間( right-sided 95% CI )。
nqpZpUCL /ˆˆˆ 16.100/16ˆ p 05.95.1
2203.100/)84)(.16(.645.116. UCL
母體不合格率 p 的 95%的右側信賴區間是 (0, .2203) ,這也就是說我們有 95%的信心說母體的不合格率低於 .2203 。
©Ming-chi Chen 社會統計
Determining the sample size 決定樣本大小
Confidence interval for the mean:
假設某人想要用樣本來估計一個已知其變異數為 2 的母體均數,如果她希望抽樣誤差 |X - u| 小於 D 的機率為 (1-) 的話,那她的樣本必須要有多大? .
©Ming-chi Chen 社會統計
Determining the sample size 決定樣本大小
信賴區間是以 X 為中心,向左右各伸展:
)/,/( 2/2/ nzXnzX
)//(1 2/2/ nzXunzXP
n
zD
2/
D
zn
2/2
2
22/
D
zn
將 D固定,求 n=?
©Ming-chi Chen 社會統計
例題An economist wants to estimate the mean annual income of households in a particular congressional district. It is assumed that the population standard deviation is =$4,000. The economist wants the probability to be .95 that the sample mean will be within a D = $500 of the true mean u. How large a sample is required?
500 D4000 96.1 95.1 2/ z
2
2
22/
D
zn
86.245500
)000,4(96.12
2
2
n
©Ming-chi Chen 社會統計
Determining the sample size 決定樣本大小
Confidence interval for a proportion:
某人想要從一個母體中,抽出若干樣本來估算母體具有某一特徵(支持某一候選人、失業、學過統計…等)的比例為何,她希望估計誤差在 100(1-)% 的信賴水準之下不超過 D ,她的樣本至少要有多大?
©Ming-chi Chen 社會統計
Determining the sample size 決定樣本大小
問題是我們還不知道樣本的比率 p^ (因為樣本數都還沒決定),所以上述公式無法使用,除非我們有 p 的推估值。在不知道的情形下,我們通常採用最大的變異 .5*.5=.25 來估計 n 。
D
qpzn
n
qpzD
ˆˆˆˆ 2/2/
2
22/ ˆˆ)(
D
qpzn
©Ming-chi Chen 社會統計
Sample size and confidence interval for the proportion
如果母體比率無法推估,則樣本數:
2
22/ 25.0*)(
D
zn
如果母體比率 p 可以推估,則樣本數:
2
22/ ˆˆ)(
D
qpzn
©Ming-chi Chen 社會統計
Sample size and confidence interval for the proportion
民意調查機構想知道某總統候選人得票的比率,請問至少要多大的樣本數才可以使此機構在 95% 的信賴度下,估計的誤差界不會超過 .03 ?
.5q̂p̂ 3.0 D96.1 95.1 2/ z
10681.067,103.
)96.1(25.)(25.2
2
2
22/
D
zn
樣本大小跟母體大小有沒有相關?
©Ming-chi Chen 社會統計
樣本大小的其他考慮• 精確度• 信賴水準• 母體在變數上的變異性,變異越大,所需的樣本越大
• 分析的複雜程度,自變數越多,所需樣本越大(分析族群、性別、家庭社經地位、父母教育程度、 IQ、社區規模、社會資本等對教育年數的影響)
• 時間、金錢與其他資源– 資源不允許時,那我們要追求不甚精確的部分知識?還是全然不知?
• 之前樣本規模是取決於信賴水準和誤差範圍,但是我們還得考慮非抽樣誤差
©Ming-chi Chen 社會統計
複習
設( x1,x2…xn) 為由某母體抽出的隨機樣本,為此母體之參數,假設 T1, T2 為兩個統計量,使得
1)( 21 TTP
則稱( T1, T2) 為的 100(1-)% 信賴區間,而 (1-) 為信賴度。
©Ming-chi Chen 社會統計
複習
的估計式,為參數設 ˆ n
1))ˆ( Dp n若
(精確度、抽樣誤差)誤差界線的估計為以則稱 )%1(100 ˆ nD
©Ming-chi Chen 社會統計
複習
母體平均數 u 之點估計:
一般以 X 來估計 u ,也就是取 X 做為 u 的估計式,因此 X 為 u 之點估計值。
當樣本數 n 已知,且 n>30 ,以 X 估計 u 的 100(1-)%誤差界線為
n
zD
2/
當樣本數未定,但 n>30 ,若誤差界限 D 已知,則樣本數為 2
2
22/
D
zn
©Ming-chi Chen 社會統計
複習
母體平均數 u 之區間估計:
當樣本數 n 已知,且 n>30 ,則
)/,/( 2/2/ nzXnzX
為母體平均數 u 的 100(1-)% 的信賴區間
©Ming-chi Chen 社會統計
複習
一個日光燈製造公司生產的燈管壽命近似常態分配,它的標準差為 100 小時。某品管人員隨機抽樣 32燈管,經使用後觀察其壽命,得平均壽命為 1200 小時
(1)求該公司生產的每支燈管的平均壽命之估計值。平均壽命 u 之點估計值為 x=1200 小時
©Ming-chi Chen 社會統計
複習
(2)求 (1) 中的估計之 95%誤差界線?
648.3432
10096.1
2
n
ZD
誤差界線
(3)若希望(2)中的 95%誤差界線為 20 小時,問此題的樣本夠不夠大?若不夠大應再抽多少樣本?
9704.96)100()20
96.1( 22
2
2
22/ 取
D
zn
故應再取 97-32=65支
©Ming-chi Chen 社會統計
複習
(4)求該公司生產的每支燈管平均壽命的 90%及 95% 信賴區間
)/,/( 2/2/ nzXnzX
)32/100645.11200,32/100645.11200(
:%90
CIu之
)32/10096.11200,32/10096.11200(
:%95
CIu之
©Ming-chi Chen 社會統計
Confidence intervals for the difference of Two means
Confidence interval for (u1-u2) when variance are known or sample sizes (n>30) are large—independent sample
Suppose we have independent random samples of size n1 and n2 from two normal populations having unknown means u1 and u2 and known variance 1
2 and 22. If the
observed sample means are x1 and x2, a 100(1-)% confidence interval for (u1 – u2) is given by
2
22
1
21
221
2
22
1
21
221 )(,)(
nnzxx
nnzxx
©Ming-chi Chen 社會統計
Confidence intervals for the difference of Two means
If sample sizes are large n>30, and the population variances are unknown, then
2
22
1
21
221
2
22
1
21
221 )(,)(
n
s
n
szxx
n
s
n
szxx
©Ming-chi Chen 社會統計
例題
在性別歧視案件中,某員工聲稱公司給予男性員工較高的薪資。假設母體1為男性,母體2為所有從事相同工作的女性。抽取獨立樣本 n1=100男性 , n2=100女性 ;
2
22
1
21
221
2
22
1
21
221 )(,)(
n
s
n
szxx
n
s
n
szxx
2500S 3000
19700x 20600
21
21
S
x求 (u1-u2)的 95%的 CI ?
100
2500
100
300096.1)900(,
100
2500
100
300096.1)900(
2222
©Ming-chi Chen 社會統計
Confidence intervals for the difference of Two means
Confidence interval for (u1-u2) when variance are UNKNOWN and sample sizes are small
Suppose we have independent random samples of size n1 and n2 from normal populations having unknown means u1 and u2 and a common unknown variance 2. If the observed sample means are x1 and x2, a 100(1-)% confidence interval for (u1 – u2) is given by
2
2
1
2
,221
2
2
1
2
,221 )(,)(
n
s
n
stxx
n
s
n
stxx pppp
©Ming-chi Chen 社會統計
Confidence intervals for the difference of Two means
2
2
1
2
,221
2
2
1
2
,221 )(,)(
n
s
n
stxx
n
s
n
stxx pppp
21,2
2121
,221
11)(,
11)(
nnstxx
nnstxx pp
)1()1(
)1()1(
21
222
2112
nn
snsnsp
11 21 nn
Pooled estimate of the common variance Degree of freedom
©Ming-chi Chen 社會統計
Confidence intervals for the difference of Two population proportion
2
22
1
11,2
212
22
1
11,2
21
ˆˆˆˆ)ˆˆ(,
ˆˆˆˆ)ˆˆ(
n
qp
n
qpZpp
n
qp
n
qpZpp
Let p1 denote the observed proportion of successes in a random sample of n1 observation from a population with proportion p1 successes, and let p2 denote the observed proportion of successes in an independent random sample of n2 observations from a population with proportion p2 successes. A 100(1- α) % confidence interval for (p1 – p2) is given by the interval
This result holds provided n1p1 5≧ n1q1 5 ≧ n2p2 5 and ≧ n2q2 5≧