Lectuer 21-ConfidenceInterval
Lectuer 21-ConfidenceInterval
Definition
A confidence interval (or interval estimate) is a range
(or an interval) of values used to estimate the true
value of a population parameter. A confidence interval
is sometimes abbreviated as CI.
Confidence level
Definition
The confidence level is the probability 1 - 𝜶 (often
expressed as the equivalent percentage value) that is
the proportion of times that the confidence interval
actually does contain the population parameter,
assuming that the estimation process is repeated a
large number of times. (The confidence level is also
called the degree of confidence, or the confidence
coefficient.)
Area under the Normal Curve [2]
z =z = 1.96 ∵ 𝟏 − α/2 = 1 - 0.250 = 0.9750
α/2 0.0250
𝐗−μ
t=
s/ 𝐧
𝟐
σ(𝒙−𝒙)
where 𝐬𝟐= 𝒏−𝟏
𝟏
2
or s = {𝐧 σ𝐧 x2 − (σ𝐧 x )2}
𝐧−𝟏 𝐢=𝟏 𝐢=𝟏
0.68 - 1.96 p
(0.68)(0.32)
< p < 0.68 + 1.96
(0.68)(0.32)
500 500
0.6391 < p < 0.7209
<
ෝ
ෝ
Calculating sample size using 𝐩
If pෝ is used as an estimate of p, we can be 100(1 − α)%
confident that the error will be less than a specified
amount e when the sample size is approximately
𝐩
ෝ𝐪ෝ z2
n = 𝐞𝟐α/2
EXAMPLE: How large a sample is required if we want to
be 95% confident that our estimate of p in the previous
example is within 0.02 of the true value?
SOLUTION:
ෝq
p ෝ z2
n = e2α/2
0.68 0.32 1.96 2
n= (0.02)2
n = 2089.8 ≈ 2090
Calculating sample size without prior
knowledge about 𝐩ෝ [1]
ෝ is used as an estimate of p, we can be at least
If 𝐩
100(1 − α)% confident that the error will not exceed a
specified amount e when the sample size is
z2α/2
n = 𝟒𝐞𝟐
Calculating sample size without prior
knowledge about 𝐩ෝ [2]
EXAMPLE: How large a sample is required if we want to
be at least 95% confident that our estimate of p in the
previous example within 0.02 of the true value?
SOLUTION: We shall now assume that no preliminary
sample has been taken to provide an estimate of p.
Consequently, we can be at least 95% confident that
our sample proportion will not differ from the true
proportion by more than 0.02 if we choose a sample of
size
2
1.96
n = 4(0.02)2 = 2401
Two Samples: Estimating the
Difference between Two Proportions
100(1 – α)% confidence interval for p1-p2 is
(pෝ -pෝ )-z ෝ1q
p ෝ1
+
ෝ2q
p ෝ2 <p -p
1 2 α/2 n1 n2 1 2
ෝ1q
p ෝ1 ෝ2q
p ෝ2
<(pෝ1-pෝ2) + zα/2 +
n1 n2
Example: A certain change in a process for
manufacturing component parts is being considered.
Samples are taken under both the existing and the new
process so as to determine if the new process results in
an improvement. If 75 of 1500 items from the existing
process are found to be defective and 80 of 2000 items
from the new process are found to be defective, find a
90% confidence interval for the true difference in the
proportion of defectives between the existing and the
new process.
Solution
Let p1 and p2 be the true proportions of defectives for
the existing and new processes, respectively.
ෝ = 75/1500 = 0.05 and 𝒑
𝒑 ෝ 𝟐 = 80/2000 = 0.04
The point estimate of p1 − p2 is pෝ1 - pෝ2 = 0.05 – 0.04 =
0.01
Using Table A.3, we find z0.05 = 1.645.
ෝ1q
p ෝ1 ෝ2q
p ෝ2 (0.05)(0.95) (0.04)(0.96)
zα/2 + = 1.645 + =
n1 n2 1500 2000
0.0117
Substitute values in the formula, we get
−0.0017 < p1 − p2 < 0.0217
Two Samples: Estimating the
Difference between Two Means [1]
Confidence Interval for μ1 − μ2, when σ 12 and σ 22 known
(x1 -x2) + z σ1 2 + σ2 2
α/2 n 1 n 2
or
(12−1)(0.7712) + (10−1)(0.4482)
s2p = 12+10−2 = 0.417, sp =
0.646
95 % for Confidence Interval for μ1 − μ2 is
1 1
(x1-x2) - t(α/2, n1+n2−2 sp + < μ1 − μ2 <
) n1 n2
1 1
(x1-x2) + t(α/2, n1+n2−2 sp +
) n1 n2
t(α/2, n1+n2−2 = t(0.05,20) = 1.725
)
(α/2, v) s1 2 + s2 2
𝐧 𝟏 𝐧 𝟐
Where
(s 2/n + s 2/n )2
v= 2 2 1 1 2 2 2 2
[(s1 /n1) /(n1−1) + (s2 /n2) /(n2−1)]
Dr. Faisal Bukhari, PUCIT, PU, Lahore
Two Samples: Estimating the
Difference between Two Means [4]
Assumption: Population Variances Unknown
but Unequal (σ12 ≠ σ 22)
Where
(s 2/n + s 2/n )2
v= 2 2 1 1 2 2 2 2
[(s1 /n1) /(n1−1) + (s2 /n2) /(n2−1)]