Session 13 14 - Hypothesis Testing-Two Sample Tests
Session 13 14 - Hypothesis Testing-Two Sample Tests
Sample Tests
Sessions 13 & 14
BUSINESS STATISTICS
Comparing Two Populations
Previously we looked at techniques to estimate and test parameters for
one population:
Population Mean µ
Population Proportion p
Population variance σ2
Sample, size: n1
Parameters: Statistics:
Two-Sample Tests
X1 – X 2
σ1 and σ2 unknown,
not assumed equal
Difference Between Two Means: Independent Samples
a a a/2 a/2
??
degrees of freedom
CI Estimator for μ1-μ2 (equal variances)
The test statistic for μ1-μ2 when the population variances are
unequal is given by:
degrees of freedom
Test statistic: s12 / s22, which is F-distributed with degrees of freedom ν1 = n1–
1 and ν2 = n2 −2.
F > 0. Two parameters define this distribution, and like we’ve already
seen these are again degrees of freedom.
is the “numerator” degrees of freedom and
is the “denominator” degrees of freedom.
F Distribution…
The mean and variance of an F random variable are given by:
and
F.05,3,7 0
Do not
reject H0 Fα
Reject H0 F
F.05,3,7=4.35
Denominator Degrees of Freedom : ROW
Numerator Degrees of Freedom : COLUMN
Determining Values of F…
For areas under the curve on the left hand side of the curve, we can
leverage the following relationship:
s12 = 37.49 and s22 = 43.34 Thus, Test statistic: F = 37.49/43.34 = 0.86
or
Thus we con conclude that the assumption of equal variances of the two population
holds as we have insufficient evidence to reject H0.
Pooled-Variance t Test Example
You are a financial analyst for a brokerage firm. Is there a
difference in returns between MFs of 2 different sectors? You
collect the following data:
IT INFRA
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.040
2 1 1
1
1.5021
1
Sp
n1 n 2 21 25
S
2 n1 1S1
2
n 2 1S 2
2
21 11.30 2 25 11.16 2
1.5021
p
(n1 1) (n2 1) (21 - 1) (25 1)
Pooled-Variance t Test Example: Hypothesis Test
Solution
H0: μ1 - μ2 = 0 i.e. (μ1 = μ2) Reject H0 Reject H0
X X t
1 2 /2
2
p
1 1
S 0.74 2.0154 0.3628 (0.009, 1.471)
n1 n 2
t
X 1
X 2 μ1 μ 2
3.27 2.53 0 2.019
S12 S 22 1.30 2 1.16 2
n1 n 2 21 25
2 2
S1 2 S 2 2 1.30 2
1.16 2
n n 21 25 Use degrees of
2
1 2
40.57
S1
2
S2 2 2
1.30 2 2
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
H0: μ1 - μ2 = 0 i.e. (μ1 = μ2) Reject H0 Reject H0
Denominator d.f. = n2 – 1 = 25 –1 = 24
Fα/2 = F.025, 20, 24 = 2.33
F(1-α/2), 20, 24 = 1/ F.025, 24, 20 =1/2.41=0.415
F Test: Example Solution
(continued)
0 F
Do not Reject H0
reject H0
FSTAT = 1.256 is not in the rejection F0.025=2.33
region, so we do not reject H0
Di = X1i - X2i
• Eliminates Variation Among Subjects
• Assumptions:
• Both Populations Are Normally Distributed
• Or, if not Normal, use large samples
Related Populations
The Paired Difference Test
(continued)
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 i
(D D ) 2
deviation is SD SD i1
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 i1
n 1
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?
Or, put it simply: whether the Training Module was effective?
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 /2
/2
= .01 D = - 4.2 - 4.604 4.604
- 1.66
t0.005 = ± 4.604
d.f. = n - 1 = 4
Decision: Do not reject H0
(tstat is not in the reject region)
Test Statistic:
Conclusion: There is not a
D μ D 4.2 0
t STAT 1.66 significant change in the
SD / n 5.67/ 5 number of complaints.
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 number of items of
interest in samples 1 and 2
Separate variance of proportions
Two Population Proportions
(continued)
ZSTAT
p1 p 2 π1 π 2
1 1
p (1 p)
n1 n 2
X1 X 2 X X
where p , p1 1 , p 2 2
n1 n2 n1 n2
Hypothesis Tests for
Two Population Proportions
Population proportions
a a a/2 a/2
z STAT
p1 p 2 1 2
1 1
p (1 p ) -1.96 1.96
n1 n 2 -2.20
.50 .70 0 2.20
1 1 Decision: Reject H0
.582 (1 .582)
72 50
Conclusion: There is a
significant evidence of a
Critical Values = ±1.96
difference in proportions
(@ what df ??) who will vote yes between
For = .05 men and women.
Confidence Interval for Two Population Proportions:
why only z- test [& no t-test]
p1 (1 p1 ) p 2 (1 p 2 )
p1 p 2 Z/2
n1 n2