Professional Documents
Culture Documents
Lecture 7 (Two Sample Tests)
Lecture 7 (Two Sample Tests)
Learning Outcomes
Two-Sample Tests
Population Population
Means, Means,
Independent Related
Samples Samples
Examples:
Same group
Group 1 vs. before vs. after
Group 2 treatment
Difference Between Two Means
X1 – X2
σ1 and σ2 unknown,
not assumed equal
Difference Between Two Means: Independent Samples
• Different data sources
Population means, • Unrelated
independent
samples
* • Independent
• Sample selected from one population
has no effect on the sample selected
from the other population
a a a/2 a/2
(n1 − 1) + (n2 − 1)
p
samples
Population means,
independent
samples
The confidence interval for
μ1 – μ2 is:
σ1 and σ2 unknown,
assumed equal
*
( X1 − X 2 ) tα/2 2
Sp
1
+
1
n1 n 2
t=
(X1 − X 2 ) − (μ1 − μ 2 )
=
(3.27 − 2.53) − 0 = 2.040
2 1 1
1
1.5021 +
1
Sp +
n1 n 2 21 25
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
Pooled-Variance t Test Example: Hypothesis Test Solution
(X − X ) t
1 2 a/2
2
p
1 1
S + = 0.74 2.0154 0.3628 = (0.009, 1.471)
n1 n 2
= 1 2
2 2
S1 2 S22
σ1 and σ2 unknown,
not assumed equal
*
n
1 +
n1 − 1
n
2
n2 − 1
Separate-Variance t Test Example
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
t=
( )
X1 − X 2 − (μ1 − μ 2 )
=
(3.27 − 2.53) − 0 = 2.019
S12 S 22 1.302 1.162
+ +
n1 n 2 21 25
2
S1 2 S 2 2
2
1.30 2
1.16 2
n +
+
n2 Use degrees of
= 2 21 25
= = 40.57
1
S1
2
S2 2 2 2 2
1.30 1.16 2 2 freedom = 40
n n 21 + 25
1 + 2
n1 − 1 n2 − 1 20 24
Separate-Variance t Test Example: Hypothesis Test Solution
t = 2.019 Conclusion:
There is insufficient evidence of
a difference in means.
Related Populations: The Paired Difference Test
Di = X1i - X2i
• Eliminates Variation Among Subjects
• Assumptions:
• Both Populations Are Normally Distributed
• Or, if not Normal, use large samples
Related Populations (continued)
The Paired Difference Test
The ith paired difference is Di , where
Related Di = X1i - X2i
samples
n
The point estimate for the
paired difference D i
D= i =1
population mean μD is D : n
n
The sample standard (D − D)i
2
deviation is SD SD = i=1
n −1
n is the number of pairs in the paired sample
The Paired Difference Test: Finding tSTAT
a a a/2 a/2
(D − D)
i
2
where SD = i=1
n −1
Paired Difference Test: Example
M.O. 4 0 - 4 n −1
-21
= 5.67
Paired Difference 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
SD
D ta / 2
The confidence interval for μD is:
n
D = -4.2, SD = 5.67
Since this interval contains 0 cannot be 99% confident that μD doesn’t = 0
5.67
99% CI for D : − 4.2 4.604
5
= (-15.87, 7.47)
Session Summary
In this session we discussed
• Comparing two independent samples
• Performed pooled-variance t test for the difference in two means
• Performed separate-variance t test for difference in two means
• Formed confidence intervals for the difference between two means
• Comparing two related samples (paired samples)
• Performed paired t test for the mean difference
• Formed confidence interval for the mean difference