Date post: | 06-Jul-2015 |
Category: |
Documents |
Upload: | eskuid-rebocero |
View: | 306 times |
Download: | 4 times |
Chapter 7
Hypothesis Testing with One Sample
1Math 117 – Eddie Laanaoui
Chapter Outline
• 7.1 Introduction to Hypothesis Testing
• 7.2 Hypothesis Testing for the Mean (Large Samples)
• 7.3 Hypothesis Testing for the Mean (Small Samples)
• 7.4 Hypothesis Testing for Proportions
2Math 117 – Eddie Laanaoui
Section 7.1
Introduction to Hypothesis Testing
3Math 117 – Eddie Laanaoui
Section 7.1 Objectives
• State a null hypothesis and an alternative hypothesis
• Identify type I and type II errors and interpret the level of significance
• Determine whether to use a one-tailed or two-tailed statistical test and find a p-value
• Make and interpret a decision based on the results of a statistical test
• Write a claim for a hypothesis test
4Math 117 – Eddie Laanaoui
Hypothesis Tests
Hypothesis test
• A process that uses sample statistics to test a claim about the value of a population parameter.
• For example: An automobile manufacturer advertises that its new hybrid car has a mean mileage of 50 miles per gallon. To test this claim, a sample would be taken. If the sample mean differs enough from the advertised mean, you can decide the advertisement is wrong.
5Math 117 – Eddie Laanaoui
Hypothesis Tests
Statistical hypothesis
• A statement, or claim, about a population parameter.
• Need a pair of hypotheses
• one that represents the claim
• the other, its complement
• When one of these hypotheses is false, the other must be true.
6
Math 117 – Eddie Laanaoui
Stating a Hypothesis
Null hypothesis
• A statistical hypothesis that contains a statement of equality such as ≤, =, or ≥.
• Denoted H0 read “H subzero” or “H naught.”
Alternative hypothesis
• A statement of inequality such as >, ≠, or <.
• Must be true if H0 is false.
• Denoted Ha read “H sub-a.”
complementary statements
7Math 117 – Eddie Laanaoui
Stating a Hypothesis
• To write the null and alternative hypotheses, translate the claim made about the population parameter from a verbal statement to a mathematical statement.
• Then write its complement.
H0: μ ≤ kHa: μ > k
H0: μ ≥ kHa: μ < k
H0: μ = kHa: μ ≠ k
• Regardless of which pair of hypotheses you use, you always assume μ = k and examine the sampling distribution on the basis of this assumption.
8Math 117 – Eddie Laanaoui
Example: Stating the Null and Alternative Hypotheses
Write the claim as a mathematical sentence. State the null and alternative hypotheses and identify which represents the claim.1.A university publicizes that the proportion of its students who graduate in 4 years is 82%.
Equality condition
Complement of H0
H0:
Ha:
(Claim)p = 0.82
p ≠ 0.82
Solution:
9Math 117 – Eddie Laanaoui
μ ≥ 2.5 gallons per minute
Example: Stating the Null and Alternative Hypotheses
Write the claim as a mathematical sentence. State the null and alternative hypotheses and identify which represents the claim.2.A water faucet manufacturer announces that the mean flow rate of a certain type of faucet is less than 2.5 gallons per minute.
Inequality condition
Complement of HaH0:
Ha:(Claim)μ < 2.5 gallons per minute
Solution:
10Math 117 – Eddie Laanaoui
μ ≤ 20 ounces
Example: Stating the Null and Alternative Hypotheses
Write the claim as a mathematical sentence. State the null and alternative hypotheses and identify which represents the claim.3.A cereal company advertises that the mean weight of the contents of its 20-ounce size cereal boxes is more than 20 ounces.
Inequality condition
Complement of HaH0:
Ha:(Claim)μ > 20 ounces
Solution:
11Math 117 – Eddie Laanaoui
Types of Errors
• No matter which hypothesis represents the claim, always begin the hypothesis test assuming that the equality condition in the null hypothesis is true.
• At the end of the test, one of two decisions will be made:
reject the null hypothesis
fail to reject the null hypothesis
• Because your decision is based on a sample, there is the possibility of making the wrong decision.
12Math 117 – Eddie Laanaoui
Types of Errors
• A type I error occurs if the null hypothesis is rejected when it is true.
• A type II error occurs if the null hypothesis is not rejected when it is false.
Actual Truth of H0
Decision H0 is true H0 is false
Do not reject H0 Correct Decision Type II Error
Reject H0 Type I Error Correct Decision
13Math 117 – Eddie Laanaoui
Example: Identifying Type I and Type II Errors
The USDA limit for salmonella contamination for chicken is 20%. A meat inspector reports that the chicken produced by a company exceeds the USDA limit. You perform a hypothesis test to determine whether the meat inspector’s claim is true. When will a type I or type II error occur? Which is more serious? (Source: United States Department of Agriculture)
14Math 117 – Eddie Laanaoui
Let p represent the proportion of chicken that is contaminated.
Solution: Identifying Type I and Type II Errors
H0:
Ha:
p ≤ 0.2
p > 0.2
Hypotheses:
(Claim)
0.16 0.18 0.20 0.22 0.24p
H0: p ≤ 0.20 H1: p > 0.20
Chicken meets USDA limits.
Chicken exceeds USDA limits.
15Math 117 – Eddie Laanaoui
Solution: Identifying Type I and Type II Errors
A type I error is rejecting H0 when it is true.
The actual proportion of contaminated chicken is lessthan or equal to 0.2, but you decide to reject H0.
A type II error is failing to reject H0 when it is false.
The actual proportion of contaminated chicken is greater than 0.2, but you do not reject H0.
H0:Ha:
p ≤ 0.2p > 0.2
Hypotheses:(Claim)
16Math 117 – Eddie Laanaoui
Solution: Identifying Type I and Type II Errors
H0:Ha:
p ≤ 0.2p > 0.2
Hypotheses:(Claim)
• With a type I error, you might create a health scare and hurt the sales of chicken producers who were actually meeting the USDA limits.
• With a type II error, you could be allowing chicken that exceeded the USDA contamination limit to be sold to consumers.
• A type II error could result in sickness or even death.
17Math 117 – Eddie Laanaoui
Level of Significance
Level of significance: α • Your maximum allowable probability of making a
type I error. P(type I error) = α (alpha).
• By setting the level of significance at a small value, you are saying that you want the probability of rejecting a true null hypothesis to be small.
• Commonly used levels of significance: α = 0.10 α = 0.05 α = 0.01
• P(type II error) = β (beta)
18Math 117 – Eddie Laanaoui
Statistical Tests
• After stating the null and alternative hypotheses and specifying the level of significance, a random sample is taken from the population and sample statistics are calculated.
• The statistic that is compared with the parameter in the null hypothesis is called the test statistic.
x
z (Section 7.4)pt (Section 7.3 n < 30)z (Section 7.2 n ≥ 30)μ
Standardized test statistic
Test statisticPopulation parameter
p̂
19Math 117 – Eddie Laanaoui
P-values
P-value (or probability value)
• The probability, if the null hypothesis is true, of obtaining a sample statistic with a value as extreme or more extreme than the one determined from the sample data.
• Depends on the nature of the test.
20Math 117 – Eddie Laanaoui
Nature of the Test
• Three types of hypothesis tests left-tailed test right-tailed test two-tailed test
21Math 117 – Eddie Laanaoui
Left-tailed Test
• The alternative hypothesis Ha contains the less-than inequality symbol (<).
z0 1 2 3-3 -2 -1
Test statistic
H0: μ ≥ k
Ha: μ < k
P is the area to the left of the test statistic.
22Math 117 – Eddie Laanaoui
• The alternative hypothesis Ha contains the greater-than inequality symbol (>).
z0 1 2 3-3 -2 -1
Right-tailed Test
H0: μ ≤ k
Ha: μ > k
Test statistic
P is the area to the right of the test statistic.
23Math 117 – Eddie Laanaoui
Two-tailed Test
• The alternative hypothesis Ha contains the not equal inequality symbol (≠). Each tail has an area of ½P.
z0 1 2 3-3 -2 -1
Test statistic
Test statistic
H0: μ = k
Ha: μ ≠ kP is twice the area to the left of the negative test statistic.
P is twice the area to the right of the positive test statistic.
24Math 117 – Eddie Laanaoui
Example: Identifying The Nature of a Test
For each claim, state H0 and Ha. Then determine whether the hypothesis test is a left-tailed, right-tailed, or two-tailed test. Sketch a normal sampling distribution and shade the area for the P-value.1.A university publicizes that the proportion of its students who graduate in 4 years is 82%.
H0:Ha:
p = 0.82p ≠ 0.82
Two-tailed testz
0-z z
½ P-value½ P-value
Solution:
25Math 117 – Eddie Laanaoui
Example: Identifying The Nature of a Test
For each claim, state H0 and Ha. Then determine whether the hypothesis test is a left-tailed, right-tailed, or two-tailed test. Sketch a normal sampling distribution and shade the area for the P-value.2.A water faucet manufacturer announces that the mean flow rate of a certain type of faucet is less than 2.5 gallons per minute.
H0:Ha:
Left-tailed testz
0-z
P-valueμ ≥ 2.5 gpmμ < 2.5 gpm
Solution:
26Math 117 – Eddie Laanaoui
Example: Identifying The Nature of a Test
For each claim, state H0 and Ha. Then determine whether the hypothesis test is a left-tailed, right-tailed, or two-tailed test. Sketch a normal sampling distribution and shade the area for the P-value.3.A cereal company advertises that the mean weight of the contents of its 20-ounce size cereal boxes is more than 20 ounces.
H0:Ha:
Right-tailed testz
0 z
P-valueμ ≤ 20 ozμ > 20 oz
Solution:
27Math 117 – Eddie Laanaoui
Making a Decision
Decision Rule Based on P-value• Compare the P-value with α.
If P ≤ α, then reject H0.
If P > α, then fail to reject H0.
Claim
Decision Claim is H0 Claim is Ha
Fail to reject H0
Reject H0
There is not enough evidence to reject the claim
There is enough evidence to reject the claim
There is not enough evidence to support the claim
There is enough evidence to support the claim
28Math 117 – Eddie Laanaoui
z0
Steps for Hypothesis Testing
1. State the claim mathematically and verbally. Identify the null and alternative hypotheses.
H0: ? Ha: ?2. Specify the level of significance.
α = ?3. Calculate the test statistic
and its standardized value, Z.
z0
Test statistic
This sampling distribution is based on the assumption that H0 is true.
29Math 117 – Eddie Laanaoui
x
Steps for Hypothesis Testing
5. Find the P-value.
6. Use the following decision rule.
7. Write a statement to interpret the decision in the context of the original claim.
Is the P-value less than or equal to the level of significance?
Fail to reject H0.
Yes
Reject H0.
No
30Math 117 – Eddie Laanaoui
Section 7.1 Summary
• Stated a null hypothesis and an alternative hypothesis
• Identified type I and type I errors and interpreted the level of significance
• Determined whether to use a one-tailed or two-tailed statistical test and found a p-value
• Made and interpreted a decision based on the results of a statistical test
• Wrote a claim for a hypothesis test
31Math 117 – Eddie Laanaoui
Section 7.2
Hypothesis Testing for the Mean (Large Samples)
32Math 117 – Eddie Laanaoui
Section 7.2 Objectives
• Find P-values and use them to test a mean μ
• Use P-values for a z-test
33Math 117 – Eddie Laanaoui
Using P-values to Make a Decision
Decision Rule Based on P-value
• To use a P-value to make a conclusion in a hypothesis test, compare the P-value with α.
1. If P ≤ α, then reject H0.
2. If P > α, then fail to reject H0.
34Math 117 – Eddie Laanaoui
Example: Interpreting a P-value
The P-value for a hypothesis test is P = 0.0237. What is your decision if the level of significance is
1.0.05?
2.0.01?
Solution:Because 0.0237 < 0.05, you should reject the null hypothesis.
Solution:Because 0.0237 > 0.01, you should fail to reject the null hypothesis.
35Math 117 – Eddie Laanaoui
Finding the P-value
After determining the hypothesis’ standardized test statistic and the test statistic’s corresponding area, do one of the following to find the P-value.
a.For a left-tailed test, P = (Area in left tail).
b.For a right-tailed test, P = (Area in right tail).
c.For a two-tailed test, P = 2(Area in tail of test statistic).
36Math 117 – Eddie Laanaoui
Z-Test for a Mean μ
• Can be used when the population is normal and σ is known, or for any population when the sample size n is at least 30.
• The test statistic is the sample mean
• The standardized test statistic is z
• When n ≥ 30, the sample standard deviation s can be substituted for σ.
xznµ
σ−=
x
37Math 117 – Eddie Laanaoui
Using P-values for a z-Test for Mean μ
1. State the claim mathematically and verbally. Identify the null and alternative hypotheses.
2. Specify the level of significance.
3. Determine the standardized test statistic.
4. Find the area that corresponds to z. (that is the P-value)
State H0 and Ha.
Identify α.
Use NormCdf function in your calculator.
xznµ
σ−=
38
In Words In Symbols
Math 117 – Eddie Laanaoui
Using P-values for a z-Test for Mean μ
Reject H0 if P-value is less than or equal to α. Otherwise, fail to reject H0.
5. Find the P-value.a. For a left-tailed test, P = NormCdf (-E99, z)b. For a right-tailed test,P = NormCdf (z, E99)c. For a two-tailed test, P =2 NormCdf (absolute value of z , E99)
6. Make a decision to reject or fail to reject the null hypothesis.
7. Interpret the decision in the context of the original claim.
39
In Words In Symbols
Math 117 – Eddie Laanaoui
Example: Hypothesis Testing Using P-values
In an advertisement, a pizza shop claims that its mean delivery time is less than 30 minutes. A random selection of 36 delivery times has a sample mean of 28.5 minutes and a standard deviation of 3.5 minutes. Is there enough evidence to support the claim at α = 0.01? Use a P-value.
40Math 117 – Eddie Laanaoui
Solution: Hypothesis Testing Using P-values
• H0:
• Ha:
• α = • Test Statistic:
μ ≥ 30 min
μ < 30 min
0.01
28.5 30
3.5 36
2.57
µ−=
−=
= −
xz
s n• Decision:
At the 1% level of significance, you have sufficient evidence to conclude the mean delivery time is less than 30 minutes.
z0-2.57
0.0051
• P-value = NormCdf(-E99, -2.57)
0.0051 < 0.01 Reject H0
41Math 117 – Eddie Laanaoui
Example: Hypothesis Testing Using P-values
You think that the average franchise investment information shown in the graph is incorrect, so you randomly select 30 franchises and determine the necessary investment for each. The sample mean investment is $135,000 with astandard deviation of $30,000. Is there enough evidence to support your claim at α = 0.05? Use a P-value.
42Math 117 – Eddie Laanaoui
Solution: Hypothesis Testing Using P-values
• H0:
• Ha:
• α = • Test Statistic:
μ = $143,260
μ ≠ $143,2600.05
135,000 143,260
30,000 30
1.51
xz
n
µσ
−=
−=
= −
• Decision:
At the 5% level of significance, there is not sufficient evidence to conclude the mean franchise investment is different from $143,260.
P = 2(0.0655) = 0.1310
0.1310 > 0.05Fail to reject H0
z0-1.51
0.0655
43Math 117 – Eddie Laanaoui
• P-value = 2*NormCdf(-E99,-1.51)
Section 7.2
Z-Test for μUsing your Calculator
• Stat Test Z-test
If you have Data enter it in a list (in L1 for example)
Otherwise:
• Enter the Hypothesized population Mean.
• Enter sample mean, sample or pop. stand. Dev., and n.
• Choose the appropriate Alternative Hypothesis.
• And VOILA!!
Remember: If the P-value is Small, Reject the Null!!!
• Make your conclusion.44
Math 117 – Eddie Laanaoui
Section 7.3
Hypothesis Testing for the Mean (Small Samples)
45Math 117 – Eddie Laanaoui
Section 7.3 Objectives
• Use the t-test to test a mean μ
• Use technology to find P-values
• Compare P-value to Alpha and make your Decision (Reject or Fail to Reject the Null Hypothesis)
• Make your Conclusion
46Math 117 – Eddie Laanaoui
t-Test for a Mean μ (n < 30, σ Unknown)
t-Test for a Mean
• A statistical test for a population mean.
• The t-test can be used when the population is normal or nearly normal, σ is unknown, and n < 30.
• The standardized test statistic is t.xts n
µ−=
47Math 117 – Eddie Laanaoui
Example: Using P-values with t-Tests
The American Automobile Association claims that the mean daily meal cost for a family of four traveling on vacation in Florida is $118. A random sample of 11 such families has a mean daily meal cost of $128 with a standard deviation of $20. Is there enough evidence to reject the claim at α = 0.10? Assume the population is normally distributed. (Adapted from American Automobile Association)
48Math 117 – Eddie Laanaoui
Solution: Using P-values with t-Tests
• H0:
• Ha:
• Decision:
μ = $118μ ≠ $118
TI-83/84set up: Calculate: Draw:
At the 0.10 level of significance, there is not enough evidence to reject the claim that the mean daily meal cost for a family of four traveling on vacation in Florida is $118.
49
0.1664 > 0.10 Fail to reject H0.
Math 117 – Eddie Laanaoui
Section 7.3
t-Test for μUsing your Calculator
Stat Test t-test
If you have Data enter it in a list (in L1 for example)
Otherwise:
• Enter the Hypothesized population Mean.
• Enter sample mean, sample stand. Dev., and n.
• Choose the appropriate Alternative Hypothesis.
• And VOILA!!
Remember: If the P-value is Small, Reject the Null!!!
• Make your conclusion.50Math 117 – Eddie Laanaoui
Section 7.4
Hypothesis Testing for Proportions
51Math 117 – Eddie Laanaoui
Section 7.4 Objectives
• Use z-test to test a population
proportion p
52Math 117 – Eddie Laanaoui
z-Test for a Population Proportion
z-Test for a Population Proportion
• A statistical test for a population proportion.
• Can be used when a binomial distribution is given such that np ≥ 5 and nq ≥ 5.
• The test statistic is the sample proportion .
• The standardized test statistic is z.
0p̂ pzpq n−=
p̂
53Math 117 – Eddie Laanaoui
Section 7.4
1 Prop Z-Test for pUsing your Calculator
54Math 117 – Eddie Laanaoui
• Stat Test 1 Prop Z-test
• Enter the Hypothesized population proportion.
• Enter x and Enter n.
• Choose the appropriate Alternative Hypothesis.
• And VOILA!!
• Decision (reject or fail to reject the Null Hypothesis)
Remember: If the P-value is Small, Reject the Null!!!
• Make your conclusion.