Longitudinal Data Analysis: Repeated Measures ANOVA

Longitudinal Data Analysis:
Repeated Measures ANOVA
Aaron Jones
Duke University
BIOSTAT 790
April 7, 2016
Aaron Jones (BIOSTAT 790)
RM ANOVA
April 7, 2016
1 / 14
Overview
1
Multivariate Models
GEE vs. GLMM
MANOVA vs. RM ANOVA
2
RM ANOVA Model
3
RM ANOVA Examples: SS & F-Tests
4
Sphericity
Aaron Jones (BIOSTAT 790)
RM ANOVA
April 7, 2016
2 / 14
GEE vs. GLMM
Familiar GLM, ANOVA assume independent residuals
Correlated outcomes require multivariate extension
Generalized Estimating Equations (GEE)
Only need mean model and working correlation matrix
Neither assumes nor estimates sources of variance
Generalized Linear Mixed Model (GLMM)
Likelihood-based, need to specify random effects
In return, estimates variance due to each source
Aaron Jones (BIOSTAT 790)
RM ANOVA
April 7, 2016
3 / 14
MANOVA vs. RM ANOVA
ANOVA: Gaussian linear (mixed) model with categorical predictors
How to extend to multivariate/correlated outcomes?
Multivariate ANOVA (MANOVA)
Compares residual covariance matrix to model covariance
Allows multivariate outcomes across different scales
No assumptions about covariance except symmetric, pos. def.
Cost: More degrees of freedom =⇒ lower power
Repeated Meaures ANOVA (RM ANOVA)
Compares sums of squares including subject-level random effect
Only makes sense for repeated measures of same variable
Requires stronger assumptions about covariance matrix
Benefit: Greater power than MANOVA when assumptions are met
Aaron Jones (BIOSTAT 790)
RM ANOVA
April 7, 2016
4 / 14
RM ANOVA Model
RM ANOVA (Mixed) Model:
yij = µij + πij + eij
yij : continuous response of subject i = 1, . . . , n at time j = 1, . . . , t
µij : fixed population mean at time j for individuals like individual i
Includes covariates and (non-subject-specific) time effects
πij : random subject effect for subject i at time j
E (yij |πij ) = µij + πij
eij : normally distributed random error for subject i at time j
Crowder and Hand (1990) trichotomy:
µij : ”immutable constant of the universe”
πij : ”lasting characteristic of the individual”
eij : ”fleeting aberration of the moment”
Aaron Jones (BIOSTAT 790)
RM ANOVA
April 7, 2016
5 / 14
RM ANOVA Model
Fundamental Assumptions:
2
E (πij ) = 0, Var(πij ) = σπj
2
E (eij ) = 0, Var(eij ) = σej
Cov(πij , πi 0 j ) = Cov(πij , πi 0 j 0 ) = 0
Cov(πij , πij 0 ) = σπjj 0 for i 6= i 0 , j 6= j 0
Cov(eij , ei 0 j 0 ) = 0 for i 6= i 0 , j 6= j 0
Cov(πij , ei 0 j 0 ) = 0 for all i, i 0 , j, j 0
2 ), e ∼ N(0, σ 2 )
Normality: πij ∼ N(0, σπj
ij
ej
Common (but Not Necessary) Simplifying Assumptions:
2 = σ 2 for all j
σπj
π
σπjj 0 constant for all j, j 0
2 = σ 2 for all j
σej
e
Aaron Jones (BIOSTAT 790)
RM ANOVA
April 7, 2016
6 / 14
RM ANOVA Model
Covariance:
Cov(yij , yi 0 j 0 ) = E [(yij − µij )(yi 0 j 0 − µi 0 j 0 )]
= E [(πij + eij )(πi 0 j 0 + ei 0 j 0 )]
= E [πij πi 0 j 0 + πij ei 0 j 0 + eij πi 0 j 0 + eij ei 0 j 0 ]
= E [πij πi 0 j 0 ] + 0 + 0 + E [eij ei 0 j 0 ]

2

if i = i 0 , j = j 0 ( 2
σπj
σej
= σπjj 0 if i = i 0 , j 6= j 0 +

0

0
if i 6= i 0

0
0
2
2

σπj + σej if i = i , j = j
= σπjj 0
if i = i 0 , j 6= j 0


0
if i 6= i 0
Aaron Jones (BIOSTAT 790)
RM ANOVA
if i = i 0 , j = j 0
otherwise
April 7, 2016
7 / 14
RM ANOVA Model
Correlation:
Observations are uncorrelated between subjects
Within-subject (intraclass) correlation:
σπjj 0
Corr(yij , yij 0 ) =
2 )]1/2
2
[(σπjj + σej )(σπj 0 j 0 + σej
0
2 = σ 2 and σ 0 = σ 2 :
Under simplifying assumptions that σej
πjj
e
π
Corr(yij , yij 0 ) = ρ =
Aaron Jones (BIOSTAT 790)
RM ANOVA
σπ2
σπ2 + σe2
April 7, 2016
8 / 14
One Sample RM ANOVA
yij = µ + πi + τj + eij
Source
SS
df
Time
Subjects
Residual
SST
SSS
SSR
t −1
n−1
(n − 1)(t − 1)
MS
E(MS)
T
MST = SS
t−1
SSS
MSS = n−1
SSR
MSR = (n−1)(t−1)
σe2 + nστ2
σe2 + tσπ2
σe2
Pt
Pt
2
2
i=1
j=1 (ȳ.j − ȳ.. ) = n
j=1 (ȳ.j − ȳ.. )
Pn Pt
P
SSS = i=1 j=1 (ȳi. − ȳ.. )2 = t ni=1 (ȳi. − ȳ.. )2
P P
SSR = ni=1 tj=1 (yij − ȳi. − ȳ.j + ȳ.. )2
T
F = MS
MSR ∼ Ft−1,(n−1)(t−1) under H0 : τj = 0 ∀ j and
SST =
Pn
Aaron Jones (BIOSTAT 790)
RM ANOVA
sphericity
April 7, 2016
9 / 14
Multiple Sample (Hierarchical) RM ANOVA
yij = µ + γh + τj + (γτ )hj + πi(h) + ehij
Source
SS
Group
Subjects(Group)
Time
Group × Time
Residual
SSG
SSS(G )
SST
SSGT
SSR
DG =
DT =
nt
s−1
ns
t−1
DGT =
df
s −1
n−s
t −1
(s − 1)(t − 1)
(n − s)(t − 1)
E(MS)
σe2 + tσπ2 + DG
σe2 + tσπ2
σe2 + DT
σe2 + DGT
σe2
Ps
2
h=1 γh
Pt
2
j=1 τj
P
Pt
s
n
2
h=1
j=1 (γτ )hj
(s−1)(t−1)
Aaron Jones (BIOSTAT 790)
RM ANOVA
April 7, 2016
10 / 14
Multiple Sample (Hierarchical) RM ANOVA
Pnh Pt
Ps
2
2
h=1 nh (ȳh.. − ȳ... )
h=1
j=1 (ȳh.. − ȳ... ) = t
i=1
P
P h Pt
Ps Pnh
2
2
SSS(G ) = sh=1 ni=1
j=1 (ȳhi. − ȳh.. ) = t
h=1
i=1 (ȳhi. − ȳh.. )
P
P h Pt
Pt
2
2
SST = sh=1 ni=1
j=1 (ȳ..j − ȳ... ) = n
j=1 (ȳ..j − ȳ... )
Ps Pnh Pt
SSGT = h=1 i=1 j=1 (yh.j − ȳh.. − ȳ..j + ȳ... )2
P
P h Pt
2
SSR = sh=1 ni=1
j=1 (yhij − ȳh.j − ȳhi. + ȳh.. )
SSG =
Ps
MSG
F = MS
∼ Fs−1,n−s under H0 : γh = (γτ )hj = 0 ∀ h, j
S(G )
and within-group covariance matrices equal
T
F = MS
MSR ∼ Ft−1,(n−s)(t−1) under H0 : τj = (γτ )hj = 0 ∀ h, j
and within-group covariance matrices equal, and sphericity
GT
F = MS
MSR ∼ F(s−1)(t−1),(n−s)(t−1) under H0 : (γτ )hj = 0 ∀ h, j
and within-group covariance matrices equal, and sphericity
Aaron Jones (BIOSTAT 790)
RM ANOVA
April 7, 2016
11 / 14
Sphericity
Assumption needed for F statistic to have F distribution with right df
Multiple ways to express sphericity:
1
Var(yij − yij 0 ) is constant for all j, j 0
2
2
3
2
t (σ̄ii −σ̄
P ..2) 2 2 = 1, where
= (t−1)(S−2t
σ̄i. +t σ̄.. )
σ̄ii is the mean of the entries on the main diagonal of Σ
σ̄.. is the mean of all the elements of Σ
σ̄i. is the mean of the entries in row i of Σ
S is the sum of the squares of the elements of Σ
Keselman, Algina & Kowalchuk: C 0 ΣC = λIt−1 , where
C is a normalized matrix of t − 1 orthogonal contrasts among t times
λ is a scalar
Mauchly test of sphericity: sensitive to sample size, non-normality
Aaron Jones (BIOSTAT 790)
RM ANOVA
April 7, 2016
12 / 14
Sphericity vs. Compound Symmetry
Compound symmetry =⇒ sphericity, but they are not equivalent
Var(yij ) = Var(yij 0 ) for all j, j 0 + sphericity =⇒ compound symmetry
Though mathematically possible, hard to imagine Var(yij ) 6= Var(yij 0 )
but covariances all happen to work out to sphericity
Conclusion: Compound symmetry not theoretically necessary for
sphericity and valid F tests, but practically it may as well be
Aaron Jones (BIOSTAT 790)
RM ANOVA
April 7, 2016
13 / 14
Lack of Sphericity
How to proceed when sphericity does not hold?
MANOVA
Sphericity replaced by equal within-group covariance matrices
Test whether the means of t − 1 differences are equal across groups
Four different test statistics summarize covariance matrix different ways
More degrees of freedom =⇒ lower power
Adjust degrees of freedom:
F ≈ F(t−1),(t−1)(n−1)
Greenhouse & Geisser: Plug in MLE ˆ estimated from sample
covariance matrix S
n(t−1)ˆ
Huynh & Feldt: Plug in ˜ = min 1, (t−1)(n−1−(t−1)ˆ
)
GG can be too conservative, especially for > 0.75 and n < 2t
HF is less biased than GG, performs better when > 0.75
Go back to (G)LMM
More flexibility to specify different covariance structures
So why try RM ANOVA at all? Adjusting df for valid F -test with
near-sphericity may still be more powerful than GLMM with more df
Aaron Jones (BIOSTAT 790)
RM ANOVA
April 7, 2016
14 / 14