0% found this document useful (0 votes)
6 views47 pages

Comparing Two Means and Proportions

The document discusses testing the difference between two means using z-tests and t-tests. It provides the assumptions and formulas for these tests, as well as examples showing how to perform hypothesis tests and calculate confidence intervals when comparing two means.

Uploaded by

Osama Samha
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views47 pages

Comparing Two Means and Proportions

The document discusses testing the difference between two means using z-tests and t-tests. It provides the assumptions and formulas for these tests, as well as examples showing how to perform hypothesis tests and calculate confidence intervals when comparing two means.

Uploaded by

Osama Samha
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Chapter 9

Testing the Difference


Between Two Means, Two
Proportions, and Two
Variances
1
9.1 Testing the Difference Between
Two Means: Using the z Test
Assumptions:
1. The samples must be independent of each
other. That is, there can be no relationship
between the subjects in each sample.
2. The standard deviations of both
populations must be known, and if the
sample sizes are less than 30, the
populations must be normally or
approximately normally distributed.

2
Hypothesis Testing Situations in
the Comparison of Means

3
Hypothesis Testing Situations in
the Comparison of Means

4
Testing the Difference Between
Two Means: Large Samples
Formula for the z test for comparing two means from
independent populations

z=
( X 1 − X 2 ) − ( µ1 − µ 2 )
σ 2
σ 2
1
+ 2
n1 n2

5
Example 9-1: Hotel Room Cost
A survey found that the average hotel room rate in New
Orleans is $88.42 and the average room rate in Phoenix is
$80.61. Assume that the data were obtained from two
samples of 50 hotels each and that the standard
deviations of the populations are $5.62 and $4.83,
respectively. At α = 0.05, can it be concluded that there is
a significant difference in the rates?

Step 1: State the hypotheses and identify the claim.


H0: μ1 = μ2 and H1: μ1 ≠ μ2 (claim)

Step 2: Find the critical value.


The critical value is z = ±1.96.
6
Example 9-1: Hotel Room Cost
A survey found that the average hotel room rate in New
Orleans is $88.42 and the average room rate in Phoenix is
$80.61. Assume that the data were obtained from two
samples of 50 hotels each and that the standard
deviations of the populations are $5.62 and $4.83,
respectively. At α = 0.05, can it be concluded that there is
a significant difference in the rates?

Step 3: Compute the test value.

z=
( X 1 − X 2 ) − ( µ1 − µ 2 )
σ 12 σ 22
+
n1 n2
7
Example 9-1: Hotel Room Cost
A survey found that the average hotel room rate in New
Orleans is $88.42 and the average room rate in Phoenix is
$80.61. Assume that the data were obtained from two
samples of 50 hotels each and that the standard
deviations of the populations are $5.62 and $4.83,
respectively. At α = 0.05, can it be concluded that there is
a significant difference in the rates?

Step 3: Compute the test value.

z=
( 88.42 − 80.61) − ( 0 )
= 7.45
2 2
5.62 4.83
+
50 50
8
Example 9-1: Hotel Room Cost
Step 4: Make the decision.
Reject the null hypothesis at α = 0.05, since
7.45 > 1.96.

Step 5: Summarize the results.


There is enough evidence to support the claim
that the means are not equal. Hence, there is a
significant difference in the rates.

9
Example 9-2: College Sports Offerings
A researcher hypothesizes that the average number of
sports that colleges offer for males is greater than the
average number of sports that colleges offer for females.
A sample of the number of sports offered by colleges is
shown. At α = 0.10, is there enough evidence to support
the claim? Assume σ1 and σ2 = 3.3.

10
Example 9-2: College Sports Offerings
Step 1: State the hypotheses and identify the claim.
H0: μ1 = μ2 and H1: μ1 > μ2 (claim)

Step 2: Compute the test value.


Using a calculator, we find
For the males: X 1 = 8.6 and σ1 = 3.3
For the females: X 2 = 7.9 and σ2 = 3.3
Substitute in the formula.

z=
( X 1 − X 2 ) − ( µ1 − µ 2 )
=
(=
8.6 − 7.9 ) − ( 0 )
1.06
σ 12 σ 22 3.32 3.32
+ +
n1 n2 50 50
11
Example 9-2: College Sports Offerings
Step 3: Find the P-value.
For z = 1.06, the area is 0.8554.
The P-value is 1.0000 - 0.8554 = 0.1446.

Step 4: Make the decision.


Do not reject the null hypothesis.

Step 5: Summarize the results.


There is not enough evidence to support the
claim that colleges offer more sports for males
than they do for females.
12
Confidence Intervals for the
Difference Between Two Means
Formula for the z confidence interval for the difference
between two means from independent populations

σ 12 σ 22
(X 1 − X 2 ) − zα 2
n1
+
n2
< ( µ1 − µ 2 )

σ 12 σ 22
< ( X 1 − X 2 ) + zα 2 +
n1 n2

13
Example 9-3: Confidence Intervals
Find the 95% confidence interval for the difference
between the means for the data in Example 9–1.
σ 12 σ 22
(X 1 − X 2 ) − zα 2
n1
+
n2
< µ1 − µ 2

σ 12 σ 22
< ( X 1 − X 2 ) + zα 2 +
n1 n2

5.622 4.832
( 88.42 − 80.61) − 1.96 + < µ1 − µ 2
50 50
5.622 4.832
< ( 88.42 − 80.61) + 1.96 +
50 50
7.81 − 2.05 < µ1 − µ 2 < 7.81 + 2.05

5.76 < µ1 − µ 2 < 9.86

14
9.2 Testing the Difference Between
Two Means: Using the t Test
Formula for the t test for comparing two means from
independent populations with unequal variances

t=
( X 1 − X 2 ) − ( µ1 − µ 2 )
s12 s22
+
n1 n2

where the degrees of freedom are equal to the smaller of


n1 – 1 or n2 – 1.

15
Testing the Difference Between
Two Means: Using the t Test
 There is a different formula for the t test for comparing
two means from independent populations with equal
variances. To determine whether two sample variances
are equal, the researcher can use an F test.

 Note, however, that not all statisticians are in


agreement about using the F test before using the t
test. Some believe that conducting the F and t tests at
the same level of significance will change the overall
level of significance of the t test. Their reasons are
beyond the scope of this textbook. Because of this, we
will assume that σ1 ≠ σ2 in this textbook.

16
Example 9-4: Farm Sizes
The average size of a farm in Indiana County,
Pennsylvania, is 191 acres. The average size of a farm in
Greene County, Pennsylvania, is 199 acres. Assume the
data were obtained from two samples with standard
deviations of 38 and 12 acres, respectively, and sample
sizes of 8 and 10, respectively. Can it be concluded at
α = 0.05 that the average size of the farms in the two
counties is different? Assume the populations are
normally distributed.

Step 1: State the hypotheses and identify the claim.


H0: μ1 = μ2 and H1: μ1 ≠ μ2 (claim)

17
Example 9-4: Farm Sizes
Step 2: Find the critical values.
Since the test is two-tailed, a = 0.05, and the
variances are unequal, the degrees of freedom
are the smaller of n1 – 1 or n2 – 1. In this case, the
degrees of freedom are 8 – 1 = 7. Hence, from
Table F, the critical values are -2.365 and 2.365.

Step 3: Find the test value.

t=
( X 1 − X 2 ) − ( µ1 − µ 2 )
=
(191 − 199 ) − ( 0 )
s12 s22 382 122
+ +
n1 n2 8 10

= −0.57
18
Example 9-4: Farm Sizes
Step 4: Make the decision.
Do not reject the null hypothesis.

Step 5: Summarize the results.


There is not enough evidence to support the claim
that the average size of the farms is different.

19
Confidence Intervals for the
Difference Between Two Means
Formula for the t confidence interval for the difference
between two means from independent populations with
unequal variances
s12 s22
(X 1 − X 2 ) − tα 2 +
n1 n2
< ( µ1 − µ 2 )

s12 s22
< ( X 1 − X 2 ) + tα 2 +
n1 n2

d.f. smaller value of n1 – 1 or n2 – 1.

20
Example 9-5: Confidence Intervals
Find the 95% confidence interval for the difference
between the means for the data in Example 9–4.
s12 s22
(X 1 − X 2 ) − tα 2 +
n1 n2
< µ1 − µ 2

s12 s22
< ( X 1 − X 2 ) + tα 2 +
n1 n2

382 122
(191 − 199 ) − 2.365 + < µ1 − µ 2
8 10
382 122
< (191 − 199 ) + 2.365 +
8 10
−41.0 < µ1 − µ 2 < 25.0

21
9-4 Testing the Difference Between
Proportions
z=
( pˆ1 − pˆ 2 ) − ( p1 − p2 )
1 1 
pq  + 
 n1 n2 
where
X1 + X 2 X1
p = pˆ1
n1 + n2 n1
X2
q=
1− p pˆ 2 =
n2
22
Example 9-9: Vaccination Rates
In the nursing home study mentioned in the chapter-
opening Statistics Today, the researchers found that 12
out of 34 small nursing homes had a resident vaccination
rate of less than 80%, while 17 out of 24 large nursing
homes had a vaccination rate of less than 80%. At
α = 0.05, test the claim that there is no difference in the
proportions of the small and large nursing homes with a
resident vaccination rate of less than 80%.
X 1 12 X 2 17
pˆ1
= = = 0.35 and pˆ=
2 = = 0.71
n1 34 n2 24
X 1 + X 2 12 + 17 29
p
= = q 0.5
= = 0.5, =
n1 + n2 34 + 24 58

23
Example 9-9: Vaccination Rates
Step 1: State the hypotheses and identify the claim.
H0: p1 – p2 = 0 (claim) and H1: p1 – p2 ≠ 0

Step 2: Find the critical value.


Since α = 0.05, the critical values are -1.96
and 1.96.

Step 3: Compute the test value.

z=
( pˆ1 − pˆ 2 ) − ( p1 − p2 ) ( 0.35 − 0.71) − ( 0 )
=
1 1   1 1 
pq  +  ( 0.5 )( 0.5 )  + 
 n1 n2   34 24 
= −2.7

24
Example 9-9: Vaccination Rates
Step 4: Make the decision.
Reject the null hypothesis.

Step 5: Summarize the results.


There is enough evidence to reject the claim
that there is no difference in the proportions of
small and large nursing homes with a resident
vaccination rate of less than 80%.
25
Example 9-10: Missing Work
In a sample of 200 workers, 45% said that they missed
work because of personal illness. Ten years ago in a
sample of 200 workers, 35% said that they missed work
because of personal illness. At α = 0.01, is there a
difference in the proportion?

To compute p , you must find X1 and X2.


X 1 pˆ=
= 1n1 0.45 ( 200
= ) 90
X 2 pˆ=
= 2 n2 0.35 ( 200
= ) 70
X1 + X 2 90 + 70 160
=p = q 0.6
= = 0.4, =
n1 + n2 200 + 200 400
26
Example 9-10: Missing Work
Step 1: State the hypotheses and identify the claim.
H0: p1 = p2 and H1: p1 ≠ p2 (claim)

Step 2: Find the critical value.


Since α = 0.01, the critical values are -2.58
and 2.58.

Step 3: Compute the test value.

z=
( pˆ1 − pˆ 2 ) − ( p1 − p2 ) ( 0.45 − 0.35 ) − ( 0 )
=
1 1   1 1 
pq  +  ( 0.4 )( 0.6 )  + 
 n1 n2   200 200 
= 2.04

27
Example 9-10: Missing Work
Step 4: Make the decision.
Do not reject the null hypothesis.

Step 5: Summarize the results.


There is not enough evidence to support the
claim that there is a difference in proportions.

28
Confidence Interval for the
Difference Between Proportions
Formula for the confidence interval for the difference
between proportions

pˆ1qˆ1 pˆ 2 qˆ2
( pˆ1 − pˆ 2 ) − zα 2 + < p1 − p2
n1 n2
pˆ1qˆ1 pˆ 2 qˆ2
< ( pˆ1 − pˆ 2 ) + zα 2 +
n1 n2

29
Example 9-11: Confidence Intervals
Find the 95% confidence interval for the difference of the
proportions for the data in Example 9–9.
X 12
ˆp1 =1 = = 0.35 and qˆ1 =
1 − 0.35 =
0.65
n1 34
X 2 17
pˆ 2 = = = 0.71 and qˆ2 =
1 − 0.71 =
0.29
n2 24

pˆ1qˆ1 pˆ 2 qˆ2
( pˆ1 − pˆ 2 ) − zα 2 + < p1 − p2
n1 n2
pˆ1qˆ1 pˆ 2 qˆ2
< ( pˆ1 − pˆ 2 ) + zα 2 +
n1 n2

30
Example 9-11: Confidence Intervals
Find the 95% confidence interval for the difference of the
proportions for the data in Example 9–9.
( 0.35 )( 0.65 ) + ( 0.71)( 0.29 ) < p
( 0.35 − 0.71) − 1.96 1 − p2
34 24

< ( 0.35 − 0.71) + 1.96


( 0.35 )( 0.65 ) + ( 0.71)( 0.29 )
34 24

−0.36 − 0.242 < p1 − p2 < −0.36 + 0.242

−0.602 < p1 − p2 < −0.118


Since 0 is not contained in the interval, the decision is
to reject the null hypothesis H0: p1 = p2.
31
9.5 Testing the Difference Between
Two Variances
 In addition to comparing two means, statisticians are
interested in comparing two variances or standard
deviations.

 For the comparison of two variances or standard


deviations, an F test is used.

 The F test should not be confused with the chi-square


test, which compares a single sample variance to a
specific population variance, as shown in Chapter 8.

32
Characteristics of the F Distribution
1. The values of F cannot be negative, because
variances are always positive or zero.
2. The distribution is positively skewed.
3. The mean value of F is approximately equal to 1.
4. The F distribution is a family of curves based on the
degrees of freedom of the variance of the numerator
and the degrees of freedom of the variance of the
denominator.

33
Shapes of the F Distribution

34
Testing the Difference Between
Two Variances
s12
F= 2
s2
where the larger of the two variances is placed in the
numerator regardless of the subscripts. (See note on
page 518.)

The F test has two terms for the degrees of freedom:


that of the numerator, n1 – 1, and that of the
denominator, n2 – 1, where n1 is the sample size from
which the larger variance was obtained.
35
Example 9-12: Table H
Find the critical value for a right-tailed F test when
α = 0.05, the degrees of freedom for the numerator
(abbreviated d.f.N.) are 15, and the degrees of freedom
for the denominator (d.f.D.) are 21.

Since this test is right-tailed with a 0.05, use the 0.05


table. The d.f.N. is listed across the top, and the d.f.D. is
listed in the left column. The critical value is found where
the row and column intersect in the table.

36
Example 9-12: Table H
Find the critical value for a right-tailed F test when
α = 0.05, the degrees of freedom for the numerator
(abbreviated d.f.N.) are 15, and the degrees of freedom
for the denominator (d.f.D.) are 21.

F = 2.18

37
Example 9-13: Table H
Find the critical value for a two-tailed F test with α = 0.05
when the sample size from which the variance for the
numerator was obtained was 21 and the sample size from
which the variance for the denominator was obtained was
12.

When you are conducting a two-tailed test, α is split; and


only the right tail is used. The reason is that F ≥ 1.

Since this is a two-tailed test with α = 0.05, the 0.05/2 =


0.025 table must be used.

Here, d.f.N. = 21 – 1 = 20, and d.f.D. = 12 – 1 = 11.

38
Example 9-13: Table H
Find the critical value for a two-tailed F test with α = 0.05
when the sample size from which the variance for the
numerator was obtained was 21 and the sample size from
which the variance for the denominator was obtained was
12.

F = 3.23

39
Notes for the Use of the F Test
1. The larger variance should always be placed in the
numerator of the formula regardless of the subscripts.
(See note on page 518.)
2. For a two-tailed test, the α value must be divided by 2
and the critical value placed on the right side of the F
curve.
3. If the standard deviations instead of the variances are
given in the problem, they must be squared for the
formula for the F test.
4. When the degrees of freedom cannot be found in
Table H, the closest value on the smaller side should
be used.

40
Assumptions for Using the F Test
1. The populations from which the samples were
obtained must be normally distributed. (Note:
The test should not be used when the
distributions depart from normality.)

2. The samples must be independent of each


other.

41
Example 9-14: Heart Rates of Smokers
A medical researcher wishes to see whether the variance
of the heart rates (in beats per minute) of smokers is
different from the variance of heart rates of people who do
not smoke. Two samples are selected, and the data are
as shown. Using α = 0.05, is there enough evidence to
support the claim?

Step 1: State the hypotheses and identify the claim.


= H 0 : σ 12 σ 22 and H1 : σ 12 ≠ σ 22 (claim)

42
Example 9-14: Heart Rates of Smokers

Step 2: Find the critical value.


Use the 0.025 table in Table H since α = 0.05
and this is a two-tailed test. Here, d.f.N. = 25,
and d.f.D. = 17. The critical value is 2.56 (d.f.N.
24 was used).

Step 3: Compute the test value.


s12 36
F
= = 2
= 3.6
s2 10

43
Example 9-14: Heart Rates of Smokers
Step 4: Make the decision.
Reject the null hypothesis, since 3.6 > 2.56.

Step 5: Summarize the results.


There is enough evidence to support the claim
that the variance of the heart rates of smokers
and nonsmokers is different.

44
Example 9-15: Doctor Waiting Times
The standard deviation of the average waiting time to see
a doctor for non-lifethreatening problems in the
emergency room at an urban hospital is 32 minutes. At a
second hospital, the standard deviation is 28 minutes. If a
sample of 16 patients was used in the first case and 18 in
the second case, is there enough evidence to conclude
that the standard deviation of the waiting times in the first
hospital is greater than the standard deviation of the
waiting times in the second hospital?

Step 1: State the hypotheses and identify the claim.


=H 0 : σ 12 σ 22 and H1 : σ 12 > σ 22 (claim)

45
Example 9-15: Doctor Waiting Times
The standard deviation of the average waiting time to see
a doctor for non-lifethreatening problems in the
emergency room at an urban hospital is 32 minutes. At a
second hospital, the standard deviation is 28 minutes. If a
sample of 16 patients was used in the first case and 18 in
the second case, is there enough evidence to conclude
that the standard deviation of the waiting times in the first
hospital is greater than the standard deviation of the
waiting times in the second hospital?

Step 2: Find the critical value.


Here, d.f.N. = 15, d.f.D. = 17, and α = 0.01.
The critical value is F = 3.31.
46
Example 9-15: Doctor Waiting Times
Step 3: Compute the test value.
s12 322
F
= = 2
=2
1.31
s2 28
Step 4: Make the decision.
Do not reject the null hypothesis since 1.31 < 3.31.

Step 5: Summarize the results.


There is not enough evidence to support the claim that
the standard deviation of the waiting times of the first
hospital is greater than the standard deviation of the
waiting times of the second hospital.

47

You might also like