Post on 22-Feb-2016
description
9-1
Business Statistics: A Decision-Making Approach
8th Edition
Chapter 9Introduction to Hypothesis Testing
9-2
Chapter Goals
After completing this chapter, you should be able to:
Formulate null and alternative hypotheses involving a single population mean or proportion
Know what Type I and Type II errors are Formulate a decision rule for testing a hypothesis Know how to use the test statistic, critical value, and
p-value approaches to test the null hypothesis Compute the probability of a Type II error
9-3
What is Hypothesis Testing?
A statistical hypothesis is an assumption about a population parameter (assumption may or may not be true).
The best way to determine whether a statistical hypothesis is true would be to examine the entire population. Often impractical. So, examine a random sample If sample data are not consistent with the statistical hypothesis,
the hypothesis is rejected. We never 100% “prove” anything because of sampling error
Types of Hypotheses
Null hypothesis. Denoted by H0
Alternative hypothesis. Denoted by H1 or Ha
9-4
9-5
The Null Hypothesis, H0
States the assumption to be tested Example: The average number of TV sets in U.S. Homes is at
least three ( ) Is always about a population parameter, not about a
sample statistic (even though sample is used)
3μ:H0
3μ:H0 3x:H0
9-6
The Null Hypothesis, H0
Begin with the assumption that the null hypothesis is true Similar to the notion of “innocent until
proven guilty” Always contains “=” , “≤” or “” sign May or may not be rejected
Based on the statistical evidence gathered
(continued)
9-7
The Alternative Hypothesis, HA
Is the opposite of the null hypothesis e.g.: The average number of TV sets in U.S.
homes is less than 3 ( HA: µ < 3 ) Contains “≠”, “<” or “>” sign
Never contains the “=” , “≤” or “” sign May or may not be accepted
9-8
Example 1: The average annual income of buyers of Ford F150 pickup trucks is claimed to be $65,000 per year. An industry analyst would like to test this claim.
What is the appropriate test? H0: µ = 65,000 (income is as claimed) HA: µ ≠ 65,000 (income is different than claimed)
The analyst will believe the claim unless sufficient evidence is found to discredit it.
Formulating Hypotheses
9-9
Formulating Hypotheses
Example 2: Ford Motor Company has worked to reduce road noise inside the cab of the redesigned F150 pickup truck. It would like to report in its advertising that the truck is quieter. The average of the prior design was 68 decibels at 60 mph.
What is the appropriate test? H0: µ ≤ 67 (the truck is quieter: must be less than 68) HA: µ > 68 (the truck is not quieter)
Research Hypothesis
More appropriate approach: standard and universal for new product or service test
H0: µ ≥ 68 (the truck is not quieter) HA: µ < 68 (the truck is quieter) wants to support
Research Hypothesis: new product is superior than the original
If the null hypothesis is rejected, Ford has sufficient evidence to support that the truck is now quieter.
9-10
Steps for Formulating Hypothesis Tests
State the hypotheses. The hypotheses must be mutually exclusive. That is, if one is true, the other must be false.
Formulate an analysis plan. The analysis plan describes how to use sample data to
evaluate the null hypothesis. The evaluation often focuses around a single test statistic.
9-11
Steps for Formulating Hypothesis Tests
Analyze sample data. Find the value of the test statistic (mean score, proportion,
t-score, z-score, etc.) described in the analysis plan and interpret result.
Apply the decision rule described in the analysis plan. If the value of the test statistic is unlikely, based on the null
hypothesis, reject the null hypothesis.
9-12
9-13
3 outcomes for a hypothesis test1. No error (no need to discuss)2. Type I error (Khan academy: type I error)3. Type II error
Errors in Making Decisions
9-14
Errors in Making Decisions
Type I Error Rejecting a true null hypothesis Considered as a serious errorThe probability of Type I Error is
Called level of significance of the test Set by researcher in advance
(continued)
9-15
Errors in Making Decisions(continued)
Type II Error Failing to reject (i.e., accept) a false null
hypothesis
The probability of Type II Error is β
β is a calculated value, the formula is discussed later in the chapter
9-16
Outcomes and Probabilities
State of NatureDecisionDo NotReject
H0
No error (1 - )
Type II Error ( β )
RejectH0
Type I Error( )
Possible Hypothesis Test Outcomes
H0 False H0 True
Key:Outcome
(Probability) No Error ( 1 - β )
9-17
Type I & II Error Relationship
Type I and Type II errors cannot happen at the same time (mutually exclusive) Type I error can only occur if H0 is true
Type II error can only occur if H0 is false
If Type I error probability ( ) , then
Type II error probability ( β )
9-18
Level of Significance, The maximum allowable probability of committing a
Type I error (is selected by researcher at the beginning). Defines rejection region (Cutoff) of the sampling distribution
Is designated by , (level of significance) Typical values are 0.01, 0.05, or 0.10 Based on COST!
Want small probability of Type I error high cost Provides the critical value(s) of the test
The value corresponding to a significance level
9-19
Hypothesis Tests for the Mean
σ Known σ Unknown
Hypothesis Tests for
Assume first that the population standard deviation σ is known
9-20
Level of Significance and the Rejection Region
H0: μ ≥ 3 HA: μ < 3
0
H0: μ ≤ 3 HA: μ > 3
H0: μ = 3 HA: μ ≠ 3
/2
Lower tail test
Level of significance =
0
/2
Upper tail test Two tailed test
0
-zα zα -zα/2 zα/2
Reject H0 Reject H0 Reject H0 Reject H0Do not
reject H0
Do not reject H0
Do not reject H0
Example:Example: Example:
*comparison operator of each test*
9-21
Reject H0 Do not reject H0
The cutoff value, or ,
is called a critical value
-zα
xα
-zα xα
0
µ=3
H0: μ ≥ 3 HA: μ < 3
nσzμx
Critical Value for Lower Tail Test
based on
9-22
Reject H0Do not reject H0
Critical Value for Upper Tail Test
zα
xα
0
H0: μ ≤ 3 HA: μ > 3
nσzμx
µ=3
The cutoff value, or ,
is called a critical value
zα xα
9-23
Do not reject H0 Reject H0Reject H0
There are two cutoff values (critical values):
or
Critical Values for Two Tailed Tests
/2
-zα/2
xα/2
± zα/2
xα/2
0
H0: μ = 3 HA: μ ¹ 3
zα/2
xα/2
nσzμx /2/2
Lower
Upperxα/2
Lower Upper
/2
µ=3
9-24
z-units (Not as universal as using p-value): For given , find the critical z value(s):
-zα , zα ,or ±zα/2
Convert the sample mean x to a z test statistic:
Reject H0 if z is in the rejection region, otherwise do not reject H0
Two Equivalent Approaches to Hypothesis Testing
nσ
μxz
9-25
x units (Not Recommended and Not Necessary): Given , calculate the critical value(s)
xα , or xα/2(L) and xα/2(U)
The sample mean is the test statistic. Reject H0 if x is in the rejection region, otherwise do not reject H0
Two Equivalent Approaches to Hypothesis Testing
9-26
1. Specify population parameter of interest2. Formulate the null and alternative hypotheses3. Specify the desired significance level, α4. Define the rejection region5. Take a random sample and determine whether or not
the sample result is in the rejection region6. Reach a decision and draw a conclusion Example next slide
Detail Process of Hypothesis Testing
9-27
Hypothesis Testing Example
Test the claim that the true mean # of TV sets in US homes is at least 3.
(Assume σ = 0.8)1. Specify the population value of interest
Testing mean number of TVs in US homes
2. Formulate the appropriate null and alternative hypotheses H0: μ 3 HA: μ < 3 (This is a lower (left) tail test)
3. Specify the desired level of significance Suppose that = 0.05 is chosen for this test: probability is given,
need to find z value
Formula Table
6-28
We have
X Z p We want
X X=μ+zσ Norminv(p,μ,σ)
Z Normsinv(p as )
p Normdist(x,μ,σ,1) Normsdist(z)
),,(estandardiz
xz
xz
9-29
Reject H0 Do not reject H0
4. Determine the rejection region
= .05
-zα= -1.645 0
This is a one-tailed test with = 0.05 Since σ is known, the cutoff value is a z value:
Reject H0 if z < z = -1.645 ; otherwise do not reject H0
Hypothesis Testing Example(continued)
Normsinv(.05) = 1.645
9-30
5. Obtain sample evidence and compute the test statistic
Suppose a sample is taken with the following results: n = 100, x = 2.84 ( = 0.8 is assumed known) Then the test statistic is:
2.00.08
.16
1000.8
32.84
nσ
μxz
Hypothesis Testing Example
9-31
Reject H0 Do not reject H0
= .05
-1.645 0
6. Reach a decision and interpret the result
-2.0
Since z = -2.0 < -1.645, we reject the null hypothesis that the mean number of TVs in US homes is at least 3. There is sufficient evidence that the mean is less than 3.
Hypothesis Testing Example(continued)
z
9-32
Reject H0
= .05
2.8684Do not reject H0
3
An alternate way (not recommend) of constructing rejection region:
2.84
Since x = 2.84 < 2.8684, we reject the null hypothesis
Hypothesis Testing Example(continued)
x
Now expressed in x, not z units
2.86841000.81.6453
nσzμx αα
Not enough statistical evidence to conclude that the number of TVs is at least 3
9-33
Using p-Value
p-value: The p-value is the probability that your null hypothesis is actually correct. Simple and easy to apply: always reject null
hypothesis if p-value < . Best and Universal approach: because p-values
are usually computed by statistical SW packages (i.e., Excel, Minitab)
9-34
p-Value Approach to Testing
Convert Sample Statistic ( ) to Test Statistic (a z value, if σ is known)
Determine the p-value from a table or computer
Compare the p-value with
If p-value < , reject H0
If p-value , do not reject H0
x
(continued)
9-35
More than just a simple “reject” Can now determine how strongly we “reject” or
“accept” The further the p-value is from , the stronger
the decision Just compare “absolute value” whether it is
one-tail or two-tail test.
p-Value Approach to Testing(continued)
9-36
Example: Based on previous example, how likely is it to see a sample mean of 2.84 (or something further below the mean) if the true mean is = 3.0?
p-value =0.0228
= 0.05
p-value Example
0-1.645
-2.0: z value from previous example
zReject H0 Do not reject H0
Normsdist(-2) = 0.0228
Normsinv(.05) = 1.645
9-37
Compare the p-value with If p-value < , reject H0
If p-value , do not reject H0
Here: p-value = 0.0228 = 0.05
Since 0.0228 < 0.05, we reject the null hypothesis
(continued)
p-value Example
p-value =0.0228
= 0.05
-1.645 0
-2.0
Reject H0
9-38
Example: Upper Tail z Test for Mean ( Known)
A phone industry manager thinks that customer monthly cell phone bill have increased, and now average over $52 per month. The company wishes to test this claim. (Assume = 10 is known)
H0: μ ≤ 52 the average is not over $52 per month
HA: μ > 52 the average is greater than $52 per month(i.e., sufficient evidence exists to support the manager’s claim)
Form hypothesis (upper-tail) test:
9-39
Reject H0Do not reject H0
Suppose = 0.10 is chosen for this test
Find the rejection region:
= 0.10
zα=1.280
Reject H0
Reject H0 if z > 1.28
Example: Find Rejection Region(continued)
Normsinv(0.1) = 1.28
9-40
Obtain sample evidence and compute the test statistic
Suppose a sample is taken with the following results: n = 64, x = 53.1 (=10 was assumed known) Then the test statistic is:
0.88
6410
5253.1
nσ
μxz
Example: Test Statistic(continued)
9-41
Reject H0Do not reject H0
Example: Decision
= 0.10
1.280
Reject H0
Do not reject H0 since z = 0.88 ≤ 1.28i.e.: there is not sufficient evidence that the mean bill is over $52
z = 0.88
Reach a decision and interpret the result:(continued)
9-42
.18940.31060.500.88)P(z
6410
52.053.1zP
52.0)μ|53.1xP(
Reject H0
= 0.10
Do not reject H0 1.280
Reject H0
z = 0.88
Calculate the p-value and compare to
(continued)
p-value = 0.1894
p -Value Solution
Do not reject H0 since p-value = 0.1894 > = 0.10
1-NORMSDIST(0.88) = 0.1894
9-43
Using t value When Pop. Dist. Type is unknown and sample size is
smaller, convert sample statistic ( ) to a t – statistic. x
Known Unknown
Hypothesis Tests for
The test statistic is:
ns
μxt 1n
When to apply t-statistic
When σ is unknown, convert sample statistic (x) to a t – statistic. This is what the textbook said….based on assumption that the population is approximately normal.
In reality, we do not know whether the population is almost or even half normal or not. Sol, forget about what the textbook says.
Thus, if n is less than 30, apply t – statistic. Of course, if n is greater than equal to 30, apply z – statistic.
9-44
9-45
Hypothesis Tests for μ, σ Unknown
1. Specify the population value of interest2. Formulate the appropriate null and alternative
hypotheses3. Specify the desired level of significance4. Determine the rejection region (critical values are from
the t-distribution with n-1 d.f.)5. Obtain sample evidence and compute the test statistic6. Reach a decision and interpret the result
9-46
Example: Two-Tail Test
The average cost of a hotel room in New York is said to be $168 per night. A random sample of 25 hotels resulted in x = $172.50 and s = $15.40. Test at the
= 0.05 level(Assume the population distribution is normal) H0: μ = 168
HA: μ ¹ 168
9-47
= 0.05 n = 25 Critical Values: t24 = ± 2.0639 is unknown, so use a t statistic
Example Solution: Two-Tail Test
Do not reject H0: not sufficient evidence that true mean cost is different than $168
Reject H0Reject H0
/2=0.025
-tα/2
Do not reject H0
0 tα/2
/2=0.025
-2.0639 2.0639
1.46
2515.40
168172.50
ns
μxt 1n
1.46
H0: μ = 168 HA: μ ¹ 168
TINV
NORMSINV(p) gives the z-value that puts probability (area) p to the left of that value of z.
TINV(p,DF) gives the t-value that puts one-half the probability (area) to the right with DF degrees of freedom.
The reason for this is that TINV is used mainly to give the t-value used in confidence intervals.
Remember in confidence intervals we use zα/2 or tα/2. So to get tα/2, you put in α and TINV automatically splits it when giving the appropriate t-value.
9-48
TDIST
NORMSDIST(z) gives the probability (area) to the left of z. TDIST gives the area to the right of t; and on top of that it only
works for positive values of t if you do want the area to the left of t?
1 – (area to the right of t). The general form TDIST(t, degrees of freedom, 1 or 2). The last argument (1 or 2) 1 for one-tail test or 2 for two-tail test. This is because that, in general, TDIST is used to get the p-values
for t-tests.
9-49
Using Excel….
Download and review following Word files from the class website Implication of TDIST and TINV Using TDIST and TINV for Hypothesis
Download Finding Critical Value and P-Value Excel file….
Last slide for today’s lecture Review example from page 349 to 365
9-50
9-51
Hypothesis Tests in PHStat
Options
9-52
Sample PHStat Output
Input
Output
9-53
Hypothesis Tests for Proportions
Involves categorical values Two possible outcomes
“Success” (possesses a certain characteristic) “Failure” (does not possesses that characteristic)
Fraction or proportion of population in the “success” category is denoted by π
9-54
Proportions
The sample proportion of successes is denoted by p :
When both nπ and n(1- π) are at least 5, p is approximately normally distributed with mean and standard deviation
sizesamplesampleinsuccessesofnumber
nxp
πμp n
π)π(1σp
9-55
The sampling distribution of p is normal, so the test statistic is a z value:
Hypothesis Tests for Proportions
nπ)π(1
πpz
nπ 5and
n(1-π) 5
Hypothesis Tests for π
nπ < 5or
n(1-π) < 5
Not discussed in this chapter
9-56
Example: z Test for Proportion
A marketing company claims that it receives 8% responses from its mailing. To test this claim, a random sample of 500 were surveyed with 25 responses. Test at the = 0.05 significance level.
Check:
n π = (500)(0.08) = 40
n(1-π) = (500)(0.92) = 460
Both > 5, so assume normal
9-57
Z Test for Proportion: Solution
= 0.05 n = 500, p = 0.05
Reject H0 at = 0.05
H0: π = 0.08 HA: π ¹ 0.08
Critical Values: ± 1.96
Test Statistic:
Decision:
Conclusion:
z0
Reject Reject
0.0250.025
1.96-2.47
There is sufficient evidence to reject the company’s claim of 8% response rate.
-1.96
2.47
500.08)00.08(1
.0800.05
nπ)π(1
πpz
9-58
Do not reject H0 Reject H0Reject H0
/2 = 0.025
1.960
z = -2.47
Calculate the p-value and compare to (For a two tailed test the p-value is always two tailed)
0.01362(0.0068).4932)02(0.5
2.47)P(x2.47)P(z
p-value = .0136:
p -Value Solution
Reject H0 since p-value = 0.0136 < = 0.05
z = 2.47
-1.96
/2 = 0.025
0.00680.0068
9-59
Reject H0: μ 52
Do not reject H0 : μ 52
Type II Error Type II error is the probability of failing to reject a false H0
5250
Suppose we fail to reject H0: μ 52 when in fact the true mean is μ = 50
9-60
Reject H0: 52
Do not reject H0 : 52
Type II Error
Suppose we do not reject H0: 52 when in fact the true mean is = 50
5250
This is the true distribution of x if = 50
This is the range of x where H0 is not rejected
(continued)
9-61
Reject H0: μ 52
Do not reject H0 : μ 52
Type II Error
Suppose we do not reject H0: μ 52 when in fact the true mean is μ = 50
5250
β
Here, β = P( x cutoff ) if μ = 50
(continued)
9-62
Steps for Calculating b
1. Specify the population parameter of interest2. Formulate the hypotheses3. Specify the significance level4. Determine the critical value5. Determine the critical value for an upper or lower tail
test6. Specify the “true” population mean value of interest7. Compute z-value based on stipulated population
mean8. Use standard normal table to find b
9-63
Reject H0: μ 52
Do not reject H0 : μ 52
Suppose n = 64 , σ = 6 , and = 0.05
5250
So β = P( x 50.766 ) if μ = 50
Calculating β
50.7666461.64552
nσzμxcutoff
(for H0 : μ 52)
50.766
9-64
Reject H0: μ 52
Do not reject H0 : μ 52
.15390.346100.51.02)P(z
646
5050.766zP50)μ|50.766xP(
Suppose n = 64 , σ = 6 , and = 0.05
5250
Calculating β(continued)
Probability of type II error: β = 0.1539
9-65
Would like b to be as small as possible If the null hypothesis is FALSE, we want to reject it i.e., we want the hypothesis test to have a high
probability of rejecting a false null hypothesis Referred to as the power of the test
Power = 1 - b
Power Of Hypothesis Testing
9-66
Chapter Summary
Addressed hypothesis testing methodology
Performed z Test for the mean (σ known) Discussed p–value approach to
hypothesis testing Performed one-tail and two-tail tests
9-67
Chapter Summary
Performed t test for the mean (σ unknown)
Performed z test for the proportion Discussed Type II error and computed its
probability
(continued)