Comparison

Chapter 18
Comparison
Copyright © 2011 Pearson Education, Inc.
18.1 Data for Comparisons
A fitness chain is considering licensing a
proprietary diet at a cost of $200,000. Is it
more effective than the conventional free
government recommended food pyramid?


Use inferential statistics to test for differences
between two populations
Test for the difference between two means
3 of 46
Copyright © 2011 Pearson Education, Inc.
18.1 Data for Comparisons
Comparison of Two Diets

Frame as a test of the difference between the
means of two populations (mean number of
pounds lost on Atkins versus conventional diets)

Let µA denote the mean weight loss in the
population if members go on the Atkins diet and
µC denote the mean weight loss in the population
if members go on the conventional diet.
4 of 46
Copyright © 2011 Pearson Education, Inc.
18.1 Data for Comparisons
Comparison of Two Diets

In order to be profitable for the fitness chain, the
Atkins diet has to win by more than 2 pounds, on
average.

State the hypotheses as:
H0: µA - µC ≤ 2
HA: µA - µC > 2
5 of 46
Copyright © 2011 Pearson Education, Inc.
18.1 Data for Comparisons
Comparison of Two Diets

Data used to compare two groups typically arise
in one of three ways:
1.
Run an experiment that isolates a specific
cause.
Obtain random samples from two populations.
Compare two sets of observations.
2.
3.
6 of 46
Copyright © 2011 Pearson Education, Inc.
18.1 Data for Comparisons
Experiments

Experiment: procedure that uses randomization
to produce data that reveal causation.

Factor: a variable manipulated to discover its
effect on a second variable, the response.

Treatment: a level of a factor.
7 of 46
Copyright © 2011 Pearson Education, Inc.
18.1 Data for Comparisons
Experiments

1.
2.
3.
In the ideal experiment, the experimenter
Selects a random sample from a population.
Assigns subjects at random to treatments
defined by the factor.
Compares the response of subjects between
treatments.
8 of 46
Copyright © 2011 Pearson Education, Inc.
18.1 Data for Comparisons
Comparison of Two Diets

The factor in the comparison of diets is the diet
offered.

There are two treatments: Atkins and
conventional.

The response is the amount of weight lost
(measured in pounds).
9 of 46
Copyright © 2011 Pearson Education, Inc.
18.1 Data for Comparisons
Confounding

Confounding: mixing the effects of two or more
factors when comparing treatments.

Randomization eliminates confounding.

If it is not possible to randomize, then sample
independently from two populations.
10 of 46
Copyright © 2011 Pearson Education, Inc.
18.2 Two-Sample t - Test
Two-Sample t – Statistic
( x 1  x 2)  D 0
t
se( x 1  x 2)
with approximate degrees of freedom calculated
using software.
11 of 46
Copyright © 2011 Pearson Education, Inc.
18.2 Two-Sample t - Test
Two-Sample t – Test Summary
12 of 46
Copyright © 2011 Pearson Education, Inc.
18.2 Two-Sample t - Test
Two-Sample t – Test Checklist




No obvious lurking variables.
SRS condition.
Similar variances. While the test allows the
variances to be different, should notice if they are
similar.
Sample size condition. Each sample must satisfy
this condition.
13 of 46
Copyright © 2011 Pearson Education, Inc.
4M Example 18.1:
COMPARING TWO DIETS
Motivation
Scientists at U Penn selected 63 subjects
from the local population of obese adults.
They randomly assigned 33 to the Atkins
diet and 30 to the conventional diet. Do the
results show that the Atkins diet is worth
licensing?
14 of 46
Copyright © 2011 Pearson Education, Inc.
4M Example 18.1:
COMPARING TWO DIETS
Method
Use the two-sample t-test with α = 0.05. The
hypotheses are
H 0: µ A - µ C ≤ 2
HA: µA - µC > 2.
15 of 46
Copyright © 2011 Pearson Education, Inc.
4M Example 18.1:
COMPARING TWO DIETS
Method – Check Conditions
Since the interquartile ranges of the boxplots
appear similar, we can assume similar variances.
16 of 46
Copyright © 2011 Pearson Education, Inc.
4M Example 18.1:
COMPARING TWO DIETS
Method – Check Conditions



No obvious lurking variables because of
randomization.
SRS condition satisfied.
Both samples meet the sample size
condition.
17 of 46
Copyright © 2011 Pearson Education, Inc.
4M Example 18.1:
COMPARING TWO DIETS
Mechanics
(15.42  7.00)  2
t
 1.91
3.369
with 60.8255 df and p-value = 0.0308; reject H0
18 of 46
Copyright © 2011 Pearson Education, Inc.
4M Example 18.1:
COMPARING TWO DIETS
Message
The experiment shows that the average
weight loss of obese adults on the Atkins
diet does exceed the average weight loss
of obese adults on the conventional diet.
Unless the fitness chain’s membership
resembles this population (obese adults),
these results may not apply.
19 of 46
Copyright © 2011 Pearson Education, Inc.
18.3 Confidence Interval for the
Difference
95% Confidence Intervals for µA and µC
20 of 46
Copyright © 2011 Pearson Education, Inc.
18.3 Confidence Interval for the
Difference
95% Confidence Intervals for µA and µC
The confidence intervals overlap. If they were
nonoverlapping, we could conclude a significant
difference. However, this result is inconclusive.
21 of 46
Copyright © 2011 Pearson Education, Inc.
18.3 Confidence Interval for the
Difference
95% Confidence Interval for µ1 - µ2
The 100(1 – α)% two-sample confidence
interval for the difference in means is
( x 1  x 2)  t / 2 se( x 1  x 2)
22 of 46
Copyright © 2011 Pearson Education, Inc.
18.3 Confidence Interval for the
Difference
95% Confidence Interval for µA - µc
Since the 95% confidence interval for µA - µB does
not include zero, the means are statistically
significantly different (those on the Atkins diet
lose on average between 1.7 and 15.2 pounds
more than those on a conventional diet).
23 of 46
Copyright © 2011 Pearson Education, Inc.
4M Example 18.2:
EVALUATING A PROMOTION
Motivation
To evaluate the effectiveness of a
promotional offer, an overnight service
pulled records for a random sample of 50
offices that received the promotion and a
random sample of 75 that did not.
24 of 46
Copyright © 2011 Pearson Education, Inc.
4M Example 18.2:
EVALUATING A PROMOTION
Method
Use the two-sample t –interval. Let µyes
denote the mean number of packages
shipped by offices that received the
promotion and µno denote the mean
number of packages shipped by offices
that did not.
25 of 46
Copyright © 2011 Pearson Education, Inc.
4M Example 18.2:
EVALUATING A PROMOTION
Method – Check Conditions
All conditions are satisfied with the exception
of no obvious lurking variables. Since we
don’t know how the overnight delivery
service distributed the promotional offer,
confounding is possible. For example, it
could be the case that only larger offices
received the promotion.
26 of 46
Copyright © 2011 Pearson Education, Inc.
4M Example 18.2:
EVALUATING A PROMOTION
Mechanics
27 of 46
Copyright © 2011 Pearson Education, Inc.
4M Example 18.2:
EVALUATING A PROMOTION
Message
The difference is statistically significant.
Offices that received the promotion used
the overnight service to ship from 4 to 21
more packages on average than those
offices that did not receive the promotion.
There is the possibility of a confounding
effect.
28 of 46
Copyright © 2011 Pearson Education, Inc.
18.4 Other Comparisons
Comparisons Using Confidence Intervals

Other possible comparisons include comparing
two proportions or comparing two means from
paired data.

95% confidence intervals generally have the form
Estimated Difference ± 2  Estimated Standard
Error of the Difference
29 of 46
Copyright © 2011 Pearson Education, Inc.
18.4 Other Comparisons
Comparing Proportions
The 100(1 – α)% confidence z-interval for p1- p2 is
( pˆ 1  pˆ 2)  z / 2 se( pˆ 1  pˆ 2) .
Checklist: No obvious lurking variables.
SRS condition.
Sample size condition (for proportion).
30 of 46
Copyright © 2011 Pearson Education, Inc.
4M Example 18.3:
COLOR PREFERENCES
Motivation
A department store sampled customers from
the east and west and each was shown
designs for the coming fall season (one
featuring red and the other violet). If
customers in the two regions differ in their
preferences, the buyer will have to do a
special order for each district.
31 of 46
Copyright © 2011 Pearson Education, Inc.
4M Example 18.3:
COLOR PREFERENCES
Method
Data were collected on a random sample of
60 customers from the east and 72 from
the west. Construct a 95% confidence
interval for pE - pW.
SRS and sample size conditions are
satisfied. However, can’t rule out a lurking
variable (e.g., customers may be younger
in the west compared to the east).
32 of 46
Copyright © 2011 Pearson Education, Inc.
4M Example 18.3:
COLOR PREFERENCES
Mechanics
33 of 46
Copyright © 2011 Pearson Education, Inc.
4M Example 18.3:
COLOR PREFERENCES
Mechanics
Based on the data,
pˆ E  pˆ W  0.5833  0.4444  0.1389.
and the 95% confidence interval is
0.1389 ±1.96 (0.08645)
[-0.031 to 0.308]
34 of 46
Copyright © 2011 Pearson Education, Inc.
4M Example 18.3:
COLOR PREFERENCES
Message
There is no statistically significant difference
between customers from the east and
those from the west in their preferences for
the two designs. The 95% confidence
interval for the difference between
proportions contains zero.
35 of 46
Copyright © 2011 Pearson Education, Inc.
18.4 Other Comparisons
Paired Comparisons

Paired comparison: a comparison of two
treatments using dependent samples designed to
be similar (e.g., the same individuals taste test
Coke and Pepsi).

Pairing isolates the treatment effect by reducing
random variation that can hide a difference.
36 of 46
Copyright © 2011 Pearson Education, Inc.
18.4 Other Comparisons
Paired Comparisons

Given paired data, we begin the analysis by
forming the difference within each pair
(i.e., di = xi – yi ).

A two-sample analysis becomes a one-sample
analysis. Let d denote the mean of the
differences and sd their standard deviation.
37 of 46
Copyright © 2011 Pearson Education, Inc.
18.4 Other Comparisons
Paired Comparisons
The 100(1 - α)% confidence paired t- interval is
d  t / 2 ; n  1
sd
n
with n-1 df
Checklist: No obvious lurking variables.
SRS condition.
Sample size condition.
38 of 46
Copyright © 2011 Pearson Education, Inc.
4M Example 18.4:
SALES FORCE COMPARISON
Motivation
The merger of two pharmaceutical
companies (A and B) allows senior
management to eliminate one of the sales
forces. Which one should the merged
company eliminate?
39 of 46
Copyright © 2011 Pearson Education, Inc.
4M Example 18.4:
SALES FORCE COMPARISON
Method
Both sales forces market similar products
and were organized into 20 comparable
geographical districts. Use the differences
obtained from subtracting sales for Division
B from sales for Division A in each district
to obtain a 95% confidence t-interval for
µA - µB .
40 of 46
Copyright © 2011 Pearson Education, Inc.
4M Example 18.4:
SALES FORCE COMPARISON
Method – Check Conditions
Inspect histogram of differences:
All conditions are satisfied.
41 of 46
Copyright © 2011 Pearson Education, Inc.
4M Example 18.4:
SALES FORCE COMPARISON
Mechanics
The 95% t-interval for the mean differences does
not include zero. There is a statistically
significant difference.
42 of 46
Copyright © 2011 Pearson Education, Inc.
4M Example 18.4:
SALES FORCE COMPARISON
Message
On average, sales force B sells more per day
than sales force A.
The high correlation (r = 0.97) of sales
between Sales Force A and Sales Force B
in these districts confirms the benefit of a
paired comparison.
43 of 46
Copyright © 2011 Pearson Education, Inc.
Best Practices

Use experiments to discover causal relationships.

Plot your data.

Use a break-even analysis to formulate the null
hypothesis.
44 of 46
Copyright © 2011 Pearson Education, Inc.
Best Practices (Continued)

Use one confidence interval for comparisons.

Compare the variances in the two samples.

Take advantage of paired comparisons.
45 of 46
Copyright © 2011 Pearson Education, Inc.
Pitfalls

Don’t forget confounding.

Do not assume that a confidence interval that
includes zero means that the difference is zero.

Don’t confuse a two-sample comparison with a
paired comparison.

Don’t think that equal sample sizes imply paired
data.
46 of 46
Copyright © 2011 Pearson Education, Inc.