0% found this document useful (0 votes)
4 views

Chapter_5_One_sample_testing

Chapter 5 discusses hypothesis testing, focusing on one-sample tests for means and proportions. It provides examples of testing hypotheses about population means with known and unknown variances, including the construction of rejection regions and significance levels. The chapter also covers the concept of P-values and confidence intervals in the context of hypothesis testing.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

Chapter_5_One_sample_testing

Chapter 5 discusses hypothesis testing, focusing on one-sample tests for means and proportions. It provides examples of testing hypotheses about population means with known and unknown variances, including the construction of rejection regions and significance levels. The chapter also covers the concept of P-values and confidence intervals in the context of hypothesis testing.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 27

Chapter 5: Hypotheses.

One sample testing

Phan Thi Khanh Van

E-mail: [email protected]

Ngày 31 tháng 3 năm 2025

(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

1 The principle of hypothesis testing

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?

Two possible conclusions:


- the taxis are not fuel efficient H : µ ≤ 27 (null hypothesis/ no change
hypothesis)
- or they are: H̄ : µ > 27 (alternative hypothesis).
µ0 = 27: null value

(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):

accept H if X̄ ≤ c; reject H if X̄ > c

C = {X̄ : X̄ > c}: rejection region of the test.

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 .

In this example we construct a level α = 0.05 test:


µ0 = 27, n = 9 => c = 27 + 1.64 √29 = 28.0933.
X̄ = 28.5 > c so we reject H, we conclude that the taxis meet the fuel efficiency
standard.
P value
The P-value is the smallest level of significance that would lead to rejection of the
null hypothesis H with the given data.

x̄−µ 28.5−27
P − value = P(µ > 28.5) = P(Z > √0 )
σ/ n
= P(Z > √ )
2/ 9
= 0.0122

Confidence interval approach


X̄ − µ0
X̄ > c = µ0 + Zα √σn ⇔ Zob = √ > Zα : rejection region
σ/ n
(Phan Thi Khanh Van) Chapter 5: Hypotheses. One sample testing intervals Ngày 31 tháng 3 năm 2025 5 / 27
Hypothesis test

Test of a statistical hypothesis


A procedure for deciding whether to accept or reject the null hypothesis is called a
test of a statistical hypothesis.

Hypothesis test procedure


Consider the sample W = (X1 , X2 , ..., Xn ).
Choose the statistic G = f (X1 , X2 , ..., Xn , θ) and the test criteria.
Given the significance level α, find the rejection region Wα :
P(G ∈ Wα |H) = α.
Choose Wα such that P(G ∈ Wα |H̄) = 1 − β → max.
Some type of the alternative hypothesis of H : µ = µ0
H̄ : µ < µ0 , the rejection region: Wα = (−∞, L).
H̄ : µ > µ0 , the rejection region: Wα = (U, ∞).
H̄ : µ 6= µ0 , the rejection region: Wα = (−∞, L) ∪ (U, ∞).

(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

X comes from an arbitrary distribution with unknown mean µ and unknown


variance σ. We make the additional assumption that the sample size n is large

√ n ≥ 30, using the Central limit theorem, we have


enough:
n(X̄ − µ)
Z= ∼ N (0, 1), where s 2 is the adjusted sample variance:
s
P (Xi − X̄ )2
s2 = .
n n−1
The hypothesis H : µ = µ0 with the significance level α. The rejection regions are
as follows if
X̄ −µ
H̄ : µ < µ0 , Wα : Zob = √0
s/ n
< −Zα
X̄ −µ
H̄ : µ > µ0 , Wα : Zob = √0
s/ n
> Zα
X̄ −µ
H̄ : µ 6= µ0 , Wα : |Zob | = √0
s/ n
> Zα/2

(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?

Alternative hypothesis: H̄ : µ < µ0 .


α = 0.05, zα = 1.64.
x̄ − µ0
Zob = √ = −1.8257 < −1.64 = −zα .
σ/ n
So, we reject the hypothesis H.

(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

X ∼ N (µ, σ 2 ), where µ and σ are unknown.


√ We consider the cases when the
n(X̄ − µ)
sample size n < 30. We have T = is Tn−1 distributed (n − 1 is the
s
degree of freedom).
The hypothesis H : µ = µ0 with the significance level α. The rejection regions are
as follows if
X̄ −µ
H̄ : µ < µ0 , Wα : Tob = √0
s/ n
< −Tn−1,α
X̄ −µ
H̄ : µ > µ0 , Wα : Tob = √0
s/ n
> Tn−1,α
X̄ −µ
H̄ : µ 6= µ0 , Wα : |Tob | = √0
s/ n
> Tn−1,α/2

(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.

α = 0.05, tα,n−1 = 2.015.


x̄ − µ0
Tob = √ = −1.8371 > −2.015 = −tα,n−1 .
s/ n
So, we do not reject the hypothesis H, conclude that the concentration of arsenic
in the copper ore is not less than 0.2%.

(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

The rejection regions are as follows if


H̄ : p < p0 , Wα : Zob < −Zα
H̄ : p > p0 , Wα : Zob > Zα
H̄ : p 6= p0 , Wα : |Zob | > Zα/2

(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?

n = 145, p0 = 0.85, α = 0.03, Zα/2 = 2.17.


Let p be the proportion of customers satisfied with the company’s service.
Hypothesis: H : p = p0 against H̄ : p 6= p0 .

(p−p0 ) n
We have Z = √ ∼ N (0, 1)).
p0 (1−p0 )
120
The sample proportion: p̂ = 145 = 0.8276.

(p̂−p0 ) n
|Zob | = √ = 0.7559 < Zα/2 : we won’t reject H, the company’s data
p0 (1−p0 )
can 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.

n = 6, µ0 = 0.2, σ = 0.04, Z0.05 = 1.64.


X̄ −µ
Zob = σ/ n
√0 = −1.837 < −Z0.05 : we reject H, we conclude that the
concentration of arsenic in the copper ore is below 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?

Let p be the recovery rate of patients being cured with drug B.


903
n = 1100, p̂ = 1100 = 0.8209.
Hypothesis H : p = 0.85 (B is not less effective than A), H̄ : p < 0.85 (B is less
effective than A).
α = 0.04, Zα = 1.75.

Zob = 1100(0.8209−0.85)
√ = −2.7029 < −1.75.
0.85(1−0.85)
So H is rejected, B is less effective than A.

(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.

Let X be the freezing point of the milk in the imported containers.


X̄ = −0.55, µ0 = −0.545, σ = 0.008.
Hypothesis H : µ ≥ −0.545 (milk was not added with water) against
H̄ : µ < −0.545 (milk was added with water).
n = 25, α = 0.01, Zα = 2.33, .

25(−0.55+0.545)
Zob = 0.008 = −3.125 < −2.33 = −Zα . So H is rejected. We conclude
that the milk was added with water.

(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

At 5% significance level, decide whether to change the processing time in this


workshop or not?

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.

Let X be the content of containers of a particular lubricant.


µ0 = 10, n = 10, X̄ = 10.06, s = 0.2459
Hypothesis H : µ = 10 against H̄ : µ 6= 10
α = 0.01, tα/2,n−1 = 3.25

10(10.06−10)
|Tob | = 0.2459 = 0.7716 < 3.25
So we won’t reject H.

(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

You might also like