CHAPTER THREE, Hypothesis Testing
CHAPTER THREE, Hypothesis Testing
INTRODUCTION
What is Hypothesis?
Hypothesis is a statement about the value of a population parameter developed for the purpose of testing or
hypothesis is an assertion or tentative
Example
A soft drink bottling company’s advertisement states that a bottle of its product contains 330 milliliters (ml). But
customers are complaining that the company is under filling its products. To check whether the complaint is true
or not, an inspector may test the following hypothesis:
HO: The average content of a bottle of this product equals 330 ml, against
H1: The average content of a bottle of this product is less than 330 ml.
Or symbolically,
HO: = 330 ml
H1 : < 330 ml
If the inspector takes a random sample of bottles of this product and finds that the mean content per bottle is
much less than 330 ml, then he may conclude that the complaint of the customers is correct.
Hypothesis testing: - is a procedure based on sample evidence and probability theory used to determine whether
the hypothesis is reasonable statement and should not be rejected, or is unreasonable and should be rejected. Or
hypothesis testing is a procedure for checking the validity of a statistical hypothesis. It is the process by which
1
we decide whether the null hypothesis should be rejected or not. The value, computed from sample information,
used to determine whether or not to reject the null hypothesis is called test statistic.
Statisticians follow a formal process to determine whether to accept or reject a null hypothesis, based on sample
data. This process, called hypothesis testing, consists of four steps.
State the hypotheses. This involves stating the null and alternative hypotheses. The hypotheses are stated
in such a way that they are mutually exclusive. That is, if one is true, the other must be false.
Formulate an analysis plan. The analysis plan describes how to use sample data to accept or reject the
null hypothesis. The accept/reject decision often focuses around a single test statistic.
Analyze sample data. Find the value of the test statistic (mean score, proportion, t-score, z-score, etc.)
described in the analysis plan. Complete other computations, as required by the plan.
Interpret results. Apply the decision rule described in the analysis plan. If the test statistic supports the
null hypothesis, accept the null hypothesis; otherwise, reject the null hypothesis.
Types of Decision Errors
Two types of errors can result from a hypothesis test.
Type I error. A Type I error occurs when the researcher rejects a null hypothesis when it is true. The
probability of committing a Type I error is called the significance level. This probability is also called
alpha, and is often denoted by α.
Type II error. A Type II error occurs when the researcher accepts a null hypothesis that is false. The
probability of committing a Type II error is called Beta, and is often denoted by β. The probability of not
committing a Type II error is called the Power of the test.
Decision Rules
The analysis plan includes decision rules for accepting or rejecting the null hypothesis. In practice, statisticians
describe these decision rules in two ways - with reference to a P-value or with reference to a region of
acceptance.
P-value. The strength of evidence in support of a null hypothesis is measured by the P-value. Suppose
the test statistic is equal to S. The P-value is the probability of observing a test statistic as extreme as S,
assuming the null hypothesis is true. If the P-value is less than the significance level, we reject the null
hypothesis.
Region of acceptance. The region of acceptance is a range of values. If the test statistic falls within the
region of acceptance, the null hypothesis is accepted. The region of acceptance is defined so that the
chance of making a Type I error is equal to the significance level.
2
The set of values outside the region of acceptance is called the region of rejection. If the test statistic
falls within the region of rejection, the null hypothesis is rejected. In such cases, we say that the
hypothesis has been rejected at the α level of significance.
These approaches are equivalent. Some statistics texts use the P-value approach; others use the region of
acceptance approach. In subsequent lessons, this tutorial will present examples that illustrate each approach.
Researcher
Accepts Rejects
HO HO
Correct Type I error
If H O is true and decision
Type II Correct
If H O is false and error decision
3
Formulate an analysis plan. The analysis plan describes how to use sample data to accept or reject the
null hypothesis. It should specify the following elements.
Significance level. Often, researchers choose significance levels equal to 0.01, 0.05, or 0.10; but
any value between 0 and 1 can be used.
Test method. Typically, the test method involves a test statistic and a sampling distribution.
Computed from sample data, the test statistic might be a mean score, proportion, difference
between means, difference between proportions, z-score, t-score, chi-square, etc. Given a test
statistic and its sampling distribution, a researcher can assess probabilities associated with the test
statistic. If the test statistic probability is less than the significance level, the null hypothesis is
rejected.
Analyze sample data. Using sample data perform computations called for in the analysis plan.
Test statistic. When the null hypothesis involves a mean or proportion, use either of the following
equations to compute the test statistic.
Test statistic = (Statistic - Parameter) / (Standard deviation of statistic)
Test statistic = (Statistic - Parameter) / (Standard error of statistic)
where Parameter is the value appearing in the null hypothesis, and Statistic is the point estimate
of Parameter. As part of the analysis, you may need to compute the standard deviation or
standard error of the statistic. Previously, we presented common formulas for the standard
deviation and standard error.
When the parameter in the null hypothesis involves categorical data, you may use a chi-square statistic as the test
statistic. Instructions for computing a chi-square test statistic are presented in the lesson on the chi-square
goodness of fit test.
P-value. The P-value is the probability of observing a sample statistic as extreme as the test
statistic, assuming the null hypotheis is true.
Interpret the results. If the sample findings are unlikely, given the null hypothesis, the researcher rejects
the null hypothesis. Typically, this involves comparing the P-value to the significance level, and rejecting
the null hypothesis when the P-value is less than the significance level.
Se Alternative
Null hypothesis Number of tails
t hypothesis
1 μ=M μ≠M 2
2 μ>M μ<M 1
3 μ<M μ>M 1
The first set of hypotheses (Set 1) is an example of a two-tailed test, since an extreme value on either side of the
sampling distribution would cause a researcher to reject the null hypothesis. The other two sets of hypotheses
(Sets 2 and 3) are one-tailed tests, since an extreme value on only one side of the sampling distribution would
cause a researcher to reject the null hypothesis.
Formulate an Analysis Plan
The analysis plan describes how to use sample data to accept or reject the null hypothesis. It should specify the
following elements.
Significance level. Often, researchers choose significance levels equal to 0.01, 0.05, or 0.10; but any
value between 0 and 1 can be used.
Test method. Use the one-sample t-test to determine whether the hypothesized mean differs significantly
from the observed sample mean.
Analyze Sample Data
Using sample data, conduct a one-sample t-test. This involves finding the standard error, degrees of freedom, test
statistic, and the P-value associated with the test statistic.
Standard error. Compute the standard error (SE) of the sampling distribution.
5
SE = s * sqrt{ ( 1/n ) * ( 1 - n/N ) * [ N / ( N - 1 ) ] }
where s is the standard deviation of the sample, N is the population size, and n is the sample size. When
the population size is much larger (at least 10 times larger) than the sample size, the standard error can be
approximated by:
s = √sn
e
Degrees of freedom. The degrees of freedom (DF) is equal to the sample size (n) minus one. Thus, DF =
n - 1.
Test statistic. The test statistic is a t-score (t) defined by the following equation.
x −μ
t=
s e
where x is the sample mean, μ is the hypothesized population mean in the null hypothesis, and S e is the
standard error.
P-value. The P-value is the probability of observing a sample statistic as extreme as the test statistic.
Since the test statistic is a t-score, use the t Distribution Calculator to assess the probability associated
with the t-score, given the degrees of freedom computed above. (See sample problems at the end of this
lesson for examples of how this is done.)
Interpret Results
If the sample findings are unlikely, given the null hypothesis, the researcher rejects the null hypothesis.
Typically, this involves comparing the P-value to the significance level, and rejecting the null hypothesis when
the P-value is less than the significance level.
Problem 1: Two-Tailed Test
An inventor has developed a new, energy-efficient lawn mower engine. He claims that the engine will run
continuously for 5 hours (300 minutes) on a single gallon of regular gasoline. Suppose a simple random sample
of 50 engines is tested. The engines run for an average of 295 minutes, with a standard deviation of 20 minutes.
Test the null hypothesis that the mean run time is 300 minutes against the alternative hypothesis that the mean
run time is not 300 minutes. Use a 0.05 level of significance. (Assume that run times for the population of
engines are normally distributed.)
Solution: The solution to this problem takes four steps: (1) state the hypotheses, (2) formulate an analysis plan,
(3) analyze sample data, and (4) interpret results. We work through those steps below:
State the hypotheses. The first step is to state the null hypothesis and an alternative hypothesis.
Null hypothesis: μ = 300
Alternative hypothesis: μ ≠ 300
6
Note that these hypotheses constitute a two-tailed test. The null hypothesis will be rejected if the sample
mean is too big or if it is too small.
Formulate an analysis plan. For this analysis, the significance level is 0.05. The test method is a one-
sample t-test.
Analyze sample data. Using sample data, we compute the standard error (SE), degrees of freedom (DF),
and the t-score test statistic (t).
s = √sn
e
= 20 / sqrt(50) = 20/7.07 = 2.83
DF = n - 1 = 50 - 1 = 49
x −μ = (295 - 300)/2.83 = 1.77
t=
s e
where s is the standard deviation of the sample, x is the sample mean, μ is the hypothesized population
mean, and n is the sample size.
Since we have a two-tailed test, the P-value is the probability that the t-score having 49 degrees of
freedom is less than -1.77 or greater than 1.77.
We use the t Distribution Calculator to find P(t < -1.77) = 0.04, and P(t > 1.75) = 0.04. Thus, the P-value
= 0.04 + 0.04 = 0.08.
Interpret results. Since the P-value (0.08) is greater than the significance level (0.05), we cannot reject
the null hypothesis.
Note: If you use this approach on an exam, you may also want to mention why this approach is appropriate.
Specifically, the approach is appropriate because the sampling method was simple random sampling, and the
population was normally distributed.
Problem2:One-TailedTest
Bon Air Elementary School has 300 students. The principal of the school thinks that the average IQ of students
at Bon Air is at least 110. To prove her point, she administers an IQ test to 20 randomly selected students.
Among the sampled students, the average IQ is 108 with a standard deviation of 10. Based on these results,
should the principal accept or reject her original hypothesis? Assume a significance level of 0.01.
Solution: The solution to this problem takes four steps: (1) state the hypotheses, (2) formulate an analysis plan,
(3) analyze sample data, and (4) interpret results. We work through those steps below:
State the hypotheses. The first step is to state the null hypothesis and an alternative hypothesis.
Null hypothesis: μ >= 110
Alternative hypothesis: μ < 110
Note that these hypotheses constitute a one-tailed test. The null hypothesis will be rejected if the sample
mean is too small.
7
Formulate an analysis plan. For this analysis, the significance level is 0.01. The test method is a one-
sample t-test.
Analyze sample data. Using sample data, we compute the standard error (SE), degrees of freedom (DF),
and the t-score test statistic (t).
s =√sn
e
10 / sqrt(20) = 10/4.472 = 2.236
DF = n - 1 = 20 - 1 = 19
x −μ = (108 - 110)/2.236 = -0.894
t=
s e
where s is the standard deviation of the sample, x is the sample mean, μ is the hypothesized population
mean, and n is the sample size.
Since we have a one-tailed test, the P-value is the probability that the t-score having 19 degrees of
freedom is less than -0.894.
We use the t Distribution Calculator to find P(t < -0.894) = 0.19. Thus, the P-value is 0.19.
Interpret results. Since the P-value (0.19) is greater than the significance level (0.01), we cannot reject
the null hypothesis.
Note: If you use this approach on an exam, you may also want to mention why this approach is appropriate.
Specifically, the approach is appropriate because the sampling method was simple random sampling, and the
population was normally distributed.
Hypothesis Test for a Proportion
This lesson explains how to conduct a hypothesis test of a proportion, when the following conditions are met:
The sampling method is simple random sampling.
The sample includes at least 10 successes and 10 failures. (Some texts say that 5 successes and 5 failures
are enough.)
The population size is at least 10 times as big as the sample size.
This approach consists of four steps: (1) state the hypotheses, (2) formulate an analysis plan, (3) analyze sample
data, and (4) interpret results.
State the Hypotheses
Every hypothesis test requires the analyst to state a null hypothesis and an alternative hypothesis. The hypotheses
are stated in such a way that they are mutually exclusive. That is, if one is true, the other must be false; and vice
versa.
8
Formulate an Analysis Plan
The analysis plan describes how to use sample data to accept or reject the null hypothesis. It should specify the
following elements.
Significance level. Often, researchers choose significance levels equal to 0.01, 0.05, or 0.10; but any
value between 0 and 1 can be used.
Test method. Use the one-sample z-test to determine whether the hypothesized population proportion
differs significantly from the observed sample proportion.
Analyze Sample Data
Using sample data, find the test statistic and its associated P-Value.
Standard deviation. Compute the standard deviation (σ) of the sampling distribution.
σ = sqrt[ P * ( 1 - P ) / n ]
where P is the hypothesized value of population proportion in the null hypothesis, and n is the sample
size.
Test statistic. The test statistic is a z-score (z) defined by the following equation.
z = (p - P) / σ
where P is the hypothesized value of population proportion in the null hypothesis, p is the sample
proportion, and σ is the standard deviation of the sampling distribution.
P-value. The P-value is the probability of observing a sample statistic as extreme as the test statistic.
Since the test statistic is a z-score, use the Normal Distribution Calculator to assess the probability
associated with the z-score. (See sample problems at the end of this lesson for examples of how this is
done.)
Interpret Results
If the sample findings are unlikely, given the null hypothesis, the researcher rejects the null hypothesis.
Typically, this involves comparing the P-value to the significance level, and rejecting the null hypothesis when
the P-value is less than the significance level.
The following sample problems illustrate how to conduct a hypothesis test of a proportion. The first problem
involves a two-tailed test; the second problem, a one-tailed test.
Problem 1: Two-Tailed Test
The CEO of a large electric utility claims that 80 percent of his 1,000,000 customers are very satisfied with the
service they receive. To test this claim, the local newspaper surveyed 100 customers, using simple random
sampling. Among the sampled customers, 73 percent say they are very satisified. Based on these findings, can
we reject the CEO's hypothesis that 80% of the customers are very satisfied? Use a 0.05 level of significance.
Solution: The solution to this problem takes four steps: (1) state the hypotheses, (2) formulate an analysis plan,
(3) analyze sample data, and (4) interpret results. We work through those steps below:
9
State the hypotheses. The first step is to state the null hypothesis and an alternative hypothesis.
Null hypothesis: P = 0.80
Alternative hypothesis: P ≠ 0.80
Note that these hypotheses constitute a two-tailed test. The null hypothesis will be rejected if the sample
proportion is too big or if it is too small.
Formulate an analysis plan. For this analysis, the significance level is 0.05. The test method, shown in
the next section, is a one-sample z-test.
Analyze sample data. Using sample data, we calculate the standard deviation (σ) and compute the z-
score test statistic (z).
s=
√ [n n ]
1 1
e p ( 1− p )∗ +
1 2
where p is the pooled sample proportion, n1 is the size of sample 1, and n2 is the size of sample 2.
Test statistic. The test statistic is a z-score (z) defined by the following equation.
z=
( p −p )
1 2
s e
where p1 is the proportion from sample 1, p2 is the proportion from sample 2, and SE is the standard error
of the sampling distribution.
P-value. The P-value is the probability of observing a sample statistic as extreme as the test statistic.
Since the test statistic is a z-score, use the Normal Distribution Calculator to assess the probability
associated with the z-score. (See sample problems at the end of this lesson for examples of how this is
done.)
The analysis described above is a two-proportion z-test.
Interpret Results
If the sample findings are unlikely, given the null hypothesis, the researcher rejects the null hypothesis.
Typically, this involves comparing the P-value to the significance level, and rejecting the null hypothesis when
the P-value is less than the significance level.
Two sample problems illustrate how to conduct a hypothesis test for the difference between two proportions. The
first problem involves a a two-tailed test; the second problem, a one-tailed test.
Problem 1: Two-Tailed Test
Suppose the Top Drug Company develops a new drug, designed to prevent colds. The company states that the
drug is equally effective for men and women. To test this claim, they choose a a simple random sample of 100
women and 200 men from a population of 100,000 volunteers.
At the end of the study, 38% of the women caught a cold; and 51% of the men caught a cold. Based on these
findings, can we reject the company's claim that the drug is equally effective for men and women? Use a 0.05
level of significance.
Solution: The solution to this problem takes four steps: (1) state the hypotheses, (2) formulate an analysis plan,
(3) analyze sample data, and (4) interpret results. We work through those steps below:
State the hypotheses. The first step is to state the null hypothesis and an alternative hypothesis.
Null hypothesis: P1 = P2
Alternative hypothesis: P1 ≠ P2
12
Note that these hypotheses constitute a two-tailed test. The null hypothesis will be rejected if the
proportion from population 1 is too big or if it is too small.
Formulate an analysis plan. For this analysis, the significance level is 0.05. The test method is a two-
proportion z-test.
Analyze sample data. Using sample data, we calculate the pooled sample proportion (p) and the
standard error (SE). Using those measures, we compute the z-score test statistic (z).
p=
( p ∗n )+( p ∗n ) =
1 1 2 2
[(0.38 * 100) + (0.51 * 200)] / (100 + 200) = 140/300 = 0.467
n +n
1 2
√ [n n ]
= sqrt [ 0.467 * 0.533 * ( 1/100 + 1/200 ) ] = sqrt [0.003733] = 0.061
s=e p ( 1− p )∗
1
+
1
1 2
z=
( p − p ) = (0.51 - 0.38)/0.061 = 2.13
1 2
s e
where p1 is the sample proportion in sample 1, where p 2 is the sample proportion in sample 2, n 1 is the
size of sample 2, and n2 is the size of sample 2.
Since we have a two-tailed test, the P-value is the probability that the z-score is less than -2.13 or greater
than 2.13.
We use the Normal Distribution Calculator to find P(z < -2.13) = 0.017, and P(z > 2.13) = 0.017. Thus,
the P-value = 0.017 + 0.017 = 0.034.
Interpret results. Since the P-value (0.034) is less than the significance level (0.05), we cannot accept
the null hypothesis.
Note: If you use this approach on an exam, you may also want to mention why this approach is appropriate.
Specifically, the approach is appropriate because the sampling method was simple random sampling, the samples
were independent, each population was at least 10 times larger than its sample, and each sample included at least
10 successes and 10 failures.
Problem 2: One-Tailed Test
Suppose the previous example is stated a little bit differently. Suppose the Acme Drug Company develops a new
drug, designed to prevent colds. The company states that the drug is more effective for women than for men. To
test this claim, they choose a a simple random sample of 100 women and 200 men from a population of 100,000
volunteers.
At the end of the study, 38% of the women caught a cold; and 51% of the men caught a cold. Based on these
findings, can we conclude that the drug is more effective for women than for men? Use a 0.01 level of
significance.
13
Solution: The solution to this problem takes four steps: (1) state the hypotheses, (2) formulate an analysis plan,
(3) analyze sample data, and (4) interpret results. We work through those steps below:
State the hypotheses. The first step is to state the null hypothesis and an alternative hypothesis.
Null hypothesis: P1>= P2
Alternative hypothesis: P1< P2
Note that these hypotheses constitute a one-tailed test. The null hypothesis will be rejected if the
proportion of women catching cold (p1) is sufficiently smaller than the proportion of men catching cold
(p2).
Formulate an analysis plan. For this analysis, the significance level is 0.01. The test method is a two-
proportion z-test.
Analyze sample data. Using sample data, we calculate the pooled sample proportion (p) and the
standard error (SE). Using those measures, we compute the z-score test statistic (z).
p=
( p ∗n )+( p ∗n ) =
1 1 2 2
[(0.38 * 100) + (0.51 * 200)] / (100 + 200) = 140/300 = 0.467
n +n
1 2
√ [n n ]
= sqrt [ 0.467 * 0.533 * ( 1/100 + 1/200 ) ] = sqrt [0.003733] = 0.061
s=e p ( 1− p )∗
1
+
1
1 2
z=
( p −p )
1
= (0.38 - 0.51)/0.061 = -2.13
2
s e
where p1 is the sample proportion in sample 1, where p 2 is the sample proportion in sample 2, n 1 is the
size of sample 2, and n2 is the size of sample 2.
Since we have a one-tailed test, the P-value is the probability that the z-score is less than -2.13. We use
the Normal Distribution Calculator to find P(z < -2.13) = 0.017. Thus, the P-value = 0.017.
Interpret results. Since the P-value (0.017) is greater than the significance level (0.01), we cannot reject
the null hypothesis.
Note: If you use this approach on an exam, you may also want to mention why this approach is appropriate.
Specifically, the approach is appropriate because the sampling method was simple random sampling, the samples
were independent, each population was at least 10 times larger than its sample, and each sample included at least
10 successes and 10 failures.
How to Find the Region of Acceptance
We define the region of acceptance in such a way that the chance of making a Type I error is equal to the
significance level. Here is how that is done.
14
Define a test statistic. Here, the test statistic is the sample measure used to estimate the population
parameter that appears in the null hypothesis. For example, suppose the null hypothesis is
H0: μ = M
The test statistic, used to estimate M, would be m. If M were a population mean, m would be the sample
mean; if M were a population proportion, m would be the sample proportion; if M were a difference
between population means, m would be the difference between sample means; and so on.
Given the significance level α, find the upper limit (UL) of the region of acceptance. There are three
possibilities, depending on the form of the null hypothesis.
If the null hypothesis is μ < M: The upper limit of the region of acceptance will be equal to the
value for which the cumulative probability of the sampling distribution is equal to one minus the
significance level. That is, P( m < UL ) = 1 - α .
If the null hypothesis is μ = M: The upper limit of the region of acceptance will be equal to the
value for which the cumulative probability of the sampling distribution is equal to one minus the
significance level divided by 2. That is, P( m < UL ) = 1 - α/2 .
If the null hypothesis is μ > M: The upper limit of the region of acceptance is equal to plus
infinity, unless the test statistic were a proportion or a percentage. The upper limit is 1 for a
proportion, and 100 for a percentage.
In a similar way, we find the lower limit (LL) of the range of acceptance. Again, there are three
possibilities, depending on the form of the null hypothesis.
If the null hypothesis is μ < M: The lower limit of the region of acceptance is equal to minus
infinity, unless the test statistic is a proportion or a percentage. The lower limit for a proportion or
a percentage is zero.
If the null hypothesis is μ = M: The lower limit of the region of acceptance will be equal to the
value for which the cumulative probability of the sampling distribution is equal to the significance
level divided by 2. That is, P( m < LL ) = α/2 .
If the null hypothesis is μ > M: The lower limit of the region of acceptance will be equal to the
value for which the cumulative probability of the sampling distribution is equal to the significance
level. That is, P( m < LL ) = α .
where s is the sample standard deviation, n is the sample size, and N is the population size. In this
example, we assume that the population size is very large, so that the value 1/N is about zero.
Find the lower limit of the region of acceptance. Given a two-tailed hypothesis, the lower limit
(LL) will be equal to the value for which the cumulative probability of the sampling distribution
is equal to the significance level divided by 2. That is, P( x < LL ) = α/2 = 0.05/2 = 0.025. To find
this lower limit, we use the Normal Distribution Calculator. We input the following entries into
16
the calculator: cumulative probability = 0.025, mean = 300, and standard deviation = 2.83. The
calculator tells us that the lower limit is 294.45, given those inputs.
Find the upper limit of the region of acceptance. Given a two-tailed hypothesis, the upper limit
(UL) will be equal to the value for which the cumulative probability of the sampling distribution
is equal to one minus the significance level divided by 2. That is, P( x < UL ) = 1 - α/2 = 1 - 0.025
= 0.975. To find this upper limit, we use the Normal Distribution Calculator. We input the
following entries into the calculator: cumulative probability = 0.975, mean = 300, and standard
deviation = 2.83. The calculator tells us that the upper limit is 305.55, given those inputs.
Thus, we have determined that the region of acceptance is defined by the values between 294.45 and
305.55.
Accept or reject the null hypothesis. The sample mean in this example was 295 minutes. This value
falls within the region of acceptance. Therefore, we cannot reject the null hypothesis that a new engine
runs for 300 minutes on a gallon of gasoline.
17