Tests of Hypothesis For A Single Sample
Tests of Hypothesis For A Single Sample
Objectives: After careful study of this chapter, you should be able to do the following:
2. Test hypotheses on the mean of a normal distribution using either a Z-test or a t-test procedure
6. Compute power and type II error probability, and make sample size selection decisions for tests
on means, variances, and proportions
7. Explain and use the relationship between confidence intervals and hypothesis tests
In the previous two chapters we showed how a parameter of a population can be estimated from
sample data, using either a point estimate (Chapter 7) or an interval of likely values called a confidence
interval (Chapter 8). In many situations a different type of problem is of interest; there are two
competing claims about the value of a parameter, and the engineer must determine which claim is
correct. For example, suppose that an engineer is designing an air crew escape system that consists of
an ejection seat and a rocket motor that powers the seat. The rocket motor contains a propellant, and in
order for the ejection seat to function properly, the propellant should have a mean burning rate of 50
cm/sec. If the burning rate is too low, the ejection seat may not function properly, leading to an unsafe
ejection and possible injury of the pilot.
Higher burning rates may imply instability in the propellant or an ejection seat that is too powerful,
again leading to possible pilot injury. So, the practical engineering question that must be answered is:
Does the mean burning rate of the propellant equal 50 cm/sec, or is it some other value (either higher
or lower)? This type of question can be answered using a statistical technique called hypothesis testing.
This chapter focuses on the basic principles of hypothesis testing and provides techniques for solving the
most common types of hypothesis testing problems involving a single sample of data.
STATISTICAL HYPOTHESES
Many problems in engineering require that we decide which of two competing claim or
statements about some parameter is true. The statements are called hypotheses, and the decision-
making procedure is called hypothesis testing. This is one of the most useful aspects of statistical
inference, since many types of decision-making problems, tests, or experiments in the engineering world
can be formulated as hypothesis testing problems. Furthermore, as we will see, there is a very close
connection between hypothesis testing and confidence intervals.
Statistical hypothesis testing and confidence interval estimation of parameters are the
fundamental methods used at the data analysis stage of a comparative experiment, in which the
engineer is interested, for example, in comparing the mean of a population to a specified value. In this
chapter we discuss comparative experiments involving a single population, and our focus is on testing
hypotheses concerning the parameters of the population.
We now give a formal definition of a statistical hypothesis:
Let:
H 0 : μ = 50 cm/sec
H 1 : μ ≠ 50 cm/sec
H 1 : μ > 50 or (one-sided)
H 1 : μ < 50 or(one-sided)
H 1 : μ ≠ 50 (two-sided)
TEST OF A HYPOTHESIS
If this information is consistent with the null hypothesis, then we will conclude that the
hypothesis is true.
If this information is inconsistent with the null hypothesis, we will conclude that the
hypothesis is false.
1. P (Type I error) = α
2. P (Type II error) = β
3. Power of a test = 1 – β
TEST OF A HYPOTHESIS
Hypothesis-testing procedures rely
on using the information in a
random sample from
the population on interest, n.
If this information is consistent
with the null hypothesis, then we
will conclude that the
hypothesis is true.
If this information is inconsistent
with the null hypothesis, we will
conclude that the
hypothesis is false.
TYPE I AND TYPE II ERROR
PROBABILITIES
1. P (Type I error) = α
Type I error is a situation; α is the
probability of that situation
occurring.
2. P (Type II error) = β
Type II error is a situation; β is the
probability of that situation
occurring.
3. Power of a test = 1 – β
Example 8.1
Mark Smith is convicted of
kidnapping and rape of a girl in the
year 1980. DNA
evidence analyzed in 2014
determined that he could not have
committed the crime.
He was immediately released from
prison.
JURY ANALOGY FOR
HYPOTHESIS TESTING:
H0: Mark Smith is innocent
H1: Mark Smith did it
The 1980 jury rejected H0 when H0
was TRUE.
Example 8.1
Mark Smith is convicted of kidnapping and rape of a girl in the year 1980. DNA evidence analyzed in
2014 determined that he could not have committed the crime. He was immediately released from
prison.
Example 8.2
In 2014, Christian Parker was recorded trying to hire someone to kill a female prosecutor for $200. He
admitted to the crime but went to trial. The jury found him “not guilty”.
Ho : Christian is innocent
H1 : Christian did it
Sometimes the Type I error probability is called the significance level of the test.
1 – β is the probability of correctly rejecting a false null hypothesis; 1 – β is called the POWER OF A TEST.
Two-Sided test:
H1:μ≠μ0
One-Sided tests:
H0:μ=μ0 or H0:μ=μ0
H1:μ<μ0 H1:μ>μ0
In one-sided alternative hypotheses, rejecting H 0 is always a strong conclusion.
Consequently, we should put the statement about which it is important to make a strong
conclusion in the alternative hypothesis.
The p-value is the smallest level of significance, α, that would lead to rejection of the null
hypothesis H 0 with the given data.
Or in other words,
The p-value is the value of α that would put you right on the edge/borderline/boundary
between Rejecting H 0 and Failing to reject H 0.
A close relationship exists between the test of a hypothesis for on a population parameter and
the confidence interval for on that parameter.
If [L, U] is 100(1-α) % confidence interval for the parameter Θ. And if Θ 0 is not in [ L, U], then we
will reject H 0 in a test of hypothesis for Θ 0
H0:Θ=Θ0
H1:Θ≠Θ0
7. Compute necessary values for calculating the test statistic and sketch any
appropriate pdfs.
H0: μ = μ0
H1: μ ≠ μ0
Two-sided:
H0:μ=μ0
H1:μ≠μ0
If you have a two-sided hypothesis test and test statistic is < 0, the p-value is 2x (area below the
test statistic)
If you have a two-sided hypothesis test and the test statistic is > 0, the p-value is 2x (area above
the test statistic).
One-sided upper:
H0:μ=μ0
H1:μ>μ0
If you have a one-sided upper hypothesis test, the p-value is the area above the test statistic.
The test statistic could be < 0 or > 0.
One-sided lower:
H0:μ=μ0
H1:μ<μ0
If you have a one-sided lower hypothesis test, the p-value is the area below the test statistic.
The Test statistic could be < 0 or > 0.
Example 8.3
Air crew escape systems are powered by a solid propellant. The burning rate of this propellant is an
important product characteristic. Specifications require that the mean burning rate must be 50cm/sec
and the standard deviation is 2m/sec. The significance level is 0 and a random sample n = 25 has a
sample average burning rate of 51. cm/sec. Is there evidence that the mean burn rate is 50cm/sec?
1. Draw the pdf of x using H0. Over this pdf, draw the shifted pdf of x if the true
a a
z σ z σ
If H1: μ ≠ μ0, we fail to reject H0 if 2 2
μ0 − < x < μ0 +
√n √n
a
z σ
If H1: μ < μ0, we fail to reject H0 if 2
x > μ0−
√n
a
z σ
If H1: μ > μ0, we fail to reject H0 if 2
x < μ0 +
√n
3. Compute the area under the shifted pdf for the values computed in 2, above.
This area is β.
Example 8.4
Determine the power of the test if the true population mean is 1 inches. Use the data given below.
H 1 : μ ≠ 1 inches n = 25 𝑥̅ = 1 inches
H0: μ = μ0
H1: μ ≠ μ0
For a two-sided alternative hypothesis:
2 2
( za ∕ 2 + zβ ) σ , where δ=μ−μ 0
n= 2
δ
Sample size for a One-sided test:
H0: μ = μ0 H0: μ = μ0
TEST ON POPULATION
MEAN, VARIANCE
KNOWN
For a one-sided alternative hypothesis:
2 2
( za + z β ) σ , where δ=μ−μ 0
n= 2
δ
Zβ is the value on the z-axis such that the area above it under the Z is equal to β.
Two-sided:
H0: μ = μ0
H1: μ ≠ μ0
If you have a two-sided hypothesis test and test statistic is < 0, the p-value is 2x (area
If you have a two-sided hypothesis test and the test statistic is > 0, the p-value is 2x (area
above the test statistic).
One-sided upper:
H0: μ = μ0
H1: μ > μ0
If you have a one-sided upper hypothesis test, the p-value is the area above the test
One-sided lower:
H0: μ = μ0
H1: μ < μ0
If you have a one-sided lower hypothesis test, the p-value is the area below the test
Example 8.5
A random sample of n = 8 Quiz #5 scores were collected from our class: 9, 8, 8, 9, 8, 10,
7, 9. Use hypothesis testing to determine if there is evidence that the population mean
Two-sided:
H0: 𝛔2 = 𝛔20
H1: 𝛔2 ≠ 𝛔20
If you have a two-sided hypothesis test and test statistic is < 0, the p-value is 2x (area below the
test statistic)
If you have a two-sided hypothesis test and the test statistic is > 0, the p-value is 2x (area
One-sided upper:
H0: 𝛔2 = 𝛔20
If you have a one-sided upper hypothesis test, the p-value is the area above the test
statistic. The test statistic could be < 0 or > 0.
One-sided lower:
H0: 𝛔2 = 𝛔20
If you have a one-sided lower hypothesis test, the p-value is the area below the test
Example 8.6
An automated filling machine is used to fill bottles with liquid detergent. A random
sample of 20 bottles results in a sample standard deviation, S = 0.0153 ounces. If the
variance of fill volume exceeds 0.0003 ounces2, an unacceptable proportion of bottles
will be underfilled or overfilled. Is there evidence in the sample data to suggest that the
manufacturer has a problem with underfilled or overfilled bottles? Use α = 0.01 and
assume that fill volume has a normal distribution. Let the fill volume be the random
variable.
TEST ON POPULATION PROPORTION
It is often necessary to test hypotheses on a population proportion. For example, suppose that a random
sample of size n has been taken from a large (possibly infinite) population and that X (< n) observations
in this sample belong to a class of interest. Then ^P = X/n is a point estimator of the proportion of the
population p that belongs to this class. Note that n and p are the parameters of a binomial distribution.
Furthermore, from Chapter 6 we know that the sampling distribution of ^ P is approximately normal with
mean p and variance p (1- p)/n, if p is not too close to either 0 or 1 and if n is relatively large. Typically,
to apply this approximation we require that np and n (1 - p) be greater than or equal to 5. We will give a
large sample test that makes use of the normal approximation to the binomial distribution.
TEST STATISTIC:
x−n p0
z o=
√ n p ( 1− p )
0 0
Example 8.7
A semiconductor manufacturer produces controllers used in automobile engine applications. The
buyer requires that the process fallout or fraction defective at a critical manufacturing step not
exceed 0.04 and that the manufacturer demonstrate process capability at this level of quality using α
= 0.05. The semiconductor manufacturer takes a random sample of 200 devices and finds that four of
them are defective. Can the manufacturer demonstrate that the fraction defective is less than 0.04?
It is possible to obtain closed-form equations for the approximate β-error for the tests. Suppose
that p is the true value of the population proportion. The approximate β-error for the two-sided
alternative H1: p ≠ p0 is:
Note: p = ptrue
Approximate Sample Size for a
One-Sided Test on a Binomial
Proportion:
Note: p = ptrue
These equations can be solved to find the approximate sample size n that gives a test
of level α that has a specified β risk. The sample size equations are:
Note: p = ptrue
Note: p = ptrue
Example 8.8
From the previous example, suppose that its process fallout is really ptrue = 0.03. What is the
probability that the null is failed to be rejected but is false?
Example 8.9
From the previous example, suppose that the semiconductor manufacturer was willing to accept a P
(type II error) as large as 0.10 if the true value of the process fraction defective was ptrue = 0.03. If
the manufacturer continues to use α = 0.05, what sample size would be required?