Download Ch. 9 - Single Hypo Test = Sigma known

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project

Document related concepts
Transcript
σ
σ
Copyright ©2013 Pearson Education, Inc. publishing as Prentice Hall
9-1
Single Population/Sample Hypothesis Testing:
• What are you trying to do?
– Have parameters (mean, standard deviation) for the population (“truth”)
• µ, σ
– Have sampled data and associated summary statistics
• X_bar, s
– Want to know if the sample is statistically significantly different from the
population
• Can’t simply compare the means
• Need to allow for that the sample’s mean can vary from 1 sample to the next, i.e.,
allow for variability
UCLx  x  zα/ 2σ x
LCLx  x  zα/ 2σ x
Copyright ©2013 Pearson Education, Inc. publishing as Prentice Hall
9-2
Hypothesis Testing for Single Populations
- How do we allow for variability?
- Depends on what we know about the data
Hypothesis
Testing
Population
Mean
Population
Proportion
Section 9.4
σ Known
σ Unknown
Section 9.2
Section 9.3
Copyright ©2013 Pearson Education, Inc. publishing as Prentice Hall
9-3
9.1 An Introduction to Hypothesis
Testing
• A hypothesis is an assumption about a
population parameter such as a mean or a
proportion
• Example: population mean
– The mean data use for smartphone users is μ = 1.8
gigabytes per month
• Example: population proportion
– The proportion of cell phone users with 4G contracts
is π = 0.62
Copyright ©2013 Pearson Education, Inc. publishing as Prentice Hall
9-4
Stating the Hypothesis
• Every hypothesis test has both a null hypothesis and
an alternative hypothesis
• The null hypothesis (H0) represents the status quo
– States a belief that the population parameter is ≤, =, or ≥ a
specific value
– The null hypothesis is believed to be true unless there is
overwhelming evidence to the contrary
• The alternative hypothesis (H1) represents the
opposite of the null hypothesis
– Is believed to be true if the null hypothesis is found to be false
– The alternative hypothesis always states that the population
parameter is >, ≠, or < a specific value
Copyright ©2013 Pearson Education, Inc. publishing as Prentice Hall
9-5
Stating the Hypothesis
• Stating the null and alternative hypotheses depends on
the nature of the test and the motivation of the person
conducting it
H0: μ ≤ 1.8
H1: μ > 1.8
This test would be used by someone who thinks that data
use has gone up, and wants to support that the average
data use is now more than 1.8 gigabytes per month
H0: μ ≥ 1.8
H1: μ < 1.8
This would be used by someone who wants to test an
assumption that data use has gone down (rejecting the
null hypothesis would support the alternative that the
average data use is less than 1.8 gigabytes per month)
H0: μ = 1.8
H1: μ ≠ 1.8
This test would be used by someone who has no specific
expectation, but wants to test the assumption that the
average data use is 1.8 gigabytes per month
Copyright ©2013 Pearson Education, Inc. publishing as Prentice Hall
9-6
Two-Tail Hypothesis Tests
• A two-tail hypothesis test is used whenever the
alternative hypothesis is expressed as ≠
We assume that μ = 1.8 unless the sample mean is
much higher or much lower than 1.8
H0: μ = 1.8
H1: μ ≠ 1.8
Reject H0
Do not reject H0
Reject H0
x scale
1.8
H
Reject H0
0
Do not reject H0
Reject H0
Copyright ©2013 Pearson Education, Inc. publishing as Prentice Hall
9-7
One-Tail Hypothesis Tests
• A one-tail hypothesis test is used when the alternative
hypothesis is stated as < or >
H0: μ ≤ 1.8
H1: μ > 1.8
H0: μ ≥ 1.8
H1: μ < 1.8
Lower tail test: We assume that
μ = 1.8 unless the sample mean
is much lower than 1.8
Upper tail test: We assume that
μ = 1.8 unless the sample mean is
much higher than 1.8
Do not reject H0
x scale
1.8
H
x scale
1.8
H
0
Do not reject H0
Do not reject H0
Reject H0
Reject H0
Reject H0
Reject H0
Copyright ©2013 Pearson Education, Inc. publishing as Prentice Hall
9-8
0
Do not reject H0
The Logic of Hypothesis Testing
• The null hypothesis can never be accepted
• The only two options available are to
(1) reject the null hypothesis, or
(2) fail to reject the null hypothesis
• The null hypothesis is tested using sample data
– The sample result provides enough evidence to reject the null or does not
provide enough evidence to reject
Copyright ©2013 Pearson Education, Inc. publishing as Prentice Hall
9-9
The Difference Between Type I
and Type II Errors
• Sample evidence is not perfect due to sampling
error, so a conclusion about the population can
be wrong
• A Type I error occurs when the null hypothesis is
rejected when it is true
– The probability of making a Type I error is known as α , the level
of significance
• A Type II error occurs when we fail to reject the null
hypothesis when it is not true
– The probability of making a Type II error is known as β
Copyright ©2013 Pearson Education, Inc. publishing as Prentice Hall
9-10
Calculating the Probability of Type II Errors
Occurring
Example: Suppose we fail to reject H0: μ ≥ 50
when in fact the true mean is μ = 52
α = 0.05
x
50
Do not reject H0 :   50
H0
Reject H0:   50
This is the range of x
where H0 is not rejected
52
Copyright ©2013 Pearson Education, Inc. publishing as Prentice Hall
9-11
This is the actual
distribution of x
if  = 52
The Difference Between Type I
and Type II Errors
• Decision Rules for the Two Types of Hypothesis Errors
Possible Hypothesis Test Outcomes
Actual State of H0
Decision
H0 is True
Type I Error
P(Type I Error) = 
Reject H0
Do Not Reject H0
Correct Outcome
H0 is False
Correct Outcome
Type II Error
P(Type II Error) = β
Copyright ©2013 Pearson Education, Inc. publishing as Prentice Hall
9-12
The Difference Between Type I
and Type II Errors
• When doing a hypothesis test, decide on a value for α before
selecting the sample
• Once α has been set, the value of β can be calculated
• For a given sample size, reducing the value of α will result in an
increase in the value of
(or the opposite, α ↑ → β ↓)
• The only way to reduce both α and β simultaneously is to
increase the sample size
Copyright ©2013 Pearson Education, Inc. publishing as Prentice Hall
9-13
9.2 Hypothesis Testing for the
Population Mean when σ is Known
Hypothesis
Testing
Population
Mean
σ Known
Population
Proportion
σ Unknown
Section 9.2
Copyright ©2013 Pearson Education, Inc. publishing as Prentice Hall
9-14
Hypothesis Testing for the
Population Mean when σ is Known
• Hypothesis testing when σ is known:
1. If the sample size is small (n < 30) the population
must follow the normal distribution
2. If the sample size is large (n ≥ 30) the Central Limit
Theorem states that the sampling distribution follows
the normal distribution, so there is no restriction on
the population distribution
Copyright ©2013 Pearson Education, Inc. publishing as Prentice Hall
9-15
An Example of a One-Tail Hypothesis Test for the
Population Mean (When σ Is Known)
• Example: A new CFL bulb is claimed to have an
average life that exceeds 8,000 hours
– Suppose the average life of a random sample of 36 of
the new bulbs is 8,120 hours
– Assume that the population standard deviation for the
life of CFL bulbs is 500 hours
• The following slides show six steps to complete this
hypothesis test
Copyright ©2013 Pearson Education, Inc. publishing as Prentice Hall
9-16
An Example of a One-Tail Hypothesis Test for the
Population Mean (When σ Is Known)
• Example: (continued)
• Step 1: Identify the null and alternative hypotheses
H0: μ ≤ 8,000 hours
(status quo: average life is not greater than 8,000 hours)
H1: μ > 8,000 hours
(the new bulb does last longer than 8,000 hours)
• Step 2: Set a value for the significance level, α
– The level of significance represents the probability of making a
Type I error
– Suppose that α = 0.05 is chosen
Copyright ©2013 Pearson Education, Inc. publishing as Prentice Hall
9-17
An Example of a One-Tail Hypothesis Test for the
Population Mean (When σ Is Known)
• Example: (continued)
• Step 3: Determine the appropriate critical value
– σ is known so use a z-score; the critical z-score identifies the
rejection region for this one-tail test
– Since this is a one-tail test the entire area for α = 0.05 is placed on
the right side (upper tail) of the sampling distribution:
Do not reject H0
Reject H0
α = 0.05
0.95
8,000
0
H
z  1.645
x scale
z scale
0
Do not reject H0
Reject H0
Copyright ©2013 Pearson Education, Inc. publishing as Prentice Hall
9-18
An Example of a One-Tail Hypothesis Test for the
Population Mean (When σ Is Known)
• Example: (continued)
• Step 4: Calculate the appropriate test statistic
Formula for the z-test statistic for a hypothesis test for the population
mean (when σ is known):
where:
x  μH 0
zx 
σ
n
z x = The z-test statistic
x = The sample mean
μ H 0 = The mean of the sampling distribution,
which is assumed to be true for
the null hypothesis
σ = The standard deviation of the population
n = The sample size
Copyright ©2013 Pearson Education, Inc. publishing as Prentice Hall
9-19
An Example of a One-Tail Hypothesis Test for the
Population Mean (When σ Is Known)
• Example: (continued)
• Step 4: Calculate the appropriate test statistic
x  μH 0 8,120  8,000
120
zx 


 1.44
σ
500
83.33
n
36
• Step 5: Compare the z-test statistic z x with the critical z-score z
– For a one-tail upper tail test, reject the null hypothesis if
– Here, 1.44 is not greater than 1.645, so do not reject H0
– (Illustrated on the next slide)
Copyright ©2013 Pearson Education, Inc. publishing as Prentice Hall
9-20
z x > z
An Example of a One-Tail Hypothesis Test for the
Population Mean (When σ Is Known)
• Step 5: (continued)
z x  1.44 is not greater than z = 1.645, so do not reject H0
Do not reject H0
Reject H0
α = 0.05
8,000
z x  1.44 z  1.645
Copyright ©2013 Pearson Education, Inc. publishing as Prentice Hall
9-21
x scale
z scale
An Example of a One-Tail Hypothesis Test for the
Population Mean (When σ Is Known)
Rule for
this
example
Copyright ©2013 Pearson Education, Inc. publishing as Prentice Hall
9-22
An Example of a One-Tail Hypothesis Test for the
Population Mean (When σ Is Known)
• Example: (continued)
• Step 5a: (Optional) Compare the sample mean x with the critical
sample mean x
• The critical sample mean, x , is the sample mean that marks the
boundary of the rejection region
Formula for the critical sample mean for a hypothesis test for the
population mean (when σ is known)
x  μH 0
 σ 
 ( z )

 n
Copyright ©2013 Pearson Education, Inc. publishing as Prentice Hall
9-23
An Example of a One-Tail Hypothesis Test for the
Population Mean (When σ Is Known)
• Step 5a: (continued)
 σ 
 500 
x  μH 0  ( z )
  8,000  (1.645)
  8,137.1
 n
 36 
Do not reject H0
The sample
result of 8,120
is not greater
than 8,137.1,
so do not
reject H0
8,000
Reject H0
α = 0.05
x  8,120
x  8,137.1
x scale
z x  1.44
z  1.645
z scale
Copyright ©2013 Pearson Education, Inc. publishing as Prentice Hall
9-24
An Example of a One-Tail Hypothesis Test for the
Population Mean (When σ Is Known)
• Example: (continued)
• Step 6: (Final Step) State the conclusion
• According to our sample of 36 new CFL bulbs, there is not
enough evidence to support Edalight’s claim that the average
life of these bulbs exceeds 8,000 hours.
Copyright ©2013 Pearson Education, Inc. publishing as Prentice Hall
9-25
The p-value Approach to Hypothesis Testing: OneTail Tests
• The p-value is the probability of observing a sample mean at
least as extreme as the one selected for the hypothesis test,
assuming the null hypothesis is true
• The p-value is sometimes referred to as the observed level of
significance
• Provides a third approach to deciding whether or not to reject the
null hypothesis
Copyright ©2013 Pearson Education, Inc. publishing as Prentice Hall
9-26
The p-value Approach to Hypothesis Testing: OneTail Tests
• Use the CFL bulb example to illustrate:
– Claim: μ ≥ 8,000
– Sample result: n = 36;
= 8,120 x
– σ = 500 was assumed known
• The p-value represents the probability of obtaining a sample mean of 8,120
hours or greater if the true population mean is 8,000 hours




8.120

8,000
  P(z x  1.44)  1 0.9251  0.0749
P( x  8,120 )  P z x 
500




36


Copyright ©2013 Pearson Education, Inc. publishing as Prentice Hall
9-27
The p-value Approach to Hypothesis Testing: OneTail Tests
p-value = 0.0749
0.9251
Compare the p-value with α:
8,000
x  8,120
x scale
z x  1.44
z scale
0.95
Since 0.0749 > 0.05,
we do not reject H0
8,000
Copyright ©2013 Pearson Education, Inc. publishing as Prentice Hall
9-28
α = 0.05
x  8,137.1
x scale
z  1.645
z scale
An Example of a Two-Tail Hypothesis Test for the
Population Mean (When σ Is Known)
• Example: The mean data use for smartphone
users is claimed to be μ = 1.8 gigabytes per
month
– Suppose data use is recorded for 49 randomly
selected smartphone users and the average use is
found to be 1.86 gigabytes per month
– Assume that the population standard deviation is 0.20
gigabytes per month
• The following slides show six steps to complete this
hypothesis test
Copyright ©2013 Pearson Education, Inc. publishing as Prentice Hall
9-29
An Example of a Two-Tail Hypothesis Test for the
Population Mean (When σ Is Known)
• Example: (continued)
• Step 1: Identify the null and alternative hypotheses
H0: μ = 1.8
(status quo: average use is 1.8 gigabytes per month)
H1: μ ≠ 1.8
(average use is not equal to 1.8 gigabytes per month)
• Step 2: Set a value for the significance level, α
– The level of significance represents the probability of making a
Type I error, chosen before conducting the hypothesis test
– Suppose that α = 0.05 is chosen
Copyright ©2013 Pearson Education, Inc. publishing as Prentice Hall
9-30
An Example of a Two-Tail Hypothesis Test for the
Population Mean (When σ Is Known)
• Example: (continued)
• Step 3: Determine the appropriate critical values
– σ is known so use a z-score; the critical z-score identifies the
rejection region for this one-tail test
– Since this is a two-tail test, α = 0.05 is split evenly into two tails:
Reject H0
α/2 = 0.025
Do not reject H0
Reject H0
α/2 = 0.025
0.95
z / 2  1.96
Reject H0
1.8
0
H
z / 2  1.96
x scale
z scale
0
Do not reject H0
Reject H0
Copyright ©2013 Pearson Education, Inc. publishing as Prentice Hall
9-31
An Example of a Two-Tail Hypothesis Test for the
Population Mean (When σ Is Known)
• Example: (continued)
• Step 4: Calculate the appropriate test statistic
x  μH 0 1.86  1.8
0.06
zx 


 2.10
σ
0.20
0.0286
n
49
• Step 5: Compare the z-test statistic z x with the critical z-score z / 2
– For a two-tail test, reject the null hypothesis if
– Here, 2.10 is greater than 1.96, so reject H0
– (Illustrated on the next slide)
Copyright ©2013 Pearson Education, Inc. publishing as Prentice Hall
9-32
z x  z / 2
An Example of a Two-Tail Hypothesis Test for the
Population Mean (When σ Is Known)
• Step 5: (continued)
z x  2.10 is greater than z / 2 = 1.96, so reject H0
Reject H0
α/2 = 0.025
Reject H0
α/2 = 0.025
Do not reject H0
z / 2  1.96
1.8
0
z / 2  1.96
z x  2.10
Copyright ©2013 Pearson Education, Inc. publishing as Prentice Hall
9-33
x scale
z scale
An Example of a Two-Tail Hypothesis Test for the
Population Mean (When σ Is Known)
• Example: (continued)
• Step 5a: (Optional) Compare the sample mean x with the critical
sample means x / 2
• A two-tail hypothesis test has two critical means, one on either side of
the distribution

Upper x / 2  μH 0  ( z / 2 )


Lower x / 2  μ H 0  ( z / 2 )

σ 
 0.20 
  1.8  (1.96)
  1.856
n
 49 
σ 
 0.20 
  1.8  (-1.96)
  1.744
n
 49 
Copyright ©2013 Pearson Education, Inc. publishing as Prentice Hall
9-34
An Example of a Two-Tail Hypothesis Test for the
Population Mean (When σ Is Known)
• Step 5a: (continued)
•
x  1.86 is not within the interval (1.744, 1.856), so the null hypothesis
is rejected
Reject H0
α/2 = 0.025
The sample
result of 1.86
is greater than
1.856, so
reject H0
Do not reject H0
x / 2  1.744
1.8
0 x  1.856
 /2
z / 2  1.96
z / 2  1.96
Reject H0
α/2 = 0.025
x  1.86
x scale
z x  2.10
z scale
Copyright ©2013 Pearson Education, Inc. publishing as Prentice Hall
9-35
An Example of a Two-Tail Hypothesis Test for the
Population Mean (When σ Is Known)
• Example: (continued)
• Step 6: (Final Step) State the conclusion
• Our sample of 49 smartphone users provides sufficient
evidence to reject the null hypothesis, so we support the
alternative hypothesis that the average data use is not equal to
1.8 gigabytes per month.
Copyright ©2013 Pearson Education, Inc. publishing as Prentice Hall
9-36
The p-value Approach to Hypothesis Testing: OneTail Tests
• For a two-tail hypothesis test, the p-value is a sum of two
tail areas
• Illustrate using the smartphone example:
α/2 = 0.025
α/2 = 0.025
Area = 0.0179
Area = 0.0179
x / 2  1.744
z x  2.10
1.8
0 x  1.856
 /2
z / 2  1.96
z / 2  1.96
x  1.86
x scale
z x  2.10
z scale
p - value  2  P( x  1.86)  2  P(z x  2.10)  2(0.0179)  0.0358
Copyright ©2013 Pearson Education, Inc. publishing as Prentice Hall
9-37
The Role α Plays in Hypothesis Testing
• Changing α changes the critical z-score in the hypothesis test, which, in turn,
changes the rejection region in the sampling distribution
Copyright ©2013 Pearson Education, Inc. publishing as Prentice Hall
9-38