Lect Hypothesis Testing
Lect Hypothesis Testing
Statistics 509
E. A. Pena
Hypothesis Testing 1
Overview of this Lecture
• The problem of hypotheses testing
• Elements and logic of hypotheses testing (hypotheses,
decision rule, one- and two-tailed tests, significance
level, Type I and Type II errors, power of test,
implications of the decision, p-values)
• Steps in performing a hypotheses test
• Large-sample test for the population mean
• Two-sample tests for the population means
• Large-sample test for the population proportion
• Two-sample tests for the population proportions
Hypothesis Testing 2
The problem of hypotheses testing
• Statement of the Problem:
• Given a population (equivalently a distribution) with a
parameter of interest, , (which could be the mean,
variance, standard deviation, proportion, etc.), we
would like to decide/choose between two
complementary statements concerning . These
statements are called statistical hypotheses.
• The choice or decision between these hypotheses is to
be based on a sample data taken from the population of
interest.
• The ideal goal is to be able to choose the hypothesis
that is true in reality based on the sample data.
Hypothesis Testing 3
Situations where Hypotheses Testing is
Relevant
• Example: A quality engineer would like to determine
whether the production process he is charged of
monitoring is still producing products whose mean
response value is supposed to be 0 (process is in-
control), or whether it is producing products whose
mean response value is now different from the required
value of 0 (process is out-of-control).
Hypothesis Testing 5
Elements and Logic of Statistical
Hypotheses Testing
• Consider a population or distribution whose mean is . To
introduce the elements and discuss the logic of hypotheses
testing, we consider the problem of deciding whether =
0, where 0 is a pre-specified value, or 0.
Hypothesis Testing 6
The Statistical Hypotheses
• The null hypothesis, H0, is usually the hypothesis that
corresponds to the status quo, the standard, the desired
level/amount, or it represents the statement of “no
difference.”
• H0: = 0
• H1: 0.
Hypothesis Testing 11
The Test Statistic
X 0
X or equivalently, Z c .
n
• The latter is a reasonable choice since it measures how far
the sample mean is from the population mean under H0.
The larger the value of |Zc| the more it will indicate that H0
is not true.
• Furthermore, under H0, by virtue of the Central Limit
Theorem, the sampling distribution of Zc will be
approximately standard normal.
Hypothesis Testing 12
When to Reject H0 and its Consequences
• Having decided which test statistic to use, the next step
is to specify the precise situation in which to reject H0.
We have said that it is logical to reject H0 if the absolute
value of Zc is large.
• But how “large” is “large”?
• For the moment, let us specify a critical value, denoted
by C, such that if
• |Zc| > C
• then H0 will be rejected.
• Before deciding on the value of C, let us examine the
consequences of our decision rule.
Hypothesis Testing 13
Possible Errors of Decision
• Remember at this stage that either H0 is correct, or H1 is
correct. Thus, there is a “true state of reality,” but this
state is not known to us (otherwise we wouldn’t be
performing a test).
Hypothesis Testing 16
Setting the Probability of a Type I Error
• In trying to minimize, however, the probability of a
Type I error, we encounter an obstacle in that the
probabilities of the Type I and Type II errors are
inversely related. Thus, if we try to make the probability
of a Type I error very, very small, then it will make the
probability of a Type II error quite large.
• As a compromise we therefore specify a maximum
tolerable Type I error probability, called the
significance level, and denoted by , and choose the
critical value C such that the probability of a Type I
error is (at most) equal to .
• This is conventionally set to 0.10, 0.05, or 0.01.
Hypothesis Testing 17
Determining the Critical Value, C
• Let us now determine the critical value C in our test.
Recall that our test will reject H0 if |Zc| > C.
• C = Z/2, which is the value such that P{Z > Z/2} = /2.
Hypothesis Testing 18
The Resulting Decision Rule
• Given a significance level of , for testing the null
hypothesis H0: = 0 versus the alternative hypothesis H1:
0, the appropriate test statistic, under the assumptions
that (a) is known, and (b) n > 30 is given by:
X 0
Reject H 0 if Z c z .
n 2
Hypothesis Testing 19
Data Gathering and Making the Decision
• Having specified the final decision rule, the next step is to
gather the sample data and to compute the sample mean and
the value of Zc.
Hypothesis Testing 21
On Conclusions … continued
• On the other hand, if we did not reject H0, then either
we are making the correct decision, or we are making a
Type II error.
• However, since we did not control for the Type II error
probability (when we set the Type I error probability to
be , we “closed our eyes to the probability of a Type
II error”), if we do not reject H0, we cannot conclude
that H0 is true. Rather, we could only say that we
“failed to reject H0 on the basis of the available data.”
• This is the basis of the saying that: “you can never
prove a theory, you can only disprove it.”
Hypothesis Testing 22
Recapitulation: Steps in Hypotheses
Testing
• Step 1: Formulate your null and alternative hypotheses.
• Step 2: Determine the type of sample you will be getting
with regards to sample size, knowledge of the standard
deviation, etc.
• Step 3: Specify your level of significance.
• Step 4: State precisely your decision rule.
• Step 5: Gather your sample data and compute the test
statistic.
• Step 6: Decide and make final conclusions.
Hypothesis Testing 23
The p-Value Approach
• Another approach to making the decision in hypotheses
testing is to compute the p-value associated with the
observed value of the test statistic.
Hypothesis Testing 24
Deciding Based on the p-Value
• If the p-value exceed 0.10, then H0 is not rejected and
we say that the result is not significant.
• If the p-value is between 0.10 and 0.05, we usually say
that the result is almost significant or tending towards
significance.
• If the p-value is between 0.05 and 0.01, we reject H0
and conclude that the result is significant.
• If the p-value is less than 0.01 then H0 is rejected and
conclude that the result is highly significant.
• Or, we may compare the p-value with the level of
significance: if it is smaller, reject H0.
Hypothesis Testing 25
Illustrative Problems
Hypothesis Testing 29