310 Spring2012 Chapter11
310 Spring2012 Chapter11
Introduction to Hypothesis
Testing
618
Hypothesis Testing
• Along with Estimation, Hypothesis Testing
constitutes the second type of statistical
inference.
619
Null and Alternative Hypothesis
• When we do hypothesis testing, we test
between two hypothesis or conjectures.
• The first such conjecture is called the null
hypothesis and is denoted as H0.
• The second conjecture is called the alternative
hypothesis and is denoted as H1.
• The goal is to design a statistical procedure
that allows us to determine whether the data
supports the null or the alternative
hypothesis.
620
• How do we determine which one is the null
(H0) and which one is the alternative (H1)
hypothesis?
621
• The basic illustrative example of hypothesis
testing and the distinction between H0 and H1 is
the issue of establishing culpability of a person
in a trial.
• The worst possible social outcome in this case is
to convict an innocent person. Thus, the null
hypothesis becomes:
H0 : The defendant is innocent
• And the alternative hypothesis is:
H1 : The defendant is guilty
• Again, H0 is the hypothesis (conjecture)
considered more costly (socially, economically,
etc.) to wrongly reject.
622
Type I and Type II Errors
• There are two types of errors (mistakes) we can make
in a hypothesis test:
I. Type I Error: Rejecting a true null hypothesis H0
II. Type II Error: Failing to reject a false null hypothesis
H0
• Significance Level: Is the probability of committing a
Type I error. It is typically denoted by α
• The probability of committing a Type II error is
typically denoted by β
• As we discussed above, the Type I error is deemed
more costly than Type II.
• The goal is to design testing procedures where the
researcher can control the significance level and fix it
to be low. For example, fix α=5%.
623
• Ideally, one would want procedures where both
error probabilities α and β Are low. Unfortunately,
these error probabilities are inversely related.
Therefore, we settle on fixing α to be low.
624
Logical Steps of a Hypothesis Test
• We begin with a null H0 and alternative hypothesis H1.
• The testing procedure begins with the assumption that
H0 is true.
• The goal is to determine whether there is enough
evidence in the data to support H1.
• There are only two possible decisions:
• Conclude that there is enough evidence to support H1
• Conclude that there is not enough evidence to support
H1
• The decision rule revolves around
Pr(Type I error) = α
625
Hypothesis Tests of a Population Mean µ
when the Standard Deviation is Known
• Here, the goal is to compare µ against a pre‐
specified value, µ*.
• There are two types of alternative hypothesis:
• Two‐tail test.‐ Here, we have
H0: µ = µ* vs. H1: µ ≠ µ*
• One‐tail tests.‐ Here, we could have either
H0: µ ≤ µ* vs. H1: µ > µ*
or…
H0: µ ≥ µ* vs. H1: µ < µ*
626
Re‐expressing One‐Tail Tests
• Suppose we have
H0: µ ≤ µ* vs. H1: µ > µ*
• Notice that if we have enough evidence in favor of
H1 when we start with the assumption that µ = µ*,
the evidence in favor of H1 would be even stronger if
we assumed that µ < µ*.
• For this reason, it would suffice to use
H0: µ = µ* vs. H1: µ > µ*
• If we reject µ = µ* in favor of µ > µ*, we would
automatically also reject µ ≤ µ* in favor of µ > µ*.
627
• Analogous reasoning leads us to conclude that, in
order to test
H0: µ ≥ µ* vs. H1: µ < µ*
it suffices to test
H0: µ = µ* vs. H1: µ < µ*
628
• Therefore, we can re‐express our tests as:
• Two‐tail test.‐
H0: µ = µ* vs. H1: µ ≠ µ*
• One‐tail tests.‐
H0: µ = µ* vs. H1: µ > µ*
or…
H0: µ = µ* vs. H1: µ < µ*
629
• Example 10.1: This is the example about the
manager wanting to estimate the demand for
computers.
• Back then, we determined that a 95%
confidence interval for the mean demand µ
was [340.76 , 399.56]
• Suppose now that the computer firm wants to
determine whether the mean demand µ is
different from 350.
• In this case, we would have
H0: µ=350 vs. H1: µ≠350
630
• Next, suppose a new inventory strategy is considered,
but it has been determined that this new strategy
would be profitable if and only if the mean demand µ
is greater than 350.
• Suppose the firm wants to test the hypothesis that this
new strategy will be profitable.
• Recall that H0 is the hypothesis that is costly to
wrongly reject. In this case, it would be costly to adopt
the new strategy when it is not profitable. Thus, we
should have “H0: The new strategy is NOT profitable”.
• That is, we should use a one‐tail test
H0: µ ≤ 350 vs. H1: µ > 350
• As we concluded previously, to test this one‐tail
hypothesis we use
H0: µ = 350 vs. H1: µ > 350
631
• Example 11.1: A department store is considering a
new billing system for the store’s credit customers. It
has been determined that the new system will be
cost‐effective only if the mean monthly account µ is
more than $170.
• Suppose the store wants to evaluate whether it
should adopt the new billing system or not.
• Again, the store wants to avoid wrongly considering
that the new system is cost‐effective. Therefore, we
should use:
H0: µ ≤ 170 vs. H1: µ > 170
• As before, to test this one‐tail hypothesis we simply
use
H0: µ = 170 vs. H1: µ > 170
632
Testing Methods
• OK, we are finally ready to describe the actual
methodology used in a hypothesis test.
X * xL
• Where xL is a cut‐off value. How do we determine xL by
making sure that we achieve the significance level α that
we pre‐specified. For this, we invoke the Central Limit
Theorem.
635
• That is, we choose xL in order to satisfy
Pr(Rejecting H0 when it is true) = α
• That is, we need
Pr( X * xL when H 0 is true)
• Next, recall “H0 is true” simply means “µ = µ*”.
• Therefore, we need xL to be such that:
Pr( X * xL when *)
• Using the Central Limit Theorem, if µ = µ*, then
X *
n
is approximately distributed as a Standard Normal
636
• Dividing both sides by , we have
X * xL
Pr( X * xL ) Pr
n n
• By the Central Limit Theorem, if µ= µ*, the above
probability is approximately equal to
xL
Pr Z
n
where Z is a Standard Normal random variable… 637
• If we want to make the above probability
equal to α, we need to make
xL
z
n
where (as before), zα is the value that satisfies
Pr(Z > zα) = α.
• To satisfy the above equality, we need to set
x L z
n
638
• Therefore, the rejection region approach tells
us to reject H0: µ = µ* in favor of H1: µ > µ* if
X * z
n
• Rearranging, we reject H0: µ = µ* in favor of
H1: µ > µ* if
X *
z
n
639
• We denote
X *
z
n
and we refer to z as the standardized test‐statistic
or simply as our test‐statistic.
645
• Again, denoting
X *
z
n
647
• So, we choose ∗ such that:
∗
∗
• We have
∗ ∗
∗ ∗
∗
• Next, notice that ∗ if and only if
∗
∗ < ∗
• Therefore,
∗ ∗
∗ ∗ < ∗
∗
∗
< ∗)
648
• Therefore, we need to choose ∗ such that
∗
∗
< ∗) =
• That is,
∗
∗
< ∗) = 1‐
• Standardizing both inequalities by , the
previous line becomes
∗
∗ ∗
649
• But by the Central Limit Theorem, if H0 is
correct and µ = µ*, the previous probability is
approximately equal to
̅∗ ̅∗
650
• To make this happen, recall from Chapter 10 that if Z
is a Standard Normal, then
651
• Again, denoting
X *
z
n
655
p‐Value Approach
• We have already described our rejection rules
for each type of test (two‐tailed, and one‐
tailed). Now, we can define the notion of a p‐
value:
• p‐Value: The p‐value of a test is the
probability of observing a test statistic at least
as extreme as the one computed in the data
given that the null hypothesis is true.
• Here, the phrase “at least as extreme” means
“at least as detrimental to the null
hypothesis”.
656
• Thus, we can now describe how to obtain the p‐
value for each type of test…
• Suppose we have H0: µ = µ* vs. H1: µ > µ*. We
know that we reject H0 in favor of H1 if our test‐
statistic X *
z
n
is large. Since the p‐value is the probability of
observing a test‐statistic at least as bad for H0 as
the one we observed in the data, then the p‐value
is the probability of observing a test‐statistic at
least as large as the one we obtained in the data
657
• Under the null hypothesis H0, the test‐statistic z
is approximately a Standard Normal.
• Therefore, the p‐value becomes
658
• Using the same reasoning, the p‐values for the other
types of tests are:
• If H0: µ = µ* vs. H1: µ < µ*.
p‐value =
659
Summary of p‐value formulas
• Let Z be a Standard Normal and ‘z’ be the value
obtained for our test‐statistic in the data
observed. Then:
• If H0: µ = µ* vs. H1: µ > µ*.
p‐value =
662
• Specifically, we want to test
against
• As we discussed previously, it suffices to test
against
• Our test statistic is
∗
664
• Example: A manufacturer of lightbulbs advertises that,
on average, its long‐life bulb will last more than 5,000
hours. To test this claim, a statistician took a random
sample of 100 bulbs and measured the amount of time
until each bulb burned out. He obtained
• If we assume that the lifetime of this type of bulb has a
standard deviation of 400 hours, can we conclude at
the 5% significance level that the claim is true?
• Letting µ denote the population mean of the lifetime of
bulbs, this problem asks us to test
against ,000
• Once again, it suffices to test
against
665
• Our test statistic is
∗
.
666
• The p‐value of this test is given by:
667