You are on page 1of 43

T Test

For 2 Related Samples

Introduction to
Biostatistical Analysis
2017
Goals
Introduce T test for 2 related samples
Present theory and formulae for related
samples T test
Obtain T test statistic from 2 related samples
Compare to IS T test
Use SPSS to perform T test on data for 2
related samples
T Test
for 2 related samples
T test for related samples are
similar to other T tests
Measures
Difference score in the numerator
Variability or Error in the denominator
T Test
for 2 related samples

General T test Formula


T= sample mean population
mean / estimated error

Single sample T test


t=M-mu/SM
T Test
for 2 related samples

Independent Sample T test

Sample Population
mean difference - mean difference
________________________________
Estimated Standard Error

t= (M1-M2) (1- 2) / SE (M1-M2)


T Test
for 2 related samples

T test for 2 related samples


Repeat measure design (our focus)
Individual is measured more than once on
same variable
Eg. Before and after training, medication

Matched subjects design


Match subjects so they are nearly equal on a
variable
T Test
for 2 related samples

T test for 2 related samples


Similar structure to Single Sample T test

Based on the difference between scores,


not the raw scores

Null Hypothesis - difference for the


population is Zero
T Test
for 2 related samples

T test for 2 related samples - Formula


t=MD D / SMD

MD = Mean differences of the sample


D = Population mean differences
Zero, as in One sample and IS T test
SMD= Estimated Standard Error of the
means of differences
T Test
for 2 related samples

T test for 2 related samples - Formula


t=MD D / SMD

Estimated Standard Error = SMD = s / n

s2 = SS / n-1 (Compute Variance)

s=SS / df
(Same as for one sample T test)
DMean 2
(D-M)
1 1
5 25
-4 16
-1 1
1 1
-3 9
1 1

54

df = n-1 = 5-1 = 4

Time after viewing a feared object before anxiety.


T Test
for 2 related samples

t=MD D / SMD

S2 = SS / n-1 = 54/6 = 9
SMD = s2 / n
SMD = 9/7
SMD = 1.28
SMD = 1.134
t=MD D / SMD

t= 8 0 / 1.134 = 7.05
T Test
for 2 related samples

Locate critical region T df=6, alpha 0.05


T table page 729
T=2.447

Make a decision
T for our sample is 7.05
Do we reject the Null Hypothesis??
T Test
for 2 related samples

Why used paired samples?


T Test
for 2 related samples

Why used paired samples?


??????????????????????????????

Will analyze same data set 2 ways

Independent Sample T test


Paired or related sample T test

Compare results
T Test
for 2 related samples

Will analyze same data


Independent Sample T test
Compute IS t statistic
t= (M1-M2)-(1 2) / S (M1-M2)
T Test for 2 related samples
Why we use paired samples example.
T Test for 2 related samples
Why we use paired samples
IS T test example.

Treat 1 Treat 2
X-M X-M2 X-M X-M2
18 -8 64 15 -6 36
27 1 1 20 -1 1
33 7 49 28 7 49
Sum 78 SS =114 63 SS=86
Mean 26 21
T Test for 2 related samples
Why we use paired samples
IS T test example.

Sum Squared Difference SS1=114 SS2=86


Means M1=26 M2=21
Df=N-1 Df1=2 Df2=2
Compute Pooled Variance
S2 P =Pooled Variance = SS1 + SS2 / Df1 + Df2
=114+86 / 4
S2 P = 200 / 4 = 50
T Test for 2 related samples
Why we use paired samples
IS T test example.

Sum Squared Difference SS1=114 SS2=86


Means M1=26 M2=21
Df=N-1 Df1=2 Df2=2
S2 P = 50
Compute Standard Error (use pooled variance)
S (M1-M2) = S2 P / N1 + S2 P / N2
= 50/3 + 50/3 = 16.67 + 16.67 = 33.333
S (M -M ) = 33.333 = 5.77
T Test for 2 related samples
Why we use paired samples
IS T test example.

Means M1=26 M2=21


Standard error = S (M1-M2) = 5.77
Compute IS t statistic
t= (M1-M2)-(1 2) / S (M1-M2)
t = (26-21) (0) / 5.77
= 5 / 5.77
t = 0.866
T Test for 2 related samples
Why we use paired samples
IS T test example.

T= 0.866
Is t in critical region? For Df=4, alpha 0.05
T Test for 2 related samples
Why we use paired samples
IS T test example.
T Test for 2 related samples
Why we use paired samples
IS T test example.

T= 0.866
Is t in critical region? For Df=4, alpha 0.05
??????????????????????????????????????????
T Test for 2 related samples
Why we use paired samples
Repeat measures T test example.
T Test for 2 related samples
Why we use paired samples
Repeat measures T test example.

Treat 1 Treat 2 D D-Mean


18 15 -3 2
27 20 -7 -2
33 28 -5 0
Sum D -15
Mean D = -5
T Test for 2 related samples
Why we use paired samples
Repeat measures T test example.
Treat 1 Treat 2 D D-Mean D-Mean 2

18 15 -3 2 4
27 20 -7 -2 4
33 28 -5 0 0
Sum D = -15;
Mean D = Sum D/n = -15/3 =-5

SS = D2 (D)2 /n
= 83 - 225 /3
SS = 83 - 75 = 8
T Test for 2 related samples
Why we use paired samples
Repeat measures T test example.
Treat 1 Treat 2 D D-Mean D-Mean 2
18 15 -3 2 4
27 20 -7 -2 4
33 28 -5 0 0

Sum D -15 Mean D -5 SS = 8


Df = n-1 = 3-1 = 2

Compute the Variance


S2 = SS/n-1
S2 = 8/2 = 4
T Test for 2 related samples
Why we use paired samples
Repeat measures T test example.
Treat 1 Treat 2 D D-Mean D-Mean 2
18 15 -3 2 4
27 20 -7 -2 4
33 28 -5 0 0

Sum D -15 Mean D -5 SS = 8


Df = 2 S2 = 4

Compute the Standard Error


SMD = S2 / N
SMD =4 / 3 =1.33333 = 1.1547
T Test for 2 related samples
Why we use paired samples
Repeat measures T test example.
Treat 1 Treat 2 D D-Mean D-Mean 2
18 15 -3 2 4
27 20 -7 -2 4
33 28 -5 0 0
Sum D -15 Mean D -5 SS = 8
Df = 2 S2 = 4 SMD=1.1547

Compute the Paired T statistic

T = MD D / SMD
T = -5 0 / 1.1547 = -5/1.1547
T = -4.33
T Test for 2 related samples
Why we use paired samples
Repeat measures T test example.
Treat 1 Treat 2 D D-Mean D-Mean 2
18 15 -3 2 4
27 20 -7 -2 4
33 28 -5 0 0

Sum D -15 Mean D -5 SS = 8


Df = 2 S2 = 4 SMD=1.1547

Determine critical value for alpha 0.05, Df 2


T Test for 2 related samples
Why we use paired samples
IS T test example.
T Test for 2 related samples
Why we use paired samples
Repeat measures T test example.
Treat 1 Treat 2 D D-Mean D-Mean 2
18 15 -3 2 4
27 20 -7 -2 4
33 28 -5 0 0
Sum D -15 Mean D -5 SS = 8
Df = 2 S2 = 4 SMD=1.1547

Determine critical value for alpha 0.05, Df 2


Critical value, T table page 729 is 4.303
Our T value is -4.33.
Should we reject the null hypothesis?
T Test for 2 related samples
Why we use paired samples
Repeat measures T test example.
Treat 1 Treat 2 D D-Mean D-Mean 2
18 15 -3 2 4
27 20 -7 -2 4
33 28 -5 0 0
Sum D -15 Mean D -5 SS = 8
Df = 2 S2 = 4 SMD=1.1547

Determine critical value for alpha 0.05, Df 2


Critical value, T table page 729 is 4.303
Our T value is (-4.33).
Should we reject the null hypothesis??????????????
T Test
for 2 related samples
The T statistic was larger for the Paired T test
than for the Independent sample T test
using the same data WHY?
A) The Difference between the means
(numerator) was larger for Paired T test

B) The Variance and therefore the Standard error


(denominator) was smaller for Paired T test

C) I am not sure, lets review the calculations


T Test
for 2 related samples
Compute IS t statistic
t= (M1-M2)-(1 2) / S (M1-M2)
t = (26-21) (0) / 5.77
t = 5 / 5.77
t = 0.866
Compute the Paired T statistic
T = MD D / SMD
T = -5 0 / 1.1547
T = -5/1.1547
T = -4.33
T Test
for 2 related samples
The T statistic was larger for the Paired
T test than for the Independent sample
T test using the same data WHY?

???????????????????????????????????
T Test
for 2 related samples
Assumptions of Related samples T test
Observations within each treatment
condition must be independent
Population of difference scores must be
normal (may be ignored if N > 30)
T Test
for 2 related samples
Time factors and order effects
Factors other than treatment can impact scores
In repeat measures one measure occurs after
another
Changes in health, mood, weather
can impact one and not the other score
T Test
for 2 related samples
Order effects
Participating in first treatment can impact second
score, like fatigue or learning
Counterbalancing
To deal with time factor and order effects
Divide into 2 groups
Group 1 gets Rx 1 first and Rx2 second
Group 2 gets Rx 2 first and Rx1 second
If Strong time or order effects anticipated
Dont use repeat measures design
T Test
for 2 related samples
T Test Assumptions - Review

Observations within each treatment are


Independent

Population of Difference scores are Normal


T Test
for 2 related samples

?
T Test
for 2 related samples

T Test Formulas
T Test Difference Standard error of DF
Between Means the difference
Independent MeanA MeanB SD pooled / N N1+N2 -2
Samples

Paired Mean difference SD mean diff / N N -1


(pre-post) / N (N = # pairs)

One Sample Xmean - SD sample / N N-1


T Test
for 2 related samples
Lets move to the SPSS homework
example

You might also like