Transcript Slide 1
Chapter 24
Comparing Means
Copyright © 2009 Pearson Education, Inc.
Objectives:
The student will be able to:
Perform and interpret a two-sample t-test for
two population means, to include: writing
appropriate hypotheses, checking the
necessary assumptions, drawing an
appropriate diagram, computing the P-value,
making a decision, and interpreting the results
in the context of the problem.
Compute and interpret in context a t-based
confidence interval for the difference between
two population means, checking the necessary
assumptions.
Copyright © 2009 Pearson Education, Inc.
Slide 1- 3
Plot the Data
The natural display for
comparing two groups is
boxplots of the data for the
two groups, placed sideby-side. For example:
Copyright © 2009 Pearson Education, Inc.
Slide 1- 4
Comparing Two Means
Once we have examined the side-by-side
boxplots, we can turn to the comparison of two
means.
Comparing two means is not very different from
comparing two proportions.
This time the parameter of interest is the
difference between the two means, 1 – 2.
Copyright © 2009 Pearson Education, Inc.
Slide 1- 5
Comparing Two Means (cont.)
Because we are working with means and
estimating the standard error of their difference
using the data, we shouldn’t be surprised that the
sampling model is a Student’s t.
The confidence interval we build is called a
two-sample t-interval (for the difference in
means).
The corresponding hypothesis test is called a
two-sample t-test.
Copyright © 2009 Pearson Education, Inc.
Slide 1- 6
Assumptions and Conditions
Independence Assumption (Each condition needs to be
checked for both groups.):
Randomization Condition: Were the data collected with
suitable randomization (representative random
samples or a randomized experiment)?
10% Condition: We don’t usually check this condition
for differences of means. We will check it for means
only if we have a very small population or an extremely
large sample.
Copyright © 2009 Pearson Education, Inc.
Slide 1- 7
Assumptions and Conditions (cont.)
Normal Population Assumption:
Nearly Normal Condition: This must be checked for
both groups. A violation by either one violates the
condition.
Independent Groups Assumption: The two groups we are
comparing must be independent of each other. (See
Chapter 25 if the groups are not independent of one
another…)
Copyright © 2009 Pearson Education, Inc.
Slide 1- 8
To find the confidence interval for the difference of
two population means – 2-SampTInt
In the morning class, the mean on the first exam was 78 with a
standard deviation of 2.3 for the 57 students in the class. In the
afternoon class, the mean was 81 with a standard deviation of 5.7 for
the 37 students in the class.
Determine the 90% confidence interval for the difference in the means
of the two groups.
Stat... Tests.. #0 for 2-Samp T Int... enter
For Inpt choose Stats unless you have placed the data in L1 and L2.
X bar 1 is 78 and sx1 is 2.3 with n1 as 57
Xbar2 is 81 and sx2 is 5.7 with n2 as 37
C-level is .9
Never pool
Calculate
You should get an interval from -4.656 to -1.344 indicating that there
is a difference between the two means of 1.344 to 4.656 points.
(Don’t report a negative difference.)
Copyright © 2009 Pearson Education, Inc.
Slide 1- 9
15. The data below show the sugar content (as a
percentage of weight) of several national brands
of children’s and adult’s cereals. Create and
interpret a 95% confidence interval for the
difference between in mean sugar content. Be
sure to check the necessary assumptions and
conditions
Children’s: 40.3 55 45.7 43.3 50.3 45.9
53.5 43 44.2 44 47.4 44 33.6 55.1 48.8
50.4 37.8 60.3 46.6
Adults’: 20 30.2 2.2 7.5 4.4 22.2 16.6
14.5 21.4 3.3 6.6 7.8 10.6 16.2 14.5 4.1
15.8 4.1 2.4 3.5 8.5 10 1 4.4 1.3 8.1
4.7 18.4
Slide 1- 10
Copyright © 2009 Pearson Education, Inc.
FYI -- Sampling Distribution for the
Difference Between Two Means
When the conditions are met, the standardized sample
difference between the means of two independent groups
y1 y2 1 2
t
SE y1 y2
can be modeled by a Student’s t-model with a number of
degrees of freedom found with a special formula.
We estimate the standard error with
s12 s22
SE y1 y2
n1 n2
Copyright © 2009 Pearson Education, Inc.
Slide 1- 11
FYI --Two-Sample t-Interval
When the conditions are met, we are ready to find the confidence
interval for the difference between means of two independent groups.
The confidence interval is
y1 y2 t
df
SE y1 y2
where the standard error of the difference of the means is
s12 s22
SE y1 y2
n1 n2
The critical value depends on the particular confidence level, C, that you
specify and on the number of degrees of freedom, which we get from the
sample sizes and a special formula.
Copyright © 2009 Pearson Education, Inc.
Slide 1- 12
FYI -- Degrees of Freedom
The special formula for the degrees of freedom
for our t critical value is a bear:
2
s12 s22
n1 n2
df
2
2
1 s12
1 s22
n1 1 n1 n2 1 n2
Because of this, we will let technology calculate
degrees of freedom for us!
Copyright © 2009 Pearson Education, Inc.
Slide 1- 13
Testing the Difference Between Two Means
The hypothesis test we use is the two-sample ttest for the difference between means.
The conditions for the two-sample t-test for the
difference between the means of two
independent groups are the same as for the twosample t-interval.
Copyright © 2009 Pearson Education, Inc.
Slide 1- 14
FYI –
A Test for the Difference Between Two Means
We test the hypothesis H0: 1 – 2 = 0, where the
hypothesized difference, 0, is almost always 0, using the
statistic
y1 y2 0
t
SE y1 y2
The standard error is
s12 s22
SE y1 y2
n1 n2
When the conditions are met and the null hypothesis is
true, this statistic can be closely modeled by a Student’s
t-model with a number of degrees of freedom given by a
special formula. We use that model to obtain a P-value.
Copyright © 2009 Pearson Education, Inc.
Slide 1- 15
Using the TI to do a hypothesis test for difference of the
means, independent samples.
It has been suggested that college students learn more and obtain higher
grades in small classes (40 or less) when compared to large classes (150 or
more).
To test this claim, a university assigned a professor to teach a small and a
large class of the same course. At the end of the course, the classes were
given the same exam. The following are the final grade results. Test the claim
at an alpha of 0.05.
Sample size
35
170
Sample mean
74.2
71.7
Standard deviation
14
13
H0: μsmall=μlarge
HA: μsmall>μlarge
Stat…Test…2-sampT-test and select STATS not data
fill in the appropriate statistics
For μ1: choose >
don't pool
Calculate
The p value is .1676 which causes us NOT to reject the null hypothesis which
means the smaller class did not do better.
Copyright © 2009 Pearson Education, Inc.
Slide 1- 16
29. A study was conducted to assess the effects that
occur when children are exposed to cocaine before birth.
190 children born to cocaine users had a mean score of
7.3 (with a standard deviation of 3.0) on a certain aptitude
test. 186 children not exposed to cocaine had a mean
score of 8.2 with a standard deviation of 3.0. Use an
alpha of 0.05 to test the claim that cocaine use is harmful
to children’s aptitude (Triola 2008).
H0: µ1=µ2
HA: µ1<µ2
Test statistic (t) = -2.91
P-value = 0.002
Conclusion: Reject the null. We can conclude with
reasonable certainty that cocaine is bad for children.
Moral: Don’t use cocaine when you are pregnant.
Copyright © 2009 Pearson Education, Inc.
Slide 1- 17
Having done poorly on their math final exams in
June, six students repeat the course in summer
school, then take another exam in August. If we
consider these students representative of all
students who might attend this summer school in
other years, do these results provide evidence
that the program is worthwhile?
June: 54, 49, 68, 66, 62, 62
August: 50, 65, 74, 64, 68, 72
Copyright © 2009 Pearson Education, Inc.
Slide 1- 18
Researchers investigated how the size of a bowl affects
how much ice cream people tend to scoop when serving
themselves. At an “ice cream social”, people were
randomly given either a 17 oz or a 34 oz bowl and were
invited to scoop as much ice cream as they liked. Did the
bowl size change the selected portion size?
Small bowl: n: 26, y(bar): 5.07oz, s: 1.84oz
Large bowl: n: 22, y(bar): 6.58oz, s: 2.91oz
Test an appropriate hypothesis and state your
conclusions
(for assumptions and conditions that you cannot test, assume
they are sufficiently satisfied to proceed)
Copyright © 2009 Pearson Education, Inc.
Slide 1- 19
Is it a good idea to listen to music when studying for a
test? In a study conducted by some statistics students,
62 people were randomly assigned to listen to rap music,
Mozart, or no music while attempting to memorize objects
pictured on a page. They were then asked to list all the
objects they could remember. Here are summary
statistics for each group:
Rap: n: 29, mean: 10.72, SD: 3.99
Mozart: n: 20, mean: 10.00, SD: 3.19
No music: n: 13, mean: 12.77, SD: 4.73
Does it appear that it is better to study while listening to
Mozart than to rap music? Test an appropriate
hypothesis and state your conclusion
Create a 90% confidence interval for the mean difference
between students who study to Mozart and those who
listen to no music at all. Interpret your interval.
Copyright © 2009 Pearson Education, Inc.
Slide 1- 20
FYI – Why we say No to Pooled
Remember that when we know a proportion, we know its standard
deviation.
Thus, when testing the null hypothesis that two proportions were
equal, we could assume their variances were equal as well.
This led us to pool our data for the hypothesis test.
For means, if we are willing to assume that the variances of two
means are equal, we can pool the data from two groups to estimate
the common variance and make the degrees of freedom formula
much simpler.
We are still estimating the pooled standard deviation from the data, so
we use Student’s t-model, and the test is called a pooled t-test (for the
difference between means).
So, when should you use pooled-t methods rather than two-sample t
methods? Never. (Well, hardly ever.)
Because the advantages of pooling are small, and you are
allowed to pool only rarely (when the equal variance assumption
is met), don’t.
It’s never wrong not to pool.
Copyright © 2009 Pearson Education, Inc.
Slide 1- 21
Is There Ever a Time When Assuming Equal
Variances Makes Sense?
Yes. In a randomized comparative experiment,
we start by assigning our experimental units to
treatments at random.
Each treatment group therefore begins with the
same population variance.
In this case assuming the variances are equal is
still an assumption, and there are conditions that
need to be checked, but at least it’s a plausible
assumption.
Copyright © 2009 Pearson Education, Inc.
Slide 1- 22
What Can Go Wrong?
Watch out for paired data.
The Independent Groups Assumption
deserves special attention.
If the samples are not independent, you can’t
use two-sample methods.
Look at the plots.
Check for outliers and non-normal distributions
by making and examining boxplots.
Copyright © 2009 Pearson Education, Inc.
Slide 1- 23
What have we learned?
We’ve learned to use statistical inference to
compare the means of two independent groups.
We use t-models for the methods in this chapter.
It is still important to check conditions to see if our
assumptions are reasonable.
The standard error for the difference in sample means
depends on believing that our data come from
independent groups, but pooling is not the best choice
here.
The reasoning of statistical inference remains the
same; only the mechanics change.
Copyright © 2009 Pearson Education, Inc.
Slide 1- 24