Course 9

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 45

8STT117

Session 9

Test on two
populations
Test on Two Populations:

Up to now, we have been interested in a single population in


which we have tried to estimate one or more parameters (m, s2,
P). Quite often in practice, we have to compare two populations
with respect to a certain characteristic. This characteristic X
when considered in the first population is noted X1 and it is
noted X2 in the second. To compare these two populations, one
draws independently a random sample of size n1 in the first one,
and a random sample of size n2 in the second one and we have
to consider the distribution of the difference between the two
sample statistics.

2
Hypothesis Testing

Inferences About the Difference Between


Two Population Means: s12 and s22 Known

Inferences About the Difference Between


Two Population Means: s12 and s22 unknown

Inferences About the Difference Between


Two Population Means: Matched Samples

Inferences About the Difference Between Two


Population Proportions

3
Inferences About the Difference Between
Two Population Means: s 1 and s 2 Known

Case 1 (large samples)

Interval Estimation of m1 – m2

Hypothesis Tests About m1 – m2

4
Estimating the Difference Between
Two Population Means
Let 1 equal the mean of population 1 and 2 equal the
mean of population 2.
The difference between the two population means is 1 - 2.

To estimate 1 - 2, we will select a simple random sample of


size n1 from population 1 and a simple random sample of size
n2 from population 2.

Let x1equal the mean of sample 1 and x2 equal the


mean of sample 2.

The point estimator of the difference between the means


of the populations 1 and 2 is x1  x2 .

5
Sampling distribution of x1  x2

Expected Value : E ( x1  x2 ) 1  2

 12  22
Standard Deviation (Standard Error) : x  x  
1 2
n1 n2

where: 1 = standard deviation of population 1


2 = standard deviation of population 2
n1 = sample size from population 1 (n1 ≥ 30)
n2 = sample size from population 2 (n2 ≥ 30)

6
Interval Estimation of m1 – m2 :
s1 and s2 Known
Interval Estimate:

 2
 2
x1  x2 z /2 1
 2
n1 n2
Where : 1 -  is the confidence coefficient

7
Interval Estimation of m1 – m2 :
s1 and s2 Known
Example: Par, Inc.

Par, Inc. is a manufacturer of golf equipment and has developed


a new golf ball that has been designed to provide “extra
distance.”
In a test of driving distance using a mechanical driving device,
a sample of Par golf balls was compared with a sample of golf
balls made by Rap, Ltd., a competitor. The sample statistics is:

Sample #1 Sample #2
Par, Inc. Rap, Ltd.
Sample Size 120 balls 80 balls
Sample Mean 295 yards 278 yards
Standard deviation s 1 = 15 yards s 2 = 20 yards

8
Interval Estimation of m1 – m2 :
s1 and s2 Known
Example: Par, Inc.

Let us develop a 95% confidence interval estimate of the


difference between the mean driving distances of the two
brands of golf ball.

Answer :

Point estimate of 1 - 2 = x1  x2 = 295 -278 = 17 yards

where:
1 = mean distance for the population of Par, Inc. golf balls
2 = mean distance for the population of Rap, Ltd. golf balls

9
Interval Estimation of m1 – m2 :
s1 and s2 Known
Interval Estimate:

 12  22 152 202
x1  x2 z /2   17 1.96 
n1 n2 120 80
17 5.14 or 11.86 yards to 22.14 yards

We are 95% confident that the difference between the mean


driving distances of Par, Inc. balls and Rap, Ltd. balls is 11.86 to
22.14 yards.

10
Hypothesis Tests About m1 – m2 :
s1 and s2 Known
Hypothesis:

H 0: 1   2 D0 H 0: 1   2 D0 H 0: 1   2 D0


H a: 1   2  D0 H a: 1   2  D0 H a: 1   2 D0
Left-tailed Right-tailed Two-tailed

( x1  x2 )  D0
Test Statistic: z
 2
 2
1
 2
n1 n2

11
Hypothesis Tests About m1 – m2 :
s1 and s2 Known
Example: Par, Inc.

Can we conclude, using a = 0.01, that the mean driving distance


of Par, Inc. golf balls is greater than the mean driving distance
of Rap, Ltd. golf balls?

Answer :
1. Develop the hypotheses H0: 1 - 2 < 0 and Ha: 1 - 2 > 0
where:
1 = mean distance for the population of Par, Inc. golf balls
2 = mean distance for the population of Rap, Ltd. golf balls

12
Hypothesis Tests About m1 – m2 :
s1 and s2 Known
Example: Par, Inc.
Answer :
2. Specify the level of significance : a = 0.01
3. Compute the value of the test statistics
( x1  x2 )  D0 (295  278)  0 17
z   6.49
 12  22 (15) 2
(20) 2 2.62
 
n1 n2 120 80
4. Determine the critical value : Z0,01 = 2.33
5. Decision : We reject H0 because 6.49 > 2.33. At the 0.01 level of
significance, the sample evidence indicates the mean driving distance of
Par, Inc. golf balls is greater than the mean driving distance of Rap,Ltd.
golf balls.

13
Inferences About the Difference Between
Two Population Means: s 1 and s 2 Unknown

Case 2 : (large samples)

Interval Estimation of m1 – m2

Hypothesis Tests About m1 – m2

14
Inferences About the Difference Between
Two Population Means: s 1 and s 2 Unknown

Case 2 : (large samples)

Interval Estimate:
2 2
s s
x1  x2 z /2 1
 2
n1 n2
 No assumptions about the shape of the populations are
required
 The samples are from independent populations

15
Hypothesis Tests About m1 – m2 :
s1 and s2 Known
Hypothesis:

( x1  x2 )  D0
Test Statistic: z
s12 s22

n1 n2

16
Hypothesis Tests About m1 – m2 :
s1 and s2 Known
Example:

Two colleges are located in York Region. The local paper


recently reported that the mean starting salary of a
graduate from College 1 is 38 000$ with a standard
deviation of 6 000$ for a sample of 40 graduates. The
same article reported the mean starting salary of a
graduate from College 2 is 35 000$ with a standard
deviation of 7 000$ for a sample of 35 graduates. At the
0,01 significance level can we conclude the mean salary of
College 1 is more ?

17
Hypothesis Tests About m1 – m2 :
s1 and s2 Known
Example:

Answer :
1. Develop the hypotheses H0: 1 - 2 < 0 and Ha: 1 - 2 > 0
where:
1 = mean starting salary of a graduate from College 1
2 = mean starting salary of a graduate from College 2

2. Specify the level of significance : a = 0.01

18
Hypothesis Tests About m1 – m2 :
s1 and s2 Known
Example:
Answer :
3. Compute the value of the test statistics
Because both samples are more than 30, the test statistic is Z

( x1  x2 )  Do (38000  35000)  0 3000


z   1.98
s2
s 2
(6000)2
(7000) 2
2300000
1
 2

n1 n2 40 35
4. Determine the critical value : Z0,01 = 2.33
5. Decision : We do not reject H0 because 1.98 < 2.33. Insufficient
evidence.

19
Inferences About the Difference Between
Two Population Means: s 1 and s 2 Unknown

Case 3 :
If one or more of the samples contain less than 30
observations we use the t distribution as the test
statistic.
Required assumptions
 Both populations must follow the normal distribution.
 The populations must have equal standard deviations.
 The samples are from independent populations.

20
Inferences About the Difference Between
Two Population Means: s 1 and s 2 Unknown

Case 3 :
1 1
Interval Estimate: x1  x2 tn1 n 2 2 d f Sc 
n1 n 2

 i1  X1     X i 2  X 2 
2 2

where Sc2 
 X

(n1  1) S12  (n2  1) S 22
n1  n 2  2 ( n1  n2  2)

2
S c is a pooled sample variance

21
Hypothesis Tests About m1 – m2 :
s1 and s2 Known
Hypothesis:

Test Statistic:

tn1 n2  2 d .. 


X  X 
1 2

X 1  X2 

 X  X    X  X  1 1
2 2
i1 1 i2 2 1 1 Sc 
 n1 n 2
n1  n 2  2 n1 n 2

22
Hypothesis Tests About m1 – m2 :
s1 and s2 Known
Example:
A recent EPA (Environmental Protection Agency) study
compared the highway fuel economy of domestic and
imported passenger cars. A sample of 15 domestic cars
revealed a mean of 33.7 mpg (miles per gallon) with a
standard deviation of 2.4 mpg. A sample of 12 imported
cars revealed a mean of 35.7 mpg with a standard
deviation of 3.9. At the 0.05 significance level can the EPA
conclude that the mpg is higher on the imported cars?

We assume that both populations follow the normal


distribution.

23
Hypothesis Tests About m1 – m2 :
s1 and s2 Known
Example:

Answer :
1. Develop the hypotheses H0: d - I ≥ 0 and Ha: d - I < 0
where:
d = mean mpg of domestic cars
I = mean mpg of imported cars

2. Specify the level of significance : a = 0.05

24
Hypothesis Tests About m1 – m2 :
s1 and s2 Known
Example:
Answer :
3. Compute the value of the test statistics
Because both samples are less than 30, the test statistic is t

tn1 n2  2 d .. 


X1  X2 

33.7  35.7 

2
 1.64
1 1 1 1 1.22
Sc  9.918 
nd nI 15 12
2 2 2 2
( n  1) S  ( n  1) S (15  1)2.4  (12  1)3.9
Sc2  d d I I
 9.918
(nd  nI  2) (15  12  2)

25
Hypothesis Tests About m1 – m2 :
s1 and s2 Known
Example:

Answer :
4. Determine the critical value : t0,05, 25 df = -1.708

5. Decision : We do not reject H0 because -1.64 < -1.708. Insufficient


evidence.

26
Inferences About the Difference Between
Two Population Means : Matched Samples
Hypothesis Testing Involving Paired
Observations
Independant samples Dependant samples are
are samples that are not samples that are paired or
related in any way related in same fashion
Examples
If the men's group and the women's If you take a sample of people who
group are asked about their income, have had a knee operation and
independent samples exist. In this interview them before and after the
case, a person from one sample operation, this is a dependent
cannot be assigned to a person from sample. This is because the same
the other sample. person was interviewed at two
different times.

27
Inferences About the Difference Between
Two Population Means : Matched Samples

Use the following test when the samples are


dependent:

 d  d
2

T
d  d
where d 
 d i
and sd 
i

sd n n n 1

d : is the mean of the differences


s d
: is the standard deviation of the differences
n : is the number of pairs (differences)

28
Inferences About the Difference Between
Two Population Means : Matched Samples

Example :

In testing the delivery times of the two services, the


firm sent two reports to a random sample of its
district offices with one report carried by UPX and the
other report carried by INTEX. Do the data on the
next slide indicate a difference in mean delivery
times for the two services? Use a 0.05 level of
significance.

29
Inferences About the Difference Between
Two Population Means : Matched Samples

Example : Delivery time (hours)


District Office UPX INTEX Difference
Seattle 32 25 7
Los Angeles 30 24 6
Boston 19 15 4
Cleveland 16 15 1
New York 15 13 2
Houston 18 15 3
Atlanta 14 15 -1
St. Louis 10 8 2
Milwaukee 7 9 -2
Denver 16 11 5

30
Inferences About the Difference Between
Two Population Means : Matched Samples

Answer :
1. Develop the hypotheses H0: d = 0, H1: d 

Let d = the mean of the difference values for the


two delivery services for the population of district
offices

2. Specify the level of significance : a = 0.05

31
Inferences About the Difference Between
Two Population Means : Matched Samples

Answer :
1. Compute the value of the test statistic.

d
 d i

(7  6  ...  5)
2,7
n 10

 d i  d
2
(7  2,7) 2  (6  2,7) 2  ...  (5  2,7) 2 76,1
sd    2,9
n 1 9 9

d  d 2, 7  0
T  2,94
sd n 2,9 10

32
Inferences About the Difference Between
Two Population Means : Matched Samples

Answer :
1. Determine the critical value and the rejection rule

For  = 0,05, t0,025 = 2,262 (9 degrees of freedom).

Reject H0 if t > 2,262 (two-tailed test)

Because t = 2.94 > 2.262, we reject H0.

We are at least 95% confident that there is a difference in mean


delivery times for the two services.

33
Inferences About the Difference Between
Two Population Proportions

34
Inferences About the Difference Between
Two Population Proportions

Interval Estimation of p1-p2

Hypothesis Tests About p1-p2

35
Sampling distribution of p1  p2

Expected Value : E ( p1  p2 )  p1  p2

Standard Deviation (Standard Error) :

p1 1  p1  p2 1  p2 
pp  
1 2
n1 n2

where: n1 = sample size from population 1 (n1 ≥ 30)


n2 = sample size from population 2 (n2 ≥ 30)

36
Sampling distribution of p1  p2

If the sample sizes are large, the sampling distribution


of p1  p2can be approximated by a normal probability
distribution.

The sample sizes are sufficiently large if all of these conditions


are met :

n 1p1 > 5 n1(1 - p1) > 5

n 2 p2 > 5 n2(1 - p2) > 5

37
Interval Estimation of p1 – p2 :

Interval Estimate:

p1 1  p1  p2 1  p2 
p1  p2 z /2 
n1 n2

38
Sampling distribution of p1  p2

Hypothesis Test on p1-p2


• We focus on test involving no difference between the
two population proportions i.e., p1  p2 .

• Left-tailed • Right-tailed • Two-tailed


H0 : p1  p2 0 H0 : p1  p2 0 H0 : p1  p2 0
Ha : p1  p2  0 Ha : p1  p2  0 Ha : p1  p2 0

39
Comparison of proportions : conditions

1- We assume 2 "large" independent samples (ni > 30)

2- To compare the proportions p1 and p2 of the 2


samples, we calculate : ( p1  p2 )
Z
1 1 
p (1  p )   
 n1 n2 
n1 p1  n2 p2 • p is the estimate of the
p proportion common to both
Where n1  n2
populations also called a
pooled proportion

40
Comparison of proportions

Hypothesis Test on p1-p2

Example: Does the new RIO MP3 player have the same appeal
for everyone? Here is the information obtained from a study with
2 groups of students.

Group 1: 63 of 78 students surveyed showed interest.

Group 2 :49 of 82 students had the same reaction.

Using 0.01 level of significance, is there a difference between the


2 groups?

41
Comparison of proportions

1- Informations:

n1 = 78 p1 = 63 / 78 = 0.808
n2 = 82 p2 = 49 / 82 = 0.598

2. The test conditions are met: n1 and n2 are large and independent

3. Develop the hypotheses.


H 0: P1 - P2 = 0

H 1: P1 - P2 ¹ 0

42
Comparison of proportions

( p1  p2 )  ( p1  p2 ) (0.808  0.598)  0
Z  2.90
1 1  1 1
p (1  p )    0.7(1  0.7)   
 n1 n2   78 82 
Where :

n1 p1  n2 p2 78 0.808  82 0.598
p  0.7
n1  n2 78  82

43
Comparison of proportions

H0: P1 - P2 = 0 Test statistics:

H1: P1 - P2 ¹ 0 Z  2.90
a = 0.01
Decision:

We reject of H0. There is


.005 .005 evidence of a difference
between the 2 proportions.
-2.575 0 2.575 Z

44
Thank you

45

You might also like