Chapter 7
HYPOTHESIS TESTING
© FAROUQ MOHAMMAD A. ALAM 1
Learning Outcomes
› After studying this chapter, the student will:
1. understand how to correctly state a null and alternative
hypothesis and carry out a structured hypothesis test.
2. understand the concepts of type I error, and type II error of a
test.
3. understand how to calculate and interpret p-values.
© FAROUQ MOHAMMAD A. ALAM 2
7.1. INTRODUCTION
© FAROUQ MOHAMMAD A. ALAM 3
Basic Concepts
› A hypothesis may be defined simply as a statement about one
or more populations.
› Types of hypotheses:
– The research hypothesis is the conjecture or supposition that motivates
the research.
– Statistical hypotheses are hypotheses that are stated in such a way that
they may be evaluated by appropriate statistical techniques.
© FAROUQ MOHAMMAD A. ALAM 4
Basic Concepts (cont.)
› Types of statistical hypotheses:
– The null hypothesis 𝐻0 is a statement of agreement with conditions
presumed to be true in the population of interest. The null hypothesis is
the hypothesis that is being tested.
– The alternative hypothesis 𝐻𝐴 is a statement of what we will believe is
true if our sample data cause us to reject the null hypothesis.
– The null and alternative hypotheses are complementary. That is, the
two together exhaust all possibilities regarding the value that the
hypothesized parameter can assume.
© FAROUQ MOHAMMAD A. ALAM 5
Statistical Hypotheses for the Population Mean
Two-tailed Right-tailed Left-tailed
test test test
Null
𝑯𝟎 : 𝝁 = 𝝁𝟎 𝑯𝟎 : 𝝁 ≤ 𝝁 𝟎 𝑯𝟎 : 𝝁 ≥ 𝝁𝟎
Hypothesis
Alternative
𝑯 𝟏 : 𝝁 ≠ 𝝁𝟎 𝑯𝟏 : 𝝁 > 𝝁𝟎 𝑯 𝟏 : 𝝁 < 𝝁𝟎
Hypothesis
© FAROUQ MOHAMMAD A. ALAM 6
Statistical Hypotheses for the Population
Proportion
Two-tailed Right-tailed Left-tailed
test test test
Null
𝑯𝟎 : 𝒑 = 𝒑𝟎 𝑯𝟎 : 𝒑 ≤ 𝒑𝟎 𝑯𝟎 : 𝒑 ≥ 𝒑𝟎
Hypothesis
Alternative
𝑯𝟏 : 𝒑 ≠ 𝒑𝟎 𝑯𝟏 : 𝒑 > 𝒑𝟎 𝑯𝟏 : 𝒑 < 𝒑𝟎
Hypothesis
© FAROUQ MOHAMMAD A. ALAM 7
Test Statistics
› In the previous tables, 𝝁𝟎 and 𝒑𝟎 are called the hypothesized population
mean and proportion, respectively.
› The test statistic is some relevant statistic that may be computed from the
data of the sample which serves as a decision maker.
› The following is a general formula for a test statistic that will be applicable
in many of the hypothesis tests:
𝐫𝐞𝐥𝐞𝐯𝐚𝐧𝐭 𝐬𝐭𝐚𝐭𝐢𝐬𝐭𝐢𝐜 − 𝐡𝐲𝐩𝐨𝐭𝐡𝐞𝐬𝐢𝐳𝐞𝐝 𝐩𝐚𝐫𝐚𝐦𝐞𝐭𝐞𝐫
𝐭𝐞𝐬𝐭 𝐬𝐭𝐚𝐭𝐢𝐬𝐭𝐢𝐜 =
𝐬𝐭𝐚𝐧𝐝𝐚𝐫𝐝 𝐞𝐫𝐫𝐨𝐫 𝐨𝐟 𝐭𝐡𝐞 𝐫𝐞𝐥𝐞𝐯𝐚𝐧𝐭 𝐬𝐭𝐚𝐭𝐢𝐬𝐭𝐢𝐜
© FAROUQ MOHAMMAD A. ALAM 8
Significance Level, Types of Errors, and the p-value
› The level of significance 𝜶 is the probability of
rejecting a true null hypothesis.
› Type I error is the error committed when a true null
hypothesis is rejected.
› Type II error is the error committed when a false
null hypothesis is not rejected.
© FAROUQ MOHAMMAD A. ALAM 9
Significance Level, Types of Errors, and the p-value
(cont.)
© FAROUQ MOHAMMAD A. ALAM 10
Significance Level, Types of Errors, and the p-
value (cont.)
› The p-value is the smallest value for which we can reject a null
hypothesis.
› If the p-value is more than 𝜶 (i.e., p-value > 𝜶), the decision is
to not reject the null hypothesis.
› If the p-value is less than oe equal to 𝜶 (i.e., p-value ≤ 𝜶), the
decision is to reject the null hypothesis.
© FAROUQ MOHAMMAD A. ALAM 11
7.2 HYPOTHESIS TESTING: A SINGLE
POPULATION MEAN
© FAROUQ MOHAMMAD A. ALAM 12
Z–Test for the Population Mean
› The Z-test is a statistical test for the mean of a population. It can
be used when the population is normally distributed, and the
population standard deviation (i.e., 𝜎) is known. The formula for
the Z-test is
ഥ − 𝝁𝟎
𝒙
𝒁=
𝝈/ 𝒏
where 𝒙ഥ is the sample mean, 𝒏 is the sample size, and 𝝁𝟎
hypothesized population mean.
Z–Test for the Population Mean (cont.)
› If the sample size 𝒏 is larger (i.e., 𝒏 ≥ 𝟑𝟎), then according to the
central limit theorem, the Z-test can be used when the population
is normally distributed, and the population standard deviation is
not known. The formula for the Z-test is
ഥ − 𝝁𝟎
𝒙
𝒁=
𝒔/ 𝒏
where 𝒙ഥ is the sample mean, 𝒔 is the sample standard
deviation, and 𝝁𝟎 is the hypothesized population mean. See
Example 7.2.4.
MegaStat Application
© FAROUQ MOHAMMAD A. ALAM 15
Example 7.2.1.
› Researchers are interested in the mean age of a certain
population. Let us say that they are asking the following question:
Can we conclude that the mean age of this population is different
from 30 years? Suppose that the sample size is 10, sample mean
is equal to 𝑥ҧ = 27, while the population variance is 𝜎 2 = 20.
© FAROUQ MOHAMMAD A. ALAM 16
Example 7.2.1.
› Researchers are interested in the mean age of a certain
population. Let us say that they are asking the following question:
Can we conclude that the mean age of this population is different
from 30 years? Suppose that the sample size is 10, sample
mean is equal to 𝒙ഥ = 𝟐𝟕, while the population variance is 𝝈𝟐 =
𝟐𝟎.
© FAROUQ MOHAMMAD A. ALAM 17
Z–Test for the Population Mean
(MegaStat Application)
1. In Data Ribbon, click on
MegaStat icon, then select
Hypothesis Tests.
2. Select Proportion vs.
Hypothesized Value.
© FAROUQ MOHAMMAD A. ALAM 18
Write the following in Excel:
• (A1) =Age (variable label OR you can
write anything here!)
• (A2) =27 (sample mean)
• (A3) =SQRT(20) (population standard
deviation or sample standard deviation)
• (A4) =10 (sample size)
DO NOT CHANGE THIS ORDER!
© FAROUQ MOHAMMAD A. ALAM 19
3. Choose summary input.
4. Input range
of information.
5. Insert the value of
the Hypothesized
mean.
7. Press OK.
6. Choose “z-test”.
© FAROUQ MOHAMMAD A. ALAM 20
The value
of the test
statistics.
The p-value which is less
than 𝜶 = 𝟎. 𝟎𝟓
© FAROUQ MOHAMMAD A. ALAM 21
Example 7.2.1. (cont.)
› Since the p-value is less that 𝜶 = 𝟎. 𝟎𝟓, the null hypothesis is
rejected at the 0.05 level of significance. In other words, the
results were not significant at the 0.05 level.
› Hence, one can conclude that the population mean is not equal to
30.
© FAROUQ MOHAMMAD A. ALAM 22
Example 7.2.2.
› Researchers are interested in the mean age of a certain
population. Let us say that they are asking the following question:
Can we conclude that the mean age of this population is less than
30 years? Suppose that the sample size is 10, sample mean is
equal to 𝑥ҧ = 27, while the population variance is 𝜎 2 = 20.
© FAROUQ MOHAMMAD A. ALAM 23
Example 7.2.2.
› Researchers are interested in the mean age of a certain
population. Let us say that they are asking the following question:
Can we conclude that the mean age of this population is less
than 30 years? Suppose that the sample size is 10, sample
mean is equal to 𝒙ഥ = 𝟐𝟕, while the population variance is 𝝈𝟐 =
𝟐𝟎.
© FAROUQ MOHAMMAD A. ALAM 24
3. Choose summary input.
4. Input range
of information.
5. Insert the value of the
hypothesized mean.
[Link]
Choose“greater
“less
than”, then press
6. Choose “z-test”. OK.
© FAROUQ MOHAMMAD A. ALAM 25
The value
of the test
statistics.
The p-value which is less
than 𝜶 = 𝟎. 𝟎𝟓
© FAROUQ MOHAMMAD A. ALAM 26
Example 7.2.2. (cont.)
› Since the p-value is less that 𝜶 = 𝟎. 𝟎𝟓, the null hypothesis is
rejected at the 0.05 level of significance.
› Hence, one can conclude that the population mean is less than
30.
© FAROUQ MOHAMMAD A. ALAM 27
7.5 HYPOTHESIS TESTING: A SINGLE
POPULATION PROPORTION
© FAROUQ MOHAMMAD A. ALAM 28
Z–Test for the Population Mean
› If the sample size 𝒏 is larger (i.e., 𝒏 ≥ 𝟑𝟎), then according to the
central limit theorem, the Z-test can be considered for the
statistical hypotheses of the population proportion. The formula
for the Z-test is
ෝ − 𝒑𝟎
𝒑
𝒁=
𝒑𝟎 (𝟏 − 𝒑𝟎 )
𝒏
where 𝑝Ƹ is the sample proportion, and 𝒑𝟎 is the hypothesized
population proportion.
MegaStat Application
© FAROUQ MOHAMMAD A. ALAM 30
Example 7.5.1
› Data of 301 Hispanic women were collected. One
variable of interest was the percentage of subjects with
impaired fasting glucose (IFG). In the study, 24 women
were classified in the IFG stage. Is there sufficient
evidence to indicate that the population of Hispanic
women has a prevalence of IFG higher than 6.3%?
© FAROUQ MOHAMMAD A. ALAM 31
Example 7.5.1
› Data of 301 Hispanic women were collected. One
variable of interest was the percentage of subjects with
impaired fasting glucose (IFG). In the study, 24 women
were classified in the IFG stage. Is there sufficient
evidence to indicate that the population of Hispanic
women has a prevalence of IFG higher than 6.3%?
© FAROUQ MOHAMMAD A. ALAM 32
Example 7.5.1
The statistical hypotheses are:
𝑯𝟎 : 𝒑 ≥ 𝟎. 𝟎𝟔𝟑 vs. 𝑯𝟏 : 𝒑 < 𝟎. 𝟎𝟔𝟑
The information form the sample are as follows:
𝟐𝟒
𝒏 = 𝟑𝟎𝟏, 𝒑
ෝ=
𝟑𝟎𝟏
≈ 𝟎. 𝟎𝟖𝟎 and 𝒑𝟎 = 𝟎. 𝟎𝟔𝟑.
© FAROUQ MOHAMMAD A. ALAM 33
Z–Test for the Population Proportion
(MegaStat Application)
1. In Data Ribbon, click on
MegaStat icon, then select
Hypothesis Tests.
2. Select Proportion vs.
Hypothesized Value.
© FAROUQ MOHAMMAD A. ALAM 34
3. Insert the value of the
sample proportion.
4. Insert the value of
the population
proportion.
5. Insert the
sample size.
6. Choose “greater
6. Choose “greater
than”, then press
than”.
OK.
© FAROUQ MOHAMMAD A. ALAM 35
The value
of the test
statistics.
The p-value which is
greater than 𝜶 = 𝟎. 𝟎𝟓
© FAROUQ MOHAMMAD A. ALAM 36
Example 7.5.1
The statistical hypotheses are:
𝑯𝟎 : 𝒑 ≥ 𝟎. 𝟎𝟔𝟑 vs. 𝑯𝟏 : 𝒑 < 𝟎. 𝟎𝟔𝟑
The information form the sample are as follows:
𝟐𝟒
𝒏 = 𝟑𝟎𝟏, 𝒑
ෝ=
𝟑𝟎𝟏
≈ 𝟎. 𝟎𝟖𝟎 and 𝒑𝟎 = 𝟎. 𝟎𝟔𝟑.
› Since the p-value > 𝜶, then there is not enough evidence to
reject 𝑯𝟎 . Thus, we cannot conclude that in the population the
proportion who are IFG is higher than 6.3 percent.
© FAROUQ MOHAMMAD A. ALAM 37