STAT 2006 Chapter 2 - 2022
STAT 2006 Chapter 2 - 2022
Presented by
Simon Cheung
Email: [email protected]
We denote a random sample of size 𝑛𝑛 as 𝑋𝑋1 , 𝑋𝑋2 , … , 𝑋𝑋𝑛𝑛 and denote the corresponding
observed values of the random sample as 𝑥𝑥1 , 𝑥𝑥2 , … , 𝑥𝑥𝑛𝑛 .
The pdf 𝑓𝑓 𝑥𝑥; 𝜃𝜃 of the random variable 𝑋𝑋 depends on an unknown parameter 𝜃𝜃, taking
value in a set Ω. Ω is called the parameter space.
For example, if 𝜇𝜇 is the GPA of all college students, then the parameter space is Ω =
𝜇𝜇: 0 ≤ 𝜇𝜇 ≤ 4.3 , and, if 𝑝𝑝 denotes the proportion of students who works part-time, then
the parameter space is Ω = 𝑝𝑝: 0 ≤ 𝑝𝑝 ≤ 1 .
Definition. A statistic is a function of 𝑋𝑋1 , 𝑋𝑋2 , … , 𝑋𝑋𝑛𝑛 , write 𝑢𝑢 𝑋𝑋1 , 𝑋𝑋2 , … , 𝑋𝑋𝑛𝑛 . A point
estimator 𝜃𝜃� to estimate 𝜃𝜃 is a statistic of the random sample 𝜃𝜃� = 𝜃𝜃� 𝑋𝑋1 , 𝑋𝑋2 , … , 𝑋𝑋𝑛𝑛 .
For example,
𝑛𝑛
1
• The function 𝑋𝑋� = � 𝑋𝑋𝑗𝑗 is a point estimator of the population mean 𝜇𝜇.
𝑛𝑛 𝑗𝑗=1
𝑛𝑛
1
• Let 𝑋𝑋𝑖𝑖 = 0 or 1. The function 𝑝𝑝̂ = � 𝑋𝑋𝑗𝑗 is a point estimator of the population
𝑛𝑛 𝑗𝑗=1
proportion 𝑝𝑝.
𝑛𝑛 2
1
• The function 𝑆𝑆 2 = � 𝑋𝑋𝑗𝑗 − 𝑋𝑋� is a point estimator of the population variance
𝑛𝑛−1 𝑗𝑗=1
𝜎𝜎 2 .
Definition. A point estimate of 𝜃𝜃 is computed from the observed sample 𝑢𝑢 𝑥𝑥1 , 𝑥𝑥2 , … , 𝑥𝑥𝑛𝑛 ,
where 𝑢𝑢 𝑋𝑋1 , 𝑋𝑋2 , … , 𝑋𝑋𝑛𝑛 is a point estimator of 𝜃𝜃.
For example, if 𝑥𝑥𝑖𝑖 s are the observed GPA of a random sample of 88 students, then
88
1
𝑥𝑥̅ = � 𝑥𝑥𝑗𝑗
88
𝑗𝑗=1
is a point estimate of the mean GPA 𝜇𝜇 of all students in the population. Define 𝑥𝑥𝑖𝑖 = 0 if a
student does not work part-time and 𝑥𝑥𝑖𝑖 = 1 if a student works part-time, then 𝑝𝑝̂ = 0.11 is
a point estimate of 𝑝𝑝, the proportion of all students in the population who works part-
time.
Basic idea. A good estimate of the unknown parameter 𝜃𝜃 is the value of 𝜃𝜃 which maximizes
the likelihood of getting the data we observed.
Suppose that 𝑋𝑋1 , 𝑋𝑋2 , … , 𝑋𝑋𝑛𝑛 is a random sample for which the pdf of each 𝑋𝑋𝑖𝑖 is 𝑓𝑓 𝑥𝑥𝑖𝑖 , 𝜃𝜃 .
Then, the joint pdf of 𝑋𝑋1 , 𝑋𝑋2 , … , 𝑋𝑋𝑛𝑛 is, as a function of 𝜃𝜃,
𝑛𝑛
where, by definition, 𝑋𝑋1 , 𝑋𝑋2 , … , 𝑋𝑋𝑛𝑛 are independent. Therefore, our objective is to find 𝜃𝜃�
such that
𝜃𝜃� = argmax 𝐿𝐿 𝜃𝜃 .
𝜃𝜃∈Ω
We call 𝐿𝐿 𝜃𝜃 the likelihood function of 𝜃𝜃.
ln 𝐿𝐿 𝑝𝑝 = � 𝑥𝑥𝑗𝑗 ln 𝑝𝑝 + 𝑛𝑛 − � 𝑥𝑥𝑗𝑗 ln 1 − 𝑝𝑝 .
𝑗𝑗=1 𝑗𝑗=1
Example. Suppose the weights of randomly selected female college students are normally
distributed with unknown mean 𝜇𝜇 and variance 𝜎𝜎 2 . A random sample of 10 female college
students have the following weights (in pounds): 115, 122, 130, 127, 149, 160, 152, 138,
149, 180. Identify the likelihood function and the mle of 𝜇𝜇, the mean weight of all female
college students, and that of 𝜎𝜎 2 . Using the given sample, find a maximum likelihood
estimate of 𝜇𝜇 and 𝜎𝜎 2 .
Answer. Let 𝑋𝑋 be the weight in pounds of a randomly selected female college student. The
1 𝑥𝑥−𝜇𝜇 2
pdf of 𝑋𝑋 is 𝑓𝑓 𝑥𝑥, 𝜇𝜇, 𝜎𝜎 2 = exp − , for 𝑥𝑥 ∈ ℝ. The parameter space is Ω =
2𝜎𝜎2
2𝜋𝜋𝜎𝜎2
𝜇𝜇, 𝜎𝜎 , 𝜇𝜇 ∈ ℝ, 𝜎𝜎 > 0 . Thus, the likelihood function of 𝜇𝜇 and 𝜎𝜎 2 is given by
𝑛𝑛
−
𝑛𝑛 1 2
𝐿𝐿 𝜇𝜇, 𝜎𝜎 2 = 2𝜋𝜋𝜋𝜋 2 2 exp − 2 � 𝑥𝑥𝑗𝑗 − 𝜇𝜇 .
2𝜎𝜎
𝑗𝑗=1
and that of 𝜎𝜎 2 is
𝑛𝑛 𝑛𝑛
1 1 1152 + ⋯ + 1802
2
2
𝜎𝜎� = � 𝑥𝑥𝑗𝑗 − 𝑥𝑥̅ = � 𝑥𝑥𝑗𝑗2 − 𝑥𝑥̅ 2 = − 142.22 = 347.96.
𝑛𝑛 𝑛𝑛 10
𝑗𝑗=1 𝑗𝑗=1
Note that
• the estimator is defined using capital letters to reflect that it is a random variable. But an
estimate is defined using lowercase letters to reflect that its value is fixed based on the
given random sample.
• the mle of 𝜎𝜎 2 is different from the sample variance 𝑆𝑆 2 .
Example. If 𝑋𝑋~𝑛𝑛 𝜇𝜇, 𝜎𝜎 2 random variable, then are the mle of 𝜇𝜇, 𝜎𝜎 2 , that is 𝜇𝜇̂ = 𝑋𝑋� and
𝑛𝑛 2
1
2
𝜎𝜎� = � �
𝑋𝑋𝑗𝑗 − 𝑋𝑋 , unbiased?
𝑛𝑛 𝑗𝑗=1
𝑛𝑛
1
Answer. 𝐸𝐸 𝜇𝜇̂ = � 𝐸𝐸 𝑋𝑋𝑗𝑗 = 𝜇𝜇
𝑛𝑛 𝑗𝑗=1
𝑛𝑛 𝑛𝑛
2
1 1 𝜎𝜎 1 2
𝐸𝐸 𝜎𝜎� = � 𝐸𝐸 𝑋𝑋𝑗𝑗2 − 𝐸𝐸
2
𝑋𝑋� 2 2 2
= � 𝜎𝜎 + 𝜇𝜇 − 2
+ 𝜇𝜇 = 1 − 𝜎𝜎 ≠ 𝜎𝜎 2 .
𝑛𝑛 𝑛𝑛 𝑛𝑛 𝑛𝑛
𝑗𝑗=1 𝑗𝑗=1
Hence, 𝜇𝜇̂ is an unbiased estimator of 𝜇𝜇 but 𝜎𝜎� 2 is a biased estimator of 𝜎𝜎 2 . Note also that
𝜎𝜎 2
𝑉𝑉𝑉𝑉𝑉𝑉 𝑋𝑋� = and 𝐸𝐸 𝑋𝑋 2 = 𝑉𝑉𝑉𝑉𝑉𝑉 𝑋𝑋 + 𝐸𝐸 𝑋𝑋 2 .
𝑛𝑛
Let 𝑋𝑋 be a Bernoulli random variable with parameter 𝑝𝑝. Find the moment estimator of 𝑝𝑝.
Answer. Since 𝐸𝐸 𝑋𝑋 = 𝑝𝑝, equating the first sample moment 𝑋𝑋� to the first theoretical
� Hence the moment estimator of 𝑝𝑝 is 𝑋𝑋.
moment 𝑝𝑝 to have 𝑝𝑝� = 𝑋𝑋. �
Let 𝑋𝑋~𝑛𝑛 𝜇𝜇, 𝜎𝜎 2 random variable. Find the moment estimators of 𝜇𝜇 and 𝜎𝜎 2 .
Answer. Since 𝐸𝐸 𝑋𝑋 = 𝜇𝜇 and 𝐸𝐸 𝑋𝑋 2 = 𝜇𝜇2 + 𝜎𝜎 2 , equating the first and the second sample
moment to the corresponding theoretical moment to obtain 𝜇𝜇� = 𝑋𝑋� and 𝜇𝜇� 2 + 𝜎𝜎� 2 = 𝑋𝑋 2 . We
can solve for 𝜇𝜇� and 𝜎𝜎� 2 to obtain 𝜇𝜇� = 𝑋𝑋� and 𝜎𝜎� 2 = 𝑋𝑋 2 −𝑋𝑋� 2 .
Example. Let 𝑋𝑋 be a Gamma random variable with parameters 𝛼𝛼 and 𝜃𝜃, where its pdf is
1 −
𝑥𝑥
𝛼𝛼−1 𝑒𝑒 𝜃𝜃 , 𝑥𝑥 > 0.
𝑓𝑓 𝑥𝑥 = 𝑥𝑥
Γ 𝛼𝛼 𝜃𝜃 𝛼𝛼
Find the moment estimators of 𝛼𝛼 and 𝜃𝜃.
Answer. The first theoretical moment about the origin is 𝐸𝐸 𝑋𝑋 = 𝛼𝛼𝛼𝛼, and the second
theoretical moment about the mean is 𝑉𝑉𝑉𝑉𝑉𝑉 𝑋𝑋 = 𝛼𝛼𝜃𝜃 2 . By equating the first sample
moment about the origin and the second sample moment about the mean to the
𝑛𝑛 2
1
corresponding theoretical moments, we have 𝛼𝛼� 𝜃𝜃� = 𝑋𝑋� and 𝛼𝛼� 𝜃𝜃� 2 = � 𝑋𝑋𝑗𝑗 − 𝑋𝑋� . It
𝑛𝑛 𝑗𝑗=1
𝑛𝑛
1 2 𝑋𝑋� 𝑛𝑛𝑋𝑋� 2
follows that 𝜃𝜃� = � 𝑋𝑋𝑗𝑗 − 𝑋𝑋� and 𝛼𝛼� = � = 𝑛𝑛 .
𝑛𝑛𝑋𝑋� 𝑗𝑗=1 𝜃𝜃 � 𝑋𝑋𝑗𝑗 −𝑋𝑋�
2
𝑗𝑗=1
Example. Let 𝑋𝑋~𝑛𝑛 𝜇𝜇, 𝜎𝜎 2 random variable. Find the moment estimators of 𝜇𝜇 and 𝜎𝜎 2 .
Answer.
The first theoretical moment about the origin is 𝐸𝐸 𝑋𝑋 = 𝜇𝜇, and the second theoretical
moment about the mean is 𝑉𝑉𝑉𝑉𝑉𝑉 𝑋𝑋 = 𝜎𝜎 2 . By equating the first sample moment about the
origin and the second sample moment about the mean to the corresponding theoretical
𝑛𝑛 2
1
moments, we have 𝜇𝜇� = 𝑋𝑋� and 𝜎𝜎� 2 = � �
𝑋𝑋𝑗𝑗 − 𝑋𝑋 .
𝑛𝑛 𝑗𝑗=1
Theorem. Let 𝑋𝑋1 , … , 𝑋𝑋𝑛𝑛 be a random sample from a population with pdf 𝑓𝑓 𝑥𝑥; 𝜃𝜃 . Then,
under certain regularity conditions, we have the following results.
• 𝐼𝐼𝑛𝑛 𝜃𝜃 = 𝑛𝑛𝑛𝑛 𝜃𝜃 , where
2
𝜕𝜕 log 𝑓𝑓 𝑋𝑋; 𝜃𝜃
𝐼𝐼 𝜃𝜃 = 𝐸𝐸 ,
𝜕𝜕𝜕𝜕
is the Fisher information of size 1 about 𝜃𝜃.
𝜕𝜕2 log 𝑓𝑓 𝑋𝑋;𝜃𝜃
• 𝐼𝐼 𝜃𝜃 = 𝐸𝐸 − .
𝜕𝜕𝜃𝜃2
� the Cramer-Rao inequality is 𝑉𝑉𝑉𝑉𝑉𝑉 𝜃𝜃� ≥ 𝐼𝐼𝑛𝑛 𝜃𝜃
• For an unbiased estimator 𝜃𝜃, −1 .
Example. Show that 𝑋𝑋�𝑛𝑛 is the UMVUE of the parameter 𝜃𝜃 of a Bernoulli population.
𝑓𝑓 𝑥𝑥; 𝜃𝜃 = 𝜃𝜃 𝑥𝑥 1 − 𝜃𝜃 1−𝑥𝑥 , 𝑥𝑥 ∈ 0,1
𝜕𝜕 log 𝑓𝑓 𝑥𝑥; 𝜃𝜃 𝜕𝜕 𝑥𝑥 1 − 𝑥𝑥 𝑥𝑥 1
= 𝑥𝑥 log 𝜃𝜃 + 1 − 𝑥𝑥 log 1 − 𝜃𝜃 = − = −
𝜕𝜕𝜃𝜃 𝜕𝜕𝜕𝜕 𝜃𝜃 1 − 𝜃𝜃 𝜃𝜃 1 − 𝜃𝜃 1 − 𝜃𝜃
2
𝜕𝜕 log 𝑓𝑓 𝑋𝑋; 𝜃𝜃 𝑋𝑋 1
𝐼𝐼 𝜃𝜃 = 𝐸𝐸 = 𝑉𝑉𝑉𝑉𝑉𝑉 = .
𝜕𝜕𝜃𝜃 𝜃𝜃 1 − 𝜃𝜃 𝜃𝜃 1 − 𝜃𝜃
The Cramer-Rao lower bound is
1 𝜃𝜃 1 − 𝜃𝜃
𝑉𝑉𝑉𝑉𝑉𝑉 𝜃𝜃� ≥ 𝐼𝐼𝑛𝑛 𝜃𝜃 −1 = = .
𝑛𝑛𝑛𝑛 𝜃𝜃 𝑛𝑛
𝜃𝜃 1−𝜃𝜃
� �
Since 𝐸𝐸 𝑋𝑋𝑛𝑛 = 𝜃𝜃 and 𝑉𝑉𝑉𝑉𝑉𝑉 𝑋𝑋𝑛𝑛 = , 𝑋𝑋�𝑛𝑛 is the UMVUE of 𝜃𝜃.
𝑛𝑛
𝑝𝑝
𝜃𝜃� is a consistent estimator of 𝜃𝜃 if 𝜃𝜃� 𝜃𝜃, that is, for any 𝜀𝜀 > 0,
lim 𝑃𝑃 𝜃𝜃� − 𝜃𝜃 > 𝜀𝜀 = 0.
𝑛𝑛→∞
Property. If 𝜃𝜃�𝑛𝑛 is a sequence of estimators of a parameter 𝜃𝜃 satisfying
• lim 𝑉𝑉𝑉𝑉𝑉𝑉 𝜃𝜃�𝑛𝑛 = 0
𝑛𝑛→∞
• lim 𝐵𝐵𝐵𝐵𝐵𝐵𝐵𝐵 𝜃𝜃�𝑛𝑛 = 0
𝑛𝑛→∞
then, 𝜃𝜃�𝑛𝑛 is a consistent sequence of estimators of 𝜃𝜃.
2
Proof. 𝐸𝐸 𝜃𝜃�𝑛𝑛 − 𝜃𝜃 = 𝑉𝑉𝑉𝑉𝑉𝑉 𝜃𝜃�𝑛𝑛 + 𝐵𝐵𝐵𝐵𝐵𝐵𝐵𝐵 𝜃𝜃�𝑛𝑛 .
Example. Suppose that 𝑋𝑋1 , … , 𝑋𝑋𝑛𝑛 are independent random variables having the same
finite mean 𝜇𝜇 = 𝐸𝐸 𝑋𝑋1 , finite variance 𝜎𝜎 2 = 𝑉𝑉𝑉𝑉𝑉𝑉 𝑋𝑋1 , and finite fourth moment 𝜇𝜇4 =
𝐸𝐸 𝑋𝑋14 . Show that 𝑋𝑋� is a consistent estimator of 𝜇𝜇 and 𝑆𝑆 2 is a consistent estimator of 𝜎𝜎 2 .
Answer. Note that 𝐸𝐸 𝑋𝑋� = 𝜇𝜇 (unbiased) and 𝑉𝑉𝑉𝑉𝑉𝑉 𝑋𝑋� = 𝜎𝜎 2 ⁄𝑛𝑛 → 0, as 𝑛𝑛 → ∞. Hence, 𝑋𝑋� is
a consistent estimator of 𝜇𝜇. (We can also prove this using weak law of large numbers)
For 𝑆𝑆 2 , we have
𝑛𝑛 𝑛𝑛
1 𝑛𝑛 1
2
𝑆𝑆 = �
� 𝑋𝑋𝑖𝑖 − 𝑋𝑋 =2 � 𝑋𝑋𝑖𝑖2 − 𝑋𝑋� 2 .
𝑛𝑛 − 1 𝑛𝑛 − 1 𝑛𝑛
𝑖𝑖=1 𝑖𝑖=1
By the weak law of large numbers, we have 𝑋𝑋 2 ⟶𝑝𝑝 𝜇𝜇2 = 𝐸𝐸 𝑋𝑋12 and 𝑋𝑋� ⟶𝑝𝑝 𝜇𝜇. Since
𝑔𝑔 𝑥𝑥 = 𝑥𝑥 2 is continuous, we have 𝑋𝑋� 2 ⟶ 𝜇𝜇2 . Hence, 𝑆𝑆 2 ⟶ 𝜇𝜇2 − 𝜇𝜇2 = 𝜎𝜎 2 .
Note that when 𝑋𝑋1 , … , 𝑋𝑋𝑛𝑛 are independent 𝑛𝑛 𝜇𝜇, 𝜎𝜎 2 random variables. We understand
that
𝑛𝑛 − 1 𝑆𝑆 2 2
2
~𝜒𝜒𝑛𝑛−1 ,
𝜎𝜎
2
where 𝜒𝜒𝑛𝑛−1 is the chi-square distribution with 𝑛𝑛 − 1 degrees of freedom. Therefore,
𝑛𝑛 − 1 𝑆𝑆 2 2 = 𝜎𝜎 2 (𝑢𝑢𝑢𝑢𝑢𝑢𝑢𝑢𝑢𝑢𝑢𝑢𝑢𝑢𝑢𝑢)
𝐸𝐸 = 𝑛𝑛 − 1 ⟹ 𝐸𝐸 𝑆𝑆
𝜎𝜎 2
𝑛𝑛−1 𝑆𝑆 2
Since 𝑉𝑉𝑉𝑉𝑉𝑉 = 2 𝑛𝑛 − 1 ,
𝜎𝜎 2
2𝜎𝜎 4
𝑉𝑉𝑉𝑉𝑉𝑉 𝑆𝑆 2 = ⟶ 0,
𝑛𝑛 − 1
as 𝑛𝑛 ⟶ ∞. Thus, 𝑆𝑆 2 is a consistent estimator of 𝜎𝜎 2 .
Theorem. Let 𝑋𝑋1 , … , 𝑋𝑋𝑛𝑛 be an independent random sample from a population with pdf
𝑓𝑓 𝑥𝑥; 𝜃𝜃 . Suppose that 𝜃𝜃� is the MLE of the true parameter 𝜃𝜃0 . Then, under certain
regularity conditions, as 𝑛𝑛 ⟶ ∞,
𝑑𝑑
𝑛𝑛 𝜃𝜃� − 𝜃𝜃0 𝑛𝑛 0, 𝐼𝐼 𝜃𝜃0 −1
.
1
In other words, the large sample distribution of the mle 𝜃𝜃� is 𝑛𝑛 𝜃𝜃0 , 𝐼𝐼 𝜃𝜃0 −1
.
𝑛𝑛
Example. Suppose that 𝑋𝑋1 , … , 𝑋𝑋𝑛𝑛 be an independent random sample from a Poisson
distribution with pdf
𝜆𝜆 𝑥𝑥
𝑓𝑓 𝑥𝑥, 𝜆𝜆 = 𝑒𝑒 −𝜆𝜆 , 𝑥𝑥 = 0,1,2, … ; 𝜆𝜆 > 0.
𝑥𝑥!
Then, the maximum likelihood estimator of 𝜆𝜆 is 𝜆𝜆̂ = 𝑋𝑋. � The log-likelihood function is
given by
log 𝐿𝐿 𝜆𝜆, 𝑋𝑋1 , … , 𝑋𝑋𝑛𝑛 = 𝑛𝑛𝑋𝑋� log 𝜆𝜆 − 𝑛𝑛𝜆𝜆.
Thus,
𝜕𝜕 log 𝐿𝐿 𝜆𝜆 𝑛𝑛𝑋𝑋� 𝜕𝜕 2 log 𝐿𝐿 𝜆𝜆 𝑛𝑛𝑋𝑋� 𝜕𝜕 2 log 𝐿𝐿 𝜆𝜆 𝑛𝑛
= − 𝑛𝑛; 2
= − 2 ⟹ 𝐼𝐼𝑛𝑛 𝜆𝜆 = −𝐸𝐸 2
= .
𝜕𝜕𝜕𝜕 𝜆𝜆 𝜕𝜕𝜆𝜆 𝜆𝜆 𝜕𝜕𝜆𝜆 𝜆𝜆
𝜆𝜆
The large sample distribution of 𝜆𝜆̂ = 𝑋𝑋� is 𝑛𝑛 𝜆𝜆, .
𝑛𝑛
Point estimates, such as the sample proportion 𝑝𝑝,̂ the sample mean 𝑥𝑥̅ or the sample
variance 𝜎𝜎� 2 depends on the particular sample. When we use the sample mean 𝑥𝑥̅ to
estimate the population mean 𝜇𝜇, can we be confident that 𝑥𝑥̅ is close to 𝜇𝜇? Can we have a
measure as to how close the sample estimator 𝜃𝜃� is to the population parameter 𝜃𝜃?
An approach is to find an upper bound 𝑈𝑈 and a lower bound 𝐿𝐿 such that the value of the
population parameter 𝜃𝜃 is between 𝐿𝐿 and 𝑈𝑈 with probability 1 − 𝛼𝛼, that is
𝑃𝑃 𝐿𝐿 < 𝜃𝜃 < 𝑈𝑈 = 1 − 𝛼𝛼,
where 1 − 𝛼𝛼 ∈ 0,1 is called the confidence coefficient or the confidence level of the
interval 𝐿𝐿, 𝑈𝑈 .
Typical confidence coefficients are 90%, 95%, and 99%. For example, we are 95% confident
that the population mean is between 𝐿𝐿 and 𝑈𝑈.
Example. For an independent random sample 𝑋𝑋1 , 𝑋𝑋2 , 𝑋𝑋3 , 𝑋𝑋4 from 𝑛𝑛 𝜇𝜇, 1 , consider an
interval estimator of 𝜇𝜇 by 𝑋𝑋� − 1, 𝑋𝑋� + 1 . Then, the probability that 𝜇𝜇 ∈ 𝑋𝑋� − 1, 𝑋𝑋� + 1
is given by
𝑃𝑃 𝜇𝜇 ∈ 𝑋𝑋� − 1, 𝑋𝑋� + 1 = 𝑃𝑃 𝑋𝑋� − 1 ≤ 𝜇𝜇 ≤ 𝑋𝑋� + 1 = 𝑃𝑃 −1 ≤ 𝑋𝑋� − 𝜇𝜇 ≤ 1
𝑋𝑋� − 𝜇𝜇
= 𝑃𝑃 −2 ≤ ≤ 2 = 𝑃𝑃 −2 ≤ 𝑍𝑍 ≤ 2 ≈ 0.9544,
1
4
where 𝑍𝑍~𝑛𝑛 0,1 . Note that we have over a 95% chance of covering 𝜃𝜃.
Definition. Let 𝑋𝑋1 , 𝑋𝑋2 , … , 𝑋𝑋𝑛𝑛 be an independent sample from a distribution with pdf 𝑓𝑓𝜃𝜃 . The
confidence coefficient 1 − 𝛼𝛼 of an interval estimator 𝐿𝐿 𝑋𝑋1 , 𝑋𝑋2 , … , 𝑋𝑋𝑛𝑛 , 𝑈𝑈 𝑋𝑋1 , 𝑋𝑋2 , … , 𝑋𝑋𝑛𝑛 of
𝜃𝜃 is given by
1 − 𝛼𝛼 = 𝑃𝑃 𝜃𝜃 ∈ 𝐿𝐿 𝑋𝑋1 , 𝑋𝑋2 , … , 𝑋𝑋𝑛𝑛 , 𝑈𝑈 𝑋𝑋1 , 𝑋𝑋2 , … , 𝑋𝑋𝑛𝑛 .
Definition. The value 𝑧𝑧𝛼𝛼/2 is the 𝑍𝑍-value (obtained from a standard normal table) such that
𝛼𝛼 𝛼𝛼
the area to the right of it under the standard normal curve is , that is 𝑃𝑃 𝑍𝑍 ≥ 𝑧𝑧𝛼𝛼/2 = . By
2 2
𝛼𝛼
symmetry of the normal distribution, 𝑃𝑃 𝑍𝑍 ≤ −𝑧𝑧𝛼𝛼/2 = .
2
Example. A publishing company has just published a new college textbook. Before the
company decides the price of the book, it wants to know the average price of all such
textbooks in the market. The research department at the company took a sample of 36
such textbooks and collected information on their prices. This information produced a
mean price of $48.40 for this sample. It is known that the standard deviation of the
prices of all such textbooks is $4.50. Construct a 90% confidence interval for the mean
price of all such college textbooks assuming that the underlying population is normal.
Answer. Given 𝑛𝑛 = 36, 𝑥𝑥̅ = 48.4 and 𝜎𝜎 = 4.50. The 90% confidence interval for the mean
price of all such college textbooks is given by
4.5 4.5
𝑥𝑥̅ − 1.645 × , 𝑥𝑥̅ + 1.645 × = 47.1662,49.6338 .
36 36
𝜎𝜎 𝜎𝜎
The statement 𝑃𝑃 𝑋𝑋� − 𝑧𝑧𝛼𝛼 ≤ 𝜇𝜇 ≤ 𝑋𝑋� + 𝑧𝑧𝛼𝛼 = 1 − 𝛼𝛼 cannot be interpreted to say that
2 𝑛𝑛 2 𝑛𝑛
𝜎𝜎 𝜎𝜎
the probability that the population mean 𝜇𝜇 falls inside the interval 𝑋𝑋� − 𝑧𝑧𝛼𝛼 , 𝑋𝑋� + 𝑧𝑧𝛼𝛼 is
2 𝑛𝑛 2 𝑛𝑛
1 − 𝛼𝛼. The correct interpretation is the followings:
• Suppose we take a large number of samples.
• We calculate a 95% confidence interval for each sample.
• Then, we expect that 95% of the intervals contain the actual unknown 𝜇𝜇.
If a confidence interval for a parameter 𝜃𝜃 is 𝐿𝐿, 𝑈𝑈 , then the length of the interval is 𝑈𝑈 − 𝐿𝐿.
We are interested in obtaining intervals that are as narrow as possible. For example,
consider the following two cases:
• We can be 95% confident that the average amount of money spent monthly on housing
in the U.S. is between $300 and $3300.
• We can be 95% confident that the average amount of money spent monthly on housing
in the U.S. is between $1100 and $1300.
In the first statement, the average amount of money spent monthly can be anywhere
between $300 and $3300, whereas, for the second statement, the average amount has
been narrowed down to somewhere between $1100 and $1300. So, of course, we would
prefer to make the second statement, because it gives us a more specific range of the
magnitude of the population mean.
Theorem. If 𝑋𝑋1 , 𝑋𝑋2 , … , 𝑋𝑋𝑛𝑛 are a random sample from 𝑛𝑛 𝜇𝜇, 𝜎𝜎 2 distribution, then a 1 − 𝛼𝛼
𝑆𝑆
�
confidence interval for the population mean 𝜇𝜇 is 𝑋𝑋 ± 𝑡𝑡𝛼𝛼,𝑛𝑛−1 .
2 𝑛𝑛
�
𝑋𝑋−𝜇𝜇
Note that 𝑇𝑇 = is a pivotal quantity.
𝑆𝑆/ 𝑛𝑛
Non-normal data
𝜎𝜎 2
By the Central Limit Theorem, the large sample distribution of 𝑋𝑋� is 𝑛𝑛 , irrespective
𝜇𝜇,
𝑛𝑛
of whether the data 𝑋𝑋1 , 𝑋𝑋2 , … , 𝑋𝑋𝑛𝑛 are normally distributed. Since 𝑡𝑡𝑛𝑛 ⟶ 𝑛𝑛 0,1 , as 𝑛𝑛 →
�
𝑋𝑋−𝜇𝜇
∞, the large sample distribution of 𝑇𝑇 = can be approximated by the standard
𝑆𝑆/ 𝑛𝑛
𝑠𝑠 𝑠𝑠
normal distribution. Thus, the two intervals 𝑥𝑥̅ ± 𝑡𝑡 𝛼𝛼
,𝑛𝑛−1 and 𝑥𝑥̅ ± 𝑧𝑧 𝛼𝛼 give similar
2 𝑛𝑛 2 𝑛𝑛
results for large samples.
Therefore, a rule of thumb is that we should use the t-interval for the mean, 𝑥𝑥̅ ±
𝑠𝑠
𝑡𝑡𝛼𝛼,𝑛𝑛−1 if the sample size is large enough.
2 𝑛𝑛
Example. A random sample of 64 guinea pigs yielded the following survival times (in
days):
36,18,91,89,87,86,52,50,149,120,
119,118,115,114,114,108,102,189,178,173,
167,167,166,165,160,216,212,209,292,279,
278,273,341,382,380,367,355,446,432,421,
641,638,637,634,621,608,607,603,688,685,
663,650,735,725
What is the mean survival time (in days) of the population of guinea pigs?
1 1
When 𝜎𝜎 is known, a 1 − 𝛼𝛼 confidence interval for 𝜇𝜇𝑋𝑋 − 𝜇𝜇𝑌𝑌 is 𝑋𝑋� − 𝑌𝑌� ± 𝑧𝑧𝛼𝛼 𝜎𝜎
2
+ .
2 𝑚𝑚 𝑛𝑛
2 𝑘𝑘 + ℎ 1
𝑈𝑈 + 𝑉𝑉~𝜒𝜒𝑘𝑘+ℎ =Γ , .
2 2
STAT 2006 - Jan 2021 54
Confidence intervals for means – Two samples
The Two-sample t Test: The case of Equal Variances
By the definition of t-distribution, the random variable
𝑋𝑋� − 𝑌𝑌� − 𝜇𝜇𝑋𝑋 − 𝜇𝜇𝑌𝑌
1 1
𝜎𝜎 𝑛𝑛 + 𝑚𝑚 𝑋𝑋� − 𝑌𝑌� − 𝜇𝜇𝑋𝑋 − 𝜇𝜇𝑌𝑌
𝑇𝑇 = = ~𝑡𝑡𝑚𝑚+𝑛𝑛−2 .
𝑚𝑚 − 1 𝑆𝑆𝑋𝑋2 + 𝑛𝑛 − 1 𝑆𝑆𝑌𝑌2 𝑆𝑆𝑝𝑝
1 1
+
𝜎𝜎 2 𝑛𝑛 𝑚𝑚
𝑚𝑚 + 𝑛𝑛 − 2
1 1
Thus, a 1 − 𝛼𝛼 confidence interval for for 𝜇𝜇𝑋𝑋 − 𝜇𝜇𝑌𝑌 is 𝑋𝑋� − 𝑌𝑌� ± 𝑡𝑡𝛼𝛼,𝑚𝑚+𝑛𝑛−2 𝑆𝑆𝑝𝑝 + .
2 𝑚𝑚 𝑛𝑛
dinopis 12.9, 10.2, 7.4, 7.0, 10.5, 11.9, 7.1, 9.9, 14.4, 11.3
menneus 11.2, 6.5, 10.9, 13.0, 10.1, 5.3, 7.5, 10.3, 9.2, 8.8
What is the difference, if any, in the mean size of the prey (of the entire populations) of
the two species?
The standard deviation of dinopis is 2.5136 and that of menneus is 2.3294. Since the two
standard deviations are close, we can assume that the variances of the two populations
are similar.
Let 𝑋𝑋1 , 𝑌𝑌1 , 𝑋𝑋2 , 𝑌𝑌2 , … , 𝑋𝑋𝑛𝑛 , 𝑌𝑌𝑛𝑛 be 𝑛𝑛 pairs of dependent measurements. Example. the
weight before and after an exercise. The objective is to construct a 1 − 𝛼𝛼 confidence
interval for 𝜇𝜇𝑋𝑋 − 𝜇𝜇𝑌𝑌 .
Then 𝐷𝐷𝑖𝑖 = 𝑋𝑋𝑖𝑖 − 𝑌𝑌𝑖𝑖 , 𝑖𝑖 = 1,2, … , 𝑛𝑛 form a random sample from 𝑛𝑛 𝜇𝜇𝑋𝑋 − 𝜇𝜇𝑌𝑌 , 𝜎𝜎 2 .
� − 𝜇𝜇𝑋𝑋 − 𝜇𝜇𝑌𝑌
𝐷𝐷
𝑇𝑇 = ~𝑡𝑡𝑛𝑛−1 .
𝑆𝑆𝐷𝐷
𝑛𝑛
Hence, a 1 − 𝛼𝛼 confidence interval for 𝜇𝜇𝑋𝑋 − 𝜇𝜇𝑌𝑌 is given by
𝑆𝑆𝐷𝐷 𝑆𝑆𝐷𝐷
� − 𝑡𝑡𝛼𝛼
𝐷𝐷 �
, 𝐷𝐷 + 𝑡𝑡𝛼𝛼,𝑛𝑛−1 .
2 ,𝑛𝑛−1 𝑛𝑛 2 𝑛𝑛
Example. An experiment was conducted to compare people's reaction times to a red light
versus a green light. When signaled with either the red or the green light, the subject was
asked to hit a switch to turn off the light. When the switch was hit, a clock was turned off
and the reaction time in seconds was recorded. The following results give the reaction
times for eight subjects.
From the data, 𝐷𝐷 � = −0.0675 and 𝑆𝑆𝐷𝐷 = 0.0798. Hence, a 95% confidence interval for
𝜇𝜇𝐷𝐷 = 𝜇𝜇𝑋𝑋 − 𝜇𝜇𝑌𝑌 is
0.0798 0.0798
−0.0675 − 2.365 , −0.0675 + 2.365 = −0.1342, −0.00081 .
8 8
Since the entire 95% confidence interval is negative, we are 95% confidence that people
react faster to a red light.
Pair 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Unaffect 1.94 1.44 1.56 1.58 2.06 1.66 1.75 1.77 1.78 1.92 1.25 1.93 2.04 1.62 2.08
Affect 1.27 1.63 1.47 1.39 1.93 1.26 1.71 1.67 1.28 1.85 1.02 1.34 2.02 1.59 1.97
A large candy manufacturer produces, packages and sells packs of candy targeted to
weigh 52 grams. A quality control manager working for the company was concerned that
the variation in the actual weights of the targeted 52-gram packs was larger than
acceptable. That is, he was concerned that some packs weighed significantly less than 52-
grams and some weighed significantly more than 52 grams. In an attempt to estimate 𝜎𝜎,
the standard deviation of the weights of all of the 52-gram packs the manufacturer
makes, he took a random sample of 𝑛𝑛 = 10 packs off of the factory line. The random
sample yielded a sample variance of 4.2 grams. Use the random sample to derive a 95%
confidence interval for 𝜎𝜎.
2 2
Answer. 𝑆𝑆 = 4.2, 𝑛𝑛 = 10, 𝜒𝜒0.025,𝑛𝑛−1 = 19.02, and 𝜒𝜒0.975,𝑛𝑛−1 = 2.70. A 95% confidence
𝑛𝑛−1 𝑛𝑛−1
interval is 𝑆𝑆 2
𝜒𝜒𝛼𝛼
, 𝑆𝑆
𝜒𝜒2 𝛼𝛼
= 1.41,3.74 .
2 ,𝑛𝑛−1
1− ,𝑛𝑛−1
2
Note that
𝑛𝑛 − 1 𝑆𝑆𝑋𝑋2 2
𝑚𝑚 − 1 𝑆𝑆 2
𝑌𝑌 2
2 ~𝜒𝜒𝑛𝑛−1 and 2 ~𝜒𝜒𝑚𝑚−1 .
𝜎𝜎𝑋𝑋 𝜎𝜎𝑌𝑌
Since 𝑆𝑆𝑋𝑋2 and 𝑆𝑆𝑌𝑌2 are independent,
𝑚𝑚 − 1 𝑆𝑆𝑌𝑌2
𝑆𝑆𝑌𝑌2 𝜎𝜎𝑋𝑋2 𝜎𝜎𝑌𝑌2 𝑚𝑚 − 1
2� 2 = 2 ~𝐹𝐹𝑚𝑚−1,𝑛𝑛−1 .
𝑆𝑆𝑋𝑋 𝜎𝜎𝑌𝑌 𝑛𝑛 − 1 𝑆𝑆𝑋𝑋
𝜎𝜎𝑋𝑋2 𝑛𝑛 − 1
𝑆𝑆𝑌𝑌2 2
𝜎𝜎𝑋𝑋
Hence, 2 � is a pivotal quantity.
𝑆𝑆𝑋𝑋 𝜎𝜎𝑌𝑌2
𝑆𝑆𝑌𝑌2 𝜎𝜎𝑋𝑋2
1 − 𝛼𝛼 = 𝑃𝑃 𝐹𝐹1−𝛼𝛼,𝑚𝑚−1,𝑛𝑛−1 ≤ 2 � 2 ≤ 𝐹𝐹𝛼𝛼,𝑚𝑚−1,𝑛𝑛−1
2 𝑆𝑆𝑋𝑋 𝜎𝜎𝑌𝑌 2
𝑆𝑆𝑋𝑋2 𝜎𝜎𝑋𝑋2 𝑆𝑆𝑋𝑋2
= 𝑃𝑃 𝐹𝐹1−𝛼𝛼,𝑚𝑚−1,𝑛𝑛−1 2 ≤ 2 ≤ 𝐹𝐹𝛼𝛼,𝑚𝑚−1,𝑛𝑛−1 2
2 𝑆𝑆𝑌𝑌 𝜎𝜎𝑌𝑌 2 𝑆𝑆𝑌𝑌
1 𝑆𝑆𝑋𝑋2 𝜎𝜎𝑋𝑋2 𝑆𝑆𝑋𝑋2
= 𝑃𝑃 2 ≤ 2 ≤ 𝐹𝐹𝛼𝛼,𝑚𝑚−1,𝑛𝑛−1 2
𝐹𝐹𝛼𝛼,𝑛𝑛−1,𝑚𝑚−1 𝑆𝑆𝑌𝑌 𝜎𝜎𝑌𝑌 2 𝑆𝑆𝑌𝑌
2
2
𝜎𝜎𝑋𝑋
A 1 − 𝛼𝛼 confidence interval for is given by
𝜎𝜎𝑌𝑌2
Example. We surveyed 𝑛𝑛 = 418 Hong Kong citizens about their opinions on insurance
rates. Of the 418 surveyed, 𝑌𝑌 = 218 blamed rising private health premiums. The sample
proportion is
280
𝑝𝑝̂ = = 0.67.
418
Estimate, with 95% confidence, the proportion of all Hong Kong citizens who blame rising
health insurance premiums.
Answer. With 𝑧𝑧0.025 = 1.96, a 95% confidence interval for 𝑝𝑝 is
𝑝𝑝̂ 1 − 𝑝𝑝̂ 𝑝𝑝̂ 1 − 𝑝𝑝̂
𝑝𝑝̂ − 𝑧𝑧0.025 , 𝑝𝑝̂ + 𝑧𝑧0.025 = 0.625,0.715 .
𝑛𝑛 𝑛𝑛
Suppose that 𝑌𝑌1 ~Binomial 𝑛𝑛1 , 𝑝𝑝1 , 𝑌𝑌2 ~Binomial 𝑛𝑛2 , 𝑝𝑝2 , and 𝑌𝑌1 and 𝑌𝑌2 are independent
Define 𝛿𝛿 = 𝑝𝑝1 − 𝑝𝑝2 . Then
𝑌𝑌1 𝑌𝑌2
𝛿𝛿̂ = 𝑝𝑝̂1 − 𝑝𝑝̂ 2 = − .
𝑛𝑛1 𝑛𝑛2
Normal approximation to Binomial implies that
𝑝𝑝1 1 − 𝑝𝑝1 𝑝𝑝2 1 − 𝑝𝑝2
̂
𝛿𝛿~𝑛𝑛 𝛿𝛿, +
𝑛𝑛1 𝑛𝑛2
A 1 − 𝛼𝛼 confidence interval for 𝛿𝛿 is given by
𝑝𝑝̂1 1 − 𝑝𝑝̂1 𝑝𝑝̂ 2 1 − 𝑝𝑝̂ 2
𝛿𝛿̂ ± 𝑧𝑧𝛼𝛼 +
2 𝑛𝑛1 𝑛𝑛2
Example. Two detergents were tested for their ability to remove stains of a certain type.
An inspector judged the first one to be successful on 63 out of 91 independent trials and
the second one to be successful on 42 out of 79 independent trials. The respective relative
frequencies of success are 0.692 and 0.532. An approximate 90% confidence interval for
the difference 𝑝𝑝1 − 𝑝𝑝2 of the two detergents is
Find a 95% confidence interval for the difference in proportions of all women with anemia
in developing countries and all women from developed countries with anemia.
Answer. A 95% confidence interval for the difference in proportions is
0.4 × 0.6 0.17 × 0.83
0.40 − 0.17 ± 1.96 + = 0.203,0.257 .
2100 1900
To estimate 𝜇𝜇 with a maximum error 𝜀𝜀 > 0. That is 𝑥𝑥̅ − 𝜇𝜇 < 𝜀𝜀. Since a 1 − 𝛼𝛼 confidence
𝑠𝑠 𝑠𝑠
interval for 𝜇𝜇 is 𝑥𝑥̅ ± 𝑡𝑡 ,𝑛𝑛−1 , it follows that 𝑡𝑡 ,𝑛𝑛−1
𝛼𝛼 𝛼𝛼 < 𝜀𝜀. Thus,
2 𝑛𝑛 2 𝑛𝑛
𝑠𝑠 2
𝑛𝑛 ≥ 𝑡𝑡𝛼𝛼2,𝑛𝑛−1 2 .
2 𝜀𝜀
If 𝑛𝑛 is a large value, 𝑡𝑡𝛼𝛼,𝑛𝑛−1 ≈ 𝑧𝑧𝛼𝛼 . We have
2 2
𝑠𝑠 2
𝑛𝑛 ≥ 𝑧𝑧𝛼𝛼2 2 .
2 𝜀𝜀
To estimate 𝑝𝑝 with a maximum error 𝜀𝜀 > 0. That is 𝑥𝑥̅ − 𝑝𝑝 < 𝜀𝜀. Since a 1 − 𝛼𝛼 confidence
𝑝𝑝� 1−𝑝𝑝� 𝑝𝑝� 1−𝑝𝑝�
interval for 𝑝𝑝 is 𝑝𝑝̂ ± 𝑧𝑧𝛼𝛼 , it follows that 𝑧𝑧𝛼𝛼 < 𝜀𝜀. Thus,
2 𝑛𝑛 2 𝑛𝑛
𝑝𝑝̂ 1 − 𝑝𝑝̂
𝑛𝑛 ≥ 𝑧𝑧𝛼𝛼2 2
.
2 𝜀𝜀
We want to construct a 95% confidence interval for with a margin of error equal to 4%.
Because there is no estimate of the proportion given, we use 𝑝𝑝̂ = 0.5 for a conservative
estimate.
2
𝑝𝑝̂ 1 − 𝑝𝑝̂ 2
0.5 × 0.5
𝑛𝑛 ≥ 𝑧𝑧0.025 2
= 1.96 × 2
= 600.23.
𝜀𝜀 0.04
We should obtain a sample of at least 𝑛𝑛 = 601.
Consider a population of size 𝑁𝑁. Suppose that there are 𝑁𝑁1 respondents (𝑁𝑁1 is unknown)
in the population who would answer yes to a particular question. The true proportion of
yes respondents is
𝑁𝑁1
𝑝𝑝 = .
𝑁𝑁
Let 𝑋𝑋1 , 𝑋𝑋2 , … , 𝑋𝑋𝑛𝑛 be a random sample of size 𝑛𝑛 without replacement from the population.
𝑛𝑛
Define 𝑋𝑋𝑖𝑖 = 1 if respondent 𝑖𝑖 answers yes to a particular question. Then, 𝑋𝑋 = � 𝑋𝑋𝑗𝑗 is
𝑗𝑗=1
the number of respondents in the sample who answers yes to the question. It is known
that 𝑋𝑋 has a hypergeometric distribution with mean 𝐸𝐸 𝑋𝑋 = 𝑛𝑛𝑛𝑛 and 𝑉𝑉𝑉𝑉𝑉𝑉 𝑋𝑋 =
𝑁𝑁−𝑛𝑛
𝑛𝑛𝑛𝑛 1 − 𝑝𝑝 .
𝑁𝑁−1
Hence, using the Central Limit Theorem, an approximate 1 − 𝛼𝛼 confidence interval for 𝑝𝑝 is
𝑝𝑝̂ 1 − 𝑝𝑝̂ 𝑁𝑁 − 𝑛𝑛
𝑝𝑝̂ ± 𝑧𝑧𝛼𝛼 � ,
2 𝑛𝑛 𝑁𝑁 − 1
�
where 𝑝𝑝̂ = 𝑋𝑋.
If we want to determine the sample size 𝑛𝑛 so that the error in estimating 𝑝𝑝 is no larger
than 𝜀𝜀 > 0, we require that
𝑝𝑝̂ 1 − 𝑝𝑝̂ 𝑁𝑁 − 𝑛𝑛 2 𝑝𝑝̂ 1 − 𝑝𝑝̂ 𝑁𝑁 − 𝑛𝑛
𝑧𝑧𝛼𝛼 � ≤ 𝜀𝜀 ⟹ 𝑧𝑧𝛼𝛼 � ≤ 𝜀𝜀 2 .
2 𝑛𝑛 𝑁𝑁 − 1 2 𝑛𝑛 𝑁𝑁 − 1
𝑝𝑝� 1−𝑝𝑝�
Let 𝑚𝑚 = 𝑧𝑧𝛼𝛼2 . Solving for 𝑛𝑛, we get
2
𝜀𝜀 2
𝑚𝑚𝑚𝑚
𝑛𝑛 ≥ .
𝑁𝑁 − 1 + 𝑚𝑚
A researcher is studying the population of a small town in India of 𝑁𝑁 = 2000 people. She's
interested in estimating 𝑝𝑝 for several yes/no questions on a survey. How many people 𝑛𝑛
does she have to randomly sample (without replacement) to ensure that her estimates 𝑝𝑝̂
are within 𝜀𝜀 = 0.04 of the true proportion 𝑝𝑝?
Answer.
1 2 𝑝𝑝� 1−𝑝𝑝�
2× 0.25
Since 𝑝𝑝̂ 1 − 𝑝𝑝̂ ≤ , we calculate 𝑚𝑚 as 𝑚𝑚 = 𝑧𝑧0.025 = 1.96 = 600.25 =
4 𝜀𝜀 2 0.04 2
601. For 95% confidence, the sample size 𝑛𝑛 we require is that
𝑚𝑚𝑚𝑚 601 × 2000
𝑛𝑛 ≥ = = 462.3.
𝑁𝑁 − 1 + 𝑚𝑚 2000 − 1 + 601
Thus, we require 463 people to estimate 𝑝𝑝 with 95% confidence.