Sunteți pe pagina 1din 53

Learning Objectives

In this chapter, you learn how to use hypothesis


testing for comparing the difference between:
 The means of two independent populations
 The means of two related populations
 The proportions of two independent
populations
 The variances of two independent
populations

Chap 10-2
Two-Sample Tests Overview
Two Sample Tests

Independent Means, Independent Independent


Population Related Population Population
Means Populations Proportions Variances

Examples

Group 1 vs. Same group Proportion 1vs. Variance 1 vs.


Group 2 before vs. after Proportion 2 Variance 2
treatment
Chap 10-3
Two-Sample Tests
Goal: Test hypothesis or form
Independent a confidence interval for the
Population Means
difference between two
population means, μ1 – μ2
σ1 and σ2 known
The point estimate for the
σ1 and σ2 unknown difference between sample
means:
X1 – X2
Chap 10-4
Two-Sample Tests
Independent Populations
 Different data sources
Independent  Independent: Sample
Population Means selected from one
population has no effect on
the sample selected from the
σ1 and σ2 known other population
 Use the difference between 2
sample means
σ1 and σ2 unknown
 Use Z test, pooled variance t
test, or separate-variance t test

Chap 10-5
Two-Sample Tests
Independent Populations
Independent
Population Means

σ1 and σ2 known Use a Z test statistic

Use S to estimate unknown σ,


σ1 and σ2 unknown use a t test statistic

Chap 10-6
Two-Sample Tests
Independent Populations
Assumptions:
Independent
Population Means  Samples are randomly and
independently drawn

σ1 and σ2 known  population distributions are


normal
σ1 and σ2 unknown

Chap 10-7
Two-Sample Tests
Independent Populations
When σ1 and σ2 are known and both
Independent populations are normal, the test
Population Means statistic is a Z-value and the
standard error of X1 – X2 is

σ1 and σ2 known
2 2
σ1 σ 2
σ1 and σ2 unknown σ X1  X 2  
n1 n 2

Chap 10-8
Two-Sample Tests
Independent Populations
Independent The test statistic is:
Population Means

σ1 and σ2 known Z
 X  X   μ
1 2 1  μ2 
2 2
σ1 σ 2

σ1 and σ2 unknown n1 n 2

Chap 10-9
Two-Sample Tests
Independent Populations
Two Independent Populations, Comparing Means

Lower-tail test: Upper-tail test: Two-tail test:

H0: μ1  μ2 H0: μ1 ≤ μ2 H0: μ1 = μ2


H1: μ1 < μ2 H1: μ1 > μ2 H1: μ1 ≠ μ2
i.e., i.e., i.e.,
H0: μ1 – μ2  0 H0: μ1 – μ2 ≤ 0 H0: μ1 – μ2 = 0
H1: μ1 – μ2 < 0 H1: μ1 – μ2 > 0 H1: μ1 – μ2 ≠ 0

Chap 10-10
Two-Sample Tests
Independent Populations
Two Independent Populations, Comparing Means
Lower-tail test: Upper-tail test: Two-tail test:
H0: μ1 – μ2  0 H0: μ1 – μ2 ≤ 0 H0: μ1 – μ2 = 0
H1: μ1 – μ2 < 0 H1: μ1 – μ2 > 0 H1: μ1 – μ2 ≠ 0

a a a/2 a/2

-za za -za/2 za/2

Reject H0 if Z < -Za Reject H0 if Z > Za Reject H0 if Z < -Za/2


or Z > Za/2
Chap 10-11
Two-Sample Tests
Independent Populations
Independent Assumptions:
Population Means  Samples are randomly and
independently drawn

σ1 and σ2 known  Populations are normally


distributed
σ1 and σ2 unknown  Population variances are
unknown but assumed equal

Chap 10-12
Two-Sample Tests
Independent Populations
Forming interval estimates:
Independent
Population Means  The population variances
are assumed equal, so use
the two sample standard
σ1 and σ2 known deviations and pool them to
estimate σ
σ1 and σ2 unknown
 the test statistic is a t value
with (n1 + n2 – 2) degrees
of freedom
Chap 10-13
Two-Sample Tests
Independent Populations
Independent
Population Means
The pooled standard
deviation is:
σ1 and σ2 known

Sp 
n1  1S1  n 2  1S2
2 2

σ1 and σ2 unknown (n 1  1)  (n 2  1)

Chap 10-14
Two-Sample Tests
Independent Populations
The test statistic is:
Independent
Population Means
t
 X  X   μ
1 2 1  μ2 
1 1 
S   
2
p
σ1 and σ2 known  n1 n 2 

Where t has (n1 + n2 – 2) d.f., and


σ1 and σ2 unknown
n
S2  1
 1 S1
2
 n 2  1 S 2
2

(n1  1)  (n2  1)
p

Chap 10-15
Two-Sample Tests
Independent Populations
You are a financial analyst for a brokerage firm. Is there
a difference in dividend yield between stocks listed on
the NYSE & NASDAQ? You collect the following data:
NYSE NASDAQ
Number 21 25
Sample mean 3.27 2.53
Sample std dev 1.30 1.16

Assuming both populations are approximately normal with equal


variances, is there a difference in average yield (a = 0.05)?

Chap 10-16
Two-Sample Tests
Independent Populations
The test statistic is:

t
X  X   μ  μ 
1 2
 1 2 3.27  2.53   0  2.040
1 1  1 1 
S   
2
1.5021  
 21 25 
p
 n1 n2 

S 
2 n1  1S1
2
 n 2  1S 2
2

21  11.30 2  25  11.16 2
 1.5021
(n1  1)  (n2  1) (21 - 1)  (25  1)
p

Chap 10-17
Two-Sample Tests
Independent Populations
 H0: μ1 - μ2 = 0 i.e. (μ1 = μ2) Reject H0 Reject H0

 H1: μ1 - μ2 ≠ 0 i.e. (μ1 ≠ μ2)


 a = 0.05 .025 .025

 df = 21 + 25 - 2 = 44 -2.0154 0 2.0154 t
 Critical Values: t = ± 2.0154
2.040
 Test Statistic: 2.040
Decision: Reject H0 at α = 0.05

Conclusion: There is evidence


of a difference in the means.

Chap 10-18
Independent Populations
Unequal Variance
 If you cannot assume population variances are equal,
the pooled-variance t test is inappropriate
 Instead, use a separate-variance t test, which includes
the two separate sample variances in the computation
of the test statistic
 The computations are complicated and are best
performed using Excel

Chap 10-19
Two-Sample Tests
Independent Populations
Independent The confidence interval for
Population Means μ1 – μ2 is:

 
2 2
σ1 σ 2
σ1 and σ2 known X1  X 2  Z 
n1 n 2
σ1 and σ2 unknown

Chap 10-20
Two-Sample Tests
Independent Populations
The confidence interval for
Independent μ1 – μ2 is:
Population Means

X  X   t
1 2 n1  n 2 - 2 p
1 1 
S   
2

σ1 and σ2 known  n1 n 2 
Where
σ1 and σ2 unknown
n
S2  1
 1 S1
2
 n 2  1 S 2
2

(n1  1)  (n2  1)
p

Chap 10-21
Two-Sample Tests
Related Populations
Tests Means of 2 Related Populations
 Paired or matched samples
 Repeated measures (before/after)
 Use difference between paired values:

D = X1 - X2
 Eliminates Variation Among Subjects
 Assumptions:
 Both Populations Are Normally Distributed

Chap 10-22
Two-Sample Tests
Related Populations
The ith paired difference is Di , where

Di = X1i - X2i
The point estimate for the population mean
paired difference is D :
n

D i
D i 1
n
Suppose the population standard deviation of
the difference scores, σD, is known. Chap 10-23
Two-Sample Tests
Related Populations
The test statistic for the mean difference is a Z
value:
D  μD
Z
σD
n
Where
μD = hypothesized mean difference
σD = population standard deviation of differences
n = the sample size (number of pairs)

Chap 10-24
Two-Sample Tests
Related Populations
If σD is unknown, you can estimate the
unknown population standard deviation with a
sample standard deviation:

 i
(D  D ) 2

SD  i 1
n 1

Chap 10-25
Two-Sample Tests
Related Populations
The test statistic for D is now a ‘t’ statistic:

D  μD
t
SD
n

n
Where ‘t’ has n - 1 d.f.  (D i  D) 2

and SD is: SD  i1


n 1
Chap 10-26
Two-Sample Tests
Related Populations
Lower-tail test: Upper-tail test: Two-tail test:

H0: μD  0 H0: μD ≤ 0 H0: μD = 0


H1: μD < 0 H1: μD > 0 H1: μD ≠ 0

a a a/2 a/2

-ta ta -ta/2 ta/2

Reject H0 if t < -ta Reject H0 if t > ta Reject H0 if t < -ta/2


or t > ta/2
Chap 10-27
Two-Sample Tests
Related Populations Example
Assume you send your salespeople to a “customer
service” training workshop. Has the training made a
difference in the number of complaints? You collect
the following data:
Salesperson Number of Complaints Difference, Di
(2-1)
Before (1) After (2)
C.B. 6 4 -2
T.F. 20 6 -14
M.H. 3 2 -1
R.K. 0 0 0
M.O 4 0 -4
Chap 10-28
Two-Sample Tests
Related Populations Example
Salesperson Number of Complaints Difference, Di
Before (1) After (2) (2-1)
C.B. 6 4 -2
T.F. 20 6 -14
M.H. 3 2 -1
R.K. 0 0 0
M.O 4 0 -4

D i SD 
 i
(D  D ) 2

D i 1
 4.2 n 1
n  5.67
Chap 10-29
Two-Sample Tests
Related Populations Example
Has the training made a difference in the number of
complaints (at the α = 0.01 level)?

H0: μD = 0 Critical Value = ± 4.604


H1: μD  0 d.f. = n - 1 = 4

Test Statistic:

D  μ D  4.2  0
t   1.66
SD / n 5.67/ 5

Chap 10-30
Two-Sample Tests
Related Populations Example
Reject Reject

a/2 a/2

- 4.604 4.604
- 1.66

Decision: Do not reject H0 Conclusion: There is no


(t statistic is not in the reject evidence of a significant change
region)
in the number of complaints
Chap 10-31
Two-Sample Tests
Related Populations
 The confidence interval for μD (σ known) is:

σD
DZ
n
Where
n = the sample size (number of pairs in the paired sample)

Chap 10-32
Two-Sample Tests
Related Populations
 The confidence interval for μD (σ unknown) is:

SD
D  t n1
n

 i
(D  D ) 2

where SD  i1
n 1

Chap 10-33
Two Population Proportions
Goal: Test a hypothesis or form a confidence
interval for the difference between two
independent population proportions, π1 – π2

Assumptions:
n1π1  5 , n1(1-π1)  5
n2π2  5 , n2(1-π2)  5

The point estimate for the difference is p1 - p2

Chap 10-34
Two Population Proportions
Since you begin by assuming the null
hypothesis is true, you assume π1 = π2 and pool
the two sample (p) estimates.

X1  X 2
The pooled estimate for p
the overall proportion is: n1  n 2

where X1 and X2 are the number of


successes in samples 1 and 2

Chap 10-35
Two Population Proportions
The test statistic for p1 – p2 is a Z statistic:

Z 
 p1  p2     1   2 
1 1
p (1  p)   
 n1 n2 

X1  X 2 X X
where p , P1  1 , P2  2
n1  n 2 n1 n2
Chap 10-36
Two Population Proportions
Hypothesis for Population Proportions

Lower-tail test: Upper-tail test: Two-tail test:

H0: π1  π2 H0: π1 ≤ π2 H0: π1 = π2


H1: π1 < π2 H1: π1 > π2 H1: π1 ≠ π2
i.e., i.e., i.e.,
H0: π1 – π2  0 H0: π1 – π2 ≤ 0 H0: π1 – π2 = 0
H1: π1 – π2 < 0 H1: π1 – π2 > 0 H1: π1 – π2 ≠ 0

Chap 10-37
Two Population Proportions
Hypothesis for Population Proportions
Lower-tail test: Upper-tail test: Two-tail test:
H0: π1 – π2  0 H0: π1 – π2 ≤ 0 H0: π1 – π2 = 0
H1: π1 – π2 < 0 H1: π1 – π2 > 0 H1: π1 – π2 ≠ 0
a a a/2 a/2

-za za -za/2 za/2

Reject H0 if Z < -Za Reject H0 if Z > Za Reject H0 if Z < -Za/2


or Z > Za/2
Chap 10-38
Two Independent Population
Proportions: Example
 Is there a significant difference between the
proportion of men and the proportion of women who
will vote Yes on Proposition A?

 In a random sample of 72 men, 36 indicated they


would vote Yes and, in a sample of 50 women, 31
indicated they would vote Yes

 Test at the .05 level of significance

Chap 10-39
Two Independent Population
Proportions: Example
 H0: π1 – π2 = 0 (the two proportions are equal)
 H1: π1 – π2 ≠ 0 (there is a significant difference
between proportions)
 The sample proportions are:
 Men: p1 = 36/72 = .50
 Women: p2 = 31/50 = .62

 The pooled estimate for the overall proportion is:


X1  X 2 36  31 67
p    .549
n1  n 2 72  50 122
Chap 10-40
Two Independent Population
Proportions: Example Reject H0 Reject H0

The test statistic for π1 – π2 is:


.025 .025
z
 p1  p2     1   2 
1 1 
p (1  p)   
 n1 n 2  -1.96 1.96


 .50  .62   0   1.31
-1.31
 1 1 
.549 (1  .549)   
 72 50  Decision: Do not reject H0

Critical Values = ±1.96 Conclusion: There is no evidence of a


significant difference in proportions who
For a = .05 will vote yes between men and women.

Chap 10-41
Two Independent Population
Proportions
The confidence interval for π1 – π2 is:

p1 (1  p1 ) p2 (1  p2 )
 p1  p2   Z 
n1 n2

Chap 10-42
Testing Population Variances
 Purpose: To determine if two independent
populations have the same variability.

H0: σ12 = σ22 H0: σ12  σ22 H0: σ12 ≤ σ22


H1: σ12 ≠ σ22 H1: σ12 < σ22 H1: σ12 > σ22

Two-tail test Lower-tail test Upper-tail test

Chap 10-43
Testing Population Variances
The F test statistic is:
2
S
F 1
2
S 2

S12 = Variance of Sample 1


n1 - 1 = numerator degrees of freedom
S22 = Variance of Sample 2
n2 - 1 = denominator degrees of freedom
Chap 10-44
Testing Population Variances
 The F critical value is found from the F table
 There are two appropriate degrees of freedom:
numerator and denominator.
 In the F table,
 numerator degrees of freedom determine the
column
 denominator degrees of freedom determine
the row

Chap 10-45
Testing Population Variances
Lower-tail test Upper-tail test
H0: σ12  σ22 H0: σ12 ≤ σ22
H1: σ12 < σ22 H1: σ12 > σ22

a
a
0 0
Do not Reject H0
Reject
FL
Do not
reject H0 reject H0 FU
H0
Reject H0 if F < FL Reject H0 if F > FU

Chap 10-46
Testing Population Variances
Two-tail test

H0: σ12 = σ22


H1: σ12 ≠ σ22
a/2
a/2 S12
F  2  FU
0  rejection region S2
F for a two-tail test is:
Do not Reject H0
FL reject H0 FU S12
F  2  FL
S2
Chap 10-47
Testing Population Variances
To find the critical F values:

1. Find FU from the F table for n1 – 1


numerator and n2 – 1 denominator degrees
of freedom.
1
FL 
2. Find FL using the formula: FU*

Where FU* is from the F table with n2 – 1


numerator and n1 – 1 denominator degrees of
freedom (i.e., switch the d.f. from FU)
Chap 10-48
Testing Population Variances
You are a financial analyst for a brokerage firm. You want to
compare dividend yields between stocks listed on the NYSE &
NASDAQ. You collect the following data:
NYSE NASDAQ
Number 21 25
Mean 3.27 2.53
Std dev 1.30 1.16

Is there a difference in the variances between the NYSE


& NASDAQ at the a = 0.05 level?

Chap 10-49
Testing Population Variances
 Form the hypothesis test:
 H0: σ21 – σ22 = 0 (there is no difference between variances)
 H1: σ21 – σ22 ≠ 0 (there is a difference between variances)

F U: F L:
 Numerator:  Numerator:
 n1 – 1 = 21 – 1 = 20 d.f.  n2 – 1 = 25 – 1 = 24 d.f.
 Denominator:  Denominator:
 n2 – 1 = 25 – 1 = 24 d.f.  n1 – 1 = 21 – 1 = 20 d.f.

FU = F.025, 20, 24 = 2.33 FL = 1/F.025, 24, 20 = 0.41

Chap 10-50
Testing Population Variances
 The test statistic is:

S12 1.302
F 2  2
 1.256
S 2 1.16 a/2 = .025 a/2 = .025

0 F
Reject H0 Do not Reject H0
reject H0
FU=2.33
FL=0.41

 F = 1.256 is not in the  Conclusion: There is insufficient


rejection region, so we do evidence of a difference in
not reject H0 variances at a = .05
Chap 10-51
Chapter Summary
In this chapter, we have
 Compared two independent samples
 Performed Z test for the differences in two
means
 Performed pooled variance t test for the
differences in two means
 Formed confidence intervals for the differences
between two means
 Compared two related samples (paired samples)
 Performed paired sample Z and t tests for the
mean difference
 Formed confidence intervals for the paired
difference
 Performed separate-variance t test

Chap 10-52
Chapter Summary
In this chapter, we have
 Compared two population proportions
 Formed confidence intervals for the difference
between two population proportions
 Performed Z-test for two population proportions

 Performed F tests for the difference between two


population variances
 Used the F table to find F critical values

Chap 10-53

S-ar putea să vă placă și