










































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!











































Two Sample Tests Bios 662
Michael G. Hudgens, Ph.D. [email protected]
http://www.bios.unc.edu/∼mhudgens
2006-09-26 15:
Two Sample Test Settings
Fundamentals
Y¯ 1 − Y¯ 2 ∼ N
μ 1 − μ 2 ,
σ 12 n 1 +^
σ^22 n 2
Fundamentals
1 /n 1 + 1/n 2
∼ tn 1 +n 2 − 2
where s^2 p =
(n 1 − 1)s^21 + (n 2 − 1)s^22 n 1 + n 2 − 2
s^2 p =^12 (s^21 + s^22 )
Two Sample t-test Example
Two Sample t-test: BW example
t.test(bw$drug,bw$placebo,var.equal=TRUE,alternative="greater")
Two Sample t-test
data: bw$drug and bw$placebo t = 2.4136, df = 28, p-value = 0. alternative hypothesis: true difference in means is greater than 0
Two Sample t-test: BW example
The TTEST Procedure T-Tests
Variable Method Variances DF t Value Pr > |t|
bw Pooled Equal 28 2.41 0. bw Satterthwaite Unequal 27.9 2.41 0.
F Distribution
0 1 2 3 4 5 6
0.^ 0.^ 0.^ 0.^
f
density
1,1 df
4,4 df
4,25 df
Homogeneity of Variance
Xk =
(nk − 1)s^2 k σ^2 k
for k = 1, 2
Y = X X^1 /(n^1 −^ 1) 2 /(n 2 −^ 1)^
∼ Fn 1 − 1 ,n 2 − 1
Y =
s^21 /σ 12 s^22 /σ 22
∼ Fn 1 − 1 ,n 2 − 1
Homogeneity of Variance
qf(.975,14,14) [1] 2.
data; y = finv(.975,14,14);
Homogeneity of Variance: BW example
C. 05 = {f : f < F 14 , 14 ,. 025 or f > F 14 , 14 ,. 975 }
= {f : f < 0 .34 or f > 2. 98 }
f =.^8994
2
. 96052
p = 2 ∗ F 14 , 14 (.8768) = 0. 809
Homogeneity of Variance: BW example
var.test(bw$drug,bw$placebo)
F test to compare two variances
data: bw$drug and bw$placebo F = 0.8767, num df = 14, denom df = 14, p-value = 0. alternative hypothesis: true ratio of variances is not equal to 1
Homogeneity of Variance