Hypothesis Testing 2
Hypothesis Testing 2
Population Population
Means, Means, Population Population
Matched Independent Proportions Variances
Pairs Samples
Examples:
Same group Group 1 vs. Proportion 1 vs. Variance 1 vs.
before vs. after independent Proportion 2 Variance 2
treatment Group 2
Matched Pairs
Tests Means of 2 Related Populations
Matched Paired or matched samples
Pairs Repeated measures (before/after)
Use difference between paired values:
di = xi - yi
Assumptions:
Both Populations Are Normally Distributed
Test Statistic: Matched Pairs
The test statistic for the mean
Matched difference is a t value, with
Pairs n – 1 degrees of freedom:
d D0
t
sd
n
Where
D0 = hypothesized mean difference
sd = sample standard dev. of differences
n = the sample size (number of pairs)
Decision Rules: Matched Pairs
Paired Samples
Lower-tail test: Upper-tail test: Two-tail test:
H0: μx – μy 0 H0: μx – μy ≤ 0 H0: μx – μy = 0
H1: μx – μy < 0 H1: μx – μy > 0 H1: μx – μy ≠ 0
a a a/2 a/2
C.B. 6 4 - 2
T.F. 20 6 -14
M.H. 3 2 - 1
Sd
i
(d d ) 2
R.K. 0 0 0
n 1
M.O. 4 0 - 4
-21
Matched Pairs 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
Number of Complaints: (2) - (1) d = n
Salesperson Before (1) After (2) Difference, di
= - 4.2
C.B. 6 4 - 2
T.F. 20 6 -14
M.H. 3 2 - 1 Sd
i
(d d) 2
R.K. 0 0 0 n 1
M.O. 4 0 - 4
-21 5.67
Matched Pairs: Solution
Has the training made a difference in the number of
complaints (at the = 0.01 level)?
Reject Reject
H0: μx – μy = 0
H1: μx – μy 0 /2
/2
= .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 D0 4.2 0
t 1.66 significant change in the
sd / n 5.67/ 5 number of complaints.
Difference Between Two Means
Independent
Population means,
independent
samples
Population means,
independent The test statistic for
samples μx – μy is:
a a a/2 a/2
t
X 1
X 2 μ1 μ2
3.27 2.53 0 2.040
1 1 1 1
S
2
p
1.5021
n1 n2 21 25
n
S2 1
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)
Solution
Reject H0 Reject H0
H0: μ1 - μ2 = 0 i.e. (μ1 = μ2)
H1: μ1 - μ2 ≠ 0 i.e. (μ1 ≠ μ2)
.025 .025
= 0.05
df = 21 + 25 - 2 = 44 -2.0154 0 2.0154 t
Critical Values: t = ± 2.0154
2.040
Test Statistic: Decision:
3.27 2.53
t 2.040 Reject H0 at a = 0.05
1 1
Conclusion:
1.5021
21 25 There is evidence of a
difference in means.
σx2 and σy2 Unknown,
Assumed Unequal
Population means,
Forming interval estimates:
independent
The population variances are
samples
assumed unequal, so a pooled
variance is not appropriate
σx2 and σy2 known
use a t value with degrees
σx2 and σy2 unknown of freedom, where
2
s 2x s 2y
σx2 and σy2 ( ) ( )
assumed equal n x n y
v 2
2 2 2
sx s
σx2 and σy2
assumed unequal * /(n x 1) y /(n y 1)
nx
n
y
Test Statistic,
σx2 and σy2 Unknown, Unequal
a a a/2 a/2
Assumptions:
Both sample sizes are large,
nP(1 – P) > 9
Two Population Proportions
(continued)
z
pˆ x pˆ y
pˆ 0 (1 pˆ 0 ) pˆ 0 (1 pˆ 0 )
nx ny
n xpˆ x n ypˆ y
Where pˆ 0
nx ny
Decision Rules: Proportions
Population proportions
Lower-tail test: Upper-tail test: Two-tail test:
H0: px – py 0 H0: px – py ≤ 0 H0: px – py = 0
H1: px – py < 0 H1: px – py > 0 H1: px – py ≠ 0
a a a/2 a/2
.50 .62
.549 (1 .549) .549 (1 .549) Decision: Do not reject H0
72 50 Conclusion: There is not
(n 1)s 2
2
n 1
σ2
follows a chi-square distribution with
(n – 1) degrees of freedom
Confidence Intervals for the
Population Variance
(continued)
(n 1)s 2
χ 2
n 1
σ 02
Decision Rules: Variance
Population variance
Lower-tail test: Upper-tail test: Two-tail test:
H0: σ2 σ02 H0: σ2 ≤ σ02 H0: σ2 = σ02
H1: σ2 < σ02 H1: σ2 > σ02 H1: σ2 ≠ σ02
a a a/2 a/2
0 0 F
Do not Reject H0 F Do not
reject H0
Reject H0
Fn x 1,n y 1,α / 2
reject H0 Fnx 1,ny 1,α
= .10/2:
Degrees of Freedom:
Numerator
F n x 1, n y 1, α / 2
Do not
F
Reject H0
reject H0
F = 1.256 is not in the
rejection region, so we do not F20 , 24 , 0.10/2 2.03
reject H0
Conclusion: There is not sufficient evidence
of a difference in variances at = .10
Two-Sample Tests in EXCEL
For variances…
F test for two variances:
Tools | data analysis | F-test: two sample for variances