Download Hypothesis Testing

Document related concepts
Transcript
Chapter 9
Hypothesis
Testing
Understanding Basic Statistics
Fifth Edition
By Brase and Brase
Prepared by Jon Booze
Methods for Drawing Inferences
• We can draw inferences on a population
parameter in two ways:
1) Estimation (Chapter 8)
2) Hypothesis Testing (Chapter 9)
Copyright © Cengage Learning. All rights reserved.
9|2
Hypothesis Testing
• Hypothesis testing is the process of making
decisions about the value of a population
parameter.
Copyright © Cengage Learning. All rights reserved.
9|3
Establishing the Hypotheses
• Null Hypothesis: A hypothesis about a
parameter that often denotes a theoretical
value, a historical value, or a production
specification.
– Denoted as H0
• Alternate Hypothesis: A hypothesis that differs
from the null hypothesis, such that if we reject
the null hypothesis, we will accept the alternate
hypothesis.
– Denoted as H1 (in other sources HA).
Copyright © Cengage Learning. All rights reserved.
9|4
Hypotheses Restated
Copyright © Cengage Learning. All rights reserved.
9|5
Statistical Hypotheses
• The null hypothesis is always a statement of
equality.
– H0: μ = k, where k is a specified value
• The alternate hypothesis states that the
parameter (μ or p) is less than, greater than, or
not equal to a specified value.
Copyright © Cengage Learning. All rights reserved.
9|6
Statistical Hypotheses
Which of the following is an acceptable null
hypothesis?
a). H0:   1.2
b). H0:  > 1.2
c). H0:  = 1.2
d). H0:   1.2
Copyright © Cengage Learning. All rights reserved.
9|7
Statistical Hypotheses
Which of the following is an acceptable null
hypothesis?
a). H0:   1.2
b). H0:  > 1.2
c). H0:  = 1.2
d). H0:   1.2
Copyright © Cengage Learning. All rights reserved.
9|8
Types of Tests
• Left-Tailed Tests:
H1: μ < k
H1: p < k
• Right-Tailed Tests:
H1: μ > k
H1: p > k
• Two-Tailed Tests:
H1: μ ≠ k
H1: p ≠ k
Copyright © Cengage Learning. All rights reserved.
9|9
Types of Tests
A production manager believes that a particular
machine averages 150 or more parts produced per
day. What would be the appropriate hypotheses for
testing this claim?
a). H0:   150; H1:  > 150
b). H0:  > 150; H1:  = 150
c). H0:  = 150; H1:   150
d). H0:  = 150; H1:  > 150
Copyright © Cengage Learning. All rights reserved.
9 | 10
Types of Tests
A production manager believes that a particular
machine averages 150 or more parts produced per
day. What would be the appropriate hypotheses for
testing this claim?
a). H0:   150; H1:  > 150
b). H0:  > 150; H1:  = 150
c). H0:  = 150; H1:   150
d). H0:  = 150; H1:  > 150
Copyright © Cengage Learning. All rights reserved.
9 | 11
Hypothesis Testing Procedure
1)
2)
3)
4)
Select appropriate hypotheses.
Draw a random sample.
Calculate the test statistic.
Assess the compatibility of the test statistic
with H0.
5) Make a conclusion in the context of the
problem.
Copyright © Cengage Learning. All rights reserved.
9 | 12
Hypothesis Test of μ
x is Normal, σ is Known
Copyright © Cengage Learning. All rights reserved.
9 | 13
P-Value
P-values are sometimes called the probability of
chance.
Low P-values are a good indication that your test
results are not due to chance.
Copyright © Cengage Learning. All rights reserved.
9 | 14
P-Value for Left-Tailed Test
Copyright © Cengage Learning. All rights reserved.
9 | 15
P-Value for Right-Tailed Test
Copyright © Cengage Learning. All rights reserved.
9 | 16
P-Value for Two-Tailed Test
Copyright © Cengage Learning. All rights reserved.
9 | 17
Types of Errors in Statistical Testing
• Since we are making decisions with incomplete
information (sample data), we can make the
wrong conclusion.
– Type I Error: Rejecting the null hypothesis
when the null hypothesis is true.
– Type II Error: Accepting the null hypothesis
when the null hypothesis is false.
Copyright © Cengage Learning. All rights reserved.
9 | 18
Type I and Type II Errors
Copyright © Cengage Learning. All rights reserved.
9 | 19
Errors in Statistical Testing
• Unfortunately, we usually will not know when
we have made an error.
• We can only talk about the probability of making
an error.
• Decreasing the probability of making a type I
error will increase the probability of making a
type II error (and vice versa).
• We can only decrease the probability of both
types of errors by increasing the sample size
(obtaining more information), but this may not
be feasible in practice.
Copyright © Cengage Learning. All rights reserved.
9 | 20
Level of Significance
• Good practice requires us to specify in advance
the risk level of type I error we are willing to
accept.
• The probability of type I error is the level of
significance for the test, denoted by α (alpha).
Copyright © Cengage Learning. All rights reserved.
9 | 21
Type II Error
• The probability of making a type II error is
denoted by β (Beta).
• 1 – β is called the power of the test.
– 1 – β is the probability of rejecting H0 when
H0 is false (a correct decision).
Copyright © Cengage Learning. All rights reserved.
9 | 22
Type II Error
• The probability of making a type II error is
denoted by β (Beta).
• 1 – β is called the power of the test.
– 1 – β is the probability of rejecting H0 when
H0 is false (a correct decision).
Copyright © Cengage Learning. All rights reserved.
9 | 23
The Probabilities
Associated with Testing
Copyright © Cengage Learning. All rights reserved.
9 | 24
Concluding a Statistical Test
For our purposes, significant is defined as follows:
At our predetermined level of risk α, the evidence
against H0 is sufficient to reject H0. Thus we adopt
H1.
Copyright © Cengage Learning. All rights reserved.
9 | 25
Concluding a Statistical Test
For a particular experiment, P = 0.17 and  = 0.05.
What is the appropriate conclusion?
a). Reject the null hypothesis.
b). Do not reject the null hypothesis.
c). Reject both the null hypothesis and the
alternative hypothesis.
d). Accept both the null hypothesis and the
alternative hypothesis.
Copyright © Cengage Learning. All rights reserved.
9 | 26
Concluding a Statistical Test
For a particular experiment, P = 0.17 and  = 0.05.
What is the appropriate conclusion?
a). Reject the null hypothesis.
b). Do not reject the null hypothesis.
c). Reject both the null hypothesis and the
alternative hypothesis.
d). Accept both the null hypothesis and the
alternative hypothesis.
Copyright © Cengage Learning. All rights reserved.
9 | 27
Statistical Testing Comments
• Frequently, the significance is set at α = 0.05 or
α = 0.01.
• When we “accept” the null hypothesis, we are
not proving the null hypothesis to be true. We
are only saying that the sample evidence is not
strong enough to justify the rejection of H0.
– Some statisticians prefer to say “fail to reject
H0 ” rather than “accept H0 .”
Copyright © Cengage Learning. All rights reserved.
9 | 28
Interpretation of Testing Terms
Copyright © Cengage Learning. All rights reserved.
9 | 29
Testing µ When σ is Known
1) State the null hypothesis, alternate hypothesis,
and level of significance.
2) If x is normally distributed, any sample size will
suffice. If not, n ≥ 30 is required.
Calculate:
Copyright © Cengage Learning. All rights reserved.
9 | 30
Testing µ When σ is Known
3) Use the standard normal table and the type of
test (one or two-tailed) to determine the Pvalue.
4) Make a statistical conclusion:
If P-value ≤ α, reject H0.
If P-value > α, do not reject H0.
5) Make a context-specific conclusion.
Copyright © Cengage Learning. All rights reserved.
9 | 31
Testing µ When σ is Known
Suppose that the test statistic z = 1.85 for a righttailed test. Use Table 3 in the Appendix to find the
corresponding P-value.
a). 0.2514
b). 0.0322
c). 0.9678
d). 0.0161
Copyright © Cengage Learning. All rights reserved.
9 | 32
Testing µ When σ is Known
Suppose that the test statistic z = 1.85 for a righttailed test. Use Table 3 in the Appendix to find the
corresponding P-value.
a). 0.2514
b). 0.0322
c). 0.9678
d). 0.0161
Copyright © Cengage Learning. All rights reserved.
9 | 33
Testing µ When σ is Unknown
1) State the null hypothesis, alternate hypothesis,
and level of significance.
2) If x is normally distributed (or mound-shaped),
any sample size will suffice. If not, n ≥ 30 is
required. Calculate:
Copyright © Cengage Learning. All rights reserved.
9 | 34
Testing µ When σ is Unknown
3) Use the Student’s t table and the type of test
(one or two-tailed) to determine (or estimate)
the P-value.
4) Make a statistical conclusion:
If P-value ≤ α, reject H0.
If P-value > α, do not reject H0.
5) Make a context-specific conclusion.
Copyright © Cengage Learning. All rights reserved.
9 | 35
Using Table 4 to Estimate P-values
Suppose we calculate t = 2.22 for a one-tailed test
from a sample size of 6.
df = n – 1 = 5.
0.025 < P-value < 0.050
Copyright © Cengage Learning. All rights reserved.
9 | 36
Testing µ Using the
Critical Value Method
• The values of x that will result in the rejection
of the null hypothesis are called the critical
region of the x distribution.
• When we use a predetermined significance
level α, the Critical Value Method and the PValue Method are logically equivalent.
Copyright © Cengage Learning. All rights reserved.
9 | 37
Critical Regions for H0: µ = k
Copyright © Cengage Learning. All rights reserved.
9 | 38
Critical Regions for H0: µ = k
Copyright © Cengage Learning. All rights reserved.
9 | 39
Critical Regions for H0: µ = k
Copyright © Cengage Learning. All rights reserved.
9 | 40
Testing µ When σ is Known
(Critical Region Method)
1) State the null hypothesis, alternate hypothesis,
and level of significance.
2) If x is normally distributed, any sample size will
suffice. If not, n ≥ 30 is required.
Calculate:
Copyright © Cengage Learning. All rights reserved.
9 | 41
Testing µ When σ is Known
(Critical Region Method)
3) Show the critical region and critical value(s) on
a graph (determined by the alternate hypothesis
and α).
4) Conclude in favor of the alternate hypothesis if
z is in the critical region.
5) State a conclusion within the context of the
problem.
Copyright © Cengage Learning. All rights reserved.
9 | 42
Left-Tailed Tests
Copyright © Cengage Learning. All rights reserved.
9 | 43
Right-Tailed Tests
Copyright © Cengage Learning. All rights reserved.
9 | 44
Two-Tailed Tests
Copyright © Cengage Learning. All rights reserved.
9 | 45
Testing a Proportion p
Binomial Experiments:
r (# of successes) is a binomial variable
n is the number of independent trials
p is the probability of success on each trial
Test Assumption: np > 5 and n(1 – p) > 5
Copyright © Cengage Learning. All rights reserved.
9 | 46
Testing a Proportion p
Test Assumption: np > 5 and n(1 – p) > 5
The values of n and p for several experiments are
shown below. Which experiment should not be
tested using the normal distribution?
a). n = 48, p = 0.39
b). n = 843, p = 0.09
c). n = 52, p = 0.93
d). n = 12, p = 0.51
Copyright © Cengage Learning. All rights reserved.
9 | 47
Testing a Proportion p
Test Assumption: np > 5 and n(1 – p) > 5
The values of n and p for several experiments are
shown below. Which experiment should not be
tested using the normal distribution?
a). n = 48, p = 0.39
b). n = 843, p = 0.09
c). n = 52, p = 0.93
d). n = 12, p = 0.51
Copyright © Cengage Learning. All rights reserved.
9 | 48
Types of Proportion Tests
Copyright © Cengage Learning. All rights reserved.
9 | 49
The Distribution
of the Sample Proportion
r
Recall the distribution of pˆ 
n
is approximately normal with:
  p and  
Copyright © Cengage Learning. All rights reserved.
p(1  p)
n
9 | 50
Converting the Sample Proportion to z
Copyright © Cengage Learning. All rights reserved.
9 | 51
Testing p
1) State the null hypothesis, alternate hypothesis,
and level of significance.
2) Check np > 5 and nq > 5
(recall q = 1 – p). Compute:
p = the specified value in H0
Copyright © Cengage Learning. All rights reserved.
9 | 52
Testing p
3) Use the standard normal table and the type of
test (one or two-tailed) to determine the Pvalue.
4) Make a statistical conclusion:
If P-value ≤ α, reject H0.
If P-value > α, do not reject H0.
5) Make a context-specific conclusion.
Copyright © Cengage Learning. All rights reserved.
9 | 53
Using the Critical Value Method for p
• As when testing for means, we can use the
critical value method when testing for p.
• Use the critical value graphs exactly as when
testing µ.
Copyright © Cengage Learning. All rights reserved.
9 | 54
Critical Thinking: Issues Related to
Hypothesis Testing
• Central question – Is the value of test statistic
too different from zero for the difference to be
due to chance alone?
• The P-value gives the probability that the test
statistic’s value is due to chance alone.
Copyright © Cengage Learning. All rights reserved.
9 | 55
Critical Thinking: Issues Related to
Hypothesis Testing
• If the P-value is close to α, then we might
attempt to clarify the results by
- increasing the sample size
- controlling the experiment to reduce the
standard deviation
• How reliable is the study and the
measurements in the sample? – Consider the
source of the data and the reliability of the
organization doing the study.
Copyright © Cengage Learning. All rights reserved.
9 | 56