You are on page 1of 31

Chapter 7: Hypothesis Testing

A hypothesis is a conjecture about a population.


Typically, these hypotheses will be stated in terms of a
parameter.
A test of hypothesis is a statistical procedure used to
make a decision about the conjectured value of a
parameter.
We will make our decision based on observed values of
a statistic.

The purpose of hypothesis testing is to determine


whether there is enough statistical evidence in
favor of a certain belief about a parameter.
Examples
Is there statistical evidence in a random sample of potential
customers, that support the hypothesis that more than 10% of
the potential customers will purchase a new products?
Is a new drug effective in curing a certain disease? A sample
of patients is randomly selected. Half of them are given the
drug while the other half are given a placebo. The
improvement in the patients conditions is then measured and
compared.

The Hypotheses
There are two hypotheses which we are comparing.
The null hypothesis, H0, specifies a value of a
parameter. This hypothesis is assumed to be true, and
the collected data will be analyzed to see if it is
contradictory to the null hypothesis.
The alternative hypothesis, Ha, gives an opposing
statement about the value of the parameter. The
collected data will be analyzed to see if it supports the
alternative hypothesis.

Examples: Give the null hypothesis


and the alternative hypothesis
You are investigating a complaint that
special delivery mail takes too much time
to be delivered
You want to show that people find the new
design for a recliner chair more comfortable
than the old design.
You are trying to show that cigarette smoke
has an effect on the quality of a persons life

Examples: Give the null hypothesis


and the alternative hypothesis
The mean age of the students enrolled in evening
classes at a certain college is greater than 26 years.
The mean weight of packages shipped on Air
Express during the past month was less than 36.7
lb.
The mean life of fluorescent light bulbs is at least
1600 hours.
The mean grade of a student in a statistics class is
not 80.

Concepts of Hypothesis Testing


The critical concepts of hypothesis testing.
Example:
An operation manager needs to determine if the
mean demand during lead time is greater than 350.
If so, changes in the ordering policy are needed.

There are two hypotheses about a population mean:


H0: The null hypothesis
= 350
Ha: The alternative hypothesis > 350

t yo
a
h
w
This is

prov
o
t
t
n
u wa

Assume the null hypothesis is true (= 350).

= 350

Sample from the demand population, and build a statistic


related to the parameter hypothesized (the sample mean).
Pose the question: How probable is it to obtain a
sample mean at least as extreme as the one observed
from the sample, if H0 is correct?

Assume the null hypothesis is true (= 350).


Since the xis much larger than 350, the mean is likely to
be greater than 350. Reject the null hypothesis.

x 355

= 350

x 450

In this case the mean is not likely to be greater


than 350. Do not reject the null hypothesis.

Statistical Terminology
Once the data is collected, we seek an answer to the
question: If the null hypothesis is true, how likely are
we to observe this type of data, or data which is more
extreme in the direction of the alternative hypothesis?
The observed significance level, or p-value of a test of
hypothesis is the probability of obtaining the observed
value of the sample statistic, or one which is even more
supportive of the alternative hypothesis, under the
assumption that the null hypothesis is true.

Statistical Terminology
For example, lets assume that we are testing the
hypothesis that the mean gas mileage for a certain type
of car is 24 miles per gallon against an alternative that
the mean is more than 24 mpg.
H0: = 24 mpg
Ha: > 24 mpg
If a sample of 50 cars have a sample mean of 24.2 mpg,
this gives a certain p-value.
If the sample of 50 cars had a sample mean of 25.0 mpg,
the p-value is even smaller, since this would be more
unusual to see if H0 is true ( = 24 mpg).

Test Statistics and P-values


Obviously, we must be able to calculate these p-values.
A test statistic is a quantity calculated from the sampled
value of a statistic, which is then used to calculate a
p-value for a test of hypothesis.
We recall that under appropriate conditions, we know
the sampling distribution of the sample mean follows a
normal distribution, and we can find a z-score using
x x x
z

x
n

Decision Rule
Based on the z-score calculated, we can determine how
likely we are to get a sample mean (x-bar) like we
observed or one more supportive of Ha.
Decision Rule: This tells us when we feel the observed
data provided sufficient evident to conclude the
alternative hypothesis is true.
It will be phrased as: Accept the alternative hypothesis
when the p-value of the test is less than .
The value of will be given in each exercise. It does
NOT depend on the sample data. (More details later)

Testing the Population Mean When the


Population Standard Deviation is Known
Example
A new billing system for a department store will be
cost- effective only if the mean monthly account is more
than $170.
A sample of 400 accounts has a mean of $178.
If accounts are approximately normally distributed with
= $65, can we conclude that the new system will be
cost effective?

Testing the Population Mean ( is Known)


Solution
The population of interest is the credit accounts
at the store.
We want to know whether the mean account for
all customers is greater than $170.
Ha : > 170
The null hypothesis must specify a single value
of the parameter
H0 : = 170

P-value Method
The p-value provides information about the
amount of statistical evidence that supports the
alternative hypothesis.
The p-value of a test is the probability of observing a
test statistic at least as extreme as the one computed,
given that the null hypothesis is true.
Let us demonstrate the concept on this example.

P-value Method
The probability of observing a
test statistic at least as extreme as 178,
given that = 170 is

P( x 178 when 170)


178 170
P( z
)
65 400
P( z 2.4615) .0069
x 170

x 178

The p-value

Interpreting the p-value


Because the probability that the sample mean will
assume a value of more than 178 when = 170 is
so small (.0069), there are reasons to believe that
> 170.
Note how the event
x 178 is rare under H0
when x 170, but...
it becomes more
probable under H1,
when x 170

H 0 : x 170
H1 : x 170

x 178

Interpreting the p-value


Wecan
canconclude
concludethat
thatthe
thesmaller
smallerthe
thep-value
p-value
We
themore
morestatistical
statisticalevidence
evidenceexists
existstotosupport
supportthe
the
the
alternativehypothesis.
hypothesis.
alternative

H 0 : x 170
H1 : x 170

x 178

Interpreting the p-value


Describing the p-value
If the p-value is less than 1%, there is overwhelming
evidence that supports the alternative hypothesis.
If the p-value is between 1% and 5%, there is a strong
evidence that supports the alternative hypothesis.
If the p-value is between 5% and 10% there is a weak
evidence that supports the alternative hypothesis.
If the p-value exceeds 10%, there is no evidence that
supports the alternative hypothesis.

The p-value Method


The p-value can be used when making decisions based
on rejection region methods as follows:
Define the hypotheses to test, and the required significance
level
Perform the sampling procedure, calculate the test statistic and
the p-value associated with it.
Compare the p-value to Reject the null hypothesis only if pvalue <; otherwise, do not reject the null hypothesis.

= 0.05
x 170
x L 175.34

x 178

The p-value

Conclusions of a Test of Hypothesis


we accept
accept the
the alternative
alternative hypothesis,
hypothesis, we
we
IfIf we
conclude that
that there
there isis enough
enough evidence
evidence to
to infer
infer
conclude
that the
the alternative
alternative hypothesis
hypothesis isis true.
true.
that
we do
do not
not accept
accept the
the alternative
alternative hypothesis,
hypothesis,
IfIf we
we conclude
conclude that
that there
there isis not
not enough
enough statistical
statistical
we
The
alternative
The
alternativehypothesis
hypothesis
evidence
to
infer
that
the
alternative
hypothesis
evidence to infer that the alternative ishypothesis
isthe
themore
moreimportant
important
true.
one.
isis true.
one.ItItrepresents
representswhat
what
we
weare
areinvestigating.
investigating.

Another Example
Historically, the mean GPA of incoming freshmen at
NKU has been 2.32 at the end of their first year. With
recent changes, the administration believes the mean
GPA has increased. How would this be tested using a .
05 level of significance?
H0: The mean GPA is still 2.32. = 2.32
> 2.32

Ha: The mean GPA is above 2.32.

The decision rule is to accept Ha if the p-value is less


than .05.
x x x
z

The test statistic is


x
n

Performing the Test of Hypothesis


In order to perform an actual test of hypothesis, we must
identify several things, ensure the procedure is valid, and
draw conclusions without stopping at calculations.
For chapter 7, we are focusing on testing hypotheses
which deal with the population mean under the three
assumptions:
The population standard deviation is known
A random sample is obtained from the population
The sample size is large. (Sampling Distn of x )

Steps of the Test of Hypothesis for with


1. Identify the null and alternative hypotheses
2. Give the decision rule
3. Identify the form of the test statistic and calculate it
based on the sampled data.
4. Verify the method is valid (n is at least 30 for now)
5. Calculate the p-value based on the z-score and Ha
6. Give an interpretation.

Example from Page 227 #6


H0: = $122,000

Ha: < $122,000

Decision Rule: Accept Ha if the p-value < .05.

x 130210 122000
8210
z

2.19

23680
3744.13675
n
40

This is valid since n = 40 is at least 30.


P-value = probability a z-score is less than 2.19
= 0.5 + 0.486 = 0.986
At the .05 level of significance, there is insufficient
evidence to conclude the mean price for all new
homes in Florida is below $122,000.

Possible Errors
Realize, that a small p-value (or observed level of
significance) suggests that the alternative hypothesis
is true, but does not guarantee it is true.
A Type I Error consists of concluding that the
alternative hypothesis is true when, in fact, the null
hypothesis is true.
A Type II Error consists of concluding that the null
hypothesis is true when, in fact, the alternative
hypothesis is true.

Type I or Type II Errors


We can examine each error and attempt to control how
willing we are to commit each.
The probability of committing a Type I Error is given by
(alpha), the level of significance of the test.
The probability of committing a Type II Error is given
by (beta).
We will decide the seriousness of each error, and then
determine relative values for and .

Type I or Type II Errors: #3 on page 234


H0: Lab is not contaminated with mercury vapor.
Ha: Lab is contaminated with mercury vapor.
A Type I Error occurs if we conclude the lab is
contaminated when, in fact, the lab is not
contaminated with mercury vapor.
Consequences: The office would probably be closed, and
procedures to reduce the mercury vapor levels
would be implemented. This means costs for
decontamination and lack of income from patients,
but no one is endangered.

Type I or Type II Errors: #3 on page 234


H0: Lab is not contaminated with mercury vapor.
Ha: Lab is contaminated with mercury vapor.
A Type II Error occurs if we conclude the lab is NOT
contaminated when, in fact, the lab is contaminated
with mercury vapor.
Consequences: The office would be open and new
patients and workers could be exposed to high levels
of mercury vapor. This means possible law suits,
people getting sick, dangerous work environment. It
could lead to a bad reputation for this dental office.

Type I or Type II Errors: #3 on page 234


H0: Lab is not contaminated with mercury vapor.
Ha: Lab is contaminated with mercury vapor.
Which error is worse? Probably Type II in my opinion.
Hence, I want to avoid this, so I set the probability
low. The Type I Error means a loss of income, so
its not good for business, but its not as serious.
Id set > .
Id like small at .01, and maybe at .05.

Type I or Type II Errors


Be able to define a Type I Error and a Type II error in
terms of a scenario.
Be able to discuss the consequences of each type of
error.
Set values for and depending on those
consequences.
There are no rules on one error being worse than the
other in all situations.

You might also like