Transcript H 1
Tests of Hypotheses
• (Statistical) Hypothesis: an assertion concerning one or
more populations.
• In statistics, there are only two states of the world:
H0 : “equals”
(null hypothesis)
H1 : _______ (alternate hypothesis)
• Examples:
H0 : μ = 17
H1 : μ ≠ 17
H0 : μ = 8
H1 : μ > 8
H0 : p = 0.5
H1 : p < 0.5
EGR 252 - Ch. 10
1
Choosing a Hypothesis
• Your turn …
Suppose a coffee vending machine claims it
dispenses an 8-oz cup of coffee. You have been using
the machine for 6 months, but recently it seems the
cup isn’t as full as it used to be. You plan to conduct a
test of your hypothesis. What are your hypotheses?
EGR 252 - Ch. 10
2
Hypothesis testing
“Accept” H0
Reject H0
H0 True
H0 False
Correct
Decision
Type II
error
Type I
error
Correct
Decision
• Level of significance, α
– Probability of committing a
Type I error
= P (rejecting H0 | H0 is true)
EGR 252 - Ch. 10
• β
– Probability of committing a
Type II error
– Power of the test = ________
(probability of rejecting the null
hypothesis given that the
alternate is true.)
3
Determining α & β
• Example:
Proportion of adults in a small town who are college
graduates is estimated to be p = 0.6. A random
sample of 15 adults is selected to test this hypothesis.
If we find that between 6 and 12 adults are college
graduates, we will accept H0 : p = 0.6; otherwise we
will reject the hypothesis and conclude the proportion
is something different (for this example, use H1: p =
0.5).
α = ________________
EGR 252 - Ch. 10
β = ________________
4
Hypothesis Testing
•
Approach 1 - Fixed probability of Type I error.
1.
State the null and alternative
hypotheses.
Choose a fixed significance level α.
Specify the appropriate test statistic
and establish the critical region
based on α. Draw a graphic
representation.
Compute the value of the test
statistic based on the sample data.
Make a decision to reject or fail to
reject H0, based on the location of
the test statistic.
Draw an engineering or scientific
conclusion.
2.
3.
4.
5.
6.
EGR 252 - Ch. 10
5
Hypothesis Testing
• Approach 2 - Significance testing (P-value approach)
1. State the null and alternative
hypotheses.
2. Choose an appropriate test
statistic.
3. Compute value of test statistic
and determine P-value.
4. Draw conclusion based on Pvalue.
P=0
EGR 252 - Ch. 10
0.25
0.5
0.75
P=1
6
Hypothesis Testing Tells Us …
• Strong conclusion:
– If our calculated t-value is “outside” tα,ν (approach 1)
or we have a small p-value (approach 2), then we
reject H0: μ = μ0 in favor of the alternate hypothesis.
• Weak conclusion:
– If our calculated t-value is “inside” tα,ν (approach 1) or
we have a “large” p-value (approach 2), then we
cannot reject H0: μ = μ0.
• In other words:
– Failure to reject H0 does not imply that μ is equal to
the stated value, only that we do not have sufficient
evidence to favor H1.
EGR 252 - Ch. 10
7
Single Sample Test of the Mean
A sample of 20 cars driven under varying highway
conditions achieved fuel efficiencies as follows:
Sample mean
Sample std dev
x = 34.271 mpg
s = 2.915 mpg
Test the hypothesis that the population mean equals 35.0
mpg vs. μ < 35.
H0: ________
n = ________
H1: ________
σ unknown
use ___ distribution.
EGR 252 - Ch. 10
8
Example (cont.)
Approach 2:
X
T
= _________________
S/ n
Using Excel’s tdist function,
P(x ≤ -1.118) = _____________
Conclusion: __________________________________
EGR 252 - Ch. 10
9
Example (concl.)
Approach 1:
t0.05,19 = _____________
Since H1 specifies “< μ,” tcrit = ___________
tcalc = _________
Conclusion: _________________________________
EGR 252 - Ch. 10
10
Your turn …
A sample of 20 cars driven under varying highway
conditions achieved fuel efficiencies as follows:
Sample mean
Sample std dev
x = 34.271 mpg
s = 2.915 mpg
Test the hypothesis that the population mean equals 35.0
mpg vs. μ ≠ 35 at an α level of 0.05. Draw the picture.
EGR 252 - Ch. 10
11
Two-Sample Hypothesis Testing
• Example:
A professor has designed an experiment to test the
effect of reading the textbook before attempting to
complete a homework assignment. Four students who
read the textbook before attempting the homework
recorded the following times (in hours) to complete the
assignment:
3.1, 2.8, 0.5, 1.9 hours
Five students who did not read the textbook before
attempting the homework recorded the following times
to complete the assignment:
0.9, 1.4, 2.1, 5.3, 4.6 hours
EGR 252 - Ch. 10
12
Two-Sample Hypothesis Testing
• Define the difference in the two means as:
μ1 - μ2 = d0
• What are the Hypotheses?
H0: _______________
H1: _______________
or
H1: _______________
or
H1: _______________
EGR 252 - Ch. 10
13
Our Example
Reading:
n1 = 4
x1 = 2.075
s12 = 1.363
No reading:
n2 = 5
x2 = 2.860
s22 = 3.883
If we assume the population variances are “equal”,
we can calculate sp2 and conduct a __________.
2
2
(
n
1
)
s
(
n
1
)
s
1
2
2
s p2 1
n1 n2 2
= __________________
EGR 252 - Ch. 10
14
Your turn …
• Lower-tail test ((μ1 - μ2 < 0)
– “Fixed α” approach (“Approach 1”) at α = 0.05 level.
– “p-value” approach (“Approach 2”)
• Upper-tail test (μ2 – μ1 > 0)
– “Fixed α” approach at α = 0.05 level.
– “p-value” approach
• Two-tailed test (μ1 - μ2 ≠ 0)
– “Fixed α” approach at α = 0.05 level.
– “p-value” approach
Recall
EGR 252 - Ch. 10
t calc
( x1 x 2 ) d0
s p 1/ n1 1/ n2
15
Lower-tail test ((μ1 - μ2 < 0)
• Draw the picture:
• Solution:
• Decision:
• Conclusion:
EGR 252 - Ch. 10
16
Upper-tail test (μ2 – μ1 > 0)
• Draw the picture:
• Solution:
• Decision:
• Conclusion:
EGR 252 - Ch. 10
17
Two-tailed test (μ1 - μ2 ≠ 0)
• Draw the picture:
• Solution:
• Decision:
• Conclusion:
EGR 252 - Ch. 10
18
Another Example
Suppose we want to test the difference in carbohydrate
content between two “low-carb” meals. Random samples
of the two meals are tested in the lab and the
carbohydrate content per serving (in grams) is recorded,
with the following results:
n1 = 15
n2 = 10
x1 = 27.2
x2 = 23.9
s12 = 11
s22 = 23
tcalc = ______________________
ν = ________________ (using equation in table 10.2)
EGR 252 - Ch. 10
19
Example (cont.)
• What are our options for hypotheses?
• At an α level of 0.05,
– One-tailed test, t0.05, 15 = ________
– Two-tailed test, t0.025, 15 = ________
• How are our conclusions affected?
EGR 252 - Ch. 10
20
Special Case: Paired Sample T-Test
Examples
A.
B.
C.
Car
Radial
1
**
2
**
3
**
4
**
Person Pre
1
**
2
**
3
**
4
**
Student Test1
1
**
2
**
3
**
4
**
EGR 252 - Ch. 10
Paired-sample?
Belted
**
**
**
**
Post
**
**
**
**
Test2
**
**
**
**
Radial, Belted tires
placed on each car.
Pre- and post-test
administered to each
person.
5 scores from test 1,
5 scores from test 2.
21
Example*
Nine steel plate girders were subjected to two methods
for predicting sheer strength. Partial data are as follows:
Girder
1
2
Karlsruhe
1.186
1.151
Lehigh
1.061
0.992
9
1.559
1.052
difference, d
Conduct a paired-sample t-test at the 0.05 significance
level to determine if there is a difference between the
two methods.
* adapted from Montgomery & Runger, Applied Statistics and Probability for
Engineers.
EGR 252 - Ch. 10
22
Example (cont.)
Hypotheses:
H0: μD = 0
H1: μD ≠ 0
t__________
= ______
Calculate difference scores (d), mean and
standard deviation, and tcalc …
d = 0.2736
sd = 0.1356
tcalc = ______________________________
EGR 252 - Ch. 10
23
What does this mean?
• Draw the picture:
• Decision:
• Conclusion:
EGR 252 - Ch. 10
24
Goodness-of-Fit Tests
• Procedures for confirming or refuting hypotheses
about the distributions of random variables.
• Hypotheses:
H0: The population follows a particular distribution.
H1: The population does not follow the distribution.
Examples:
H0: The data come from a normal distribution.
H1: The data do not come from a normal distribution.
EGR 252 - Ch. 10
25
Goodness of Fit Tests (cont.)
• Test statistic is χ2
– Draw the picture
– Determine the critical value
χ2 with parameters α, ν = k – 1
• Calculate χ2 from the sample
2
(
O
E
)
i
2 i
Ei
i 1
n
• Compare χ2calc to χ2crit
• Make a decision about H0
• State your conclusion
EGR 252 - Ch. 10
26
Tests of Independence
• Hypotheses
H0: independence
H1: not independent
• Example
Choice of pension plan.
1. Develop a Contingency Table
Worker Type
Salaried
Hourly
Total
EGR 252 - Ch. 10
Pension Plan
#1
#2
160
40
200
140
60
200
#3
40
60
100
Total
340
160
500
27
Example
Worker Type
Salaried
Hourly
Total
Pension Plan
#1
#2
160
140
40
200
60
200
#3
40
60
100
Total
340
160
500
2. Calculate expected probabilities
P(#1 ∩ S) = _______________
E(#1 ∩ S) = _____________
P(#1 ∩ H) = _______________
(etc.)
E(#1 ∩ H) = _____________
#1
#2
#3
S (exp.)
H (exp.)
EGR 252 - Ch. 10
28
Hypotheses
3. Define Hypotheses
H0: the categories (worker & plan) are independent
H1: the categories are not independent
4. Calculate the sample-based statistic
2
(
O
E
)
i
2 i
Ei
i 1
n
= ________________________________________
= ______
EGR 252 - Ch. 10
29
The Test
5. Compare to the critical statistic, χ2α, r
where r = (a – 1)(b – 1)
for our example, say α = 0.01
χ2_____ = ___________
Decision:
Conclusion:
EGR 252 - Ch. 10
30
Homework for Thursday, March 23
• 3, 6, 7 (pg. 319)
(Refer to your updated schedule for future
homework assignments.)
EGR 252 - Ch. 10
31