You are on page 1of 36

Section 7

Hypothesis Testing for The Difference


Between Two Population Means

Learning Objectives
Comparing two populations
Paired samples
Independent samples

In Section 6
H0: = M

We tested ONE population mean to see if it


was equal to a particular number.
3

x1

1
H0: 1 = 2

x2

Is there a DIFFERENCE between the two


population means?
4

The Hypotheses
H0: 1 = 2
The alternate hypothesis can have any
of the three usual forms:
Ha: 1 < 2 left tail test
Ha: 1 > 2 right tail test
Ha: 1 2 two tail test
5

Example
Is the mean university tuition rate
higher in Canada than in the United
States? Find the null and alternate
hypotheses.
H0 (no difference at all):
Ha (Canadas is higher):
6

Independent Samples
When taking two samples, you can take
them INDEPENDENTLY of one another.
You number the two populations and
use your random number table once for
EACH population.
DIFFERENT individuals in each
sample!
Even the sample sizes dont have to be
7
the same!

Paired Samples
A paired sample is when the second
sample consists of the SAME
individuals (people, or whatever) as the
first. Or, the second sample must be
DETERMINED from the first one.
Useful when trying to keep many
factors identical, except the variable
youre trying to study.
8

Examples: Independent or
Paired?
In order to compare tuition rates in
Canada and the U.S., a random sample
of universities in Canada and the U.S.
was taken.

Examples: Independent or
Paired?
To determine whether a new drug is
effective in helping people reduce the
amount they smoke, a random sample
of smokers nicotine use was measured.
Then these same people were put on
the drug. After 8 weeks on the drug,
their nicotine use was measured again.
10

In Class Exercise 7.1


For the following studies, determine
The null and alternate hypotheses.
Whether the samples taken are
independent or paired.

11

In Class Exercise
7.1 coach
A swimming
Do VWs on average
survive for the same
total mileage as a
Toyota? The mean
mileage of a random
sampling of each
type of car was
measured.

says his training


program decreases
lap times. A random
sample of swimmers
had their lap times
measured. Then
they were put on the
program and had
their lap times
measured again.
12

Same 5 Step Procedure


We use the same 5 steps as
hypothesis testing for one mean.
Rejection regions / P values remain
identical!
Test statistics change.
Theres an extra EDA graph in the
independent sample case.
13

Notation
1 = population mean of P1.
2 = population mean of P2.
x1 = sample mean of sample from P1.
x2 = sample mean of sample from P2.
1 = population st. dev. of P1.
2 = population st. dev. of P2.
S1 = sample st. dev. of sample from P1.
S2 = sample st. dev. of sample from P2.
n1 = sample size from P1.

14

Paired Samples
This is exactly like the ONE SAMPLE
case!
Make a NEW DATASET by finding the
PAIRED DIFFERENCES (di).
Then pretend you have only a single
sample (of the ds), and use the
methods from section 6.
15

Paired Samples: Example


Smoker

Nicotine use before


therapy (mg)

12.3

17.5

14.0

14.6

Nicotine use after


therapy (mg)

11.0

15.7

16.1

14.5

Differences (di)

1.3

2.2

-2.1

0.1

Use these as your data points!


16
Use one sample methods from section 6.

Paired Sample Test Statistic


Since were using one sample (section
6) methods, the test statistic remains
the same.
Well assume we dont know , so
ALWAYS use t. Here, n is number of
DIFFERENCES.
xd M
TS t
df

1
Sd / n
17

Independent Sample Test


Statistic
Again, well assume we dont know the
population standard deviations, so use t
exclusively.
The TS for independent samples
actually depends on whether the
population standard deviations are
equal or unequal.
Whats the problem with this?
18

The Rule of 2

Many statisticians use the rule of 2:


Divide the LARGER sample st. dev. by the
SMALLER one.
If the result is LESS than 2, ASSUME the
population standard deviations are equal.
19

The Rule of 2
Mathematically:

If

If

Sbig
S small
Sbig
S small

assume the population


2 standard deviations are
EQUAL.
assume the population
2 standard deviations are
NOT EQUAL.
20

Test Statistic for Independent


Samples
If the population standard deviations
are considered EQUAL, then first find
the POOLED sample standard
deviation according to the formula:
2

(n1 1) S1 (n2 1) S 2
Sp
n1 n2 2

21

Test Statistic for Independent


Samples: POOLED
Then use this to get the test statistic for
independent samples, population
standard deviations considered
EQUAL.( x1 x2 )

TS t

Sp

1 1

n1 n2

df n1 n2 2

22

Population Standard
Deviations NOT EQUAL
The Test Statistic for INDEPENDENT
SAMPLES, population standard
deviations considered NOT EQUAL, is

TS t

( x1 x2 )
2

S1 S 2

n1
n2

df

/ n1 S 2 / n2

/ n1
S 2 / n2

n1 1
n2 1

Called the NON POOLED t test.


23

EDA for Paired Samples


Same graphs as for the one sample
case, but the data is the
DIFFERENCES:
Boxplot of differences.
Normal probability plot of residuals of
differences.

24

EDA for Independent Samples


Boxplot of each samples raw data
SEPARATELY to check for OUTLIERS.
Normal probability plot of each
samples residuals TOGETHER to
check for NORMALITY.
Do the SAME graphs whether the test
is pooled or non pooled.
25

5 Steps: Testing For


Differences Of Two Means
Step 1: Set up the null and alternate
hypotheses.
H0: 1 = 2

Vs.

Ha: 1 < 2
Ha: 1 > 2
Ha: 1 2

OR
OR
26

5 Steps: Testing For


Differences Of Two Means
Step 2:
(a) State .
(b) Design and carry out the study.
(c) EDA
Paired Samples: Boxplot of DIFFERENCES
and normal probability plot of RESIDUALS OF
DIFFERENCES.
Independent Samples: Boxplot of EACH
samples RAW DATA SEPARATELY and normal
probability plot of each samples RESIDUALS
TOGETHER.
27

5 Steps: Testing For


Differences Of Two Means
Step 3: Find the Test Statistic.
Paired samples: See slide 17.
Independent samples, population standard
deviations considered EQUAL: Use the
pooled TS (slides 21, 22).
Independent samples, population standard
deviations considered NOT EQUAL: Use
the non pooled TS (slide 23).
28

5 Steps: Testing For


Differences Of Two Means
Step 4: Find the rejection region or P
value.
Step 5: Decide whether you reject or
accept the null hypothesis, and give an
interpretation in the context of the
original research question.

29

Example 1
Dell claims that their waiting times (for
customers calling for service) are
shorter than the wait times for IBM. To
test this, both companies were called at
random times and the waiting times
were recorded. The data is free of
outliers. The summary statistics are in
the following table. Test Dells claim at
the 1% level of significance.
30

Example 1 (Continued)
Number
of calls

Sample
mean wait
time
(minutes)

Sample
St. dev.
wait time
(minutes)

Dell

20

3.51

1.25

IBM

17

4.37

0.36

31

Example 2
A new therapy claims that it can help
you reduce how much you smoke. To
test the claim, a random sample of 10
smokers was taken and the number of
milligrams of nicotine they used per day
was recorded. These smokers were
then put on the therapy and after 18
weeks, the amount they smoked was
recorded again. The results are on the
next slide. Test at the 5% level.
32

Example 2 (Continued)
Person

10

Daily Nicotine
use before
therapy (mg)

9.6

11.2

7.8

21.5

13.1

7.0

19.6

10

5.6

8.2

Daily Nicotine
use after
therapy (mg)

9.0

10.9

7.8

19.8

13.7

6.5

20.0

9.3

5.6

8.1

33

Example 3
Are mean tuition rates different
between Canadian and U.S.
universities? To answer this question, a
sample of 11 universities in Canada and
18 in the U.S. were taken and the tuition
rates (dollars per year) were recorded
in Minitab. Test at the 10 % level of
significance.
34

In Class Exercise 7.2


A researcher wanted to know if
smokers who are also beer drinkers
smoke more on average than smokers
who dont drink beer. A random sample
of each group (drinkers and non
drinkers) was collected and the nicotine
use of each was recorded. The data is
summarized in the table on the next
slide. Test the hypothesis at 5%
35
significance.

In Class Exercise 7.2


Sample size

Sample mean Sample St.


nicotine
dev. nicotine
usage (mg)
usage (mg)

31

12.6

2.3

Non - drinkers 45

11.0

2.1

Drinkers

36

You might also like