Chapter_5_One_sample_testing
Chapter_5_One_sample_testing
E-mail: [email protected]
(Phan Thi Khanh Van) Chapter 5: Hypotheses. One sample testing intervals Ngày 31 tháng 3 năm 2025 1 / 27
Table of Contents
2 Comparing means
3 Comparing proportions
4 Exercises
(Phan Thi Khanh Van) Chapter 5: Hypotheses. One sample testing intervals Ngày 31 tháng 3 năm 2025 2 / 27
Example: Testing a hypothesis about a population mean, variance
known
From experimental data it is known that the fuel efficiency of a taxi, measured in
miles per gallon (mpg), is normally distributed: N (µ, σ 2 ). In order to reduce fuel
costs a taxi company plans to order a fleet of taxis, provided the fuel efficiency of
the new fleet exceeds 27 mpg. We assume the standard deviation is known, with
value σ = 2. To determine whether or not the new taxis meet the standard, 9 of
them are randomly selected and the average mpg was recorded as X̄ = 28.5. On
the basis of these data, is it plausible to conclude that the taxis meet the fuel
efficiency standard of 27 mpg?
(Phan Thi Khanh Van) Chapter 5: Hypotheses. One sample testing intervals Ngày 31 tháng 3 năm 2025 3 / 27
Choose c > µ0 : cutoff value for the following decision procedure (test of a
statistical hypothesis):
H is true H is false
Test Statistic X̄ µ ≤ µ0 µ > µ0
X̄ ≤ c (accept H) correct desicion type II error
X̄ > c (reject H) type I error correct desicion
2
We have X̄ ∼ N (µ, σn ).
Probability of type I error:
√ √ √
n(X̄ −µ0 ) n(c−µ0 ) n(c−µ0 )
α = P(X̄ > c|H) = P( σ > σ ) = 1 − Φ( σ )
- the significance level of the test (size of the rejection region). Therefore,
c = µ0 + zα √σn .
Probability of type II error: β = P(X̄ ≤ c|H̄). 1 − β is called the power of the
test.
(Phan Thi Khanh Van) Chapter 5: Hypotheses. One sample testing intervals Ngày 31 tháng 3 năm 2025 4 / 27
Constructing a level α test
The cutoff value c corresponding to a level α test of H : µ ≤ µ0 against
H̄ : µ > µ0 is given by c = µ0 + zα √σn .
x̄−µ 28.5−27
P − value = P(µ > 28.5) = P(Z > √0 )
σ/ n
= P(Z > √ )
2/ 9
= 0.0122
(Phan Thi Khanh Van) Chapter 5: Hypotheses. One sample testing intervals Ngày 31 tháng 3 năm 2025 6 / 27
Testing a hypothesis about the mean of a normal
distribution, variance known
X ∼ N (µ, σ 2 ), where σ is known. The hypothesis H : µ = µ0 with the
significance level α. The rejection regions are as follows if
X̄ −µ
H̄ : µ < µ0 , Wα : Zob = σ/ n
√0 < −Zα
X̄ −µ
H̄ : µ > µ0 , Wα : Zob = σ/ n
√0 > Zα
X̄ −µ
H̄ : µ 6= µ0 , Wα : |Zob | = σ/ n
√0 > Zα/2
(Phan Thi Khanh Van) Chapter 5: Hypotheses. One sample testing intervals Ngày 31 tháng 3 năm 2025 7 / 27
Example: Testing a hypothesis about a population mean of a normal
distribution, variance known
The resistors produced by a manufacturer are required to have a resistance of
µ0 = 0.150 ohms. Statistical analysis of the output suggests that the resistances
can be approximated by a normal distribution N (µ, σ 2 ) with known standard
deviation σ = 0.005. A random sample of n = 10 resistors is drawn and the
sample mean is found to be x̄ = 0.152. Test, at the 5% level, the hypothesis that
the resistors are conforming.
Alternative hypothesis: H̄ : µ 6= µ0 .
α = 0.05, zα/2 = 1.96.
x̄ − µ0
Zob = √ = 1.2649.
σ/ n
Because |Zob | < 1.96, we conclude that the resistors are conforming.
(Phan Thi Khanh Van) Chapter 5: Hypotheses. One sample testing intervals Ngày 31 tháng 3 năm 2025 8 / 27
Large Sample Tests Concerning the Mean of an Arbitrary
Distribution, variance unknown
(Phan Thi Khanh Van) Chapter 5: Hypotheses. One sample testing intervals Ngày 31 tháng 3 năm 2025 9 / 27
Example: Testing a hypothesis about a population mean, variance
unknown
A laboratory makes n = 30 determinations of the concentration µ of an impurity
in an ore and obtains the result that x̄ = 0.09% and s = 0.03%. If µ ≥ 0.10% the
ore cannot be used without additional processing. consequently, we want to test
H : µ ≥ 0.1 against H̄ : µ < 0.1. At the 5% level how plausible is the null
hypothesis given that x̄ = 0.09?
(Phan Thi Khanh Van) Chapter 5: Hypotheses. One sample testing intervals Ngày 31 tháng 3 năm 2025 10 / 27
Tests Concerning the Mean of a Normal Distribution with
Unknown Variance
(Phan Thi Khanh Van) Chapter 5: Hypotheses. One sample testing intervals Ngày 31 tháng 3 năm 2025 11 / 27
Example: Testing a hypothesis about a population mean, variance
unknown
The problem of determining the concentration of arsenic in copper, measured as a
percentage, is of considerable importance since the presence of even a small
amount can significantly increase the copper’s electrical resistance. A laboratory
makes n = 6 measurements of the concentration of arsenic in copper, with the
result x̄ = 0.17 and sample standard deviation s = 0.04. Assuming that the data
come from a normal distribution test (at the 5% level) the null hypothesis
H : µ = 0.20 against H̄ : µ < 0.20.
(Phan Thi Khanh Van) Chapter 5: Hypotheses. One sample testing intervals Ngày 31 tháng 3 năm 2025 12 / 27
H̄ Rejection region
√
(x̄ − µ0 ) n
X ∼ N (µ, σ 2 ) µ < µ0 Zob = < −Zα
σ √
(x̄ − µ0 ) n
σ known µ > µ0 Zob = > Zα
σ √
(x̄ − µ0 ) n
µ 6= µ0 |Zob | = > Zα/2
σ√
(x̄ − µ0 ) n
X ∼ N (µ, σ 2 ) µ < µ0 Tob = < −tα,n−1
s √
(x̄ − µ0 ) n
σ unknown µ > µ0 Tob = > tα,n−1
s √
(x̄ − µ0 ) n
µ 6= µ0 |Tob | = > tα/2,n−1
s √
(x̄ − µ0 ) n
n ≥ 30 µ < µ0 Zob = < −Zα
s √
(x̄ − µ0 ) n
X has arbitrary distribution µ > µ0 Zob = > Zα
s √
(x̄ − µ0 ) n
σ unknown µ 6= µ0 |Zob | = > Zα/2
s
(Phan Thi Khanh Van) Chapter 5: Hypotheses. One sample testing intervals Ngày 31 tháng 3 năm 2025 13 / 27
Tests for the Parameter p of a Binomial Distribution
Example
The effectiveness of a medical procedure is usually determined by the number of
patients whose symptoms are relieved by the treatment. Because treatments using
powerful drugs may have severe, if not fatal, side effects, the null hypothesis is
that the treatment is ineffective; that is, it is up to the drug manufacturer to
demonstrate the effectiveness of its drug to the Food and Drug Administration
(FDA). For example, approximately 25% of babies born to HIV infected mothers
are themselves infected with the same virus. The National Institute of Allergy and
Infectious Diseases announced on Feb. 22, 1994 that giving the drug AZT to
infected mothers reduced the infection rate to 8%—a three-fold reduction in the
rate of infection! To put it another way, approximately 75% of babies born to HIV
infected mothers do not have the HIV virus, but for those mothers treated with
AZT the percentage increased to 92%. The results were regarded as so significant
that clinics participating in the trials were advised to offer AZT to the women and
babies in the control group.
(Phan Thi Khanh Van) Chapter 5: Hypotheses. One sample testing intervals Ngày 31 tháng 3 năm 2025 14 / 27
Tests for the Parameter p of a Binomial Distribution (Large sample)
Let p be the proportion of elements that have the property X in a population.Let
X be number of elements that have the property X in the sample of size n the
sample proportion p̂ = Xn . We consider the cases when the sample size is large
enough (np ≥ 5, n(1 − p) ≥ 5) so that the normal approximation is valid.
The hypothesis H : p = p0 with the significance level α.
(p̂−p0 )
Zob = q
p0 (1−p0 )
n
(Phan Thi Khanh Van) Chapter 5: Hypotheses. One sample testing intervals Ngày 31 tháng 3 năm 2025 15 / 27
Example
The natural recovery rate from the disease is 40% and the treatment group now
consists of n = 200 patients, 90 of whom recovered, so p̂ = 0.45. The question is
this: Can we conclude, at the 5% significance level, that the drug is effective?
Let p be the proportion of patients that recover from the disease in the treatment
group.
Hypothesis: H : p = p0 (the drug is not effective) against H̄ : p > p0 (the drug is
effective).
n = 200, p0 = 0.4, α = 0.05, Zα = 1.64.
√
(p−p0 ) n
We have Z = √ ∼ N (0, 1)).
p0 (1−p0 )
The sample proportion: p̂ = 0.45.
√
(p̂−p0 ) n
Zob = √ = 1.4434 < 1.64 = Zα : we do not reject H, the treatment can
p0 (1−p0 )
not be considered effective.
(Phan Thi Khanh Van) Chapter 5: Hypotheses. One sample testing intervals Ngày 31 tháng 3 năm 2025 16 / 27
Example
According to the publication data of a service company, the proportion of
customers satisfied with the company’s service is 85%. An independent survey
showed that out of the company’s 145 customers, there are 120 satisfied
customers. At the 3% level of significance, can the company’s data be considered
reliable?
(Phan Thi Khanh Van) Chapter 5: Hypotheses. One sample testing intervals Ngày 31 tháng 3 năm 2025 17 / 27
Example
The problem of determining the concentration of arsenic in copper, measured as a
percentage, is of considerable importance since the presence of even a small
amount can significantly increase the copper’s electrical resistance. A laboratory
makes n = 6 measurements of the concentration of arsenic in copper, with the
result X̄ = 0.17%. We assume that the data come from a normal distribution with
σ = 0.04. The copper can not be used if the concentration of arsenic in copper
exceeds 0.2%. Construct a 5% level test of the null hypothesis H : µ ≥ 0.2 against
H̄ : µ < 0.2.
(Phan Thi Khanh Van) Chapter 5: Hypotheses. One sample testing intervals Ngày 31 tháng 3 năm 2025 18 / 27
Exercise 1
According to a company standard, a batch of products is rejected if there are
more than 3% defective items in the batch. Randomly check 400 products from
this batch and 16 defectives ones were found. At 5% significance level, is this
batch acceptable?
16
n = 400, p̂ = 400 = 0.04.
Hypothesis H : p ≤ 0.03 (the batch is accepted), H̄ : p > 0.03 (the batch is
rejected).
α = 0.05, Zα = 1.64.
√
Zob = √400(0.04−0.03) = 1.172 < 1.64.
0.03(1−0.03)
So H is not rejected, the batch is acceptable.
(Phan Thi Khanh Van) Chapter 5: Hypotheses. One sample testing intervals Ngày 31 tháng 3 năm 2025 19 / 27
Exercise 2
The recovery rate of patients being cured with drug A is 85%. When using B to
treat, out of 1100 patients, we found that 903 people recovered. Can we conclude
that drug B is less effective than drug A at the 4% significance level?
(Phan Thi Khanh Van) Chapter 5: Hypotheses. One sample testing intervals Ngày 31 tháng 3 năm 2025 20 / 27
Exercise 3
A company suspects that the milk suppliers has added water to milk to increase
their delivery quantities. If milk is mixed with more water than normal, its freezing
point will be lower than natural milk. Given that the freezing point of natural milk
follows a normal distribution with the mean −0.545o C and the standard deviation
0.008o C . People checked the quality of milk in the imported containers by taking
out a sample of size n = 25 and found that the average freezing temperature of
milk in the sample was −0.55o C . Make a conclusion about the quality of the milk
at the 1% significance level.
(Phan Thi Khanh Van) Chapter 5: Hypotheses. One sample testing intervals Ngày 31 tháng 3 năm 2025 21 / 27
Exercise 4
A technical improvement has been made in carburetor cars to improve the
efficiency. Let the car drive 12 times, the number of kilometers the car can run
with 1 liter of gasoline are given as follows
20.6, 20.5, 20.8, 20.8, 20.7, 20.6, 21, 20.6, 20.5, 20.4, 20.3, 20.7. If before the
improvement, the average number of kilometers the car can run with 1 liter of
gasoline is normally distributed with the mean 20.4 km. Can we end up with a
significant improvement, at a significance level of 5%?
Let X be the number of kilometers the car can run with 1 liter of gasoline after
the improvement. qP
2
n (Xi −X̄ )
n = 12 < 30, X̄ = 20.625, s = n−1 = 0.1913, µ0 = 20.4.
Hypothesis H : µ = 20.4 against H̄ = µ > 20.4.
α = 0.05, tα,n−1 = 1.796
√
12(20.625−20.4)
Tob = 0.0366 = 4.0741 > 1.796
So we reject H, it means that we end up with a significant improvement.
(Phan Thi Khanh Van) Chapter 5: Hypotheses. One sample testing intervals Ngày 31 tháng 3 năm 2025 22 / 27
Exercise 5
In a workshop, the processing time of a part for a worker is set at 12 minutes.
After changing the input materials, people randomly check the machining process
of 160 parts and obtain the following data:
Time (min) 10-10.5 10.5-11 11-11.5 11.5-12 12-12.5 12.5-13 13-13.5
Number of parts 4 12 26 37 43 28 10
Let X be the processing time for a part in the workshop after changing the input
materials. q
X̄ = n1 s2 = n
xi2 nni − X̄ 2 = 0.7170
P P
xi .ni = 11.9594, n−1
µ0 = 12, n = 160, α = 0.05
Hypothesis H : µ = 12 against H̄ : µ 6= 12
Zα/2 = 1.96
√
160(11.9594−12)
|Zob | = 0.7170 = 0.7163 < Z0.05
So H is not rejected, we won’t change the processing time.
(Phan Thi Khanh Van) Chapter 5: Hypotheses. One sample testing intervals Ngày 31 tháng 3 năm 2025 23 / 27
Exercise 6
In the American Heart Association journal Hypertension, researchers report that
individuals who practice Transcendental Meditation (TM) lower their blood
pressure significantly. If a random sample of 225 male TM practitioners meditate
for 8.5 hours per week with a standard deviation of 2.25 hours, does that suggest
that, on average, men who use TM meditate more than 8 hours per week at a
0.01 level of significance?
Let X (hours) be the time that men use TM meditate per week.
µ0 = 8, n = 225, X̄ = 8.5, s = 2.25.
Hypothesis H : µ ≤ 8 against H̄ : µ > 8.
α = 0.01, Zα = 2.32
√
225(8.5−8)
Zob = 2.25 = 3.33 > 2.32
So we reject H and conclude that men who use TM, on average, meditate more
than 8 hours per week.
(Phan Thi Khanh Van) Chapter 5: Hypotheses. One sample testing intervals Ngày 31 tháng 3 năm 2025 24 / 27
Exercise 7
Test the hypothesis that the average content of containers of a particular lubricant
is 10 liters if the contents of a random sample of 10 containers are
10.2, 9.7, 10.1, 10.3, 10.1, 9.8, 9.9, 10.4, 10.3, and 9.8 liters. Use a 0.01 level of
significance and assume that the distribution of contents is normal.
(Phan Thi Khanh Van) Chapter 5: Hypotheses. One sample testing intervals Ngày 31 tháng 3 năm 2025 25 / 27
Exercise 8
A geneticist is interested in the proportion of African males that have a certain
minor blood disorder. In a random sample of 100 African males, 24 are found to
be afflicted. Test the hypothesis that this proportion is 0.245 at a 0.01 level of
significance.
Let p be the proportion of African males that have a certain minor blood disorder.
p̂ = 0.24, n = 100, p0 = 0.245.
Hypothesis H : p = 0.245 against H̄ : p 6= 0.245
α = 0.01, Zα/2 = 2.57
√
|Zob | = √100(0.24−0.245) = 0.1163 < 2.57
0.245(1−0.245)
So H is not rejected.
(Phan Thi Khanh Van) Chapter 5: Hypotheses. One sample testing intervals Ngày 31 tháng 3 năm 2025 26 / 27
Thank you for your attention!
(Phan Thi Khanh Van) Chapter 5: Hypotheses. One sample testing intervals Ngày 31 tháng 3 năm 2025 27 / 27