T-Test for Independent Normal Samples: Equal & Unequal Variances, Study notes of Biostatistics

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

Pre 2010

Uploaded on 08/30/2009

koofers-user-04z
koofers-user-04z 🇺🇸

9 documents

1 / 25

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Biostatistics
Biostatistics
Lecture 13
Lecture
13
BIL 311
Lecturer: Dr. Patricia Buendia
11
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19

Partial preview of the text

Download T-Test for Independent Normal Samples: Equal & Unequal Variances and more Study notes Biostatistics in PDF only on Docsity!

BiostatisticsBiostatistics Lecture 13Lecture

BIL 311 Lecturer: Dr. Patricia Buendia

Lecture 13 OutlineLecture

13 Outline

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

NOT

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

−^

x

x

t

with a significance level of

α

„

We compute:

2

(^21)

1

2

2

1

2

1

s

n

s

n

s

n

n

s

t

„

If |t|

tn1+n2-2,

1-

α /

, we reject H

0

„

If |t|

t

n1+n2-2,

1- α /

, we accept H

0

(^

2

1

=^

n

n

s

„

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

P

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

  • 1

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

Reminder: The t-test is quite robust forequal sizes and large sample sizes. „

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:

F ll o w c hh a r t

t

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: