

















Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
An explanation of the two-sample t-test for independent normally distributed samples, with a focus on the cases where variances are equal and unequal. Formulas, examples, and instructions on how to calculate the test statistic, degrees of freedom, and p-values. It also discusses confidence intervals and power analysis.
Typology: Study notes
1 / 25
This page cannot be seen from the preview
Don't miss anything!


















Chapter 8 – Two sample Hypothesis^ Testing
T
esting Decision: Are Variances Equal
g
q
in two Independent Normal Samples?
Strategy for testing for the equality ofmeans in two independent normal samples:1.^
Perform F Test for the equality of two
y
variances:a)
If significant (variances different!): Perform tt^
t^
i^
l^
i
In a t-test
test assuming
unequal
variances
b)
If
significant (variances are the same):
Perform t test assuming
equal
variances
In a t-testvariances are assumed
to be
Perform t test assuming
equal
variances
to^ be^ Book page: UNKNOWN
Hypothesis Testing: Two-Sample T-Test
for
yp
g
p
Independent Samples with Equal Variance^
Example: The time it takes for the blood to clot isrecorded for people in two groups (not necessarily ofrecorded for people in two groups (not necessarily ofthe same size) that are taking drugs B or G.
The data in both groups are normally distributed
After running an F test we accept the Null hypothesisof …
equal variances
equal
variances
Book page:
Hypothesis Testing: Two-Sample T-Test
for
yp
g
p
Independent Samples with Equal Variance^
To test the hypothesis H
: μ 0
= μ 1
2
versus H
: μ 1
1
μ 2
with a significance level of
α
2
1
with a significance level of
α
We compute:
2
(^21)
1
2
2
1
2
1
If |t|
tn1+n2-2,
1-
α /
, we reject H
0
If |t|
≤ t
n1+n2-2,
1- α /
, we accept H
0
2
1
with:
[^
]^
⎫ ⎬ ⎭
⎧ ⎨ ⎩
≤
− ×
≤
≤
×
=^
− −− −
0
,)
Pr( 1 2
0
),
Pr( 2
2 2 2 (^211)
t if t
t
t if t
t
p^
n n n n
7
⎭
⎩^
2 1
Book page:305&
Hypothesis Testing: Two-Sample T-Test
for
yp
g
p
Independent Samples with Equal Variance
2 − 1 x x
) 2
(
) 1
(
) 1
(
/ 1
/ 1
(^22)
2
(^21)
1
2
2
1
2 1
−
−
=
=
s
n
s
n
s
n
n s
x x
t
Example: Blood clothing times of two independentgroups, group B has 6 persons, group G has 7.
) 2
(^
2 1
− +^
n n
g
p , g
p^
p^
, g
p
s
and s=0.72 min
t=(8.75-9.74)/(0.
Because t
11,0.
=2.201<|-2.475| we reject H
0
Book page:306&
Hypothesis Testing: Two-Sample T-Test
for
yp
g
p
Independent Samples with Equal Variance
You can obtain the exact p-value or approximate the p-value using the tables. For p=
×P(t
11
g
p
11
t
11,0.
<|-2.475|< t
11,0.
, or equivalently
2.201 < 2.475 < 2.718, it then follows that
0.01 < p/2 <0.025 and 0.02 < p < 0.05 or equivalently0.02 < 2
×P(t
11
Th
l
Th
e exact P-value = TDIST(2.475,11,2)=0.
Book page:
Confidence Intervals for Independent Samples with Equal Variance
A two-sided 100%
×
(1-
α
) CI for the true mean
difference μ
-μ 1
2
between two independent
samples is given by: ⎯x
⎯
x
2
±
t^ n1+n2-2,
1- α
/^
s√
(1/n
+1/n 1
Example: A 95% CI for the true mean blood clottingdifference is given by:8 75-9 75
±
t
±
±
t
11,
0.
±
×0.4= -0.99 min
±
0.88 min=(-1.87,-0.11)
Book page:
Hypothesis Testing: Two-Sample T-Test
for
yp
g
p
Independent Samples with Unequal Variance
Assume that the samples are normallydistributed with the first sample from a
p
N(μ
, 1
σ
(^21) ) distribution, the second from a
N(μ
, 2 σ
(^22) ) distribution and
σ
(^21) ≠
σ
(^22)
(μ
, 2
2
)^
1
2
We want to test H
: μ 0
= μ 1
2
vs. H
: μ 1
≠ 1
μ
Book page:
Hypothesis Testing: Two-Sample T-Test
for
yp
g
p
Independent Samples with Unequal Variance
Use Satterthwaite’s Method and compute the teststatistic t and round down the degrees of freedom
d’
g
to the nearest integer
d”
If |t|
td”,
1- α /
, we reject H
0
)
(
'^
2 2 (^22) 1 (^21)
2 (^22) 1 (^21)
2 1
=
− +
=
n s n s
d
n s n s
x x
t
If |t|
≤ t
d”,
1- α /
, we accept H
0
with:
) 1
( )
( ) 1
( )
(^
2 2 2 (^22)
1 2 1 21
−
−
=^
n n s n n s d
[^
]^
⎫ ⎬ ⎭
⎧ ⎨ ⎩
≤
− ×
≤
≤
×
=^
0
,)
Pr( 1 2
0
),
Pr( 2
" "
t if t
t
t if t
t
p
d d
Does this
14
Book page:
look familiar?
Confidence Intervals for two Independent Samples with Unequal Variance
The two sided 100% CI for μ
-μ 1
2
(with
σ
(^21) ≠σ
(^22)
2
2
Heart Disease Example: The 95% CI is given by:
2 (^22)
1 (^21)
(^2) /
(^1) ,"
2
1
n s n s t x
x^
d^
±
−
−α
Heart
Disease Example: The 95% CI is given by:
t151,0.
TINV(0.05,151)=
(^
,^
)
Book page:
Let’s say you obtain a power of
y y
p
Φ
(-0.108). What is the power?
-0.108 or -10%
Φ
(0 108)=0 54 or 54%
Φ
(0.108)=0.54 or 54%
1-
Φ
(0.108)=1-0.54=0. 46% or 46%
Estimation of Sample Size for Comparing
p
p
g
Two Means with Known Variance Prior to performing a two-sample test fordifference between means an investigatordifference between means, an investigatormay ask
how many samples
to collect.
In many cases it can be anticipated that one
In many cases it can be anticipated that onesample will be k times larger than the other,therefore n
=k 2
×
n
. 1
2
1
Book page: