Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 12

Nested Designs and Repeated Measures

with Treatment and Time Effects

KNNL Sections 26.1-26.5, 27.3


Nested Factors
Factor is Nested if its levels under different levels of
another (Nesting) factor are not the same
Nesting Factor School, Nested Factor Teacher
Nesting Factor Factory, Nested Factor Machinist
If Factor A (Nesting) has a levels and Each Level of A
has b levels of Factor B (Nested), there are a total of
ab levels of Factor B, each being observed n times

Factor A A1 A2 A3

Factor B B1(1) B2(1) B1(2) B2(2) B1(3) B2(3)

Replicates Y111 Y112 Y121 Y122 Y211 Y212 Y221 Y222 Y311 Y312 Y321 Y322

Note: When Programming, give levels of B as: 1,2,...,b,b+1,...,2b,...(a-1)b+1,...,ab


2-Factor Nested Model Balanced Case
Factor A at a levels with means: i i
Factor B with ab levels (b disinct levels w/in each level of A) with means:
ij i j (i ) j (i ) ij i ij i
a b
A and B Fixed Factors
i 1
i 0
j 1
j (i ) 0 i

Yijk ij ijk ij i j (i ) ijk i 1,..., a; j 1,..., b; k 1,..., n ijk ~ N 0, 2 independent


Yijk ~ N i j (i ) , 2 independent

0 j (i ) ~ N 0, 2 independent
a
A Fixed and B Random:
i 1
i j (i )

2 2 i i ', j j ', k k '



Yijk ~ N i , 2 2 Yijk , Yijk ' 2 i i ', j j ', k k '
0 otherwise

A and B Random i ~ N 0, 2 indep j (i ) ~ N 0, 2 indep j (i )


2 2 2 i i ', j j ', k k '
2
i i ', j j ', k k '
2
Yijk ~ N , 2 2 2 Yijk , Yi ' j ' k ' 2
i i ', j j ', k , k '
0 i i ', j , j ', k , k '
Estimators, Analysis of Variance, F-tests
^ ^ ^
Y i Y i Y j (i ) Y ij Y i


^ ^ ^ ^
Fitted Values: Y ijk = i j (i ) Y Y i Y Y ij Y i Y ij


^ a b n
SSE Yijk Y ij df E ab n 1
2
Residuals: eijk Yijk Y ijk Yijk Y ij
i 1 j 1 k 1


a
Factor A Sum of Squares: SSA bn Y i Y
2
df A a 1
i 1


a b
Factor B Within A Sum of Squares: SSB( A) n Y ij Y i df B ( A) a b 1
2

i 1 j 1

A Fixed, B Fixed A Fixed, B Random A Random, B Random


a a
bn i2 bn i2
E MSA 2 i 1
E MSA 2 n 2 ( ) i 1
E MSA 2 n 2 ( ) bn 2
a 1 a 1
a b
n j2(i )
E MSB ( A) 2 E MSB( A) 2 n 2 ( ) E MSB( A) 2 n 2 ( )
i 1 j 1

a b 1
E MSE 2 E MSE 2 E MSE 2

MSA MSA MSA


H 0 : 1 ... a 0 TS : FA H 0 : 1 ... a 0 TS : FA H 0 : 2 0 TS : FA
MSE MSB ( A) MSB( A)
MSB ( A) MSB( A) MSB( A)
H 0 : 1(1) ... b ( a ) 0 TS : FB ( A) H 0 : 2 ( ) 0 TS : FB ( A) H 0 : 2 ( ) 0 TS : FB ( A)
MSE MSE MSE
Fixed Effects Model (A and B Fixed)
MSA
Factor A: H 0 : 1 ... a 0 TS : FA RR : FA F 1 ; a 1, ab n 1
MSE
2

E Y i i i
Y i
2

bn

s 2 Y i
MSE
bn
a
Contrasts among Means of A: ci 0
i 1


a a a
^ ^ MSE a 2
LA ci i ci i L A ci Y i s2 L A ci
i 1 i 1 i 1 bn i 1
MSE a 2
L A t 1 / 2 ; ab n 1
^
1 100% CI for LA : ci
bn i 1
a
a a 1
All Possible Comparisons among pairs of means of A: c
i 1
2
i 2 CA
2
2 MSE

Tukey: Y i Y i ' q 1 ; a, ab n 1
MSE

Bonferroni: Y i Y i ' t 1
; ab n 1
bn 2C A bn

MSB( A)
Factor B(A): H 0 : 1(1) ... b ( a ) 0 TS : FB ( A) RR : FB ( A) F 1 ; a b 1 , ab n 1
MSE
2

E Y ij ij i j (i )
Y ij
2

n

s 2 Y ij
MSE
n
b b 1
All Possible Comparisons among pairs of means of B within a given level (i ) of A: CB ( A)
2
2 MSE

Tukey: Y ij Y ij ' q 1 ; b, ab n 1
MSE
n

Bonferroni: Y ij Y ij ' t 1
2CB ( A)
; ab n 1
n

Mixed Effects Model (A Fixed and B Random)
MSA
Factor A: H 0 : 1 ... a 0 TS : FA RR : FA F 1 ; a 1, a b 1
MSB( A)
2 n 2 ( )

E Y i i i
Y i
2

bn
MSB( A)
bn

s 2 Y i
a
a a 1
All Possible Comparisons among pairs of means of A: ci2 2 C A
i 1 2
2MSB( A)

Tukey: Y i Y i ' q 1 ; a, a b 1
MSB( A)

Bonferroni: Y i Y i ' t 1 ; a b 1
bn 2C A bn

MSB( A)
Factor B(A): H 0 : 2 ( ) 0 TS : FB ( A) RR : FB ( A) F 1 ; a b 1 , ab n 1
MSE
1 1
E MSB( A) 2 n 2 ( ) E MSE 2 E MSB ( A) E MSE ( )
2

n n
s
2 2
1 1 ( )
s2 ( ) MSB ( A) MSE Approximate df (Satterthwaite): df ( )
n n MSB( A) 2 MSE 2

n n
a b 1 ab n 1



df ( ) s2 ( ) df ( ) s ( )
2

Approximate 1 a 100% CI For ( ) :


2
,
2 1 ; df 2
; df ( )

2 ( )
2
Random Effects Model (A and B Random)
MSA
Factor A: H 0 : 2 0 TS : FA RR : FA F 1 ; a 1, a b 1
MSB( A)

E MSA 2 n 2 ( ) bn 2 E MSB ( A) 2 n 2 ( )
1 1
E MSA) E MSB( A)
2

bn bn

s2
2
1 1
s2 MSA MSB ( A) Approximate df (Satterthwaite): df A
bn bn MSA 2 MSB( A) 2

bn bn
a 1 a b 1



df A s2 df A s2
Approximate 1 100% CI For :
2
,
2 1 ; df
2 ; df A
2 A
2
Factor B Within A is same as in Mixed Effects Model
Repeated Measures with Treatment and Time
Goal: Compare a Treatments over b Time Points
Begin with nT = as Subjects, and randomly assign them
such that s Subjects receive Treatment 1, ... s
Subjects receive Treatment a
Each Subject receives 1 Treatment (not all Treatments)
Each Subject is observed at b Time points
Treatment is referred to as Between Subjects Factor
Time is referred to as Within Subjects Factor
Treatment and Time are typically Fixed Factors
Subject (Nested within Treatment) is Random Factor
Generalizes to more than 1 Treatment Factor
Statistical Model
Yijk i ( j ) j k jk ijk i 1,..., s; j 1,..., a; k 1,..., b
Yijk Measurement on i th Subject within the i th Treatment at the k th Time Point
Overall Mean ijk ~ N 0, 2 independent
i ( j ) Subject Effects i ( j ) ~ N 0, 2 independent
i( j) ijk
a
j Treatment Effects j 1
j 0

b
k Time Effects
k 1
k 0
a b
jk TreatmentxTime Interaction Effects
j 1
jk
jk 0
k 1

2 2 i i ', j j ', k k '



E Yijk j k jk 2 Yijk 2 2 Yijk , Yi ' j ' k ' 2 i i ', j j ', k k '
0 otherwise

Yij1 2 2 2 2

Yij 2 2 2 2

2

Yijk ~ N j k jk , 2 2


Yijb 2 2
2 2

Analysis of Variance & F-Tests
a
sb 2j

a
Treatment (Factor A): SSA sb Y j Y E MSA 2 b 2
2
j 1
df A a 1
j 1 a 1
b
sa k2

b
SSB sa Y k Y E MSB 2
2
Time (Factor B): df B b 1 k 1

k 1 b 1
a b
s jk
2


a b
SSAB s Y jk Y j Y k Y df AB a 1 b 1 E MSAB 2
2
j 1 k 1
Trt x Time (AB):
j 1 k 1 a 1 b 1

s a
Subject(Trt) (S(A)): SSS ( A) b Y ij Y j df S ( A) a s 1 E MSS ( A) 2 b 2
2

i 1 j 1


s a b
TimexSubj(Trt) (B.S(A)): SSB.S ( A) Y ijk Y ij Y jk Y j df B.S ( A) a b 1 s 1 E MSB.S ( A) 2
2

i 1 j 1 k 1

Tests: H 0A : all j 0 H 0B : all k 0 H 0AB : all jk 0

MSA MSB MSAB


Tests Statistics: FA FB FAB
MSS ( A) MSB.S ( A) MSB.S ( A)

Rejection Regions: F F 1 ; a 1, a s 1 F F 1 ; b 1, a b 1 s 1 F F 1 ; a 1 b 1 , a b 1 s 1
A B AB
Comparing Treatment and Time Effects No Interaction
Treatment (Factor A) Effects when No Interaction Between Treatment and Time:


Tukey Method: Y j Y j ' q 1 ; a s 1
MSS ( A)
sb
Bonferroni Method:
2MSS ( A) a (a 1)
Y j Y j ' t 1 ; a s 1 CA
2C A sb 2

Time (Factor B) Effects when No Interaction Between Treatment and Time:


Tukey Method: Y k Y k ' q 1 ; a b 1 s 1
MSB.S ( A)
sa
Bonferroni Method:
2MSB.S ( A) b(b 1)
Y k Y k ' t 1 ; a b 1 s 1 CB
2CB sa 2
Comparing Trt Levels w/in Time Periods
Comparing Treatment Levels Within Time Levels:
Bonferroni:
2 MSS ( A) b 1 MSB.S ( A)

Y . jk Y . j ' k t 1 ; df
2C A bs
with approximate df:
(b 1) MSB.S ( A) MSS ( A)
2

df
(b 1) MSB.S ( A) 2 MSS ( A) 2

a(b 1)( s 1) a( s 1)

You might also like