Two-Sample Tests
Two-Sample Tests
Two-Sample Tests
Two-Sample Tests
Population
Means, Means, Population Population
Independent Related Proportions Variances
Samples Samples
Examples:
Population 1 vs. Same population Proportion 1 vs. Variance 1 vs.
independent before vs. after Proportion 2 Variance 2
Population 2 treatment
Difference Between Two Means
Population means,
independent
samples
*
σ1 and σ2 known Use a Z test statistic
Population means,
independent The test statistic for
samples μ1 – μ2 is:
σ1 and σ2 known * Z
X1
X 2 μ1 μ2
2 2
σ1 and σ2 unknown, σ σ2
assumed equal
1
n1 n2
σ1 and σ2 unknown,
not assumed equal
Hypothesis Tests for
Two Population Means
Two Population Means, Independent Samples
a a a/2 a/2
Population means,
independent The confidence interval for
samples μ1 – μ2 is:
σ1 and σ2 known *
2 2
σ σ2
X1 X 2 Z 1
σ1 and σ2 unknown, n1 n2
assumed equal
σ1 and σ2 unknown,
not assumed equal
Apply you Knowledge
Population means,
independent
samples
The pooled variance is
σ1 and σ2 known
n1 1S
2
n2 1S2
2
σ1 and σ2 unknown,
assumed equal
* S 2
p 1
(n1 1) (n2 1)
σ1 and σ2 unknown,
not assumed equal
σ1 and σ2 Unknown,
Assumed Equal
(continued)
X X μ μ
samples
t
1 2 1 2
σ1 and σ2 known
1 1
S
2
σ1 and σ2 unknown,
assumed equal
* p
n1 n2
Where t has (n1 + n2 – 2) d.f.,
and
σ1 and σ2 unknown, n1 1S1 n2 1S2
2 2
Population means,
The confidence interval for
independent
samples μ1 – μ2 is:
σ1 and σ2 known
X X t
1 2 n1 n2 -2
1 1
S
2
p
n1 n2
σ1 and σ2 unknown,
assumed equal
*
Where
σ1 and σ2 unknown, n
S2 1
1 S1
2
n 2 1 S 2
2
(n1 1) (n2 1)
p
not assumed equal
Apply you Knowledge
Population means,
independent Forming the test statistic:
samples
The population variances
are not assumed equal, so
σ1 and σ2 known include the two sample
variances in the computation
σ1 and σ2 unknown, of the t-test statistic
assumed equal
the test statistic is a t value
σ1 and σ2 unknown,
not assumed equal
* with v degrees of freedom
(see next slide)
σ1 and σ2 Unknown,
Not Assumed Equal
(continued)
Population means,
independent
The number of degrees of
samples freedom is the integer
portion of:
σ1 and σ2 known 2
S 2
S2
2
1
n n
σ1 and σ2 unknown, 12 2
2 2
assumed equal S1 S 2
2
n n
1 2
σ1 and σ2 unknown,
not assumed equal
* n1 1 n2 1
σ1 and σ2 Unknown,
Not Assumed Equal
(continued)
Population means,
independent The test statistic for
samples
μ1 – μ2 is:
X X μ μ
σ1 and σ2 known
t
1 2 1 2
σ1 and σ2 unknown, 2 2
S S
assumed equal
1 2
n1 n2
σ1 and σ2 unknown,
not assumed equal
*
Related Populations
Tests Means of 2 Related Populations
Related Paired or matched samples
samples Repeated measures (before/after)
Use difference between paired values:
Di = X1i - X2i
Eliminates Variation Among Subjects
Assumptions:
Both Populations Are Normally Distributed
Or, if not Normal, use large samples
Mean Difference, σD Known
The ith paired difference is Di , where
Related Di = X1i - X2i
samples
n
The point estimate for
the population mean
D i
D i 1
paired difference is D : n
Suppose the population
standard deviation of the
difference scores, σD, is known
n is the number of pairs in the paired sample
Mean Difference, σD Known
(continued)
The test statistic for the mean
Paired difference is a Z value:
samples
D μD
Z
σD
n
Where
μD = hypothesized mean difference
σD = population standard dev. of differences
n = the sample size (number of pairs)
Confidence Interval, σD Known
n
The sample standard
deviation is i
(D D ) 2
SD i1
n 1
Mean Difference, σD Unknown
(continued)
(D D)
i
2
where SD i1
n 1
Hypothesis Testing for
Mean Difference, σD Unknown
Paired Samples
a a a/2 a/2
M.O. 4 0 - 4 n 1
-21
5.67
Paired t Test: Solution
Has the training made a difference in the number of
complaints (at the 0.01 level)?
Reject Reject
H0: μD = 0
H1: μD 0
a/2 a/2
a = .01 D = - 4.2 - 4.604 4.604
- 1.66
Critical Value = ± 4.604
d.f. = n - 1 = 4
Decision: Do not reject H0
(t stat is not in the reject region)
Test Statistic:
Conclusion: There is not a
D μD 4.2 0
t 1.66 significant change in the
SD / n 5.67/ 5 number of complaints.
Apply you Knowledge
A car company reported results of an experiment to compare handling ability
for two cars having quite difference length, wheelbases, and turning radii.
The observations are time in second require to parallel park each car
Subject 1 2 3 4 5 6 7
Car A 37 25.8 16.2 24.2 22 33.4 23.8
Subject 8 9 10 11 12 13 14
Car A 58.2 33.6 24.4 23.4 21.2 36.2 29.8
Car B 32.2 27.8 23.2 29.6 20.6 32.2 53.8
Does the data suggest that the average person will more easily handle one
car than the other? Test relevant hypotheses using α=0.10
Apply you Knowledge
A sample of nine local banks shows their deposits (in billions of dollars) 3
years ago and their deposits (in billions of dollars) today. At a 0.05, can
it be concluded that the average in deposits for the banks is greater today
than it was 3 years ago? Use a 0.05
Bank 1 2 3 4 5 6 7 8 9
3 years 11.42 8.41 3.98 7.37 2.28 1.10 1.00 0.9 1.35
ago
Today 16.69 9.44 6.53 5.58 2.92 1.88 1.78 1.5 1.22
Two Population Proportions
Goal: test a hypothesis or form a
Population confidence interval for the difference
proportions between two population proportions,
π1 – π2
Assumptions:
n1 π1 5 , n1(1- π1) 5
n2 π2 5 , n2(1- π2) 5
X1 X 2
p
n1 n2
where X1 and X2 are the numbers from
samples 1 and 2 with the characteristic of
interest
Two Population Proportions
(continued)
Z
p1 p2 π1 π2
1 1
p (1 p)
n1 n2
X1 X2 X X
where p , p1 1 , p 2 2
n1 n2 n1 n2
Confidence Interval for
Two Population Proportions
p1(1 p1 ) p2 (1 p2 )
p1 p2 Z
n1 n2
Hypothesis Tests for
Two Population Proportions
Population proportions
a a a/2 a/2
F test statistic * S 2
2
0 F
Reject Do not Reject H0
H0 FL reject H0 FU
To find the critical F values:
1
1. Find FU from the F table 2. Find FL using the formula: FL
FU*
for n1 – 1 numerator and
n2 – 1 denominator Where FU* is from the F table
degrees of freedom with n2 – 1 numerator and n1 – 1
denominator degrees of freedom
(i.e., switch the d.f. from FU)
F Test: An Example
0 F
Reject H0 Do not Reject H0
reject H0
F = 1.256 is not in the rejection FL=0.43
FU=2.33
region, so we do not reject H0
30 35 26 40 31 15 25 19
36 20 45 31 28 17 19 18
33 29 21 48 24 10 20 21
Prior to conducting this experiment, the manager believed that the variance in
inspection errors was lower for experienced inspectors than novice inspectors. Do
sample data support her belief? Test using a= 0.05