Sei sulla pagina 1di 47

Statistics

Chapter 8: Inferences Based on a


Single Sample: Tests of Hypotheses
Where We’ve Been

 Calculated point estimators of


population parameters
 Used the sampling distribution of a
statistic to assess the reliability of an
estimate through a confidence interval

McClave, Statistics, 11th ed. Chapter 8: Inferences 2


Based on a Single Sample: Tests of Hypotheses
Where We’re Going

 Test a specific value of a population


parameter
 Measure the reliability of the test

McClave, Statistics, 11th ed. Chapter 8: Inferences 3


Based on a Single Sample: Tests of Hypotheses
8.1: The Elements of a Test of
Hypotheses

Confidence Interval
µ? Where on the number line do the data point us? µ?
(No prior idea about the value of the parameter.)

Hypothesis Test
Do the data point us to this particular value? µ 0?
(We have a value in mind from the outset.)

McClave, Statistics, 11th ed. Chapter 8: Inferences 4


Based on a Single Sample: Tests of Hypotheses
8.1: The Elements of a Test of
Hypotheses

Null Hypothesis: H0
•This will be supported
unless the data
provide evidence that it
is false
• The status quo Alternative Hypothesis: Ha
•This will be supported if
the data provide sufficient
evidence that it is true
• The research hypothesis

McClave, Statistics, 11th ed. Chapter 8: Inferences 5


Based on a Single Sample: Tests of Hypotheses
8.1: The Elements of a Test of
Hypotheses

 If the test statistic has a high


probability when H0 is true, then H0 is
not rejected.
 If the test statistic has a (very) low
probability when H0 is true, then H0 is
rejected.

McClave, Statistics, 11th ed. Chapter 8: Inferences 6


Based on a Single Sample: Tests of Hypotheses
8.1: The Elements of a Test of
Hypotheses

McClave, Statistics, 11th ed. Chapter 8: Inferences 7


Based on a Single Sample: Tests of Hypotheses
8.1: The Elements of a Test of
Hypotheses
Reality ↓ / Test Result → Do not reject H0 Reject H0

Type I Error:
H0 is true
Correct! rejecting a true null
hypothesis
P(Type I error) = 
Type II Error: not
H0 is false rejecting a false null
hypothesis
Correct!
P(Type II error) =

McClave, Statistics, 11th ed. Chapter 8: Inferences 8


Based on a Single Sample: Tests of Hypotheses
8.1: The Elements of a Test of
Hypotheses

Note: Null hypotheses


are either rejected, or
else there is insufficient
evidence to reject them.
(I.e., we don’t accept
null hypotheses.)

McClave, Statistics, 11th ed. Chapter 8: Inferences 9


Based on a Single Sample: Tests of Hypotheses
8.1: The Elements of a Test of
Hypotheses
• Null hypothesis (H0): A theory about the values of one or more parameters
• Ex.: H0: µ = µ0 (a specified value for µ)
• Alternative hypothesis (Ha): Contradicts the null hypothesis
• Ex.: H0: µ ≠ µ0
• Test Statistic: The sample statistic to be used to test the hypothesis
• Rejection region: The values for the test statistic which lead to rejection of
the null hypothesis
• Assumptions: Clear statements about any assumptions concerning the
target population
• Experiment and calculation of test statistic: The appropriate calculation for
the test based on the sample data
• Conclusion: Reject the null hypothesis (with possible Type I error) or do
not reject it (with possible Type II error)

McClave, Statistics, 11th ed. Chapter 8: Inferences 10


Based on a Single Sample: Tests of Hypotheses
8.1: The Elements of a Test of
Hypotheses
Suppose a new interpretation of the rules by
soccer referees is expected to increase the
number of yellow cards per game. The
average number of yellow cards per game
had been 4. A sample of 121 matches
produced an average of 4.7 yellow cards
per game, with a standard deviation of .5
cards. At the 5% significance level, has
there been a change in infractions called?

McClave, Statistics, 11th ed. Chapter 8: Inferences 11


Based on a Single Sample: Tests of Hypotheses
8.1: The Elements of a Test of
Hypotheses
H0: µ = 4
H a: µ ≠ 4
Sample statistic: = 4.7
= .05

Assume the sampling distribution is normal.


x   0 4.7  4
Test statistic: z*    10.94
sx .064

Conclusion: z.05 = 1.96. Since z* > z.05 , reject H0.


(That is, there do seem to be more yellow cards.)

McClave, Statistics, 11th ed. Chapter 8: Inferences 12


Based on a Single Sample: Tests of Hypotheses
8.2: Large-Sample Test of a
Hypothesis about a Population Mean

The null hypothesis is


usually stated as an
equality … H0: µ = µ0

Ha: µ < µ0 Ha: µ ≠ µ0 Ha: µ > µ0

… even though the alternative hypothesis


can be either an equality or an inequality.

McClave, Statistics, 11th ed. Chapter 8: Inferences 13


Based on a Single Sample: Tests of Hypotheses
8.2: Large-Sample Test of a
Hypothesis about a Population Mean

McClave, Statistics, 11th ed. Chapter 8: Inferences 14


Based on a Single Sample: Tests of Hypotheses
8.2: Large-Sample Test of a
Hypothesis about a Population Mean
Rejection Regions for Common Values of 

Lower Tailed Upper Tailed Two tailed


 = .10 z < - 1.28 z > 1.28 | z | > 1.645
 = .05 z < - 1.645 z > 1.645 | z | > 1.96
 = .01 z < - 2.33 z > 2.33 | z | > 2.575

McClave, Statistics, 11th ed. Chapter 8: Inferences 15


Based on a Single Sample: Tests of Hypotheses
8.2: Large-Sample Test of a
Hypothesis about a Population Mean
One-Tailed Test Two-Tailed Test
 H0 : µ = µ0  H0 : µ = µ0

Ha : µ < or > µ0 Ha : µ ≠ µ0
x  0 x  0
Test Statistic: z  Test Statistic: z 
x x
Rejection Region: | z | > Rejection Region: | z | >
z z/2
Conditions: 1) A random sample is selected from the target population.
2) The sample size n is large.

McClave, Statistics, 11th ed. Chapter 8: Inferences 16


Based on a Single Sample: Tests of Hypotheses
8.2: Large-Sample Test of a
Hypothesis about a Population Mean

 The Economics of Education Review


(Vol. 21, 2002) reported a mean salary
for males with postgraduate degrees of
$61,340, with an estimated standard
error (s ) equal to $2,185. We wish to
test, at the  = .05 level, H0: µ =
$60,000.

McClave, Statistics, 11th ed. Chapter 8: Inferences 17


Based on a Single Sample: Tests of Hypotheses
8.2: Large-Sample Test of a
Hypothesis about a Population Mean
The Economics of  H0 : µ = 60,000
Education Review (Vol. Ha : µ ≠ 60,000
21, 2002) reported a Test Statistic:
mean salary for males x  0
with postgraduate z
x
degrees of $61,340,
61,340  60,000
with an estimated z
standard error (s ) 2,185
equal to $2,185. We z  .613
wish to test, at the
 = .05 level, Rejection Region: | z | > z.025 = 1.96
H0: µ = $60,000. Do not reject H0
McClave, Statistics, 11th ed. Chapter 8: Inferences 18
Based on a Single Sample: Tests of Hypotheses
8.3:Observed Significance Levels: p -
Values

Suppose z = 2.12.
P(z > 2.12) = .0170.

Reject H0 at the = .05 level Do not reject H0 at the = .01


level
But it’s pretty close, isn’t it?

McClave, Statistics, 11th ed. Chapter 8: Inferences 19


Based on a Single Sample: Tests of Hypotheses
8.3:Observed Significance Levels: p -
Values

The observed significance level, or p-value, for


a test is the probability of observing the results
actually observed (z*) assuming the null
hypothesis is true.

P( z  z* | H 0 )

The lower this probability, the less likely H0 is true.

McClave, Statistics, 11th ed. Chapter 8: Inferences Based 20


on a Single Sample: Tests of Hypotheses
8.3:Observed Significance Levels: p -
Values
H0 : µ = 65,000
Let’s go back to the
Ha : µ ≠ 65,000
Economics of Test Statistic:
Education Review
x  0
report ( = $61,340, z
x
s = $2,185). This
61,340  65,000
time we’ll test z
2,185
H0: µ = $65,000.
z  1.675

p-value: P( 61,340 |H0 ) =


P(|z| > 1.675) = .0475

McClave, Statistics, 11th ed. Chapter 8: Inferences 21


Based on a Single Sample: Tests of Hypotheses
8.3:Observed Significance Levels: p -
Values

 Reporting test results


 Choose the maximum tolerable value of 
 If the p-value < , reject H0
If the p-value > , do not reject H0

McClave, Statistics, 11th ed. Chapter 8: Inferences 22


Based on a Single Sample: Tests of Hypotheses
8.3:Observed Significance Levels: p -
Values
Some stats packages will only
report two-tailed p-values.

Converting a Two-Tailed p-Value to a One-Tailed p-Value

Reported p - value H a includes  and z is positive


p if 
2 H a includes  and z is negative
Reported p - value H a includes  and z is negative
p  1 if 
2 H a includes  and z is positive

McClave, Statistics, 11th ed. Chapter 8: Inferences 23


Based on a Single Sample: Tests of Hypotheses
8.3:Observed Significance Levels: p -
Values
Some stats packages will only
report two-tailed p-values.

Converting a Two-Tailed p-Value to a One-Tailed p-Value

McClave, Statistics, 11th ed. Chapter 8: Inferences 24


Based on a Single Sample: Tests of Hypotheses
8.4: Small-Sample Test of a
Hypothesis about a Population Mean
If the sample is small and  is unknown,
testing hypotheses about µ requires the
t-distribution instead of the z-distribution.

x  0
t
s/ n

McClave, Statistics, 11th ed. Chapter 8: Inferences 25


Based on a Single Sample: Tests of Hypotheses
8.4: Small-Sample Test of a
Hypothesis about a Population Mean
One-Tailed Test Two-Tailed Test
 H0 : µ = µ0  H0 : µ = µ0

Ha : µ < or > µ0 Ha : µ ≠ µ0

x  0 x  0
Test Statistic: t  Test Statistic: t 
s/ n s/ n
Rejection Region: | t | > t Rejection Region: | t | > t/2
Conditions: 1) A random sample is selected from the target population.
2) The population from which the sample is selected is
approximately normal.
3) The value of t is based on (n – 1) degrees of freedom
McClave, Statistics, 11th ed. Chapter 8: Inferences 26
Based on a Single Sample: Tests of Hypotheses
8.4: Small-Sample Test of a
Hypothesis about a Population Mean

Suppose copiers average 100,000


between paper jams. A salesman
claims his are better, and offers to
leave 5 units for testing. The average
number of copies between jams is
100,987, with a standard deviation of
157. Does his claim seem believable?

McClave, Statistics, 11th ed. Chapter 8: Inferences 27


Based on a Single Sample: Tests of Hypotheses
8.4: Small-Sample Test of a
Hypothesis about a Population Mean
Suppose copiers H0 : µ = 100,000
average 100,000 Ha : µ > 100,000
between paper jams. A Test Statistic:
salesman claims his are x  0
better, and offers to t
s/ n
leave 5 units for testing.
100,987  100,000
The average number of t
copies between jams is 157 / 5
100,987, with a standard t  14.06
deviation of 157. Does
his claim seem p-value: P( 100,987|H0 ) =
believable? P(|tdf=4| > 14.06) < .001

McClave, Statistics, 11th ed. Chapter 8: Inferences 28


Based on a Single Sample: Tests of Hypotheses
8.4: Small-Sample Test of a
Hypothesis about a Population Mean
Suppose copiers HReject
0 : µ = 100,000
the null hypothesis
average 100,000 Hbased on the very low
a : µ > 100,000
probability
Test of seeing the
Statistic:
between paper jams. A observed results if the null
salesman claims his are x  0
were true.
better, and offers to  claim does seem
So,t the
s/ n
plausible.
leave 5 units for testing.
100,987  100,000
The average number of t
copies between jams is 157 / 5
100,987, with a standard t  14.06
deviation of 157. Does
his claim seem p-value: P( 100,987|H0 ) =
believable? P(|tdf=4| > 14.06) < .001

McClave, Statistics, 11th ed. Chapter 8: Inferences 29


Based on a Single Sample: Tests of Hypotheses
8.5: Large-Sample Test of a Hypothesis about
a Population Proportion

One-Tailed Test Two-Tailed Test


 H0 : p = p0  H0 : p = p0

Ha : p < or > p0 Ha : p ≠ p0
pˆ  p0 pˆ  p0
Test Statistic: z  Test Statistic: z 
 pˆ  pˆ
Rejection Region: | z | > Rejection Region: | z | >
z zp0 q/20
p0 = hypothesized value of p,  pˆ  , and q0 = 1 - p0
n
Conditions: 1) A random sample is selected from a binomial population.
2) The sample size n is large (i.e., np0 and nq0 are both 15).
McClave, Statistics, 11th ed. Chapter 8: Inferences 30
Based on a Single Sample: Tests of Hypotheses
8.5: Large-Sample Test of a Hypothesis about
a Population Proportion
Rope designed for use in The vendor will reject
the theatre must any shipment which
withstand unusual cannot pass a 1% defect
stresses. Assume a test (that’s harsh, but so
brand of 3” three-strand is falling scenery during
rope is expected to have an aria). 1500 sections
a breaking strength of of rope are tested, with
1400 lbs. A vendor 20 pieces failing the test.
receives a shipment of At the  = .01 level,
rope and needs to should the shipment be
(destructively) test it. rejected?

McClave, Statistics, 11th ed. Chapter 8: Inferences 31


Based on a Single Sample: Tests of Hypotheses
8.5: Large-Sample Test of a Hypothesis about
a Population Proportion

The vendor will reject H0: p = .01


any shipment that cannot Ha: p > .01
pass a 1% defects test . Rejection region: |z| > 2.236
1500 sections of rope Test statistic:
are tested, with 20
pˆ  p0
pieces failing the test. At z
the  = .01 level, should  pˆ
the shipment be .013  .01
rejected? z
(.013)(. 987) / 1500
z  1.14

McClave, Statistics, 11th ed. Chapter 8: Inferences 32


Based on a Single Sample: Tests of Hypotheses
8.5: Large-Sample Test of a Hypothesis about
a Population Proportion

The vendor will reject H0: p = .01


any shipment that cannot Ha: p > .01
There is insufficient
pass a 1% defects test . Rejection region:
evidence |z| >
to reject the2.236
1500 sections of rope null hypothesis based
Test statistic:
are tested, with 20 on the sample results.
pˆ  p0
pieces failing the test. At z
the  = .01 level, should  pˆ
the shipment be .013  .01
rejected? z
(.013)(. 987) / 1500
z  1.14

McClave, Statistics, 11th ed. Chapter 8: Inferences 33


Based on a Single Sample: Tests of Hypotheses
8.6: Calculating Type II Error Probabilities:
More about 
To calculate P(Type II), or , …
1. Calculate the value(s) of that divide the “do not reject”
region from the “reject” region(s).
 s 
x
Upper-tailed test: 0   0  z 
 x   0  z 
 n
 s 
Lower-tailed test: x0   0  z  x   0  z  
 n
 s 
Two-tailed test: x0 L  0  z / 2 x  0  z / 2  
 n
 s 
x0U  0  z / 2 x  0  z / 2  
 n

McClave, Statistics, 11th ed. Chapter 8: Inferences 34


Based on a Single Sample: Tests of Hypotheses
8.6: Calculating Type II Error Probabilities:
More about 
To calculate P(Type II), or , …
1. Calculate the value(s) of that divide the “do not
reject” region from the “reject” region(s).

2. Calculate the z-value of 0 assuming the


alternative hypothesis mean is the true µ:
x0   a
z
x
The probability of getting this z-value is .

McClave, Statistics, 11th ed. Chapter 8: Inferences 35


Based on a Single Sample: Tests of Hypotheses
8.6: Calculating Type II Error Probabilities:
More about 

 The power of a test is the probability


that the test will correctly lead to the
rejection of the null hypothesis for a
particular value of µ in the alternative
hypothesis. The power of a test is
calculated as (1 -  ).

McClave, Statistics, 11th ed. Chapter 8: Inferences 36


Based on a Single Sample: Tests of Hypotheses
8.6: Calculating Type II Error Probabilities:
More about 
The Economics of  H0 : µ = 60,000
Education Review (Vol. Ha : µ ≠ 60,000
21, 2002) reported a mean
salary for males with Test Statistic: z = .613;
postgraduate degrees of z=.025 = 1.96
$61,340, with an We did not reject this null
estimated standard error hypothesis earlier, but what
(s ) equal to $2,185. We if the true mean were
wish to test, at the  = $62,000?
.05 level, H0: µ = $60,000.

McClave, Statistics, 11th ed. Chapter 8: Inferences 37


Based on a Single Sample: Tests of Hypotheses
8.6: Calculating Type II Error Probabilities:
More about 
The Economics of P(Type II )   
Education Review (Vol.
 61,340  62,000 
21, 2002) reported a mean P z  
salary for males with  2185 
postgraduate degrees of P z  0.30   .3821
$61,340, with s equal to
$2,185.
The power of this test is
We did not reject this null 1 - .3821 = .6179
hypothesis earlier, but
what if the true mean were
$62,000?

McClave, Statistics, 11th ed. Chapter 8: Inferences 38


Based on a Single Sample: Tests of Hypotheses
8.6: Calculating Type II Error Probabilities:
More about 

 For fixed n and , the value of 


decreases and the power increases as the
distance between µ0 and µa increases.
 For fixed n, µ0 and µa, the value of 
increases and the power decreases as the
value of  is decreased.
 For fixed , µ0 and µa, the value of 
decreases and the power increases as n is
increased.
McClave, Statistics, 11th ed. Chapter 8: Inferences 39
Based on a Single Sample: Tests of Hypotheses
8.6: Calculating Type II Error Probabilities:
More about 

For fixed n
 decreases as |µ0 - µa|
and (1-)
and  increases
increases

For fixed n, µ0
 increases as 
and (1 - )
and µa decreases
decreases

 decreases
For fixed , µ0 and (1 -  )
as n
and µa increases
increases

McClave, Statistics, 11th ed. Chapter 8: Inferences 40


Based on a Single Sample: Tests of Hypotheses
8.7: Tests of Hypotheses about a
Population Variance

Random Variable X

Sample Statistic:
Sample Statistic: or p-hat s2

Hypothesis Test
Hypothesis Test on µ or p
on 2 or 

Based on z Based on t Based on 2

McClave, Statistics, 11th ed. Chapter 8: Inferences 41


Based on a Single Sample: Tests of Hypotheses
8.7: Tests of Hypotheses about a
Population Variance

The chi-square distribution is really a family of distributions,


depending on the number of degrees of freedom.
But, the population must be normally distributed for the
hypothesis tests on 2 (or ) to be reliable!

(n  1) s 2
2 
2

McClave, Statistics, 11th ed. Chapter 8: Inferences 42


Based on a Single Sample: Tests of Hypotheses
8.7: Tests of Hypotheses about a
Population Variance

One-Tailed Test Two-Tailed Test


H 0 :  2   02 H 0 :  2   02

H a :  2   02  2   02  H a :  2   02
Test statistic: Test statistic:
(n  1) s 2 (n  1) s 2
 2
 
2

0
2 2
0
Rejection region: Rejection region:
 2  12   2  2  2  12 / 2 or  2  2 / 2

McClave, Statistics, 11th ed. Chapter 8: Inferences 43


Based on a Single Sample: Tests of Hypotheses
8.7: Tests of Hypotheses about a
Population Variance

Conditions Required for a Valid


Large- Sample Hypothesis Test for 2

1. A random sample is selected from the


target population.
2. The population from which the sample is
selected is approximately normal.

McClave, Statistics, 11th ed. Chapter 8: Inferences 44


Based on a Single Sample: Tests of Hypotheses
8.7: Tests of Hypotheses about a
Population Variance

Earlier, we considered the average number


of copies between jams for a brand of
copiers. The salesman also claims his
copiers are more predictable, in that the
standard deviation of jams is 125. In the
sample of 5 copiers, that sample standard
deviation was 157. Does his claim seem
believable, at the  = .10 level?

McClave, Statistics, 11th ed. Chapter 8: Inferences 45


Based on a Single Sample: Tests of Hypotheses
8.7: Tests of Hypotheses about a
Population Variance

Earlier, we considered the


average number of copies Two-Tailed Test
between jams for a brand of H 0 :  2  125
copiers. The salesman also
H a :  2  125
claims his copiers are more
predictable, in that the Test statistic:
standard deviation of jams is (5  1)(157 ) 2

125. In the sample of 5 2  2



125
copiers, that sample standard
Rejection criterion:
deviation was 157. Does his
 2  6.31  .205  9.48773
claim seem believable, at the
 = .10 level?
McClave, Statistics, 11th ed. Chapter 8: Inferences 46
Based on a Single Sample: Tests of Hypotheses
8.7: Tests of Hypotheses about a
Population Variance

Earlier, we considered the


average number of copies Two-Tailed Test
between jams for a brand of H 0 :  2  125
Do not
copiers. reject also
The salesman
H a :  2  125
claims his copiers are more
the null
reliable, in that the standard Test statistic:
hypothesis.
deviation of jams is 125. In (5  1)(157 ) 2

the sample of 5 copiers, that 2  2



125
sample standard deviation
Rejection criterion:
was 157. Does his claim
 2  6.31  .205  9.48773
seem believable, at the  =
.10 level?
McClave, Statistics, 11th ed. Chapter 8: Inferences 47
Based on a Single Sample: Tests of Hypotheses

Potrebbero piacerti anche