Vous êtes sur la page 1sur 29

Chapter

Hypothesis Testing

Two
Samples
8

Elementary Statistics
Larson Farber

Overview

To test the effect of an herbal treatment on


improvement of memory you randomly select
two samples, one to receive the treatment and
one to receive a placebo. Results of a memory
test taken one month later are given.
Sample
1

x1 77
s1 15
n1 95

x 2 73

s 2 12 Sample
n2 105

Experimental Group

Control Group

Treatment

Placebo

The resulting test statistic is 77 - 73 = 4. Is this


difference significant or is it due to chance
(sampling error)?
2

Larson/Farber Ch 8

Independent Samples
INDEPENDENT SAMPLES
When members of one sample are not related to
members of the other sample.
Persons receiving herbal treatment were not
related or paired with those in the control group
who took a placebo.

x1 x1
x1
x1
x x1

x1

Experimental Group
Larson/Farber Ch 8

x2
x2

x2
x2

x2

Control Group
3

Dependent Samples
DEPENDENT SAMPLES
Each member of one sample is paired with a
member of the other sample.
The test score for each person in the sample could be
recorded before and after taking the herbal treatment.

x1

x1

x1

x2

x1
x1
x1

x2

Score Before
The difference x1

Larson/Farber Ch 8

x2

x2
x2
x2
x2

Score After

can be calculated for4 each pair.

Application

To test the effect of an herbal


treatment on improvement of memory,
you randomly select sample of 95 to
receive the treatment and a sample of
105 to receive a placebo. Both groups
take a test after one month. The mean
score for the experimental group is 77
with a standard deviation of 15. For
the control group, the mean is 73 with
a standard deviation of 12. Test the
claim that the herbal treatment
improves memory at = 0.01.

Larson/Farber Ch 8

11..Write
Write the
the null
null and
and alternative
alternative hypothesis
hypothesis
Null Hypothesis H0 usually
states there is no difference
between the parameters of two
populations
Alternative Hypothesis Ha is
true when H0 is false.
H0: 1 2
Ha: 1 > 2 Claim

22..State
State the
the level
level of
of significance
significance
= 0.01. This is the probability that H0 is true
but you reject it..
Larson/Farber Ch 8

33..Identify
Identify the
the sampling
sampling distribution
distribution
The distribution for the sample statistic x1
is normal since both samples are large.

x1 x 2 0

x1 x 2

x2

n1 n2
2

2
2

Rejection Region

z
0

z0
2.33

44..Find
Find the
the

critical
critical value
value
Larson/Farber Ch 8

z0

Critical Value

5.
5.Find
Find the
the

rejection
rejection region
region
7

6.
6.Find
Find the
the test
test statistic
statistic
z

( x1 x2 ) ( 1

x x
1

When both samples


2 ) are large, you can
use s1 and s2 in place
of 1 and 2.

152 12 2

95 105

3.74 1.933

40
z
2.07
1.933

77..Make
Make your
your decision
decision
0 2.33
z=2.07 does not fall in the rejection region. Do
not reject the null hypothesis.

88..Interpret
Interpret your
your decision
decision
There is not enough evidence to support the claim
that the herbal treatment improves memory.
Larson/Farber Ch 8

Testing Difference Between Means (Small

Samples)

When you cannot collect samples of 30 or more, you


can use a t-test, provided both populations are normal.
The sampling distribution depends on whether the
population variances are equal.
If the variances of the two populations are equal, you
can combine or pool information from both samples
to form a pooled estimate of the standard deviation .
2

(n1 1) s1 (n2 1) s2

n1 n2 2
The standard error is
d.f. = n1 + n2 -2

x1 x2

1 1

n1 n2

If the variances are not equal, the standard error is:

x1 x2
Larson/Farber Ch 8

s1 s2

n1 n2

And d.f. is the smaller of n1-1 or n2-1.

Application

Crash tests at 5 miles per hour were


performed on 5 small pickups and 8 SUVs.
For the small pickups the mean bumper
repair cost was $1520 and the standard
deviation was $403. For the SUVs, the
mean bumper repair cost was $937 and the
standard deviation was $382. At =0.05
test the claim that the bumper repair cost is
greater for small pickups than for SUVs.
Assume equal variances.

Pickup SUV
n

x 1520

937

s 403

382

Larson/Farber Ch 8

10

11..Write
Write the
the null
null and
and alternative
alternative hypothesis
hypothesis
H0: 1 2
Ha: 1 > 2 Claim

22..State
State the
the level
level of
of significance
significance
= 0.05.

33..Identify
Identify the
the sampling
sampling distribution
distribution
Since the variances are equal, the distribution for
the sample statistic x1 x 2 is a t-distribution with
d.f. = 5 + 8 - 2 = 11.
Larson/Farber Ch 8

11

44..Find
Find the
the

critical
critical value
value

5.
5.Find
Find the
the

t0
1.796

rejection
rejection region
region

6.
6.Find
Find the
the test
test statistic
statistic
2

(n1 1) s1 (n2 1) s2

n1 n2 2

When variances
are equal find
the pooled value

(5 1)4032 (8 1)(382) 2

389.77
582

x1 x2

1 1

n1 n2

1 1
389.77 389.77(.570) 222.203
5 8
12

Larson/Farber Ch 8

( x1 x2 ) ( 1 2 )

x x
1

(1520 937) 0
t
2.624
222.203

77..Make
Make your
your decision
decision

t
0

1.796

t=2.624 falls in the rejection region. Reject the


null hypothesis.

88..Interpret
Interpret your
your decision
decision
There is enough evidence to support the claim that
bumper repair costs are greater for pickups than for
SUVs.
Larson/Farber Ch 8

13

Application

A real estate agent claims there is no


difference between the mean household
incomes of two neighborhoods. The mean
income of 12 households from the first
neighborhood was $48,250 with a
standard deviation of $1200. In the second
neighborhood, 10 households has a mean
income of $50,375 with a standard
deviation of $3400. Assume the incomes
are normally distributed and the variances
are not equal. Test the claim at = 0.01.

Larson/Farber Ch 8

14

11..Write
Write the
the null
null and
and alternative
alternative hypothesis
hypothesis
H0: 1 = 2 Claim
Ha: 1 2

22..State
State the
the level
level of
of significance
significance
= 0.01.

33..Identify
Identify the
the sampling
sampling distribution
distribution
Since the variances are not equal, the distribution
for the sample statistic x1 x 2 is a t-distribution
with d.f. = 9
(The smaller sample size is 10 and 10 - 1 =9.)
Larson/Farber Ch 8

15

44..Find
Find the
the

critical
critical values
values

5.
5.Find
Find the
the

-t0 0 t0
-3.250 3.250

rejection
rejection regions
regions

6.
6.Find
Find the
the test
test statistic
statistic
x1 x2

2
2
s1 s2
1200
3400

n1 n2
12
10

= 1129..6017

( x1 x2 ) ( 1 2 )

x x
1

( 48250 50375) 0
t
1.88
1129 .6017
Larson/Farber Ch 8

16

77..Make
Make your
your decision
decision
t

-3.250 0 3.250

t =- 1.881 does not fall in the rejection region.


Do not eject the null hypothesis.

88..Interpret
Interpret your
your decision
decision
There is not enough evidence to reject the claim
that there is no difference in mean household
incomes in the two neighborhoods.
Larson/Farber Ch 8

17

The Difference Between Means-Dependent

Samples

When each value from one sample is paired


with a data value in the second sample, the
samples are dependent.

x1

x1

x1
x1
x1
x1

x2

x2

x2
x2
x2
x2

The difference d = x1 - x2 is calculated


for each data pair.
The sampling distribution for d the mean of
the differences is a t-distribution with n-1
degrees of freedom. (Where n is the number
18
Larson/Farber Ch 8
of pairs.)

Application

The table shows the heart rates (beats per minute)


of five people before exercising and after. At =
0.05, is there enough evidence to conclude that
heart rate increases with exercise?
Person

Before

1
2
3
4
5

d
sd

65
72
85
78
93

After

127
135
140
136
150

62
63
55
58
57

the mean of d is 59
the standard deviation of d is 3.39

Larson/Farber Ch 8

19

11..Write
Write the
the null
null and
and alternative
alternative hypothesis
hypothesis
H0: d 0
Ha: d > 0 claim

22..State
State the
the level
level of
of significance
significance
= 0.05.

33..Identify
Identify the
the sampling
sampling distribution
distribution
The distribution for the sample statistic
t-distribution with d.f. = 4

(since there are 5 data pairs, d.f.= 5 - 1 =4)


Larson/Farber Ch 8

20

is a

44..Find
Find the
the

critical
critical value
value

t0
2.132

5.
5.Find
Find the
the

rejection
rejection region
region

6.
6.Find
Find the
the test
test statistic
statistic
d d
t
sd
n
59 0
t
38.92
3.39
5
Larson/Farber Ch 8

21

77..Make
Make your
your decision
decision

t0
2.132

t=38.92 falls in the rejection region. Reject the


null hypothesis.

88..Interpret
Interpret your
your decision
decision
There is enough evidence to support the claim that
heart rate increases with exercise.
Larson/Farber Ch 8

22

Using Minitab

The Minitab printout

Test of mu =
Variable
T
diff
1.52

0.00 vs mu >
N

Mean
P
5
38.90

0.00
StDev

59.00
0.0000

SE Mean
3.39

The P-value is 0.0000. Since 0.0000 < 0.05, reject


the null hypothesis.

Larson/Farber Ch 8

23

The Difference
Between Proportions
If independent samples are taken from each of two
populations and the samples are large enough to use
a normal sampling distribution, then you can test
for the difference between sample proportions p1 p2.
x1and
x2. represent the number of successes in
each sample.
n1and n2. represent the total number in each
sample.

x1
p 1
n1

x2
p 2
n2

Sample proportions of
successes.

Since the proportions will be assumed equal, an


estimate for the common value is:

x1 x2
p
n1 n2

and
Larson/Farber Ch 8

q 1 p

24

Two Sample z-test


If

n1 p, n1q , n2 p, n2 q

the sampling distribution for

are each at least 5

p1 p 2

is normal.

The mean is p1 - p2 and the standard error

p1 p 2

1 1
p q( )
n1 n2

The standardized test statistic is:

( p 1 p 2 ) ( p1 p2 )
z
1 1
p q( )
n1 n2
Larson/Farber Ch 8

25

Application
In a survey of 3420 college students
attending private schools 917 said they
smoked in the last 30 days. In a survey of
5131 college students attending public
schools, 1503 said they had smoked in the
last 30 days. At = 0.01, can you support
the claim that the proportion of college
students who said they had smoked in the
last 30 days in the private schools is less
than the proportion in public schools?
private
n1 = 3420
x1 = 917

p 1 0.268
Larson/Farber Ch 8

public
n2 = 5131
x2 = 1503

p 2 0.293
26

11..Write
Write the
the null
null and
and alternative
alternative hypothesis
hypothesis
H0: p1 p2
Ha: p1 < p2 Claim

22..State
State the
the level
level of
of significance
significance = 0.01.
33..Identify
Identify the
the sampling
sampling distribution
distribution
2420
p
0.283 and q 0.717
8551
The distribution for the sample statistic
is normal since n1 p , n1q , n2 p ,
are each at least 5

p 1 p 2

n2 q

p1 p 2 0

p1 p 2
Larson/Farber Ch 8

1 1
p q ( ) 0.00994
n1 n2
27

Rejection Region

Critical Value

z0

z
-2.33

5.
5.Find
Find the
the

44..Find
Find the
the

rejection
rejection region
region

critical
critical value
value

6.
6.Find
Find the
the test
test statistic
statistic
( p 1 p 2 ) ( p1 p2 )
z
1 1
p q( )
n1 n2

(.268 .293) (0)


0.025
z

2.514
0.00994 28
.00009888

Larson/Farber Ch 8

77..Make
Make your
your decision
decision

-2.33

z=-2.514 falls in the rejection region. Reject


the null hypothesis.

88..Interpret
Interpret your
your decision
decision
There is enough evidence to support the claim that
there is a lower proportion of students who smoke
in private colleges than in public colleges.
Larson/Farber Ch 8

29

Vous aimerez peut-être aussi