Lecture 10
Lecture 10
𝑋ത1
𝜇1 𝑋ത2
𝜇2
Two-Sample Tests
Two-Sample Tests
Population Population
Means, Means, Population Population
Independent Related Proportions Variances
Samples Samples
Comparing Two Means
Difference Between Two Means & Independent Samples
Test hypothesis or form a confidence interval for the difference between
two population means, μ1 – μ2 where the point estimate for the difference
is 𝑋1 − 𝑋2
a a a/2
Hypothesis Tests for µ1 - µ2 with σ1 and σ2 known
σ1 and σ2 unknown,
not assumed equal
Hypothesis tests for µ1 - µ2 with σ1 and σ2 known
The test statistic:
ZSTAT
X X μ μ
1 2 1 2
12 22
n1 n2
X X Z
1 2 a/2
12 22
n1 n2
Hypothesis tests for µ1 - µ2 with σ1 and σ2 unknown assumed equal
σ1 and σ2 unknown,
not assumed equal
Hypothesis tests for µ1 - µ2 with σ1 and σ2 unknown and assumed equal
The pooled variance
S 2
n1 1 S1 n 2 1 S2
2 2
(n1 1) (n 2 1)
p
1 1
d.f. = (n1 + n2 – 2) S
2
p
n1 n 2
The confidence interval
Number 21 25
t STAT
X X μ
1 2 1 μ2
3.27 2.53 0 2.040
1 1 1 1
S
2
1.5021
p
n1 n 2 21 25
n
S2 1
1S1
2
n 2 1S 2
2
21 1 1.30 2
25 1 1.16 2
1.5021
(n1 1) (n 2 1) (21 - 1) (25 1)
P
Pooled-Variance t Test Example: Hypothesis Test Solution
Reject H0 Reject H0
a = 0.05
df = 21 + 25 - 2 = 44 .025 .025
3.27 2.53
t STAT 2.040
1 1
1.5021
21 25
Conclusion: Reject H0 at a = 0.05. There is evidence of a difference in means.
Pooled-Variance t Test Example: Confidence Interval for µ1 - µ2
Since we rejected H0 can we be 95% confident that
µNYSE > µNASDAQ?
X X t
1 2 a/2 p
1 1
S 0.74 2.0154 0.3628 (0.009, 1.471)
2
n1 n 2
Population means,
Assumptions
independent Samples are randomly and
samples independently drawn.
Populations are normally
σ1 and σ2 known
distributed or both sample
2
S1 2 S 2 2
X X 2 μ1 μ 2
n n
1
2
2
t STAT
2 2
tSTAT has 1
2
S S S1 2 S22
1
2
d.f. ν:
n
n
n1 n 2 1 2
n1 1 n2 1
Welch’s rule:
df = min(n1 – 1, n2 – 1)
X 1
X 2 ta
2
S12 S22
n1 n 2
Difference Between Two Means & Paired Samples
The average score of subjects on the posttest is different
than the average of those same subjects on the pretest.
Di = X1i - X2i
Assumptions:
Both Populations Are Normally Distributed
SD i 1
paired sample n 1
D μD
The test statistic for μD where t STAT
SD
tSTAT has n - 1 d.f. n
Paired Difference Test: Possible Hypotheses & CI
Lower-tail test Upper-tail test Two-tail test
a a a/2 a/2
SD
The confidence interval for μD is D ta / 2
n
Paired Difference Test: 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:
Di
Salesperson Number of complaints Difference
Before After D = n
A 6 4 -2
B 20 6 -14 = -4.2
(D D)
C 3 2 -1 2
D 0 0 0 SD i
F 4 0 -4
n 1
-21 5.67
Has the training made a difference in the
number of complaints (at the 0.01 level)?
H0: μD = 0
H1: μD 0 Reject Reject
a/2 a/2
a = .01 D = - 4.2 - 4.604 4.604
- 1.66
t0.005 = ± 4.604
d.f. = n - 1 = 4
Conclusion: Do not reject 𝐻0 . There
is insufficient evidence there is
D μ D 4.2 0
t STAT 1.66 significant change in the number of
SD / n 5.67/ 5
complaints.
Comparing Two Proportions
Two Population Proportions
Time magazine reported the result of a telephone poll of 800
adult Americans. The question posed of the Americans who
were surveyed was: "Should the federal tax on cigarettes be
raised to pay for health care reform?” Is there sufficient
evidence at the 𝛼 = 0.05, say, to conclude that the true
populations – smokers and non-smokers – differ significantly?
Assumptions about Normality
a a a/2 a/2
X1 X 2 X1 X2
p , p1 , p2
n1 n2 n1 n2
Hypothesis Test Example: Two population Proportions
Is there a significant difference between the
proportion of men and the proportion of
women who will vote Yes on Proposition A?
X 1 X 2 36 35 71
p 0 .582
n1 n2 72 50 122
Reject H0
z STAT
p1 p2 π1 π2
Reject H0
1 1 .025
p ( 1 p)
n1 n2 .025
.50 .70 0 2 .20
1 1
.582 ( 1 .582 ) -1.96 1.96
72 50 -2.20
(p1 p 2 ) ( 1 2 )
Z STAT
p1 (1 p1 ) p 2 (1 p 2 )
n1 n2
p1 (1 p1 ) p 2 (1 p 2 )
p1 p 2 Za/2
n1 n2
Comparing Two Variances
Comparing Two Variances
𝜎12
variances are different by considering 𝐹 =
𝜎22
𝑠12
Test statistic is the ratio between two sample variances 𝐹𝑆𝑇𝐴𝑇 =
𝑠22
Number 21 25
analyst for a brokerage
Sample mean 3.27 2.53
firm. Is there a Sample SD 1.3 1.16
difference in the
variances between the
NYSE & NASDAQ at
the a = 0.05 level?
Solution.
Form the hypothesis test:
Numerator d.f. = n1 – 1 = 21 –1 = 20
Denominator d.f. = n2 – 1 = 25 –1 = 24