Longitudinal Notes
Longitudinal Notes
Zhang
Daowen Zhang
[email protected]
http://www4.stat.ncsu.edu/∼dzhang2
Contents
1 Review and introduction to longitudinal studies 5
1.1 Review of 3 study designs . . . . . . . . . . . . . . . . . . 5
1.2 Introduction to longitudinal studies . . . . . . . . . . . . . 11
1.3 Data examples . . . . . . . . . . . . . . . . . . . . . . . . 12
1.4 Features of longitudinal data . . . . . . . . . . . . . . . . 20
1.5 Why longitudinal studies? . . . . . . . . . . . . . . . . . . 22
1.6 Challenges in analyzing longitudinal data . . . . . . . . . . 25
1.7 Methods for analyzing longitudinal data . . . . . . . . . . 30
1.8 Two-stage method for analyzing longitudinal data . . . . . 31
1.9 Analyzing Framingham data using two-stage method . . . 33
•
400
•• • •••
• • •
••
350
• •• ••
•• • •
• •• • ••
• • •• ••• • •••
Cholesterol level
•
• •• •• •• •• ••
•
300
• •• • ••
••• ••• •• • •••
••
• •• •• ••• •••
••• ••• ••• • •• •••
•• ••
••••
• ••• ••• ••
• ••• •• •••
250
•• •• •••
••• •• ••• •• • ••
•• ••• •• •• ••• ••
•
•• •• •••• •• • ••
••• •••
•
•• ••• ••• ••
200
• • • • •
• •• • •
• •
0 2 4 6 8 10
Time in years
0.15
0.06
Proportion of vitamin A deficiency
Proportion of respiratory infection
0.10
0.04
0.05
0.02
0.0
1 2 3 4 5 6 0.0 1 2 3 4 5 6
Seizure counts for progabide arm Seizure counts for control arm
150
150
Seizure counts
Seizure counts
100
100
50
50
0
0
0 1 2 3 4 0 1 2 3 4
Then
Yij = bi + eij .
yi = β0 + β1 agei + β2 sexi + ǫi .
yij = bi + eij ,
For j 6= k,
cov(yij , yik )
corr(yij , yik ) = p
var(yij )var(yik )
σb2
= .
σb2 + σe2
140
130
blood pressure
120
110
100
5 10 15 20 25
minute
and get estimates bbi0 , bbi1 of bi0 and bi1 . Here we assume that
subject i’s true response at time tij is given by
bi0 + bi1 tij ,
a straight line. Suppose t = 0 is the baseline, then bi0 is subject
i’s true response at baseline and bi1 is subject i’s change rate of
Graduate Summer Session in Epidemiology Slide 31
CHAPTER 1 Epid 766, D. Zhang
the true response (not y). The error term ǫij can be regarded
as measurement error.
2. Stage 2: Treat the summary statistics as new responses and
regress the summary statistics on one-time covariates. For
example, after we got bbi0 and bbi1 , we can calculate the means of
bbi0 and bbi1 and the standard errors of those means, compare bbi0 ,
bbi0 among genders, or do the following regressions
Note:
1. Similar to the blood pressure example, we can use the sample means
of bb0 and bb1 to estimate the means of b0 and b1 . Hence we can use
sample mean of bb1 (2.55) its SE (0.257) to answer the first objective
of this study.
2. However, since var(bbi0 ) and var(bbi1 ) contain variability due to
estimating the true baseline response bi0 and change rate bi1 for
individual i, so
Sample variances Sbb2 and Sbb2 are unbiased estimates of var(bbi0 ) and
0 1
• Stage II:
1. Try to compare E(b0 ) and E(b1 ) between males and females.
2. Try to compare var(b0 ) and var(b1 ) between males and females.
3. Try to examine the effects of age and sex on b0 using
bb0 = α0 + α1 sex + α2 age + e0 .
title "Test equality of mean and variance of intercepts and slopes between sexes";
proc ttest;
class sex;
var b0hat b1hat;
run;
title "Regression to look at the association between intercept and age, sex";
proc reg data=main;
model b0hat = sex age;
run;
title "Regression to look at the association between slope and age, sex";
proc reg data=main;
model b1hat = sex age;
run;
Variable: b1hat
sex N Mean Std Dev Std Err Minimum Maximum
0 97 1.7454 3.3567 0.3408 -14.0000 8.3000
1 103 3.3083 3.7282 0.3673 -11.3750 11.7429
Diff (1-2) -1.5629 3.5529 0.5027
sex Method Mean 95% CL Mean Std Dev 95% CL Std Dev
0 1.7454 1.0688 2.4219 3.3567 2.9417 3.9092
1 3.3083 2.5796 4.0369 3.7282 3.2793 4.3206
Diff (1-2) Pooled -1.5629 -2.5542 -0.5716 3.5529 3.2348 3.9410
Diff (1-2) Satterthwaite -1.5629 -2.5511 -0.5747
Method Variances DF t Value Pr > |t|
Pooled Equal 198 -3.11 0.0022
Satterthwaite Unequal 197.61 -3.12 0.0021
Equality of Variances
Method Num DF Den DF F Value Pr > F
Folded F 102 96 1.23 0.2996
Parameter Estimates
Parameter Standard
Variable DF Estimate Error t Value Pr > |t|
Intercept 1 138.21793 15.04083 9.19 <.0001
sex 1 -9.75053 5.47862 -1.78 0.0767
age 1 2.05576 0.34820 5.90 <.0001
Parameter Estimates
Parameter Standard
Variable DF Estimate Error t Value Pr > |t|
Intercept 1 6.14089 1.35288 4.54 <.0001
sex 1 1.73654 0.49279 3.52 0.0005
age 1 -0.10538 0.03132 -3.36 0.0009
What are random effects? Random effects are the covariate effects
that vary among subjects. So these effects are subject-specific and hence
are random (unobservable) since each subject is a random subject drawn
from a population.
Graduate Summer Session in Epidemiology Slide 49
CHAPTER 2 Epid 766, D. Zhang
where β’s are fixed effects of interest, bi ∼ N (0, σb2 ) are random effects,
εij ∼ N (0, σε2 ) are independent (measurement)errors.
Interpretation of the model components:
1. From model,
σb2
corr(yij , yij ′ ) = 2 =ρ
σb + σε2
•
8
• •
•
• •
•
••
••
• • •
•
6
• •
•
• • •
Response
•• •
• • •
• •
• •
•
4
• • •
• •
••
•
•
•
•
2
•
•
•
•
•
1 2 3 4 5
subject i at tij .
4. β0 + bi = the intercept for subject i =⇒ bi0 = deviation of intercept
of subject i from population intercept β0
5. β1 + bi1 = the slope for subject i =⇒ bi1 = deviation of slope of
subject i from population slope β1
6. V ar(bi0 + bi1 tij ) = σ00 + 2tij σ01 + t2ij σ11 = between-subject
variance (varying over time).
7. σε2 = within-subject variance.
8. Total variance of y: Var(yij ) = σ00 + 2tij σ01 + t2ij σ11 + σε2 , not a
constant over time.
9. Correlation between yij and yij ′ : not a constant over time.
•
14
•
•
12
•
•
•
•
10
• •
Response
•
• •
•
8
•
•
•
•
•
6
• •
• •
• ••
• •
4
• •
•
••• •
•
2
• • •
•
1 2 3 4 5
where ǫij are correlated normal errors (contains random effects and
εij ).
For example,
1. Compound symmetric (exchangeable) variance matrix
ǫi1 0 1 ρ ρ
ǫi2 ∼ N 0 , σ 2 ρ 1 ρ .
ǫi3 0 ρ ρ 1
If the time points are equally spaced, we can use type=ar(1) in the
repeated statement for AR(1) variance structure for Ui (t):
repeated cat_t / subject=id type=ar(1); /* cat_t is class t */
If the time points are equally spaced, we can use type=ar(1) in the
repeated statement if assuming AR(1) for Ui (t):
repeated cat_t / subject=id type=sp(pow)(t) local; /* cat_t is class t */
Hypothesis Testing
• After we fit a linear mixed model such as
SAS will output a test for each βk , including the estimate, SE,
p-value (for testing H0 : βk = 0), etc.
• If we want to test a contrast between βk , we can use estimate
statement in Proc Mixed. Then SAS will output the estimate, SE
for the contrast and the p-value for testing the contrast is zero. See
Programs 2 and 3 for Framingham data.
Therefore, β0 , β1 are fixed effects and ai0 , ai1 are random effects.
Graduate Summer Session in Epidemiology Slide 70
CHAPTER 2 Epid 766, D. Zhang
Iteration History
Iteration Evaluations -2 Res Log Like Criterion
0 1 10899.75433605
1 2 9960.12567386 0.00000120
2 1 9960.12082968 0.00000000
Fit Statistics
-2 Res Log Likelihood 9960.1
AIC (smaller is better) 9968.1
AICC (smaller is better) 9968.2
BIC (smaller is better) 9981.3
Fit Statistics
-2 Res Log Likelihood 9959.9
AIC (smaller is better) 9969.9
AICC (smaller is better) 9969.9
BIC (smaller is better) 9986.3
⋆ Note:
1. P-value for testing H0 : ρ = 0 is 0.6039, no strong evidence
against H0 .
2. All model selection criteria lead to iid error εij .
3. We usually don’t use the above output to test variances
because of the boundary issue.
β1 + βA E(age),
Here both σ00 and σ11 are the remaining variances in bi0 and bi1
after baseline age effect has been taken into account. So they
should be smaller than those corresponding values in model (2.1).
⋆ Basic model (2.1) becomes
yij = β0 + βC cent agei + β1 tij + βA cent agei × tij
+ai0 + ai1 tij + εij , (2.5)
Graduate Summer Session in Epidemiology Slide 78
CHAPTER 2 Epid 766, D. Zhang
Iteration History
Iteration Evaluations -2 Res Log Like Criterion
0 1 10826.01576300
1 2 9929.74817925 0.00000516
2 1 9929.72729664 0.00000000
Estimated G Matrix
Row Effect newid Col1 Col2
1 Intercept 1 1226.69 9.7829
2 time 1 9.7829 3.2598
Fit Statistics
-2 Res Log Likelihood 9929.7
AIC (smaller is better) 9937.7
Graduate Summer Session in Epidemiology Slide 80
CHAPTER 2 Epid 766, D. Zhang
Estimates
Standard
Label Estimate Error DF t Value Pr > |t|
long-cross 0.8296 0.4174 652 1.99 0.0473
⋆ Re-write the true baseline cholesterol level bi0 and the change
rate bi1 in model (2.1) in terms of conditional distribution given
gender and baseline age:
bi0 = β0 + sexi β0,sex + agei β0,age + ai0 (2.6)
bi1 = β1 + sexi β1,sex + agei β1,age + ai1 , (2.7)
where we assume that ai0 , ai1 have the following distribution
a 0 σ σ01
i0 ∼ N , 00 .
ai1 0 σ01 σ11
⋆ Then β0,sex , β0,age are the sex effect and baseline age effect on
the baseline cholesterol level. Of course, β0 does NOT have a
proper interpretation.
Graduate Summer Session in Epidemiology Slide 84
CHAPTER 2 Epid 766, D. Zhang
⋆ Similarly, β1,sex , β1,age are the sex effect and baseline age effect
on the change rate of the true cholesterol level, and β1 does
NOT have a proper interpretation.
⋆ Substituting the above expressions into model (2.1), we got
Estimated G Matrix
Row Effect newid Col1 Col2
1 Intercept 1 1209.89 13.5502
2 time 1 13.5502 2.5211
Fit Statistics
-2 Res Log Likelihood 9907.9
AIC (smaller is better) 9915.9
AICC (smaller is better) 9915.9
BIC (smaller is better) 9929.1
Estimates
Standard
Label Estimate Error DF t Value Pr > |t|
rate-diff 2.9441 0.5606 651 5.25 <.0001
⋆ Note: The models (2.6) and (2.7) for bi0 and bi1 are basically
the same as the second stage models in the two stage analysis
for the Framingham data.
⋆ Compare results from this model to the results from the
two-stage analysis:
Graduate Summer Session in Epidemiology Slide 91
CHAPTER 2 Epid 766, D. Zhang
400 •
•• • •••
• ID=2
• •
••
350
• •• ••
•• • •
• •• •• ••
• • •• ••• •• ••• ID=74
Cholesterol level
• •• •• •• • ••
• •
300
• •• • ••
••• •••••
••
•• •• •• •••
•
•• ••• •
••• ••• ••• • •• •••
• ••
••••
• ••• ••• ••
••• •• ••••
250
••• • •
••• •• ••• ••• ••• ••
•• ••• •• •• ••• ••
•
•••
• ••
• •••• •• •• ••
• ••• • ••• •••• ••
•••
200
ID=171
•• ••• ••• ••• ••
•
••
•• •• •• ••• •••• •••
• ••• ••• • ••
••• •
• • •
••• • •
•
150
• • • • •
• •• • •
• •
0 2 4 6 8 10
Time in years
⋆ The SAS program and its output for fitting above model are as
follows:
data cholst; set cholst;
gender=sex;
run;
title "Framingham data: do males have more stable (true) baseline";
title2 "cholesterol level and change rate than females?";
proc mixed data=cholst;
class newid gender;
model cholst = sex time sex*time / s;
random intercept time / type=un subject=newid group=gender g;
repeated / type=vc subject=newid;
run;
Iteration History
Iteration Evaluations -2 Res Log Like Criterion
0 1 10889.09479529
1 3 9939.57691271 0.00000317
2 1 9939.56399905 0.00000000
The Mixed Procedure
Convergence criteria met.
Estimated G Matrix
Row Effect newid gender Col1 Col2 Col3 Col4
1 Intercept 1 0 1402.47 -4.7015
2 time 1 0 -4.7015 1.8279
3 Intercept 1 1 1532.81 3.6119
4 time 1 1 3.6119 4.7970
Fit Statistics
-2 Res Log Likelihood 9939.6
AIC (smaller is better) 9953.6
AICC (smaller is better) 9953.7
BIC (smaller is better) 9976.7
Framingham data under H0: males and females have the same variance 1
matrices of baseline cholesterol level and change rate
The Mixed Procedure
Model Information
Data Set WORK.CHOLST
Dependent Variable cholst
Covariance Structures Unstructured, Variance
Estimated G Matrix
Row Effect newid Col1 Col2
1 Intercept 1 1465.85 -0.2516
2 time 1 -0.2516 3.2618
Fit Statistics
-2 Res Log Likelihood 9943.0
AIC (smaller is better) 9951.0
AICC (smaller is better) 9951.1
BIC (smaller is better) 9964.2
title "Framingham data: do males have more stable (true) baseline cholesterol";
title2 "level and change rate than females adjusting for sex and baseline age";
proc mixed data=cholst;
class newid gender;
model cholst = sex age time sex*time age*time / s;
random intercept time / type=un subject=newid group=gender g;
repeated / type=vc subject=newid;
run;
Estimated G Matrix
Row Effect newid gender Col1 Col2 Col3 Col4
1 Intercept 1 0 1403.04 -2.6077
2 time 1 0 -2.6077 1.5955
3 Intercept 1 1 1021.77 30.7768
4 time 1 1 30.7768 3.3214
Fit Statistics
-2 Res Log Likelihood 9901.6
AIC (smaller is better) 9915.6
AICC (smaller is better) 9915.7
BIC (smaller is better) 9938.7
• Note:
1. The choice of model, especially the fixed effects terms, depends
on the questions we need to answer. However, we can use AIC or
BIC to determine the random effects and the error structure.
2. If we want a model with the most prediction power, we can
consider a complicated model with AIC or BIC as a guide for
model selection.
3. It seems that model (2.8) is the winner among the above models
if we are looking for a model with the most prediction power.
What we observed:
1. Fixed effects estimates and variance-covariance parameter estimates
are exactly the same as those from model (2.8).
2. The SEs for the fixed effects estimates are different from those from
model (2.8). However, they are very close, indicating model (2.8)
has a reasonably good fit to the data and we don’t have to use the
GEE approach.
?
? ?
and assume x (such as age) is a completely observed variable.
2. Compare x for the two groups with observed y and missing y at
times 2 and 3 (using, say, two-sample t-test). A significant
difference indicates the violation of MCAR. Otherwise, you may feel
comfortable about the MCAR assumption.
Remark: MAR cannot be tested.
where the errors ǫij include random effects and other errors, and
hence are correlated. For example, ǫij = bi + εij for a random
intercept model.
• Model baseline outcome as a covariate. For example,
Comments:
1. There are some subtle difference between these two models. The
regression parameters β0 , β1 and the variance components have
different interpretation and hence we will get different estimates
from two models. β1 in model (3.1) is the overall effect of x on y,
Graduate Summer Session in Epidemiology Slide 114
CHAPTER 3 Epid 766, D. Zhang
Comments:
1. This model is different from models (3.1) and (3.2). Here β1 is the
adjusted effect of x on y after adjusting for the previous response.
Therefore, they have different interpretation.
2. Since we allow the current response depends on the previous
response in this model, part of the correlation among responses is
taken away by the coefficient β2 . Hence the errors may have much
simpler variance structure than the errors in model (3.1). In fact,
people often assume ǫij in (3.3) to be independent. This is an
Graduate Summer Session in Epidemiology Slide 116
CHAPTER 3 Epid 766, D. Zhang
Comments:
1. This model emphasizes the effect of x on the change (from baseline
value) of outcome. Therefore, β1 has different interpretation than
the β1 ’s in previous models.
2. Since we are modeling the difference, part of the correlation in the
responses due to among individual variation is removed. Therefore,
the errors in this model will have a simpler variance structure than
Graduate Summer Session in Epidemiology Slide 118
CHAPTER 3 Epid 766, D. Zhang
A simulation study
1. yi1 can be viewed as pre-test (or baseline) score, yi2 can be viewed
as post-test score for subject i.
2. In the simulation, we let yi2 be missing whenever the baseline
measurement yi1 is negative.
3. β1 = E(yi2 ) − E(yi1 ). We would like to make inference on β1 in the
presence of missing data.
Fit Statistics
-2 Res Log Likelihood 300.6
AIC (smaller is better) 304.6
AICC (smaller is better) 304.8
BIC (smaller is better) 308.4
The SAS System 5
The Mixed Procedure
Solution for Fixed Effects
Standard
Effect Estimate Error DF t Value Pr > |t|
Intercept 0.9146 0.2117 49 4.32 <.0001
time 2.0503 0.1987 37 10.32 <.0001
where Mean is the sample mean of 1000 βb1 ’s from both approaches;
SE is the sample mean of 1000 estimated SEs of βb1 ; SD is the sample
standard deviation of 1000 βb1 ’s; Cov. prob. is the empirical coverage
probability of 95% CI of β1 .
H0 : µ1 = µ2 vs HA : µ1 6= µ2 .
H0 : µA = µB vs HA : µA 6= µB
Comments:
1. When n = 1, the study reduces to a cross-sectional study and the
sample size formula reduces to the classical one.
2. When ρ = 0 (responses are independent), the required sample size is
1/n of that for classical study.
3. When ρ = 1, required sample size is the same as that of the classical
study.
4. For fixed n, smaller ρ gives smaller sample size.
5. If correlation is high, use more subjects and less obs/subject; if
correlation is low, use less subjects and more obs/subject.
6. The sample size formula depends on information on σ 2 and ρ.
7. One can choose a combination of m and n to meet one’s specific
needs.
8. The above formula is for two-sided test.
Graduate Summer Session in Epidemiology Slide 130
CHAPTER 3 Epid 766, D. Zhang
(1.96 + 0.84)2
m = 2(1 + 2ρ)
3∆2
∆
ρ 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8
0.2 733 184 82 46 30 21 15 12
0.3 838 210 94 53 34 24 18 14
0.4 942 236 105 59 38 27 20 15
0.5 1047 262 117 66 42 30 22 17
0.6 1152 288 128 72 47 32 24 18
0.7 1256 314 140 79 51 35 26 20
0.8 1361 341 152 86 55 38 28 22
Comments:
1. For fixed time points tj , larger ρ gives smaller sample size m.
2. If ρ = 1, one subject from each group is enough.
3. ρ = 0 will require maximum sample size m.
4. If correlation is low, use more subjects and less obs/subject; if
correlation is high, use less subjects and more obs/subject.
5. The sample size formula depends on information on σ 2 and ρ and
the placement of time points tj ’s.
6. One can choose a combination of m and n to meet one’s specific
needs.
7. The above formula is for two-sided test.
∆
ρ 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.10
0.2 2479 1102 620 397 276 203 155 123 100
0.3 2169 964 543 348 241 178 136 108 87
0.4 1859 827 465 298 207 152 117 92 75
0.5 1550 689 388 248 173 127 97 77 62
0.6 1240 551 310 199 138 102 78 62 50
0.7 930 414 233 149 104 76 59 46 38
0.8 620 276 155 100 69 51 39 31 25
• Recall that a linear mixed model for longitudinal data may take the
form:
• Key features:
1. Outcome yij is continuous and normally distributed.
2. Correlation in outcome observations from the same individuals is
directly modeled using random effects (e.g., random intercept
and slope).
• However,
1. in many biomedical studies, the outcome variables are discrete
Graduate Summer Session in Epidemiology Slide 136
CHAPTER 4 Epid 766, D. Zhang
• Continuous (Normal):
µ(x) = β0 + β1 x1 + · · · + βp xp
logit{π(x)} = β0 + β1 x1 + · · · + βp xp
Denote
yi1 µi1
yi2 µi2
yi = .. , µi = .. .
. .
yini µini
where g(µ) is the link function such as the logit function for binary
response and the log link for count data.
Graduate Summer Session in Epidemiology Slide 144
CHAPTER 4 Epid 766, D. Zhang
where
Σ = I0−1 I1 I0−1
m
X
I0 = DiT Vi−1 Di
i=1
Xm
I1 = DiT Vi−1 var(yi |xi )Vi−1 Di
i=1
Xm
= b
DiT Vi−1 (yi − µi (β))(y b T −1
i − µi (β)) Vi Di
i=1
where
var(yi1 |xi1 ) 0 ··· 0
0 var(yi2 |xi2 ) · · · 0
Ai = .. .. .. .. ,
. . . .
0 ··· 0 var(yini |xini )
3. AR(1):
ni −1
1 α ··· α
α 1 ··· α ni −2
Ri = .. .. .. ..
. . . .
αni −1 αni −2 ··· 1
∗∗
Pm
where N = i=1 (ni − 1) (total # of adjacent pairs).
4. Many more can be found in SAS.
• Software: Proc Genmod in SAS
logit(π) = β0 + β1 XE + β2 XC
where
1 exposure = yes 1 confounder = yes
XE = XC =
0 exposure = no 0 confounder = no
• Data:
⋆ 275 Indonesian preschool children.
⋆ Each was followed over 6 consecutive quarters.
⋆ Outcome = respiratory infection (yes/no)
⋆ Covariates: Xero (xerophthalmia (yes/no)), season, age, sex,
height (height for age)
• GEE logistic model: yij (1/0) = infection indicator ∼ Bin(1, πij ),
Response Profile
Ordered Total
Value infect Frequency
1 1 107
2 0 1093
PROC GENMOD is modeling the probability that infect=’1’.
Algorithm converged.
Some remarks:
• Proc Genmod in SAS fits the model using independence correlation
structure to get initial parameter estimate and get the estimate of
over-dispersion parameter (SAS does not output the initial estimates
now). We should read the output under “Analysis Of GEE
Parameter Estimates”, which is valid even if the correlation
structure we specified (it is exchangeable here) may not be true.
• Given other characteristics, the odds-ratio of getting respiratory
infection between two populations with or without Vitamin A
deficiency is estimated to be e0.5525 = 1.74. If respiratory infection
could be viewed as a rare disease, kids with Vitamin A deficiency
would be 74% more likely to develop respiratory infection. However,
p-value=0.2167 indicates that there is no significant difference in
infection risk for these two populations.
• Data:
⋆ 59 patients, 28 in control group, 31 in treatment (progabide)
group.
⋆ 5 seizure counts (including baseline) were obtained.
⋆ Covariates: treatment (covariate of interest), age.
• GEE Poisson model: yij =seizure counts obtained at the jth
(j = 0, 1, ..., 4) time point for patient i, yij ∼ over-dispersed
Poisson(µij ), µij = E(yij ) = tij λij , where tij is the length of time
from which the seizure count yij was observed, λij is hence the rate
to have a seizure. First consider model
• Interpretation of β’s:
Algorithm converged.
Algorithm converged.
Analysis Of GEE Parameter Estimates
Empirical Standard Error Estimates
Standard 95% Confidence
Parameter Estimate Error Limits Z Pr > |Z|
Intercept 1.3476 0.1574 1.0392 1.6560 8.56 <.0001
assign 0.1108 0.1161 -0.1168 0.3383 0.95 0.3399
trt 0.0265 0.2219 -0.4083 0.4613 0.12 0.9049
assign*trt -0.1037 0.2136 -0.5223 0.3150 -0.49 0.6274
Algorithm converged.
Algorithm converged.
Algorithm converged.
Algorithm converged.
6. Even though π b (x) has a logistic form in model (4.3), π(x) does
NOT have a logistic form. In particular:
logit{π(x)} 6= β0 + β1 x1 + · · · + βp xp .
6. For given x, the population event rate λ(x) (the event rate for
the population with covariate x) can be obtained through
• Why GLMMs?
1. We are interested in how the outcome variable is related to the
independent variables (covariates).
2. We are also interested in how individuals’ data vary from subject
to subject (between-subject variation). This can be modeled
through the use of random effects. The random effects have a
natural interpretation.
3. A GLMM is a likelihood-based model. So it requires much less
strong assumption for missing data mechanism. Only MAR
mechanism is required for a GLMM to make valid inference,
compared to MCAR for GEE approach.
4. The regression coefficients have a subject-specific interpretation,
and for some special GLMMs we can still (approximately) make
population level inference.
logit(π1b ) − logit(π0b ) = β2 ,
that is
π1b /(1 − π1b )
β2 = log .
π0b /(1 − π0b )
That is, β2 is the log odds-ratio of getting respiratory infection if a
subject becomes Vitamin A deficiency (from Vitamin A sufficiency).
Similar interpretation holds for continuous time-varying covariates.
• Interpretation of β5 (coefficient of a one-time covariate sex): Let
b
π1bi be the infection probability for subject i who is a boy and π0j be
the infection probability for subject j who is a girl. Assume they
have the same covariate values (except sex). Then
b
logit(π1bi ) − logit(π0j ) = β5 + (bi − bj ).
If bi ≈ bj , then
b
logit(π1bi ) − logit(π0j ) ≈ β5 ,
" #
bi bi
π1 /(1 − π1 )
β5 ≈ log bj bj
.
π0 /(1 − π0 )
That is, β5 is the log odds-ratio of getting respiratory infection
comparing a boy and a girl who are similar in other subject
characteristics except gender. Similar interpretation holds for
continuous one-time covariates.
See the SAS program indon mix.sas and its output
indon mix.lst for details.
Dimensions
G-side Cov. Parameters 1
Columns in X 7
Columns in Z per Subject 1
Subjects (Blocks in V) 275
Max Obs per Subject 6
Optimization Information
Optimization Technique Dual Quasi-Newton
Parameters in Optimization 8
Lower Boundaries 1
Upper Boundaries 0
Fixed Effects Not Profiled
Starting From GLM estimates
Quadrature Points 9
Iteration History
Objective Max
Iteration Restarts Evaluations Function Change Gradient
0 0 4 711.85214926 . 370.248
1 0 4 705.17377387 6.67837539 325.4556
2 0 4 701.66091706 3.51285681 63.11033
3 0 2 698.22850425 3.43241282 133.8429
4 0 2 694.02433064 4.20417361 29.58844
5 0 4 688.64294661 5.38138403 44.45273
6 0 2 684.7338452 3.90910141 36.74223
7 0 3 682.76342298 1.97042222 5.605872
8 0 2 680.11119418 2.65222880 49.52205
9 0 3 679.63453452 0.47665966 37.21899
10 0 2 679.03086357 0.60367095 34.80307
11 0 3 678.8643414 0.16652217 7.530059
12 0 3 678.86037714 0.00396426 2.913637
13 0 3 678.85888563 0.00149150 2.037862
14 0 2 678.85638762 0.00249801 1.749602
15 0 3 678.8553423 0.00104532 0.476605
16 0 3 678.85532391 0.00001839 0.072154
17 0 3 678.8553228 0.00000111 0.005773
Convergence criterion (GCONV=1E-8) satisfied.
Fit Statistics
-2 Log Likelihood 678.86
AIC (smaller is better) 694.86
AICC (smaller is better) 694.98
BIC (smaller is better) 723.79
CAIC (smaller is better) 731.79
HQIC (smaller is better) 706.47
where
µbij = E(yij |bi ) = tij λbij ,
λbij is the rate to have a seizure for subject i. Consider model
• Interpretation of β’s:
log(λb ) for random subject i
Group Before randomization After randomization
Control (trt=0) β0 + bi β0 + β1 + bi
Treatment (trt=1) β0 + bi β0 + β1 + β2 + bi
β1 : difference in log of rate of seizure counts comparing after
randomization and before randomization for a random subject in
control group (time effect).
β2 : difference in log of rate of seizure counts for a treated subject
compared to if he/she received a placebo (treatment effect).
• For more details of the result, see SAS program seize mix.sas and
its output seize mix.lst
• Remark: Since here we used the Poisson GLMM with log link and
a random intercept, so the regression coefficients (except the
intercept) also have population-average interpretation.
Graduate Summer Session in Epidemiology Slide 192
CHAPTER 4 Epid 766, D. Zhang
title "Random intercept model for seizure data with conditional overdispersion";
proc glimmix data=seizure;
class id;
model seize = assign agn_trt / dist=poisson link=log offset=logtime s;
random int / subject=id type=vc;
random _residual_; *for conditional overdispersion;
run;
Dimensions
G-side Cov. Parameters 1
R-side Cov. Parameters 1
Columns in X 3
Columns in Z per Subject 1
Subjects (Blocks in V) 59
Max Obs per Subject 5
Optimization Information
Optimization Technique Dual Quasi-Newton
Parameters in Optimization 1
Lower Boundaries 1
Upper Boundaries 0
Fixed Effects Profiled
Residual Variance Profiled
Starting From Data
Iteration History
Objective Max
Iteration Restarts Subiterations Function Change Gradient
0 0 4 609.19264304 0.49414053 0.000205
1 0 5 671.59595217 0.14411653 3.061E-6
2 0 3 675.96769701 0.01612221 0.000016
3 0 2 675.86073055 0.00032842 1.901E-8
4 0 1 675.85749753 0.00000336 3.111E-8
5 0 0 675.85746125 0.00000000 5.906E-6
Convergence criterion (PCONV=1.11022E-8) satisfied.
Fit Statistics
-2 Res Log Pseudo-Likelihood 675.86
Generalized Chi-Square 822.08
Gener. Chi-Square / DF 2.82