Ch 9B More Hypothesis Testing

Download Report

Transcript Ch 9B More Hypothesis Testing

Chapter 9 Tests of Hypothesis
Single Sample Tests
The Middle Game – applications to
the real world
Chapter 9B
Recall?
If Z1, Z2, ..., Zn are independent standard normal random
variables, then
  Z  Z  ...  Z
2
2
1
T
Z
2 / n
2
2
2
n
 ( n)
chi-square distribution
with n degrees freedom
t-distribution
with n degrees freedom
t (n)
 (n) / n
F 2
 (m) / m
2
2
F (n, m)
F-distribution
with n degrees freedom in
the numerator and m degrees
of freedom in the denominator
9-3 Tests on the Mean of a Normal
Distribution, Variance Unknown
One-Sample t-Test
T
Z
 /n
2
t (n)
9-3.1 Hypothesis Tests on the Mean
Figure 9-9 The reference distribution for H0:  = 0 with critical
region for (a) H1:   0 , (b) H1:  > 0, and (c) H1:  < 0.
Tests on the mean - variance unknown


Peter Perk is concerned about the amount of caffeine in his
pop (soft drink). It appears that his midday soda is keeping
him awake during the boring statistics lectures. The label on
the can states that it contains only 20 mg of caffeine. Peter
Perk doesn’t believe this.
A random sample and testing of 25 cans of soda resulted in
the following caffeine levels:
X  22 mg, s  5mg

Test at a 2 percent level of significance.
H0:  = 20
H1:  > 20
One can of soda contains:
• About 10 teaspoons of sugar
• 150 calories
• 30-55 mg of caffeine
• Artificial food colors and sulphites
The t-test

X crit  0  t.02,24 s / n
X  0 22  20
T0 

2
s / n 5 / 25
t ,n 1  t.02,24  2.1715

 5 
 20  2.1715 
  22.1715
 25 
T0  2  2.1715; cannot reject
at 5% : t.05,24  1.711;
 5 
X crit  20  1.711

 25 
 21.711; reject
The Prob-Value
H0:  = 20
H1:  > 20
X  22 mg, s  5mg; n=25
22  20 

P  X  22 |   20  P t24 
  P t24  2  .0285
5 / 25 

conclusion: Peter should be able to sleep
during the boring lectures.
Non-Central t Distribution – a Small
Complication
•If the alternative hypothesis is true, the statistic T0 does
not have a mean of zero.
•It has what is called the non-central t distribution.
•Many of the operations performed for the central t must
now be done using numerical techniques, e.g. integrating
the non-central t distribution.
•No sweat for us. The results we need are tabulated –
we need the O.C. curves!
if   0  
X  0 X   0     n
T0 


s
s/ n
s/ n
estimated
noncentrality
parameter
Non-Central t Distribution – a Small
Complication
•O.C. curves relate b, n, and d, where d=|
0|/s. and b is the Type II error probability.
•Since variance is unknown, estimate s – either
from previous experiments where we measured s,
or after the current measurement set is collected.
•Alternatively we can think of d as a certain
number of standard deviations (if a relative
measure is satisfactory).
O.C. Curves for t-test
two-sided t-test
with  = .05
  0 
d

s
s
More on Peter Perk’s Pop
If the actual caffeine
level is 22 mg per can,
what is the probability
of not rejecting at the
5 percent level (i.e.
the probability of a
Type II error)?
d = |22-20|/5 = .4
n = 25
Pr{do not reject|  = 22}  .5
9-4.1 Hypothesis Test on the
Variance
9-4.1 Hypothesis Test on the Variance
More on Variance Tests
Much more on Variance Tests
A Variance Test Example




Professor Vera Vance asserts that the variability of the IQ’s
among the Engineering Management (ENM) students is
significantly less than for the population at large.
It is well know that the distribution of IQ’s is normal with a
mean of 100 and a standard deviation of 15.
Thirty ENM students were forced to take an exhaustive IQ test
in which the sample standard deviation was computed to be
12.78.
Professor Vance is willing to test her assertion at the 10
percent level.
Add a little variance to your life
H0: s2 = 152
H1: s2 < 152
n  1 s

 
2
2
0
s0
2
29 12.78


15
2
2
 21.05
2
12 ,n 1  .90,29
 19.7677; cannot reject
Professor Vera Vance lecturing
the students on their excessive variability.
Prob-value and so much more…

Prob-Value
P   21.05  .1427
2
29
9-4.2 Type II Error and Choice of Sample Size:
s

s0
Operating characteristic curves are provided in Charts
VIIi through VIIn
O.C. Curves for Variance
b

s
s0
More sugar?
Problem 9-75
1) The parameter of interest is the true variance of sugar
content, s2.
2) H0 : s2 = 18 milligrams2
3) H1 : s2  18
4)  = 0.05
5)
20
=
( n  1)s2
s2
6) Reject H0 if
20  12 / 2,n 1 where
 02.975,9  2.70 or
2
20  
,2,n 1 where
 02.025,9  19.02
7) n = 10, s = 4.8
20 =
(n  1) s 2
s2
9(4.8) 2

 11.52
18
8) Since 2.70 < 11.52 < 19.02 do not reject H0 and conclude there
is insufficient evidence to indicate the true variance of sugar
content is significantly different from 18 at  = 0.05.
Problem 9-75 P-Value
Pr   11.52  .2417
2
9
P-value  2 .2417   .4834
Problem 9-75 Confidence Interval
The 95% confidence interval includes the value 18,
therefore, we could not be able to conclude that the
variance was not equal to 18.
2
9(4.8)
9(4.8)
2
s 
19.02
2.70
2
10.90  s  76.80
2
Problem 9-75
Assume s2 = 40
what sample size to detect difference with prob = .9?
Using the chart in the Appendix, with  
40
 1.49 and
18
b = 0.10, we find
n = 50 at .01 alpha level
This is the O.C. graphic
for alpha = .01
9-5.1 Large-Sample Tests on a
Proportion
Many engineering decision problems include hypothesis testing
about p.
An appropriate test statistic is
9-5 Tests on a Population Proportion
Another form of the test statistic Z0 is
or
X
ˆ
P
n
the sample proportion
Test on a Proportion - Example
A cable news commentator has asserted that more
than half the population believe that the United States
should not have taken military action against Iraq.
Test this assertion at the 5 percent level.
CBS News Poll. Sept. 14-16, 2007. N=706 adults nationwide. MoE ± 4 (for all adults).
"Looking back, do you think the United States did the right thing in
taking military action against Iraq, or should the U.S. have
stayed out?"
Right
Thing
9/14-16/07
Stayed
Out
Unsure
%
%
%
39
53
8
An Example Continued
H0: p  .5
H1: p > .5
z0 
 = .05
.53  .50
.50 1  .50  / 706
pˆ  .53, n  706
 1.594
z0  1.594  z.05  1.6449; cannot reject H 0
p-Value  Pr z  1.594  .0555
9-5.2 Type II Error and Choice
of Sample Size
For a two-sided alternative where p is the true value
If the alternative is p < p0
If the alternative is p > p0
Type II Error
H0: p  .5
H1: p > .5
 = .05
assume p  .55, n  706
 .5  .55  1.645 .5 1  .5  / 706 
    1.017   .1546
b  


.55
1

.55
/
706




9-5.3 Type II Error and Choice
of Sample Size
For a two-sided alternative
For a one-sided alternative
Sample Size Calculations
H0: p  .5
H1: p > .5
 = .01, b=.05 when p = .55
2
 2.33 .5 1  .5   1.645 .55 1  .55  
  1573.5  1574
n
.55  .50


Goodness-of-fit (GOF) Tests
Testing for the distribution of the
underlying population
9-7 The Chi-Square GOF Test
• Assume there is a sample of size n from a population whose
probability distribution is unknown.
• Let Oi be the observed frequency in the ith class interval.
• Let Ei be the expected frequency in the ith class interval.
The test statistic is chi-square with
df = k – p – 1 where p = number of estimated parameters
Example 9-12
More of Example 9-12
Much More of Example 9-12
Still Example 9-12
Yes, Example 9-12
The last of Example 9-12
Next Week – Chapter 10
How to do it with two samples!