applied longitudinal data analysis:lecture notes

691
. ST 732 Applied Longitudinal Data Analysis Lecture Notes M. Davidian Department of Statistics North Carolina State University c 2005 by Marie Davidian

Upload: gump423

Post on 19-Jan-2016

476 views

Category:

Documents


37 download

DESCRIPTION

Presentation of Data analysis techniques

TRANSCRIPT

Page 1: Applied Longitudinal Data Analysis:Lecture Notes

.

ST 732Applied Longitudinal Data Analysis

Lecture Notes

M. Davidian

Department of Statistics

North Carolina State University

c©2005 by Marie Davidian

Page 2: Applied Longitudinal Data Analysis:Lecture Notes

TABLE OF CONTENTS ST 732, M. DAVIDIAN

Contents

1 Introduction and Motivation 1

1.1 Purpose of this course . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

1.2 Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

1.3 Statistical models for longitudinal data . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

1.4 Outline of the course . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

2 Review of matrix algebra 20

2.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20

2.2 Matrix notation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20

2.3 Matrix operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22

3 Random vectors and multivariate normal distribution 32

3.1 Preliminaries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32

3.2 Random vectors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39

3.3 The multivariate normal distribution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46

3.4 Multiple linear regression . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57

4 Introduction to modeling longitudinal data 68

4.1 Basic Statistical Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68

4.2 Sources of variation in longitudinal data . . . . . . . . . . . . . . . . . . . . . . . . . . . 73

4.3 Exploring mean and covariance structure . . . . . . . . . . . . . . . . . . . . . . . . . . 76

4.4 Popular models for covariance structure . . . . . . . . . . . . . . . . . . . . . . . . . . . 86

4.5 Diagnostic calculations under stationarity . . . . . . . . . . . . . . . . . . . . . . . . . . 92

4.6 Implementation with SAS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96

5 Univariate repeated measures analysis of variance 105

5.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105

5.2 Basic situation and statistical model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106

5.3 Questions of interest and statistical hypotheses . . . . . . . . . . . . . . . . . . . . . . . 121

5.4 Analysis of variance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129

5.5 Violation of covariance matrix assumption . . . . . . . . . . . . . . . . . . . . . . . . . . 132

i

Page 3: Applied Longitudinal Data Analysis:Lecture Notes

TABLE OF CONTENTS ST 732, M. DAVIDIAN

5.6 Specialized within-unit hypotheses and tests . . . . . . . . . . . . . . . . . . . . . . . . . 134

5.7 Adjusted tests . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144

5.8 Implementation with SAS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145

6 Multivariate repeated measures analysis of variance 172

6.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172

6.2 General multivariate problem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175

6.3 Hotelling’s T 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176

6.4 One-way MANOVA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179

6.5 Profile Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184

6.6 Implementation with SAS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188

7 Drawbacks and limitations of classical methods 201

7.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 201

7.2 Assumptions and restrictions of classical methods . . . . . . . . . . . . . . . . . . . . . . 201

8 General linear models for longitudinal data 208

8.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208

8.2 Simplest case – one group, balanced data . . . . . . . . . . . . . . . . . . . . . . . . . . 210

8.3 General case – several groups, unbalanced data, covariates . . . . . . . . . . . . . . . . . 212

8.4 Models for covariance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222

8.5 Inference by maximum likelihood . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 228

8.6 Restricted maximum likelihood . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 240

8.7 Discussion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243

8.8 Implementation with SAS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 247

8.9 Parameterizing models in SAS: Use of the noint option in SAS model statements in PROCGLM and PROC MIXED . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 296

8.10 Using SAS model, contrast, and estimate statements . . . . . . . . . . . . . . . . . . 305

9 Random coefficient models for multivariate normal data 308

9.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 308

9.2 Random coefficient model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 309

9.3 Inference on regression and covariance parameters . . . . . . . . . . . . . . . . . . . . . 323

ii

Page 4: Applied Longitudinal Data Analysis:Lecture Notes

TABLE OF CONTENTS ST 732, M. DAVIDIAN

9.4 Inference on individuals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 328

9.5 Discussion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 330

9.6 Basic PROC MIXED sytnax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 332

9.7 Implementation with SAS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 335

10 Linear mixed effects models for multivariate normal data 362

10.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 362

10.2 Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 362

10.3 General linear mixed effects model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 373

10.4 Inference on regression and covariance parameters . . . . . . . . . . . . . . . . . . . . . 375

10.5 Best linear unbiased prediction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 376

10.6 Testing whether a component is random . . . . . . . . . . . . . . . . . . . . . . . . . . . 385

10.7 Time-dependent covariates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 387

10.8 Discussion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 391

10.9 Implementation with SAS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 391

11 Generalized linear models for nonnormal response 422

11.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 422

11.2 Probability models for nonnormal data . . . . . . . . . . . . . . . . . . . . . . . . . . . . 424

11.3 Generalized linear models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 435

11.4 Maximum likelihood and iteratively reweighted least squares . . . . . . . . . . . . . . . 442

11.5 Discussion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 446

11.6 Implementation with SAS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 446

12 Population-averaged models for nonnormal repeated measurements 463

12.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 463

12.2 Population-averaged model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 467

12.3 Generalized estimating equations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 482

12.4 “Robust” estimator for sampling covariance . . . . . . . . . . . . . . . . . . . . . . . . . 486

12.5 Contrasting population-averaged and subject-specific approaches . . . . . . . . . . . . . 487

12.6 Discussion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 491

12.7 Implementation with SAS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 491

iii

Page 5: Applied Longitudinal Data Analysis:Lecture Notes

TABLE OF CONTENTS ST 732, M. DAVIDIAN

13 Advanced topics 517

13.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 517

13.2 Generalized linear mixed models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 517

13.3 Nonlinear mixed effects models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 520

13.4 Issues associated with missing data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 522

14 References 527

iv

Page 6: Applied Longitudinal Data Analysis:Lecture Notes

ST 732, SPRING 2005APPLIED LONGITUDINAL DATA ANALYSIS

COURSE INFORMATION

GOAL OF COURSETo introduce students to statistical models and methods for the analysis of longitudinal data, i.e.data collected repeatedly on experimental units over time (or other conditions).

INSTRUCTORMarie Davidian, 220-F Patterson Hall, 515-1940, [email protected] Hours T 2:30-3:30, or by appointment

MEETING TIMESTTh 11:20 am – 12:35 pm, Broughton 3216

REQUIRED TEXTLecture notes prepared by the instructor (see below). These may be purchased at the campusbookstore.

TEACHING ASSISTANTTae-Young Heo ([email protected] Hours Th 1:00-2:00 and F 11:00-12:00 in 9 Patterson Hall

PREREQUISITEST 512, Experimental Statistics for Biological Sciences II, or equivalent. Thus, students should befamiliar with basic notions of probability, random variables, and statistical inference, analysis ofvariance, and (multiple) linear regression. Familiarity with matrix algebra is also useful. We willreview matrix algebra at the beginning of the course and make considerable use of matrix notationand operations throughout. ST 512 involves the use of the SAS (Statistical Analysis System)software package; thus, students are expected to have had some exposure to the use of SAS. Thecourse is meant to be accessible both to non-majors and majors. The underlying mathematicaltheory will not be stressed, and the main focus will be on concepts and applications. Please seethe instructor if you have questions about the suitability of your background.

COURSE CONDUCT

Lectures: We will follow mimeographed lecture notes prepared by the instructor. In-class lectureswill follow the notes; the notes will be projected and discussed, so you will want to bring yourcopy so that you may follow along.

Homework: Homework will be assigned approximately once every two weeks. As the focus of theclass is on the practical application of methods for longitudinal data analysis, many of theproblems will involve using statistical software to carry out analyses on real data sets. Toimplement the analyses, we will use SAS; examples of the use of this software are includedin the lecture notes and will be discussed in class (see below). The principles underlying themethods we will learn involve much philosophy and subjectivity; thus, each homework willalso include “essay”-type questions to help you to clarify your thinking on these matters.

Page 7: Applied Longitudinal Data Analysis:Lecture Notes

Homework will be collected at the beginning of class on the date it is due. It should beneat, all work should be shown, and no late homework accepted unless prearrangedwith the instructor. There will be no exceptions to this policy.

For problems where SAS programs are assigned, both the program and its output shouldbe included. Students are encouraged to consult one another on homework problems, buteveryone should turn in their own homework, and no “blind copying” permitted. All studentsshould do their own programming!

Computing: Students may use SAS on the campus network. Alternatively, students with accessto SAS somewhere else (PCs in your department or at home, at work, etc) may use whateversystem is most convenient. Please see the instructor if you have any questions. All datasets to be analyzed as part of homework assignments will be available on the class web page(http://www.stat.ncsu.edu/~st732_info/Davidian).

Tests: We will have 2 tests during the semester. These will be in-class. The tests are tentativelyscheduled as follows:

1. Test 1, Tuesday, March 22.

2. Test 2, Tuesday, May 3 (the final exam day).

Although it will take place on the scheduled final exam day, Test 2 will not be a cumulativefinal exam; rather, it will involve material covered since Test 1.

Data Analysis Project: Students will carry out an analysis of data collected in a study that willbe described in detail in the assignment using methods covered in the class (which methodsare relevant is to be determined by the student). Students will need to formalize the scientificquestions posed by the investigator, carry out the appropriate analyses, interpret the results,and write a comprehensive report for the investigator reporting on all of these activities. Theassignment will be handed out on March 29 and will be due on the last day of class, Thursday,April 28.

Final Exam Date: Tuesday, May 3, 2005, 8:00 – 11:00 am. As discussed above, there will be noin-class final exam; Test 2 will be held at this time.

Grading: All homeworks and tests will be graded on a scale of 0 to 100. A numerical final scoreon this scale will be determined according to the following breakdown:

Homework 15%

Test 1 30%

Test 2 30%

Project 25%

Conversion of these scores into letter grades will be made according to the following (theupper score in each range belongs to the next highest grade): A, 92–100; A−, 90–92; B+, 86–90; B, 79–86; B−, 75–79. C, 70–75. Scores below 70 will be handled on a case-by-case basis.The grade of A+ will be given at the discretion of the instructor for truly stellar individualperformance. Depending on overall class performance, these ranges may be adjusted (butonly downward – criteria will only become easier, not harder).

Page 8: Applied Longitudinal Data Analysis:Lecture Notes

OUTLINE OF COURSE TOPICS

1. Preliminaries:IntroductionReview of matrix algebraRandom vectors, multivariate normal distribution, review of linear regressionIntroduction to modeling longitudinal data, exploring covariance structure

2. Classical methods for normally distributed, balanced repeated measurements:Univariate repeated measures analysis of varianceMultivariate repeated measures analysis of varianceDrawbacks and limitations of classical methods

3. Methods for normally distributed, unbalanced repeated measurements:General linear models and models for correlationRandom coefficient modelsLinear mixed effects models

4. Methods for non-normally distributed, unbalanced data:Probability models for discrete and continuous nonnormal data and generalized linear modelsGeneralized estimating equations for population-averaged models

5. Advanced topics (brief overview):Generalized linear mixed effects modelsNonlinear mixed effects modelsMissing data mechanisms

Page 9: Applied Longitudinal Data Analysis:Lecture Notes

REFERENCE TEXTSStudents may find the following texts useful for more in-depth mathematical treatment ofcourse topics or alternative perspectives, although none of these is required:

Crowder, M.J. and Hand, D.J. (1990) Analysis of Repeated Measures. London: Chapmanand Hall/CRC Press.

Davidian, M. and Giltinan, D.M. (1995) Nonlinear Models for Repeated Measurement Data.London: Chapman and Hall/CRC Press.

Diggle, P.J., Heagerty, P., Liang, K.-Y., and Zeger, S.L. (2002) Analysis of LongitudinalData, 2nd Edition. New York: Oxford University Press.

Fitzmaurice, G.M., Laird, N.M., and Ware, J.H. (2004) Applied Longitudinal Analysis. NewYork: Wiley.

Hand, D. and Crowder, M. (1996) Practical Longitudinal Data Analysis. New York: Chap-man and Hall/CRC Press.

Lindsey, J.K. (1993) Models for Repeated Measurements. New York: Oxford UniversityPress.

Littell, R.C., Milliken, G.A., Stroup, W.A., and Wolfinger, R.D. (1996) SAS System forMixed Models, SAS Institute, Cary NC.

Longford, N.T. (1993) Random Coefficient Models. New York: Oxford University Press.

Pinheiro, J.C. and Bates, D.M. (2000) Mixed Effects Models in S and S-PLUS. New York:Springer.

Verbeke, G. and Molenberghs, G. (2000) Linear Mixed Models for Longitudinal Data. NewYork: Springer. Oxford: Oxford University Press.

Vonesh, E.F. and Chinchilli, V.M. (1997) Linear and Nonlinear Models for the Analysis ofRepeated Measurements. New York: Marcel Dekker.

Page 10: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 1 ST 732, M. DAVIDIAN

1 Introduction and Motivation

1.1 Purpose of this course

OBJECTIVE: The goal of this course is to provide an overview of statistical models and methods that

are useful in the analysis of longitudinal data; that is, data in the form of repeated measurements

on the same unit (human, plant, plot, sample, etc.) over time.

Data are routinely collected in this fashion in a broad range of applications, including agriculture and

the life sciences, medical and public health research, and physical science and engineering. For example:

• In agriculture, a measure of growth may be taken on the same plot weekly over the growing season.

Plots are assigned to different treatments at the start of the season.

• In a medical study, a measure of viral load (roughly, amount of HIV virus present in the body)

may be taken at monthly intervals on patients with HIV infection. Patients are assigned to take

different treatments at the start of the study.

Note that a defining characteristic of these examples is that the same response is measured repeatedly

on each unit; i.e. viral load is measured again and again on the same subject. This particular type of

data structure will be the focus of this course.

The scientific questions of interest often involve not only the usual kinds of questions, such as how the

mean response differs across treatments, but also how the change in mean response over time

differs and other issues concerning the relationship between response and time. Thus, it is necessary to

represent the situation in terms of a statistical model that acknowledges the way in which the data

were collected in order to address these questions. Complementing the models, specialized methods of

analysis are required.

In this course, we will study ways to model these data, and we will explore both classical and more

recent approaches to analyzing them. Interest in the best ways to represent and interpret longitudinal

data has grown tremendously in recent years, and a number of new powerful statistical techniques have

been developed. We will discuss these techniques in some detail.

PAGE 1

Page 11: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 1 ST 732, M. DAVIDIAN

TERMINOLOGY: Although the term longitudinal naturally suggests that data are collected over

time, the models and methods we will discuss are more broadly applicable to any kind of repeated

measurement data. That is, although repeated measurement most often takes place over time, this is

not the only way that measurements may be taken repeatedly on the same unit. For example,

• The units may be human subjects. For each subject, reduction in diastolic blood pressure is

measured on several occasions, each occasion involving administration of a different dose of an

anti-hypertensive medication. Thus, the subject is measured repeatedly over dose.

• The units may be trees in a forest. For each tree, measurements of the diameter of the tree are

made at several different points along the trunk of the tree. Thus, the tree is measured repeatedly

over positions along the trunk.

• The units may be pregnant female rats. Each rat gives birth to a litter of pups, and the birthweight

of each pup is recorded. Thus, the rat is measured repeatedly over each of her pups.

The third example is a bit different from the other two in that there is no natural order to the repeated

measurements.

Thus, the methods will apply more broadly than the strict definition of the term longitudinal data

indicates – the term will mean, to us, data in the form of repeated measurements that may well be

over time, but may also be over some other set of conditions. Because time is most often the condition

of measurement, however, many of our examples will indeed involve repeated measurement over time.

We will use the term response to denote the measurement of interest. Because units are often human

or animal subjects, we use the terms unit, individual, and subject interchangeably.

1.2 Examples

To put things into firmer perspective, we consider several real datasets from a variety of applications.

These will not only provide us with concrete examples of longitudinal data situations, but will also serve

to illustrate the range of ways that data may be collected and the types of measurements that may be

of interest.

PAGE 2

asus
Note
diastolic adj. 心脏舒张的
asus
Note
diameter [dai5AmitE] n. 直径
Page 12: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 1 ST 732, M. DAVIDIAN

EXAMPLE 1: The orthodontic study data of Potthoff and Roy (1964).

A study was conducted involving 27 children, 16 boys and 11 girls. On each child, the distance (mm)

from the center of the pituitary to the pterygomaxillary fissure was made at ages 8, 10, 12, and 14 years

of age. In Figure 1, the distance measurements are plotted against age for each child. The plotting

symbols denote girls (0) and boys (1), and the trajectory for each child is connected by a solid line so

that individual child patterns may be seen.

Figure 1: Orthodontic distance measurements (mm) for 27 children over ages 8, 10, 12, 14. The plotting

symbols are 0’s for girls, 1’s for boys.

age (years)

dist

ance

(m

m)

8 9 10 11 12 13 14

2025

30

0 0 0

0

0

0

0

0

0

0

0

1

1

1

1

1

1

1

1

1

1

1

1

1

11

1

0

0

0 0

0

0

0 0

0

0

01

11

1

1

1

11

1

1

11

1

1

1

1 0

0 0 0

0

0

0 0

0

0

0

1

1

1

1

1

1

11

11

11

111

1 0

0 0 0

0

0

0

0

0

0

0

1

1

11

1

1

1

11

1

1

1

1

1

1

1

Dental Study Data

Plots like Figure 1 are often called spaghetti plots, for obvious reasons!

The objectives of the study were to

• Determine whether distances over time are larger for boys than for girls

• Determine whether the rate of change of distance over time is similar for boys and girls.

PAGE 3

Page 13: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 1 ST 732, M. DAVIDIAN

Several features are notable from the plot of the data:

• It appears that each child has his/her own trajectory of distance as a function of age. For any

given child, the trajectory looks roughly like a straight line, with some fluctuations. But from

child to child, features of the trajectory (e.g., its steepness), vary. Thus, the trajectories are all of

similar form, but vary in their specific characteristics among children. Note the one unusual boy

whose pattern fluctuates more profoundly than those of the other children and the one girl who

is much “lower” than the others.

• The overall trend is for the distance measurement to increase with age. The trajectories for some

children exhibit strict increase with age, while others show some intermittent decreases, but still

with an overall increasing trend across the entire 6 year period.

• The distance trajectories for boys seem for the most part to be “higher” than those for girls –

most of the boy profiles involve larger distance measurements than those for girls. However, this is

not uniformly true: some girls have larger distance measurements than boys at some of the ages.

• Although boys seems to have larger distance measurements, the rate of change of the measure-

ments with increasing age seems similar. More precisely, the slope of the increasing (approximate

straight-line) relationship with age seems roughly similar for boys and girls. However, for any

individual boy or girl, the rate of change (slope) may be steeper or shallower than the evident

“typical” rate of change.

To address the questions of interest, it is clear that some formal way of representing the fact that each

child has an individual-specific trajectory is needed. Within such a representation, a formal way of

stating the questions is required.

PAGE 4

Page 14: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 1 ST 732, M. DAVIDIAN

EXAMPLE 2: Vitamin E diet supplement and growth of guinea pigs.

The following data are reported by Crowder and Hand (1990, p. 27) The study concerned the effect

of a vitamin E diet supplement on the growth of guinea pigs. 15 guinea pigs were all given a growth-

inhibiting substance at the beginning of week 1 of the study (time 0, prior to the first measurement),

and body weight was measured at the ends of weeks 1, 3, and 4. At the beginning of week 5, the pigs

were randomized into 3 groups of 5, and vitamin E therapy was started. One group received zero dose

of vitamin E, another received a low dose, and the third received a high dose. The body weight (g)

of each guinea pig was measured at the end of weeks 5, 6, and 7. In Figure 2, the data for the three

dose groups are plotted on three separate graphs; the plotting symbol is the ID number (1–15) for each

guinea pig. The plotting is similar to that for the dental data.

Figure 2: Growth of guinea pigs receiving different doses of vitamin E diet supplement. Pigs 1–5 received

zero dose, pigs 6–10 received low dose, pigs 11–15 received high dose.

0 2 4 6 8

400

450

500

550

600

650

700

750

Weeks

Bod

y W

eigh

t (g)

1 1

1 1

1

12

2

22

2

2

3

3

33

3

3

4

4

44

4 4

55

55

55

Zero dose

0 2 4 6 8

400

450

500

550

600

650

700

750

Weeks

Bod

y W

eigh

t (g)

6

6 6

6

6

6

7

7

7

7

7 7

8

8 88 8

8

9

99

9

9

9

10

10

1010

10

10

Low dose

0 2 4 6 8

400

450

500

550

600

650

700

750

Weeks

Bod

y W

eigh

t (g)

11

11

11 11 11

11

12

12

12

1212

12

13

13

1313

13

13

1414

1414

1414

15

15

1515 15

15

High dose

0 2 4 6 8

400

450

500

550

600

650

700

750

Weeks

Bod

y W

eigh

t (g)

Zero doseLow doseHigh dose

Sample averages

The primary objective of the study was to

• Determine whether the growth patterns differed among the three groups.

PAGE 5

asus
Note
inhibit [in5hibit] 抑制, 约束, [化][医]抑制
Page 15: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 1 ST 732, M. DAVIDIAN

As with the dental data, several features are evident:

• For the most part, the trajectories for individual guinea pigs seem to increase overall over the

study period (although note pig 1 in the zero dose group). Different guinea pigs in the same dose

group have different trajectories, some of which look like a straight line and others of which seem

to have a “dip” at the beginning of week 5, the time at which vitamin E was added in the low

and high dose groups.

• The trajectories for the zero dose group seem somewhat “lower” than those in the other dose

groups.

• It is unclear whether the rate of change in body weight on average is similar or different across

dose groups. In fact, it is not clear that the pattern for either individual pigs or “on average”

is a straight line, so the rate of change may not be constant. Because vitamin E therapy was

not administered until the beginning of week 5, we might expect two “phases,” before and after

vitamin E, making things more complicated.

Again, some formal framework for representing this situation and addressing the primary research

question is required.

EXAMPLE 3: Growth of two different soybean genotypes.

This study was conducted by Colleen Hudak, a former student in the Department of Crop Science at

North Carolina State University, and is reported in Davidian and Giltinan (1995, p. 7). The goal was

to compare the growth patterns of two soybean genotypes, a commercial variety, Forrest (F) and an

experimental strain, Plant Introduction #416937 (P). Data were collected in each of three consecutive

years, 1988–1990. In each year, 8 plots were planted with F, 8 with P. Over the course of the growing

season, each plot was sampled at approximate weekly intervals. At each sampling time, 6 plants were

randomly selected from each plot, leaves from these plants were mixed together and weighted, and an

average leaf weight per plant (g) was calculated. In Figure 3, the data from the 8 F plots and 8 P plots

for 1989 are depicted.

The primary objective of the study was

• To compare the growth characteristics of the two genotypes.

PAGE 6

Page 16: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 1 ST 732, M. DAVIDIAN

Figure 3: Average leaf weight/plant profiles for 8 plots planted with Forrest and 8 plots planted with PI

#416937 in 1989.

0 20 40 60 80

05

1015

2025

Days After Planting

Leaf

Wei

ght/P

lant

(g)

1 1 11

1

1

11

2 2 22

2

2

22

3 3 3 33

3

3

3

4 4 44

4

4

4 4

5 5 5 5

5

5

55

6 6 6 66

6

6

6

7 7 7 77

7

7

7

8 8 88

8

88

8

Genotype F

0 20 40 60 80

05

1015

2025

Days After PlantingLe

af W

eigh

t/Pla

nt (

g)

1 1 1

1

1

1

1

1

2 2 2

22

2

2

2

3 3 3

3

3

3

3

3

4 4 44

4

4

4

4

5 5 55

5

5

5

5

6 66

6

6

6

6

6

7 77

7

7

7

77

8 88 8

8

8

8

8

Genotype P

From the figure, several features are notable:

• If we focus on the trajectory of a particular plot, we see that, typically, the growth begins slowly,

with not much change over the first 3–4 observation times. Then, growth begins increasing at a

faster rate in the middle of the season.

• Toward the end of the season, growth appears to begin “leveling off.” This makes sense – soybean

plants may only grow so large, so their leaf weight cannot increase without bound forever!

• Overall, then, the trajectory for any one plot does not appear to have the rough form of a straight

line as in the previous two examples, with an apparent constant rate of change over the observation

period. Rather, the form of the trajectory seems more complicated, with almost an “S” type shape.

It is thus clear that trying to characterize differences in growth characteristics will involve more

than simply comparing rate of change over the season.

PAGE 7

Page 17: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 1 ST 732, M. DAVIDIAN

In fact, the investigators realized that the growth pattern would not be as simple as an apparent straight

line. They knew that growth would tend to “level off” toward the end of the season; thus, a more precise

statement of their primary objective was

• To compare the apparent “limiting” average leaf weight/plant between the 2 genotypes.

• To compare the way in which growth accelerates during the middle of the growing season.

• To compare the apparent initial average leaf weight/plant.

From Figure 3, it seems that average leaf weight/plant achieves “higher” limiting growth for genotype

P relative to genotype F. That is, the “leveling off” seems to begin at lower values of the response for

genotype F. The two genotypes seem to start off at roughly same value. It is difficult to make a simple

statement about the relative rates of growth from the figure. Naturally, the investigators would like to

be able to be more formal about these observations.

As it so happened, weather patterns differed considerably over the three years of the experiment: in

1988, conditions were unusually dry; in 1989, they were unusually wet; and conditions in 1990 were

relatively normal. Thus, comparison of growth patterns across the different weather patterns as well

as how the weather patterns affected the comparison of growth characteristics between genotypes, was

also of interest.

SO FAR: In the three examples we have considered, the measurement of interest is continuous in

nature. That is,

• Distance (mm) from the center of the pituitary to the pterygomaxillary fissure

• Body weight (g)

• Average leaf weight/plant (g)

all may in principle take on any possible value in a particular range. How precisely we observe the value

of the response is limited only by the precision of the measuring device we use.

In some situations, the response of interest is not continuous; rather, it is discrete in nature. That

is, the values that we may observe differ by fixed amounts. For definiteness, we consider 2 additional

examples:

PAGE 8

Page 18: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 1 ST 732, M. DAVIDIAN

EXAMPLE 4: Epileptic seizures and chemotherapy.

A common situation is where the measurements are in the form of counts. A response in the form of

a count is by nature discrete – counts (usually) take only nonnegative integer values (0, 1, 2, 3, . . .).

The following data were first reported by Thall and Vail (1990). A clinical trial was conducted in which

59 people with epilepsy suffering from simple or partial seizures were assigned at random to receive

either the anti-epileptic drug progabide (subjects 29–59) or an inert substance (a placebo, subjects

1–28) in addition to a standard chemotherapy regimen all were taking. Because each individual might

be prone to different rates of experiencing seizures, the investigators first tried to get a sense of this

by recording the number of seizures suffered by each subject over the 8-week period prior to the start

of administration of the assigned treatment. It is common in such studies to record such baseline

measurements, so that the effect of treatment for each subject may be measured relative to how that

subject behaved before treatment.

Following the commencement of treatment, the number of seizures for each subject was counted for

each of four, two-week consecutive periods. The age of each subject at the start of the study was also

recorded, as it was suspected that the age of the subject might be associated with the effect of the

treatment somehow.

The data for the first 5 subjects in each treatment group are summarized in Table 1.

Table 1: Seizure counts for 5 subjects assigned to placebo (0) and 5 subjects assigned to progabide (1).

Period

Subject 1 2 3 4 Trt Baseline Age

1 5 3 3 3 0 11 312 3 5 3 3 0 11 303 2 4 0 5 0 6 254 4 4 1 4 0 8 365 7 18 9 21 0 66 22...

29 11 14 9 8 1 76 1830 8 7 9 4 1 38 3231 0 4 3 0 1 19 2032 3 6 1 3 1 10 3033 2 6 7 4 1 19 18

The primary objective of the study was to

• Determine whether progabide reduces the rate of seizures in subjects like those in the trial.

PAGE 9

Page 19: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 1 ST 732, M. DAVIDIAN

Here, we have repeated measurements (counts) on each subject over four consecutive observation periods

for each subject. Obviously, we would like to compare somehow the baseline seizure counts to post-

treatment counts, where the latter are observed repeatedly over time following initiation of treatment.

Clearly, an appropriate analysis would make the best use of this feature of the data in addressing the

main objective.

Moreover, note that some of the counts are quite small; in fact, for some subjects, 0 seizures (none)

were experienced in some periods. For example, subject 31 in the treatment group experienced only 0,

3, or 4 seizures over the 4 observation periods. Clearly, pretending that the response is continuous

would be a lousy approximation to the true nature of the data! Thus, it seems that methods suitable

for handling continuous data problems like the first three examples here would not be appropriate for

data like these.

To get around this problem, a common approach to handling data in the form of counts is to transform

them to some other scale. The motivation is to make them seem more “normally distributed” with

constant variance, and the square root transformation is used to (hopefully) accomplish this. The

desired result is that methods that are usually used to analyze continuous measurements may then be

applied.

However, the drawback of this approach is that one is no longer working with the data on the orig-

inal scale of measurement, numbers of seizures in this case. The statistical models being assumed

by this approach describe “square root number of seizures,” which is not particularly interesting nor

intuitive. Recently, new statistical methods have been developed to allow analysis of discrete repeated

measurements like counts on the original scale of measurement.

EXAMPLE 5: Maternal smoking and child respiratory health.

Another common discrete data situation is where the response is binary; that is, the response may

take on only two possible values, which usually correspond to things like

• “success” or “failure” of a treatment to elicit a desired response

• “presence” or “absence” of some condition

Clearly, it would be foolish to even try and pretend such data are approximately continuous!

PAGE 10

Page 20: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 1 ST 732, M. DAVIDIAN

The following data come from a very large public health study called the Six Cities Study, which was

undertaken in six small American cities to investigate a variety of public health issues. The full situation

is reported in Lipsitz, Laird, and Harrington (1992). The current study was focused on the association

between maternal smoking and child respiratory health. Each of 300 children was examined once a year

at ages 9–12. The response of interest was “wheezing status,” a measure of the child’s respiratory health,

which was coded as either “no” (0) or “yes” (1), where “yes” corresponds to respiratory problems. Also

recorded at each examination was a code to indicate the mother’s current level of smoking: 0 = none,

1 = moderate, 2 = heavy.

The data for the first 5 subjects are summarized in Table 1.2.

Table 2: Data for 5 children in the Six Cities study. Missing data are denoted by a “.”

Smoking at age Wheezing at age

Subject City 9 10 11 12 9 10 11 12

1 Portage 2 2 1 1 1 0 0 02 Kingston 0 0 0 0 0 0 0 03 Portage 1 0 0 . 0 0 0 .4 Portage . 1 1 1 . 1 0 05 Kingston 1 . 1 2 0 . 0 1

The objective of an analysis of these data was to

• Determine how the typical “wheezing” response pattern changes with age

• Determine whether there is an association between maternal smoking severity and child respiratory

status (as measured by “wheezing”).

Note that it would be pretty pointless to plot the responses as a function of age as we did in the

continuous data cases – here, the only responses are 0 or 1! Inspection of individual subject data does

suggest that there is something going on here; for example, note that subject 5 did not exhibit positive

wheezing status until his/her mother’s smoking increased in severity.

This highlights the fact that this situation is complex: over time (measured here by age of the child),

an important characteristic, maternal smoking, changes. Contrast this with the previous situations,

where a main focus is to compare groups whose membership stays constant over time.

PAGE 11

Page 21: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 1 ST 732, M. DAVIDIAN

Thus, we have repeated measurements, where, to further complicate matters, the measurements

are binary! As with the count data, one might first think about trying to summarize and transform

the data to allow (somehow) methods for continuous data to be used; however, this would clearly be

inappropriate. As we will see later in the course, methods for dealing with repeated binary responses

and scientific questions like those above have been developed.

Another feature of these data is the fact that some measurements are missing for some subjects.

Specifically, although the intention was to collect data for each of the four ages, this information is not

available for some children and their mothers at some ages; for example, subject 3 has both the mother’s

smoking status and wheezing indicator missing at age 12. This pattern would suggest that the mother

may have failed to appear with the child for this intended examination.

A final note: In the other examples, units (children, guinea pigs, plots, patients) were assigned to

treatments; thus, these may be regarded as controlled experiments, where the investigator has some

control over how the factors of interest are “applied” to the units (through randomization). In contrast,

in this study, the investigators did not decide which children would have mothers who smoke; instead,

they could only observe smoking behavior of the mothers and wheezing status of their children. That

is, this is an example of an observational study. Because it may be impossible or unethical to

randomize subjects to potentially hazardous circumstances, studies of issues in public health and the

social sciences are often observational.

As in many observational studies, an additional difficulty is the fact that the thing of interest, in this

case maternal smoking, also changes with the response over time. This leads to complicated issues of

interpretation in statistical modeling that are a matter of some debate. We will discuss these issues in

our subsequent development.

SUMMARY: These five examples illustrate the broad range of applications where data in the form of

repeated measurements may arise. The response of interest may be continuous or discrete. The

questions of interest may be focused on very specific features of the trajectories, e.g. “limiting growth,”

or may involve vague questions about the form of the “typical” trajectory.

1.3 Statistical models for longitudinal data

In this course, we will discuss a number of approaches for modeling data like those in the examples and

describe different statistical methods for addressing questions of scientific interest within the context of

these models.

PAGE 12

Page 22: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 1 ST 732, M. DAVIDIAN

STATISTICAL MODELS: A statistical model is a formal representation of the way in which data

are thought to arise, and the features of the model dictate how questions of interest may be stated

unambiguously and how the data should be manipulated and interpreted to address the questions.

Different models embody different assumptions about how the data arise; thus, the extent to which

valid conclusions may be drawn from a particular model rests on how relevant its assumptions are to

the situation at hand.

Thus, to appreciate the basis for techniques for data analysis and use them appropriately, one must

refer to and understand the associated statistical models. This connection is especially critical in the

context of longitudinal data, as we will see.

Formally, a statistical model uses probability distributions to describe the mechanism believed to generate

the data. That is, responses are represented by a random variables whose probability distributions are

used to describe the chances that a response takes on different values. How responses arise may involve

many factors; thus, how one “builds” a statistical model and decides which probability distributions are

relevant requires careful consideration of the features of the situation.

RANDOM VECTORS: In order to

• elucidate the assumptions made under different models and methods and make distinctions among

them

• describe the models and methods easily

it is convenient to think of all responses collected on the same unit over time or other set of conditions

together, so that complex relationships among them may be summarized.

Consider the random variable

Yij = the jth measurement taken on unit i.

To fix ideas, consider the dental study data in Figure 1. Each child was measured 4 times, at ages 8,

10, 12, and 14 years. Thus, we let j = 1, . . . , 4; j is indexing the number of times a child is measured.

To summarize the information on when these times occur, we might further define

tij = the time at which the j measurement on unit i was taken.

PAGE 13

Page 23: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 1 ST 732, M. DAVIDIAN

Here, for all children, ti1 = 8, ti2 = 10, and so on for all children in the study. Thus, if we ignore

gender of the children for the moment, the responses for the ith child, where i ranges from 1 to 27, are

Yi1, . . . , Yi4, taken at times ti1, . . . , ti4. In fact, we may summarize the measurements for the ith child

even more succinctly: define the (4× 1) random vector

Y i =

Yi1

Yi2

Yi3

Yi4

.

The components are random variables representing the responses that might be observed for child i

at each time point. Later, we will expand this notation to include ways of representing additional

information, such as gender in this example.

The important message is that it is possible to represent the responses for the ith child in a very

streamlined and convenient way for the purposes of talking about them all together. Each child i has

its own vector of responses Y i. It often makes sense to think of the data not just as individual

responses Yij , some from one child, some from another according to the indices, but rather as vectors

corresponding to children, the units – each unit has associated with it an entire vector of responses.

It is worth noting that this way of summarizing information is not always used; in particular, some of

the classical methods for analyzing repeated measurements that we will discuss are usually not cast in

these terms. However, as we will see, using this unified way of representing the data will allow us to

appreciate differences among approaches.

This discussion demonstrates that it will be convenient to use matrix notation to summarize longi-

tudinal data. This is indeed the case in the literature, particularly when discussing some of the newer

methods. Thus, we will need to review elements of of matrix algebra that will be useful in describing

the models and methods that we will use.

PROBABILITY DISTRIBUTIONS: Statistical models rely on probability distributions to describe

the way in which the random variables invoved in the model take on their values. That is, probability

distributions are used to describe the chances of seeing particular values of the response of interest.

This same reasoning will of course be true for repeated measurements. In fact, acknowledging that it

makes sense to think of the responses for each unit in terms of a random vector, it will be necessary

to consider probability models for entire vectors of several responses thought of together, coming from

the same unit.

PAGE 14

Page 24: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 1 ST 732, M. DAVIDIAN

NORMAL DISTRIBUTION: For continuous data, recall that the most common model for single

observations is the normal or Gaussian distribution. That is, if Y is a normal random variable with

mean µ and variance σ2, then the probabilities with which Y takes on different values y are described

by the probability density function

f(y) =1√

2πσ2exp

{−(y − µ)2

2σ2

}.

This function is depicted graphically in Figure 4. Recall that the area under the curve between two

values represents the probability of the random variable Y taking on a value in that range.

Figure 4: Normal density function with mean µ.

µ

The assumption that data may be thought of as ending up the way they did according to the probabilities

dictated by a normal distribution is a fundamental one in much of statistical methodology. For example,

classical analysis of variance methods rely on the relevance of this assumption for conclusions (i.e.

inferences based on F ratios) to be valid. Classical methods for linear regression modeling also

are usually motivated based on this assumption. When the response is continuous, the assumption of

normality is often a reasonable one.

PAGE 15

Page 25: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 1 ST 732, M. DAVIDIAN

MULTIVARIATE NORMAL DISTRIBUTION: When we have data in the form of repeated measure-

ments, we have already noted that it is convenient to think of the data from a particular unit i as a

vector of individual responses, one vector from each unit. We will be much more formal later; for now,

consider that these vectors may be thought of as unrelated across individuals – how the measurements

for one child turn out over time has nothing to do with how they turn out for another child. However,

if we focus on a particular child, the measurements on that child will definitely be related to one

another! For example, in Figure 1, the boy with the “highest” profile starts out “high” at age 8, and

continues to be “high” over the entire period. Thus, we would like some way of not only characterizing

the probabilities with which a child has a certain response at a certain age, but of characterizing how

responses on the same child are related!

When the response is continuous and the assumption of normality seems reasonable, we will thus need to

discuss the extension of the idea of the normal distribution from a model just for probabilities associated

with a single random variable representing a response at one time to a model of the joint probabilities

for several responses together in a random vector. This of course includes how the responses are related.

The multivariate normal distribution is the extended probability model for this situation. Because

many popular methods for the analysis of longitudinal data are based on the assumption of normally

distributed responses, we will discuss the multivariate normal distribution and its properties in some

detail.

NORMAL, CONTINUOUS RESPONSE: Armed with our understanding of matrix notation and al-

gebra and the multivariate normal distribution, we will study methods for the analysis of continuous,

longitudinal data in the first part of the course that are appropriate when the multivariate normal

distribution is a reasonable probability model.

PAGE 16

Page 26: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 1 ST 732, M. DAVIDIAN

DISCRETE RESPONSE: Of course, the normal distribution is appropriate when the response of interest

is continuous, so, although the assumption of normality may be suitable in this case, it may not be

when the data are in the form of small counts, as in the seizure example. This assumption is certainly not

reasonable for binary data. As discussed above, a common approach has been to try to transform data

to make them “approximately normal” on the transformed scale; however, this has some disadvantages.

In the early 1980’s, there began an explosion of research into ways to analyze discrete responses that did

not require data transformation to induce approximate normality. These methods were based on more

realistic probability models, the Poisson distribution as a model for count data and the Bernoulli

(binomial) distribution as a model for binary data.

For regression-type problems, where a single response is measured on each unit, the usual classical

linear regression methods were extended to allow the assumption that these distributions, rather than

the normal distribution, are sensible probability models for the data. The term generalized linear

models is used to refer to the models and techniques used.

Starting in the late 1980’s, generalized linear model methods were extended to the situation of re-

peated measurement data, allowing one to think in terms of random vectors of responses, each

element of which may be thought of as Poisson or Bernoulli distributed. We will study these probability

distributions, generalized linear models, and their extension to longitudinal data.

NONNORMAL, CONTINUOUS RESPONSE: In fact, although the normal distribution is by far the

most popular probability model for continuous data, it is not always a sensible choice. As can be seen

from Figure 4, the normal probability density function is symmetric, saying that probabilities of seeing

responses smaller or larger than the mean are the same. This may not always be reasonable.

As we will discuss later in the course, other probability models are available in this situation. It turns

out that the methods in the same spirit as those used for discrete response may be used to model and

analyze such data.

PAGE 17

Page 27: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 1 ST 732, M. DAVIDIAN

1.4 Outline of the course

Given the considerations of the previous section, the course will offer coverage of two main areas.

First, methods for the analysis of continuous repeated measurements that are reasonably thought of as

normally distributed will be discussed. Later, methods for the analysis of repeated measurements that

are not reasonably thought of as normally distributed, such as discrete responses, are covered.

The course may be thought of as coming in roughly five parts:

I. Preliminaries:

• Introduction

• Review of matrix algebra

• Random vectors, multivariate distributions as models for repeated measurements, multivariate

normal distribution, review of linear regression

• Introduction to modeling longitudinal data

II. Classical methods:

• Classical methods for analyzing normally distributed, balanced repeated measurements

– “univariate” analysis of variance approaches

• Classical methods for analyzing normally distributed, balanced repeated measurements

– “multivariate” analysis of variance approaches

• Discussion of classical methods – drawbacks and limitations

III. Methods for unbalanced, normally distributed data:

• General linear models for longitudinal data, models for correlation

• Random coefficient models for continuous, normally distributed repeated measurements

• Linear mixed models for continuous, normally distributed repeated measurements

PAGE 18

Page 28: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 1 ST 732, M. DAVIDIAN

IV. Methods for unbalanced, nonnormally distributed data:

• Probability models for discrete and nonnormal continuous response, generalized linear models

• Models for discrete and nonnormal continuous repeated measurements – generalized estimating

equations

V. Advanced topics:

• Generalized linear mixed models for discrete and nonnormal continuous repeated measurements

• More general nonlinear mixed models for all kinds of repeated measurements

• Issues associated with missing data

Throughout, we will devote considerable time to the use of standard statistical software to implement

the methods. In particular, we will focus on the use of the SAS (Statistical Analysis System) software.

Some familiarity with SAS, such as how to read data from a file, how perform simple data manipulations,

and basic use of simple procedures such as PROC GLM is assumed.

The examples in subsequent chapters are implemented using Version 8.2 of SAS on a SunOs operating

system. Features of the output and required programming statements may be somewhat different

when older versions of SAS are used, as some of the procedures have been modified. In addition, slight

numerical differences arise when the same programs are run on other platforms. The user should consult

the documentation for his/her version of SAS for possible differences.

Plots in the figures are made with R and Splus. Making similar plots with SAS is not demonstrated in

these notes, as it is assumed the user will wish to use his/her own favorite plotting software.

It is important to stress that there are numerous approaches to the modeling and analysis of longitudinal

data, and there is no strictly “right” or “wrong” way. It is true, however, that some approaches are

more flexible than others, imposing less restrictions on the nature of the data and allowing questions of

scientific interest to be addressed more directly. We will note how various approaches compare as we

proceed.

Throughout, we adopt a standard convention. We often use upper case letters, e.g., Y and Y , to denote

random variables and vectors, most often those corresponding to the response of interest. We use lower

case letters, e.g., y and y, when we wish to refer to actual data values, i.e., realizations of the

random variable or vector.

PAGE 19

Page 29: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 2 ST 732, M. DAVIDIAN

2 Review of matrix algebra

2.1 Introduction

Before we begin our discussion of the statistical models and methods, we review elements of matrix

algebra that will be quite useful in streamlining our presentation and representing data. Here, we will

note some basic results and operations. Further results and definitions will be discussed as we need

them throughout the course. Many useful facts here are stated systematically in this chapter; thus, this

chapter will serve as a reference for later developments using matrix notation.

2.2 Matrix notation

MATRIX: A rectangular array of numbers, e.g.

A =

3 5 7 8

1 2 3 7

As is standard, we will use boldface capital letters to denote an entire matrix.

DIMENSION: A matrix with r rows and c columns is said to be of dimension (r × c).

It is customary to refer generically to the elements of a matrix by using 2 subscripts, e.g.

A =

a11 a12 a13 a14

a21 a22 a23 a24

a11 = 3, a12 = 5, etc. In general, for a matrix with r rows and c columns, A, the element of A in the

ith row and the jth column is denoted as aij , where i = 1, . . . , r and j = 1, . . . , c.

VECTOR: A column vector is a matrix with only one column, e.g.

a =

2

0

3

−2

PAGE 20

Page 30: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 2 ST 732, M. DAVIDIAN

A row vector is matrix with only one row, e.g.

b =(

1, 3, −5)

It is worth noting some special cases of matrices.

SQUARE MATRIX: A matrix with r = c, that is, with the same number of rows and columns is called

a square matrix. If a matrix A is square, the elements aii are said to lie on the (principal) diagonal

of A. For example,

A =

4 0 7

9 −1 3

−8 4 5

.

SYMMETRIC MATRIX: A square matrix A is called symmetric if aij = aji for all values of i and j.

The term symmetric refers to the fact that such a matrix “reflects” across its diagonal, e.g.

A =

3 5 7

5 1 4

7 4 8

Symmetric matrices turn out to be quite important in formulating statistical models for all types of

data!

IDENTITY MATRIX: An important special case of a square, symmetric matrix is the identity matrix

– a square matrix with 1’s on diagonal, 0’s elsewhere, e.g.

I =

1 0 0

0 1 0

0 0 1

As we will see shortly, the identity matrix functions the same way as “1” does in the real number system.

TRANSPOSE: The transpose of any (r × c) A matrix is the (c × r) matrix denoted as A′ such that

aij is replaced by aji everywhere. That is, the transpose of A is the matrix found by “flipping” the

matrix around, e.g.

A =

3 5 7 8

1 2 3 7

, A′ =

3 1

5 2

7 3

8 7

PAGE 21

Page 31: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 2 ST 732, M. DAVIDIAN

A fundamental property of a symmetric matrix is that the matrix and its transpose are the same; i.e.,

if A is symmetric then A = A′. (Try it on the symmetric matrix above.)

2.3 Matrix operations

The world of matrices can be thought of as an extension of the world of real (scalar) numbers. Just as

we add, subtract, multiply, and divide real numbers, we can do the same in with matrices. It turns out

that these operations make the expression of complicated calculations easy to talk about and express,

hiding all the details!

MATRIX ADDITION AND SUBTRACTION: Adding or subtracting two matrices are operations that

are defined element-by-element. That is, to add to matrices, add their corresponding elements, e.g.

A =

5 0

−3 2

, B =

6 4

2 −1

A + B =

11 4

−1 1

, A−B =

−1 −4

−5 3

Note that these operations only make sense if the two matrices have the same dimension – the

operations are not defined otherwise.

MULTIPLICATION BY A CONSTANT: The effect of multiplying a matrix A of any dimension by a

real number (scalar) b, say, is to multiply each element in A by b. This is easy to see by considering

that this is just equivalent to adding A to itself b times. E.g.

3

5 −2

6 4

=

15 −6

18 12

.

GENERAL FACTS:

• A + B = B + A, b(A + B) = bA + bB

• (A + B)′ = A′ + B′, (bA)′ = bA′

PAGE 22

Page 32: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 2 ST 732, M. DAVIDIAN

MATRIX MULTIPLICATION: This operation is a bit tricky, but as we will see in a moment, it proves

most powerful for expressing a whole series of calculations in a very simple way.

• Order matters

• Number of columns of first matrix must = Number of rows of second matrix, e.g.

A =

1 3 5

−2 −1 2

B =

2 3

0 5

1 −2

A B =

7 8

−2 −15

E.g. (1)(2) + (3)(0) + (5)(1) = 7 for the (1, 1) element.

• Two matrices satisfying these requirements are said to conform to multiplication.

• Formally, if A is (r × c) and B is (c× q), then AB is a (r × q) matrix with (i, j)th element

c∑k=1

aikbkj .

Here, we say that A is postmultiplied by B and, equivalently, that B is premultiplied by A.

EXAMPLE: Consider a simple linear regression model: suppose that we have n pairs (x1, Y1), . . . , (xn, Yn),

and we believe that, except for a random deviation, the relationship between the covariate x and the

response Y follows a straight line. That is, for j = 1, . . . , n, we have

Yj = β0 + β1xj + εj ,

where εj is a random deviation representing the amount by which the actual observed response Yj

deviates from the exact straight line relationship. Defining

X =

1 x1

1 x2

......

1 xn

, Y =

Y1

Y2

...

Yn

, ε =

ε1

ε2...

εn

, β =

β0

β1

,

we may express the model succinctly as

Y = Xβ + ε. (2.1)

PAGE 23

Page 33: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 2 ST 732, M. DAVIDIAN

SPECIAL CASE: Multiplying vectors. With a row vector premultiplying a column vector, the result is

a scalar (remember, a (1× 1) matrix is just a real number!), e.g.

a b =(

1, 3, −5, 1)

2

0

3

−2

= −15

i.e. (1)(2) + (3)(0) + (−5)(3) + (1)(−2) = −15

With a column vector premultiplying a row vector, the result is a matrix. e.g.

bc =

2

0

3

−2

(

3 −1 2)

=

6 −2 4

0 0 0

9 −3 6

−6 2 −4

MULTIPLICATION BY AN IDENTITY MATRIX: Multiplying any matrix by an identity matrix of

appropriate dimension gives back the same matrix, e.g.

I A =

1 0

0 1

1 3 5

−2 −1 2

= A

GENERAL FACTS:

• A(B + C) = AB + AC, (A + B)C = AC + BC

• For any matrix A, A′A will be a square matrix.

• The transpose of a matrix product – if A and B conform to multiplication, then the transpose

of their product

(AB)′ = B′A′.

These latter results may be proved generically, but you may convince yourself by working them out for

the matrices A and B given above.

PAGE 24

Page 34: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 2 ST 732, M. DAVIDIAN

LINEAR DEPENDENCE: This characteristic of a matrix is extremely important in that it describes

the nature and extent of the information contained in the matrix. Consider the matrix

A =

1 1 1

3 1 5

2 3 1

.

Refer to the columns as c1, c2, c3. Note that

2c1 +−c2 +−c3 = 0,

where 0 is a column of zeros (in this case, a (3 × 1) vector). Because the 3 columns of A may be

combined in a linear function to yield a vector of nothing but zeros, clearly, there is some kind of

relationship, or dependence, among the information in the columns. Put another way, it seems as

though there is some duplication of information in the columns.

In general, we say that k columns c1, c2, . . . , ck of a matrix are linearly dependent if there exists a

set of scalar values λ1, . . . , λk such that

λ1c1 + · · ·+ λkck = 0, (2.2)

and at least one of the λj ’s is not equal to 0.

Linear dependence implies that each column vector is a combination of the others, e.g.,

ck = −(λ1c1 + · · ·+ λk−1ck−1)/λk.

The implication is that all of the “information” in the matrix is contained in a subset of the columns

– if we know any (k − 1) columns, we know them all. This formalizes our notion of “duplication” of

information.

If, on the other hand, the only set of λj values we can come up with to satisfy (2.2) is a set of all zeros,

then it must be that there is no relationship among the columns, e.g. they are “independent” in the

sense of containing no overlap of information. The formal term is linearly independent.

PAGE 25

Page 35: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 2 ST 732, M. DAVIDIAN

RANK OF A MATRIX: The rank of a matrix is the maximum number of linearly independent columns

that may be selected from the columns of the matrix. It is sort of a measure of the extent of “duplication

of information” in the matrix. The rank of a matrix may be equivalently defined as the number of linearly

independent rows (by turning the matrix on its side). The rank determined either way is the same.

Thus, the largest that the rank of a matrix can be is the minimum of r and c. The smallest rank may

be is 1, in which case there is one column such that all other columns are direct multiples.

In the above, the rank of the matrix A is 2. To see this, eliminate one of the columns (we have already

seen that the three columns are linearly dependent, so we can get the third from the other two). Now

try to find a new linear combination of the remaining columns that has some λj not equal to 0. If this

can not be done – stop and declare the rank to be the number of remaining columns.

FULL RANK: A matrix is said to be of full rank if its rank is equal to the minimum of r and c.

FACT: If X is a (r × c) matrix with rank k, then X ′X also has rank k. Note, of course, that X ′X is

a square matrix of dimension (c× c). If k = c, then X ′X is of full rank.

INVERSE OF A MATRIX: This is related to the matrix version of “division” – the inverse of a matrix

may be thought of in way similar to a “reciprocal” in the world of real numbers.

• The notion of an inverse is only defined for square matrices, for reasons that will be clear below.

• The inverse of the square matrix A is denoted by A−1 and is the square matrix satisfying

A A−1 = I = A−1 A

where I is an identity matrix of the same dimension.

• We sometimes write Ik when I is (k × k) when it is important to note explicitly the dimension.

Thus, the inverse of a matrix is like the analog of the reciprocal for scalars. Recall that if b is a scalar

and b = 0, then the reciprocal of b, 1/b does not exist – it is not defined in this case. Similarly, there

are matrices that “act like zero” for which no inverse is defined. Consequently, inverse is only defined

when it exists.

Computing the inverse of a matrix is best done on a computer, where the intricate formulæ for matrices

of general dimension are usually built in to software packages. Only in simple cases is an analytic

expression obtained easily (see the next page).

PAGE 26

Page 36: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 2 ST 732, M. DAVIDIAN

A technical condition that an inverse of the matrix A exist is that the columns of A are linearly

independent. This is related to the following.

DETERMINANT: When is a matrix “like zero?” The determinant of a square matrix is a scalar

number that in some sense summarizes how “zero-like” a matrix is.

The determinant of a (2× 2) matrix is defined as follows. Let

A =

a b

c d

Then the determinant of A is given by

|A| = ad− bc.

The notation |A| means “determinant of;” this may also be written as det(A). Determinant is also

defined for larger matrices, although the calculations become tedious (but are usually part of any decent

software package).

The inverse of a matrix is related to the determinant. In the special case of a (2 × 2) matrix like A

above, it may be shown that

A−1 =1

ad− bc

d −b

−c a

.

Inverse for matrices of larger dimension is also defined in terms of the determinant, but the expressions

are complicated.

GENERAL FACTS:

• If a square matrix is not of full rank, then it will have determinant equal to 0. For example, for

the (2 × 2) matrix above, suppose that the columns are linearly dependent with a = 2b and

c = 2d. Then note that

|A| = ad− bc = 2bd− 2bd = 0.

• Thus, note that if a matrix is not of full rank, its inverse does not exist. In the case of a (2× 2)

matrix, note that the inverse formula requires division by (ad− bc), which would be equal to zero.

PAGE 27

Page 37: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 2 ST 732, M. DAVIDIAN

EXAMPLE:

A =

5 0

−3 2

, |A| = (5)(2)− (0)(−3) = 10

A−1 =110

2 0

3 5

=

1/5 0

3/10 1/2

Verify that A A−1 = A−1A = I.

ADDITIONAL FACTS: Let A and B be square matrices of the same dimension whose inverses exist.

• (AB)−1 = B−1A−1, (A−1)′ = (A′)−1.

• If A is a diagonal matrix, that is, a matrix that has non-zero elements only on its diagonal,

with 0’s everywhere else, then its inverse is nothing more than a diagonal matrix whose diagonal

elements are the reciprocals of the original diagonal elements, e.g., if

A =

5 0 0

0 2 0

0 0 −4

, A−1 =

1/5 0 0

0 1/2 0

0 0 −1/4

.

Note that an identity matrix is just a diagonal matrix whose inverse is itself, just as 1/1=1.

• |A| = |A′|

• If each element of a row or column of A is zero, then |A| = 0.

• If A has any rows or columns identical, then |A| = 0.

• |A| = 1/|A−1|

• |AB| = |A||B|

• If b is a scalar, then |bA| = bk|A|, where k is the dimension of A.

• (A + B)−1 = A−1 −A−1(A−1 + B−1)−1A−1

• If A is a diagonal matrix, then |A| is equal to the product of the diagonal elements, i.e.

A =

a11 0 · · · 0

0 a22 · · · 0...

......

...

0 0 · · · ann

⇒ |A| = a11a22 · · · ann.

PAGE 28

Page 38: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 2 ST 732, M. DAVIDIAN

USE OF INVERSE – SOLVING SIMULTANEOUS EQUATIONS: Suppose we have a set of simulta-

neous equations with unknown values x, y, and z, e.g.

x − y + z = 2

2x + y = 7

3x + y + z = -5.

We may write this system succinctly in matrix notation as Aa = b, where

A =

1 −1 1

2 1 0

3 1 1

, a =

x

y

z

, b =

2

7

−5

.

Then, provided A−1 exists, we may write the solution as

a = A−1b.

Note that if b = 0, then the above shows that if A has an inverse, then it must be that a = 0. More

formally, a square matrix A is said to be nonsingular if Aa = 0 implies a = 0. Otherwise, the matrix

is said to be singular.

Equivalently, a square matrix is nonsingular if it is of full rank.

For a square matrix A, the following are equivalent:

• A is nonsingular

• |A| 6= 0

• A−1 exists

We will see that matrix notation is incredibly useful for summarizing models and methods for longitudi-

nal data. As is true more generally in statistics, the concepts of rank and singularity are very important.

Matrices in statistical models that are singular generally reflect a problem – most often, they reflect

that there is not sufficient information available to learn about certain aspects of the model. We will

see this in action later in the course.

PAGE 29

Page 39: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 2 ST 732, M. DAVIDIAN

EXAMPLE: Returning to the matrix representation of the simple linear regression model, it is possible

to use these operations to streamline the statement of how to calculate the least squares estimators of

β0 and β1. Recall that the least squares estimators β0 and β1 for the intercept and slope minimize the

sum of squared deviationsn∑

j=1

(Yj − β0 − xjβ1)2

and are given by

β1 =SXY

SXX, β0 = Y − β1x,

where

SXY =n∑

j=1

(Yj − Y )(xj − x) =n∑

j=1

xjYj −(∑n

j=1 xj)(∑n

j=1 Yj)n

, Y = n−1n∑

j=1

Yj , x = n−1n∑

j=1

xj

SXX =n∑

j=1

(xj − x)2 =n∑

j=1

x2j −

(∑n

j=1 xj)2

n, SY Y =

n∑j=1

(Yj − Y )2 =n∑

j=1

Y 2j −

(∑n

j=1 Yj)2

n,

We may summarize these calculations succinctly in matrix notation: the sum of squared deviations may

be written as

(Y −Xβ)′(Y −Xβ),

and, letting β = (β0, β1)′, the least squares estimator for β may be written

β = (X ′X)−1X ′Y .

Verify that, with X and Y defined as in (2.1), this matrix equation gives the usual estimators above.

CONVENTION: Here, we have referred to β0 and β1 as estimators, and have written them in terms of

the random variables Yj . The term estimator refers to the generic function of random variables one

would use to learn about parameters like β0 or β1. The term estimate refers to the actual numerical

values obtained by applying the estimator to data; e.g., y1, . . . , yn in this case.

We will see later that matrix notation is more generally useful for summarizing models for longitudinal

data and the calculations required to fit them; the simple linear regression model above is a simple

example.

TRACE OF A MATRIX: Defining this quantity allows a streamlined representation of many complex

calculations. If A is a (k × k) square matrix, then define the trace of A, tr(A), to be the sum of the

diagonal elements; i.e.

tr(A) =k∑

i=1

aii.

PAGE 30

Page 40: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 2 ST 732, M. DAVIDIAN

If A and B are both square with dimension k, then

• tr(A) = tr(A′), tr(bA) = btr(A)

• tr(A + B) = tr(A) + tr(B), tr(AB) = tr(BA)

QUADRATIC FORMS: The following form arises quite often. Suppose A is a square, symmetric

matrix of dimension k, and x is a (k × 1) column vector. Then

x′Ax

is called a quadratic form. It may be shown that

x′Ax =k∑

i=1

k∑j=1

aijxixj .

Note that this sum will involve both squared terms x2i and cross-product terms xixj , which forms

the basis for the name quadratic.

A quadratic form thus takes on scalar values. Depending on the value, the quadratic form and the

matrix A may be classified. With x 6= 0,

• If x′Ax ≥ 0, the quadratic form and the matrix A are said to be nonnegative definite

• If x′Ax > 0, the quadratic form and the matrix A are said to be positive definite. If A is

positive definite, then it is symmetric and nonsingular (so its inverse exists).

EXAMPLE: The sum of squared deviations that is minimized to obtain the least squares estimators in

regression is a quadratic form with A = I,

(Y −Xβ)′(Y −Xβ) = (Y −Xβ)′I(Y −Xβ).

Note that this is strictly greater than 0 by definition, because it equals

n∑j=1

(Yj − β0 − xjβ1)2,

which is a sum of squared quantities, all of which must be positive (assuming that not all deviations

are identically equal to zero, in which case the problem is rather nonsensical).

FACT: x′Ax = tr(Axx′); this may be verified by simply multiplying out each side. (Try it for the sum

of squared deviations above.)

PAGE 31

Page 41: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 3 ST 732, M. DAVIDIAN

3 Random vectors and multivariate normal distribution

As we saw in Chapter 1, a natural way to think about repeated measurement data is as a series of

random vectors, one vector corresponding to each unit. Because the way in which these vectors of

measurements turn out is governed by probability, we need to discuss extensions of usual univari-

ate probability distributions for (scalar) random variables to multivariate probability distributions

governing random vectors.

3.1 Preliminaries

First, it is wise to review the important concepts of random variable and probability distribution and

how we use these to model individual observations.

RANDOM VARIABLE: We may think of a random variable Y as a characteristic whose values may

vary. The way it takes on values is described by a probability distribution.

CONVENTION, REPEATED: It is customary to use upper case letters, e.g Y , to denote a generic

random variable and lower case letters, e.g. y, to denote a particular value that the random variable

may take on or that may be observed (data).

EXAMPLE: Suppose we are interested in the characteristic “body weight of rats” in the population of

all possible rats of a certain age, gender, and type. We might let

Y = body weight of a (randomly chosen) rats

from this population. Y is a random variable.

We may conceptualize that body weights of rats are distributed in this population in the sense that

some values are more common (i.e. more rats have them) than others. If we randomly select a rat

from the population, then the chance it has a certain body weight will be governed by this distribution

of weights in the population. Formally, values that Y may take on are distributed in the population

according to an associated probability distribution that describes how likely the values are in the

population.

In a moment, we will consider more carefully why rat weights we might see vary. First, we recall the

following.

PAGE 32

Page 42: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 3 ST 732, M. DAVIDIAN

(POPULATION) MEAN AND VARIANCE: Recall that the mean and variance of a probability

distribution summarize notions of “center” and “spread” or “variability” of all possible values. Consider

a random variable Y with an associated probability distribution.

The population mean may be thought of as the average of all possible values that Y could take on,

so the average of all possible values across the entire distribution. Note that some values occur more

frequently (are more likely) than others, so this average reflects this. We write

E(Y ). (3.1)

to denote this average, the population mean. The expectation operator E denotes that the

“averaging” operation over all possible values of its argument is to be carried out. Formally, the average

may be thought of as a “weighted” average, where each possible value is represented in accordance to

the probability with which it occurs in the population. The symbol “µ” is often used.

The population mean may be thought of as a way of describing the “center” of the distribution of all

possible values. The population mean is also referred to as the expected value or expectation of Y .

Recall that if we have a random sample of observations on a random variable Y , say Y1, . . . , Yn, then

the sample mean is just the average of these:

Y = n−1n∑

j=1

Yj .

For example, if Y = rat weight, and we were to obtain a random sample of n = 50 rats and weigh each,

then Y represents the average we would obtain.

• The sample mean is a natural estimator for the population mean of the probability distribution

from which the random sample was drawn.

The population variance may be thought of as measuring the spread of all possible values that may

be observed, based on the squared deviations of each value from the “center” of the distribution of all

possible values. More formally, variance is based on averaging squared deviations across the population,

which is represented using the expectation operator, and is given by

var(Y ) = E{(Y − µ)2}, µ = E(Y ). (3.2)

(3.2) shows the interpretation of variance as an average of squared deviations from the mean across the

population, taking into account that some values are more likely (occur with higher probability) than

others.

PAGE 33

Page 43: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 3 ST 732, M. DAVIDIAN

• The use of squared deviations takes into account magnitude of the distance from the “center” but

not direction, so is attempting to measure only “spread” (in either direction).

The symbol “σ2” is often used generically to represent population variance. Figure 1 shows two normal

distributions with the same mean but different variances σ21 < σ2

2, illustrating how variance describes

the “spread” of possible values.

Figure 1: Normal distributions with mean µ but different variances

µ

σ21

σ22

Variance is on the scale of the response, squared. A measure of spread that is on the same scale as the

response is the population standard deviation, defined as√

var(Y ). The symbol σ is often used.

Recall that for a random sample as above, the sample variance is (almost) the average of the squared

deviations of each observation Yj from the sample mean Y .

S2 = (n− 1)−1n∑

j=1

(Yj − Y )2.

• The sample variance is used as an estimator for population variance. Division by (n− 1) rather

than n is used so that the estimator is unbiased, i.e estimates the true population variance well

even if the sample size n is small.

• The sample standard deviation is just the square root of the sample variance, often represented

by the symbol S.

PAGE 34

Page 44: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 3 ST 732, M. DAVIDIAN

GENERAL FACTS: If b is a fixed scalar and Y is a random variable, then

• E(bY ) = bE(Y ) = bµ; i.e. all values in the average are just multiplied by b. Also, E(Y + b) =

E(Y ) + b; adding a constant to each value in the population will just shift the average by this

same amount.

• var(bY ) = E{(bY −bµ)2} = b2var(Y ); i.e. all values in the average are just multiplied by b2. Also,

var(Y + b) = var(Y ); adding a constant to each value in the population does not affect how they

vary about the mean (which is also shifted by this amount).

SOURCES OF VARIATION: We now consider why the values of a characteristic that we might observe

vary. Consider again the rat weight example.

• Biological variation. It is well-known that biological entities are different; although living things

of the same type tend to be similar in their characteristics, they are not exactly the same (except

perhaps in the case of genetically-identical clones). Thus, even if we focus on rats of the same

strain, age, and gender, we expect variation in the possible weights of such rats that we might

observe due to inherent, natural biological variation.

Let Y represent the weight of a randomly chosen rat, with probability distribution having mean

µ. If all rats were biologically identical, then the population variance of Y would be equal to 0,

and we would expect all rats to have exactly weight µ. Of course, because rat weights vary as a

consequence of biological factors, the variance is > 0, and thus the weight of a randomly chosen

rat is not equal to µ but rather deviates from µ by some positive or negative amount. From this

view, we might think of Y as being represented by

Y = µ + b, (3.3)

where b is a random variable, with population mean E(b) = 0 and variance var(b) = σ2b , say.

Here, Y is “decomposed” into its mean value (a systematic component) and a random devia-

tion b that represents by how much a rat weight might deviate from the mean rat weight due to

inherent biological factors.

(3.3) is a simple statistical model that emphasizes that we believe rat weights we might see vary

because of biological phenomena. Note that (3.3) implies that E(Y ) = µ and var(Y ) = σ2b .

PAGE 35

Page 45: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 3 ST 732, M. DAVIDIAN

• Measurement error. We have discussed rat weight as though, once we have a rat in hand, we

may know its weight exactly. However, a scale usually must be used. Ideally, a scale should

register the true weight of an item each time it is weighed, but, because such devices are imperfect,

measurements on the same item may vary time after time. The amount by which the measurement

differs from the truth may be thought of as an error; i.e. a deviation up or down from the true

value that could be observed with a “perfect” device. A “fair” or unbiased device does not

systematically register high or low most of the time; rather, the errors may go in either direction

with no pattern.

Thus, if we only have an unbiased scale on which to weigh rats, a rat weight we might observe

reflects not only the true weight of the rat, which varies across rats, but also the error in taking the

measurement. We might think of a random variable e, say, that represents the error that might

contaminate a measurement of rat weight, taking on possible values in a hypothetical “population”

of all such errors the scale might commit.

We still believe rat weights vary due to biological variation, but what we see is also subject to

measurement error. It thus makes sense to revise our thinking of what Y represents, and think

of Y = “measured weight of a randomly chosen rat.” The population of all possible values Y

could take on is all possible values of rat weight we might measure; i.e., all values consisting of a

true weight of a rat from the population of all rats contaminated by a measurement error from

the population of all possible such errors.

With this thinking, it is natural to represent Y as

Y = µ + b + e = µ + ε, (3.4)

where b is as in (3.3). e is the deviation due to measurement error, with E(e) = 0 and var(e) = σ2e ,

representing an unbiased but imprecise scale.

In (3.4), ε = b + e represents the aggregate deviation due to the effects of both biological

variation and measurement error. Here, E(ε) = 0 and var(ε) = σ2 = σ2b + σ2

e , so that E(Y ) = µ

and var(Y ) = σ2 according to the model (3.4). Here, σ2 reflects the “spread” of measured rat

weights and depends on both the spread in true rat weights and the spread in errors that could

be committed in measuring them.

There are still further sources of variation that we could consider; we defer discussion to later in the

course. For now, the important message is that, in considering statistical models, it is critical to be

aware of different sources of variation that cause observations to vary. This is especially important

with longitudinal data, as we will see.

PAGE 36

Page 46: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 3 ST 732, M. DAVIDIAN

We now consider these concepts in the context of a familiar statistical model.

SIMPLE LINEAR REGRESSION: Consider the simple linear regression model. At each fixed value

x1, . . . , xn, we observe a corresponding random variable Yj , j = 1, . . . , n. For example, suppose that

the xj are doses of a drug. For each xj , a rat is randomly chosen and given this dose. The associated

response for the jth rat (given dose xj) may be represented by Yj .

The simple linear regression model as usually stated is

Yj = β0 + β1xj + εj ,

where εj is a random variable with mean 0 and variance σ2; that is E(εj) = 0, var(εj) = σ2. Thus,

E(Yj) = β0 + β1xj and var(Yj) = σ2.

This model says that, ideally, at each xj , the response of interest, Yj , should be exactly equal to the

fixed value β0 + β1xj , the mean of Yj . However, because of factors like (i) biological variation and (ii)

measurement error, the values we might see at xj vary. In the model, εj represents the deviation from

β0 + β1xj that might occur because of the aggregate effect of these sources of variation.

If Yj is a continuous random variable, it is often the case that the normal distribution is a reasonable

probability model for the population of εj values; that is,

εj ∼ N (0, σ2).

This says that the total effect of all sources of variation is to create deviations from the mean of Yj that

may be equally likely in either direction as dictated by the symmetric normal probability distribution.

Under this assumption, we have that the population of observations we might see at a particular xj is

also normal and centered at β0 + β1xj ; i.e.

Yj ∼ N (β0 + β1xj , σ2).

• This model says that the chance of seeing Yj values above or below the mean β0 + β1xj is the

same (symmetry).

• This is an especially good model when the predominant source of variation (represented by the

εj) is due to a measuring device.

• It may or may not be such a good model when the predominant source of variation is due to

biological phenomena (more later in the course!).

PAGE 37

Page 47: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 3 ST 732, M. DAVIDIAN

The model thus says that, at each xj , there is a population of possible Yj values we might see, with

mean β0 + β1xj and variance σ2. We can represent this pictorially by considering Figure 2.

Figure 2: Simple linear regression

x

y

0 2 4 6 8 10

34

56

78

“ERROR”: An unfortunate convention in the literature is that the εj are referred to as errors, which

causes some people to believe that they represent solely deviation due to measurement error. We prefer

the term deviation to emphasize that Yj values may deviate from β0+β1xj due to the combined effects

of several sources (but not limited to measurement error).

INDEPENDENCE: An important assumption for simple linear regression and, indeed, more general

problems, is that the random variables Yj , or equivalently, the εj , are independent.

(Statistical) independence is a formal statistical concept with an important practical interpretation. In

particular, in our simple linear regression model, this says that the way in which Yj at xj takes on its

values is completely unrelated to the way in which Yj′ observed at another position xj′ takes on its

values. This is certainly a reasonable assumption in many situations.

• In our example, where xj are doses of a drug, each given to a different rat, there is no reason to

believe that responses from different rats should be related in any way. Thus, the way in which

Yj values turn out at different xj would be totally unrelated.

PAGE 38

Page 48: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 3 ST 732, M. DAVIDIAN

The consequence of independence is that we may think of data on an observation-by-observation

basis; because the behavior of each observation is unrelated to that of others, we may talk about each

one in its own right, without reference to the others.

Although this way of thinking may be relevant for regression problems where the data were collected

according to a scheme like that in the example above, as we will see, it may not be relevant for

longitudinal data.

3.2 Random vectors

As we have already mentioned, when several observations are taken on the same unit, it will be

convenient, and in fact, necessary, to talk about them together. We thus must extend our way of

thinking about random variables and probability distributions.

RANDOM VECTOR: A random vector is a vector whose elements are random variables. Let

Y =

Y1

Y2

...

Yn

be a (n× 1) random vector.

• Each element of Y , Yj , j = 1, . . . , n, is a random variable with its own mean, variance, and

probability distribution; e.g.

E(Yj) = µj , var(yj) = E{(Yj − µj)2} = σ2j .

We might furthermore have that Yj is normally distributed; i.e.

Yj ∼ N (µj , σ2j ).

• Thus, if we talk about a particular element of Y in its own right, we may speak in terms of its

particular probability distribution, mean, and variance.

• Probability distributions for single random variables are often referred to as univariate, because

they refer only to how one (scalar) random variable takes on its values.

PAGE 39

Page 49: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 3 ST 732, M. DAVIDIAN

JOINT VARIATION: However, if we think of the elements of Y together, we must consider the fact

that they come together in a group, so that there might be relationships among them. Specifically,

if we think of Y as containing possible observations on the same unit at times indexed by j, there is

reason to expect that the value observed at one time and that observed at another time may turn out

the way they do in a “common” fashion. For example,

• If Y consists of the heights of a pine seedling measured on each of n consecutive days, we might

expect a “large” value one day to be followed by a “large” value the next day.

• If Y consists of the lengths of baby rats in a litter of size n from a particular mother, we might

expect all the babies in a litter to be “large” or “small” relative to babies from other litters.

This suggests that if observations can be naturally thought to arise together, then they may not be

legitimately viewed as independent, but rather related somehow.

• In particular, they may be thought to vary together, or covary.

• This suggests that we need to think of how they take on values jointly.

JOINT PROBABILITY DISTRIBUTION: Just as we think of a probability distribution for a random

variable as describing the frequency with which the variable may take on values, we may think of a

joint probability distribution that describes the frequency with which an entire set of random variables

takes on values together. Such a distribution is referred to as multivariate for obvious reasons. We

will consider the specific case of the multivariate normal distribution shortly.

We may thus think of any two random variables in Y , Yj and Yk, say, as having a joint probability

distribution that describes how they take on values together.

COVARIANCE: A measure of how two random variable vary together is the covariance. Formally,

suppose Yj and Yk are two random variables that vary together. Each of them has its own probability

distribution with means µj and µk, respectively, which is relevant when we think of them separately.

They also have a joint probability distribution, which is relevant when we think of them together. Then

we define the covariance between Yj and Yk as

cov(Yj , Yk) = E{(Yj − µj)(Yk − µk)}. (3.5)

Here, the expectation operator denotes average over all possible pairs of values Yj and Yk may take on

together according to their joint probability distribution.

PAGE 40

Page 50: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 3 ST 732, M. DAVIDIAN

Inspection of (3.5) shows

• Covariance is defined as the average across all possible values that Yj and Yk may take on jointly

of the product of the deviations of Yj and Yk from their respective means.

• Thus note that if “large” values (“larger” than their means) of Yj and Yk tend to happen together

(and thus “small” values of Yj and Yk tend to happen together), then the two deviations (Yj−µj)

and (Yk − µk) will tend to be positive together and negative together, so that the product

(Yj − µj)(Yk − µk) (3.6)

will tend to be positive for most of the pairs of values in the population. Thus, the average in

(3.5) will likely be positive.

• Conversely, if “large” values of Yj tend to happen coincidently with “small” values of Yk and vice

versa, then the deviation (Yj − µj) will tend to be positive when (Yk − µk) tends to be negative,

and vice versa. Thus the product (3.6) will tend to be negative for most of the pairs of values in

the population. Thus, the average in (3.5) will likely be negative.

• Moreover, if in truth Yj and Yk are unrelated, so that “large” Yj are likely to happen with “small”

Yk and “large” Yk and vice versa, then we would expect the deviations (Yj −µj) and (Yk−µk) to

be positive and negative in no real systematic way. Thus, (3.6) may be negative or positive with

no special tendency, and the average in (3.5) would likely be zero.

Thus, the quantity of covariance defined in (3.5) makes intuitive sense as a measure of how “associated”

values of Yj are with values of Yk.

• In the last bullet above, Yj and Yk are unrelated, and we argued that cov(Yj , Yk) = 0. In fact,

formally, if Yj and Yk are statistically independent, then it follows that cov(Yj , Yk) = 0.

• Note that cov(Yj , Yk) = cov(Yk, Yj).

• Fact: the covariance of a random variable Yj and itself,

cov(Yj , Yj) = E{(Yj − µj)(Yj − µj)} = var(Yj) = σ2j .

• Fact: If we have two random variables, Yj and Yk, then

var(Yj + Yk) = var(Yj) + var(Yk) + 2cov(Yj , Yk).

PAGE 41

Page 51: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 3 ST 732, M. DAVIDIAN

That is, the variance of the population consisting of all possible values of the sum Yj + Yk is the

sum of the variances for each population, adjusted by how “associated” the two values are. Note

that if Yj and Yk are independent, var(Yj + Yk) = var(Yj) + var(Yk).

We now see how all of this information is summarized.

EXPECTATION OF A RANDOM VECTOR: For an entire n-dimensional vector random Y , we sum-

marize the means for each element in a vector

µ =

E(Y1)

E(Y2)...

E(Yn)

=

µ1

µ2

...

µn

.

We define the expected value or mean of Y as

E(Y ) = µ;

the expectation operation is applied to each element in the vector Y , yielding the vector µ of means.

RANDOM MATRIX: A random matrix is simply a matrix whose elements are random variables; we

will see a specific example of importance to us in a moment. Formally, if Y is a (r × c) matrix with

element Yjk, each a random variable, then each element has an expectation, E(Yjk) = µjk, say. Then

the expected value or mean of Y is defined as the corresponding matrix of means; i.e.

E(Y) =

E(Y11) E(Y12) · · · E(Y1c)

......

......

E(Yr1) E(Yr2) · · · E(Yrc)

.

COVARIANCE MATRIX: We now see how this concept is used to summarize information on covariance

among the elements of a random vector. Note that

(Y − µ)(Y − µ)′ =

(Y1 − µ1)2 (Y1 − µ1)(Y2 − µ2) · · · (Y1 − µ1)(Yn − µn)

(Y2 − µ2)(Y1 − µ1) (Y2 − µ2)2 · · · (Y2 − µ2)(Yn − µn)...

.... . .

...

(Yn − µn)(Y1 − µ1) (Yn − µn)(Y2 − µ2) · · · (Yn − µn)2

,

which is a random matrix.

PAGE 42

Page 52: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 3 ST 732, M. DAVIDIAN

Note then that

E{(Y − µ)(Y − µ)′} =

E(Y1 − µ1)2 E(Y1 − µ1)(Y2 − µ2) · · · E(Y1 − µ1)(Yn − µn)

E(Y2 − µ2)(Y1 − µ1) E(Y2 − µ2)2 · · · E(Y2 − µ2)(Yn − µn)...

.... . .

...

E(Yn − µn)(Y1 − µ1) E(Yn − µn)(Y2 − µ2) · · · E(Yn − µn)2

=

σ21 σ12 · · · σ1n

σ21 σ22 · · · σ2n

......

. . ....

σn1 σn2 · · · σ2n

= Σ,

say, where for j, k = 1, . . . , n, var(Yj) = σ2j and we define

cov(Yj , Yk) = σjk.

The matrix Σ is called the covariance matrix or variance-covariance matrix of Y .

• Note that σjk = σkj , so that Σ is a symmetric, square matrix.

• We will write succinctly var(Y ) = Σ to state that the random vector Y has covariance matrix Σ.

JOINT PROBABILITY DISTRIBUTION: It follows that, if we consider the joint probability distribu-

tion describing how the entire set of elements of Y take on values together, µ and Σ are the features

of this distribution characterizing “center” and “spread and association.”

• µ and Σ are referred to as the population mean and population covariance (matrix) for the

population of data vectors represented by the joint probability distribution.

• The symbols µ and Σ are often used generically to represent population mean and covariance, as

above.

PAGE 43

Page 53: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 3 ST 732, M. DAVIDIAN

CORRELATION: It is informative to separate the information on “spread” contained in variances σ2j

from that describing “association.” Thus, we define a particular measure of association that takes into

account the fact that different elements of Y may vary differently on their own.

The population correlation coefficient between Yj and Yk is defined as

ρjk =σjk√

σ2j

√σ2

k

.

Of course, σj =√

σ2j is the population standard deviation of Yj , on the same scale of measurement as

Yj , and similarly for Yk.

• ρjk scales the information on association in the covariance in accordance with the magnitude of

variation in each random variable, creating a “unitless” measure. Thus, it allows one to think of

the associations among variables measured on different scales.

• ρjk = ρkj .

• Note that if σjk = σjσk, then ρjk = 1. Intuitively, if this is true, it says that the ways Yj and

Yk vary separately is identical to how they vary together, so that if we know one, we know the

other. Thus, a correlation of 1 indicates that the two random variables are “perfectly positively

associated.” Similarly, if σjk = −σjσk, then ρjk = −1 and by the same reasoning they are

“perfectly negatively associated.”

• Clearly, ρjj = 1, so a random variable is perfectly positively correlated with itself.

• It may be shown that correlations must satisfy −1 ≤ ρjk ≤ 1.

• If σjk = 0 then ρjk = 0, so if Yj and Yk are independent, then they have 0 correlation.

CORRELATION MATRIX: It is customary to summarize the information on correlations in a matrix:

The correlation matrix Γ is defined as

Γ =

1 ρ12 · · · ρ1n

ρ21 1 · · · ρ1n

......

. . ....

ρn1 ρn2 · · · 1

.

For now, we use the symbol Γ to denote the correlation matrix of a random vector.

PAGE 44

Page 54: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 3 ST 732, M. DAVIDIAN

ALTERNATIVE REPRESENTATION OF COVARIANCE MATRIX: Note that knowledge of the vari-

ances σ21, . . . , σ

2n and the correlation matrix Γ is equivalent to knowledge of Σ, and vice versa. It is often

easier to think of associations among random variables on the unitless correlation scale than in terms

of covariance; thus, it is often convenient to write the covariance matrix another way that presents the

correlations explicitly.

Define the “standard deviation” matrix

T 1/2 =

σ1 0 · · · 0

0 σ2 · · · 0...

.... . .

...

0 0 · · · σn

.

The “1/2” reminds us that this is a diagonal matrix with the square roots of the variances on the

diagonal. Then it may be verified that (try it)

T 1/2ΓT 1/2 = Σ. (3.7)

The representation (3.7) will prove convenient when we wish to discuss associations implied by models

for longitudinal data in terms of correlations. Moreover, it is useful to appreciate (3.7), as it allows

calculations involving Σ that we will see later to be implemented easily on a computer.

GENERAL FACTS: As we will see later, we will often be interested in linear combinations of the

elements of a random vector Y ; that is, functions of the form

c1Y1 + · · · cnYn,

which may be written succinctly as c′Y , where c is the column vector

c =

c1

...

cn

.

• Note that c′Y is a scalar quantity.

It is possible using facts on the multiplication random variables by scalars (see above) and the definitions

of µ and Σ to show that

E(c′Y ) = c′µ var(c′Y ) = c′Σc.

(Try to verify these.)

PAGE 45

Page 55: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 3 ST 732, M. DAVIDIAN

More generally, if we have a set of q such linear combinations defined by vectors c1, . . . , cq, we may

summarize them all in a matrix whose rows are the c′k; i.e.

C =

c11 · · · c1n

.... . .

...

cq1 · · · cqn

.

Then CY is a (q × 1) random vector. For example, if we consider the simple linear model in matrix

notation, we noted earlier that if Y is the random vector consisting of the observations, then the least

squares estimator of β is given by

β = (X ′X)−1X ′Y ,

which is such a linear combination. It may be shown using the above that

E(CY ) = Cµ var(CY ) = CΣC ′.

Finally, the results above may be generalized. If A is a (q × 1) vector, then

• E(CY + a) = Cµ + a.

• var(CY + a) = CΣC ′.

• We will make extensive use of this result.

• It is important to recognize that there is nothing mysterious about these results – they merely

represent a streamlined way of summarizing information on operations performed on all elements

of a random vector succinctly. For example, the first result on E(CY + a) just summarizes what

the expected value of several different combinations of the elements of Y is, where each is shifted

by a constant (the corresponding element in a). Operationally, the results follow from applying

the above definitions and matrix operations.

3.3 The multivariate normal distribution

A fundamental theme in much of statistical methodology is that the normal probability distribution

is a reasonable model for the population of possible values taken on by many random variables of

interest. In particular, the normal distribution is often (but not always) a good approximation to the

true probability distribution for a random variable y when the random variable is continuous. Later

in the course, we will discuss other probability distributions that are better approximations when the

random variable of interest is continuous or discrete.

PAGE 46

Page 56: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 3 ST 732, M. DAVIDIAN

If we have a random vector Y with elements that are continuous random variables, then, it is natural

to consider the normal distribution as a probability model for each element Yj . However, as we have

discussed, we are likely to be concerned about associations among the elements of Y . Thus, it does not

suffice to describe each of the elements Yj separately; rather, we seek a probability model that describes

their joint behavior. As we have noted, such probability distributions are called multivariate for

obvious reasons.

The multivariate normal distribution is the extension of the normal distribution of a single random

variable to a random vector composed of elements that are each normally distributed. Through its

form, it naturally takes into account correlation among the elements of Y ; moreover, it gives a basis

for a way of thinking about an extension of “least squares” that is relevant when observations are not

independent but rather are correlated.

NORMAL PROBABILITY DENSITY: Recall that, for a random variable y, the normal distribution

has probability density function

f(y) =1

(2π)1/2σexp

{−(y − µ)2/(2σ2)

}. (3.8)

This function has the shape shown in Figure 3. The shape will vary in terms of “center” and “spread”

according to the values of the population mean µ and variance σ2 (e.g. recall Figure 1).

Figure 3: Normal density function with mean µ.

µ

PAGE 47

Page 57: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 3 ST 732, M. DAVIDIAN

Several features are evident from the form of (3.8):

• The form of the function is determined by µ and σ2. Thus, if we know the population mean and

variance of a random variable Y , and we know it is normally distributed, we know everything

about the probabilities associated with values of Y , because we then know the function (3.8)

completely.

• The form of (3.8) depends critically on the term

−(y − µ)2

σ2= (y − µ)(σ2)−1(y − µ). (3.9)

Note that this term depends on the squared deviation (y − µ)2.

• The deviation is standardized by the standard deviation σ, which has the same units as y, so

that it is put on a unitless basis.

• This standardized deviation has the interpretation of a distance measure – it measures how far y

is from µ, and then puts the result on a unitless basis relative to the “spread” about µ expected.

• Thus, the normal distribution and methods such as least squares, which depends on minimizing

a sum of squared deviations, have an intimate connection. We will use this connection to motivate

the interpretation of the form of multivariate normal distribution informally now. Later in the

course, we will be more formal about this connection.

SIMPLE LINEAR REGRESSION: For now, to appreciate this form and its extension, consider the

method of least squares for fitting a simple linear regression. (The same considerations apply to multiple

linear regression, which will be discussed later in this chapter.) As before, at each fixed value x1, . . . , xn,

there is a corresponding random variable Yj , j = 1, . . . , n, which is assumed to arise from

Yj = β0 + β1xj + εj , β = (β0, β1)′

The further assumption is that Yj are each normally distributed with means µj = β0+β1xj and variance

σ2.

• Thus, each Yj ∼ N (µj , σ2), so that they have different means but the same variance.

• Furthermore, the Yj are assumed to be independent.

PAGE 48

Page 58: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 3 ST 732, M. DAVIDIAN

The method of least squares is to minimize in β the sum of squared deviations∑n

j=1(Yj − µj)2 which

is the same as minimizingn∑

j=1

(Yj − µj)2/σ2 (3.10)

as σ2 is just a constant. Pictorially, realizations of such deviations are shown in Figure 4.

Figure 4: Deviations from the mean in simple linear regression

X

Y

IMPORTANT POINTS:

• Each deviation gets “equal weight” in (3.10) – all are “weighted” by the same constant, σ2.

• This makes sense – if each Yj has the same variance, then each is subject to the same magnitude

of variation, so the information on the population at xj provided by Yj is of “equal quality.” Thus,

information from all Yj is treated as equally valuable in determining β.

• The deviations corresponding to each observation are summed, so that each contributes to (3.10)

in its own right, unrelated to the contributions of any others.

• (3.10) is like an overall distance measure of Yj values from their means µj (put on a unitless basis

relative to the “spread” expected for any Yj).

PAGE 49

Page 59: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 3 ST 732, M. DAVIDIAN

MULTIVARIATE NORMAL PROBABILITY DENSITY: The joint probability distribution that is the

extension of (3.8) to a (n × 1) random vector Y , each of whose components are normally distributed

(but possibly associated), is given by

f(y) =1

(2π)n/2|Σ|−1/2 exp

{−(y − µ)′Σ−1(y − µ)/2

}(3.11)

• (3.11) describes the probabilities with which the random variable Y takes on values jointly in its

n elements.

• The form of (3.11) is determined by µ and Σ. Thus, as in the univariate case, if we know the

mean vector and covariance matrix of a random vector Y , and we know each of its elements are

normally distributed, then we know everything about the joint probabilities associated with values

y of Y .

• By analogy to (3.9), the form of f(y) depends critically on the term

(y − µ)′Σ−1(y − µ). (3.12)

Note that this is a quadratic form, so it is a scalar function of the elements of (y−µ) and Σ−1.

Specifically, if we refer to the elements of Σ−1 as σjk, i.e.

Σ−1 =

σ11 · · · σ1n

.... . .

...

σn1 · · · σnn

,

then we may write

(y − µ)′Σ−1(y − µ) =n∑

j=1

n∑k=1

σjk(yj − µj)(yk − µk). (3.13)

Of course, the elements σjk will be complicated functions of the elements σ2j , σjk of Σ, i.e. the

variances of the Yj and the covariances among them.

• This term thus depends on not only the squared deviations (yj − µj)2 for each element in y

(which arise in the double sum when j = k), but also on the crossproducts (yj − µj)(yk − µk).

Each contribution of these squares and crossproducts is being “standardized” somehow by values

σjk that somehow involve the variances and covariances.

• Thus, although it is quite complicated, one gets the suspicion that (3.13) has an interpretation,

albeit more complex, as a distance measure, just as in the univariate case.

PAGE 50

Page 60: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 3 ST 732, M. DAVIDIAN

BIVARIATE NORMAL DISTRIBUTION: To gain insight into this suspicion, and to get a better

understanding of the multivariate distribution, it is instructive to consider the special case n = 2, the

simplest example of a multivariate normal distribution (hence the name bivariate).

Here,

Y =

Y1

Y2

, µ =

µ1

µ2

, Σ =

σ21 σ12

σ12 σ22

.

Using the inversion formula for a (2× 2) matrix given in Chapter 2,

Σ−1 =1

σ21σ

22 − σ2

12

σ22 −σ12

−σ12 σ21

.

We also have that the correlation between Y1 and Y2 is given by

ρ12 =σ12

σ1σ2.

Using these results, it is an algebraic exercise to show that (try it!)

(y − µ)′Σ−1(y − µ) =1

1− ρ212

{(y1 − µ1)2

σ21

+(y2 − µ2)2

σ22

− 2ρ12(y1 − µ1)

σ1

(y2 − µ2)σ2

}. (3.14)

Compare this expression to the general one (3.13).

Inspection of (3.14) shows that the quadratic form involves two components:

• The sum of standardized squared deviations

(y1 − µ1)2

σ21

+(y2 − µ2)2

σ22

.

This sum alone is in the spirit of the sum of squared deviations in least squares, with the difference

that each deviation is now weighted in accordance with its variance. This makes sense – because

the variances of Y1 and Y2 differ, information on the population of Y1 values is of “different quality”

than that on the population of Y2 values. If variance is “large,” the quality of information is poorer;

thus, the larger the variance, the smaller the “weight,” so that information of “higher quality”

receives more weight in the overall measure. Indeed, then, this is like a “distance measure,” where

each contribution receives an appropriate weight.

PAGE 51

Page 61: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 3 ST 732, M. DAVIDIAN

• In addition, there is an “extra” term that makes (3.14) have a different form than just a sum of

weighted squared deviations:

−2ρ12(y1 − µ1)

σ1

(y2 − µ2)σ2

.

This term depends on the crossproduct, where each deviation is again weighted in accordance

with its variance. This term modifies the “distance measure” in a way that is connected with

the association between Y1 and Y2 through their crossproduct and their correlation ρ12. Note

that the larger this correlation in magnitude (either positive or negative), the more we modify the

usual sum of squared deviations.

• Note that the entire quadratic form also involves the multiplicative factor 1/(1 − ρ212), which is

greater than 1 if |ρ12| > 0. This factor scales the overall distance measure in accordance with the

magnitude of the association.

INTERPRETATION: Based on the above observations, we have the following practical interpretation

of (3.14):

• (3.14) is an overall measure of distance of the value y of Y from its mean µ.

• It contains the usual distance measure, a sum of appropriately weighted squared deviations.

• However, if Y1 and Y2 are positively correlated, ρ12 > 0, it is likely that the crossproduct

(Y1−µ1)(Y2−µ2) is positive. The measure of distance is thus reduced (we subtract off a positive

quantity). This makes sense – if Y1 and Y2 are positively correlated, knowing one tells us a lot

about the other. Thus, we won’t have to “travel as far” to get from Y1 to µ1 and Y2 to µ2.

• Similarly, if Y1 and Y2 are negatively correlated, ρ12 < 0, it is likely that the crossproduct

(Y1 − µ1)(Y2 − µ2) is negative. The measure of distance is again reduced (we subtract off a

positive quantity). Again, if Y1 and Y2 are negatively correlated, knowing one still tells us a lot

about the other (in the opposite direction).

• Note that if ρ12 = 0, which says that there is no association between values taken on by Y1 and

Y2, then the usual distance measure is not modified – there is “nothing to be gained” in traveling

from Y1 to µ1 by knowing Y2, and vice versa.

PAGE 52

Page 62: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 3 ST 732, M. DAVIDIAN

This interpretation may be more greatly appreciated by examining pictures of the bivariate normal

density for different values of the correlation ρ12. Note that the density is now an entire surface in 3

dimensions rather than just a curve in the plane, because account is taken of all possible pairs of values

of Y1 and Y2. Figure 5 shows a the bivariate density function with µ1 = 40, µ2 = 40, σ21 = 5, σ2

2 = 5 for

ρ12 = 0.8 and ρ12 = 0.0.

Figure 5: Bivariate normal distributions with different correlations

2530

3540

4550

55

25

30

35

40

45

50

55

00.

20.

40.

60.

81

1.2

25 30 35 40 45 50 55

2530

3540

4550

55

2530

3540

4550

55

25

30

35

40

45

50

55

00.

10.

20.

30.

40.

50.

60.

7

25 30 35 40 45 50 55

2530

3540

4550

55

ρ12 = 0.0ρ12 = 0.0

ρ12 = 0.8ρ12 = 0.8

y1

y1

y1

y1

y 2

y2

y 2

y2

• The two panels in each row are the surface and a “bird’s-eye” view for the 2 ρ12 values.

• For ρ12 = 0.8, a case of strong positive correlation, note that the picture is “tilted” at a 45 degree

angle and is quite narrow. This reflects the implication of positive correlation – values of Y1 and

Y2 are highly associated. Thus, the “overall distance” of a pair (Y1, Y2) from the “center” µ is

constrained by this association.

• For ρ12 = 0, Y1 and Y2 are not at all associated. Note now that the picture is not “tilted” – for a

given value of Y1, Y2 can be “anything” within the relevant range of values for each. The “overall”

distance of a pair (Y1, Y2) from the “center” µ is not constrained by anything.

PAGE 53

Page 63: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 3 ST 732, M. DAVIDIAN

INDEPENDENCE: Note that if Y1 and Y2 are independent, then ρ12 = 0. In this case, the second term

in the exponent of (3.14) disappears, and the entire quadratic form reduces to

(y1 − µ1)2

σ21

+(y2 − µ2)2

σ22

.

This is just the usual sum of weighted squared deviations.

EXTENSION: As you can imagine, these same concepts carry over to higher dimensions n > 2 in an

analogous fashion; although the mechanics are more difficult, the ideas and implications are the same.

• In general, the quadratic form (y − µ)′Σ−1(y − µ) is a distance measure taking into account

associations among the elements of Y , Y1, . . . , Yn, in the sense described above.

• When the Yj are all mutually independent, the quadratic form will reduce to a weighted sum of

squared deviations, as observed in particular for the bivariate case. It is actually possible to see

this directly.

If Yj are independent, then all the correlations ρjk = 0, as are the covariances σjk, and it follows

that Σ is a diagonal matrix. Thus, if

Σ =

σ2

1 0 · · · 0...

......

0 0 · · · σ2n

,

then

Σ−1 =

1/σ2

1 0 · · · 0...

......

0 0 · · · 1/σ2n

,

so that (verify)

(y − µ)′Σ−1(y − µ) =n∑

j=1

(yj − µj)2/σ2j .

Note also that, as Σ is diagonal, we have

|Σ| = σ21σ

22 · · ·σ2

n.

Thus, f(y) becomes

f(y) =1

(2π)1/2σ1exp{−(y1 − µ1)2/(2σ2

1)} · · ·1

(2π)1/2σnexp{−(yn − µn)2/(2σ2

n)}; (3.15)

f(y) reduces to the product of individual normal densities. This is a defining characteristic of

statistical independence; thus, we see that if Y1, . . . , Yn are each normally distributed and

uncorrelated, they are independent. Of course, this independence assumption forms the basis for

the usual method of least squares.

PAGE 54

Page 64: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 3 ST 732, M. DAVIDIAN

SIMPLE LINEAR REGRESSION, CONTINUED: We now apply the above concepts to extension of

usual least squares. We have seen that estimation of β is based on minimizing an appropriate distance

measure. For classical least squares under the assumptions of

(i) constant variance

(ii) independence

the distance measure to be minimized is a sum of squared deviations, where each receives the same

weight.

• Consider relaxation of (i); i.e. suppose we believe that Y1, . . . , Yn were each normally distributed

and uncorrelated (which implies independent or totally unrelated), but that var(Yj) is not the

same at each xj . This situation is represented pictorially in Figure 6.

Figure 6: Simple linear regression with nonconstant variance

x

y

0 2 4 6 8 10

34

56

78

Under these conditions, we believe that the joint probability density of Y is given by (3.15),

so we would want to obtain the estimator for β that minimizes the overall distance measure

associated with this, the one that takes the fact that there are different variances, and hence

different “quality” of information, at each xj ; i.e. the weighted sum of squared deviations

n∑j=1

(Yj − µj)2/σ2j .

Estimation of β in linear regression based on minimization of this distance measure is often called

weighted least squares for obvious reasons.

PAGE 55

Page 65: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 3 ST 732, M. DAVIDIAN

(Note that, to actually carry this out in practice, we would need to know the values of each σ2j ,

which is unnecessary when all the σ2j are the same. We will take up this issue later.)

• Consider relaxation both of (i) and (ii); we believe that Y1, . . . , Yn are each normally distributed

but correlated with possibly different variances at each xj . In this case, we believe that y follows

a general multivariate normal distribution. Thus, we would want to base estimation of β on the

overall distance measure associated with this probability density, which takes both these features

into account; i.e. we would minimize the quadratic form

(Y − µ)′Σ−1(Y − µ).

Estimation of β in linear regression based on such a general distance measure is also sometimes

called weighted least squares, where it is understood that the “weighting” also involves infor-

mation on correlations (through terms involving crossproducts).

(Again, to carry this out in practice, we would need to know the entire matrix Σ; more later.)

NOTATION: In general, we will use the following notation. If Y is a (n × 1) random vector with a

multivariate normal distribution, with mean vector µ and covariance matrix Σ, we will write this as

Y ∼ Nn(µ,Σ).

• The subscript n reminds us that the distribution is n-variate

• We may at times omit the subscript in places where the dimension is obvious.

PROPERTIES:

• If Y ∼ Nn(µ,Σ), then if we have a linear combination of Y , CY , where C is (q × n), then

CY ∼ Nn(Cµ, CΣC ′).

• If also Z ∼ Nn(τ ,Γ) and is independent of Y , then Z + Y ∼ Nn(µ + τ ,Σ + Γ) (as long as Σ

and Γ are nonsingular).

• We will use these two facts alone and together.

PAGE 56

Page 66: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 3 ST 732, M. DAVIDIAN

3.4 Multiple linear regression

So far, we have illustrated the usefulness of matrix notation and some key points in the context of the

problem of simple linear regression, which we have referred to informally throughout our discussion.

Now that we have discussed the multivariate normal distribution, it is worthwhile to review formally

the usual multiple linear regression model, of which the simple linear regression model is a special case,

and summarize what we have discussed from the broader perspective we have developed in terms of this

model in one place. This will prove useful later, when we consider more complex models for longitudinal

data.

SITUATION: The situation of the general multiple linear regression model is as follows.

• We have responses Y1, . . . , Yn, the jth of which is to be taken at a setting of k covariates (also

called predictors or independent variables) xj1, xj2, . . . , xjk.

• For example, an experiment may be conducted involving n men. Each man spends 30 minutes

walking on a treadmill, and at the end of this period, Y = his oxygen intake rate (ml/kg/min)

is measured. Also recorded are x1 = age (years), x2 = weight (kg) x3 = heart rate while resting

(beats/min), and x4 = oxygen rate while resting (ml/kg/min). Thus, for the jth man, we have

response

Yj = oxygen intake rate after 30 min

and his covariate values xj1, . . . , xj4.

The objective is to develop a statistical model that represents oxygen intake rate after 30 minutes

on the treadmill as a function of the covariates. One possible use for the model may be to get a

sense of how oxygen rates after 30 minutes might be for men with certain baseline characteristics

(age, weight, resting physiology) in order to develop guidelines for an exercise program.

• A standard model under such conditions is to assume that each covariate affects the response in

a linear fashion. Specifically, if there are k covariates (k = 4 above), then we assume

Yj = β0 + β1xj1 + · · ·+ βkxjk + εj , µj = β0 + β1xj1 + · · ·+ βkxjk. (3.16)

Here, εj is a random deviation with mean 0 and variance σ2 that characterizes how the observations

on Yj deviate from the mean value µj due to the aggregate effects of relevant sources of

variation.

PAGE 57

Page 67: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 3 ST 732, M. DAVIDIAN

• More formally, under this model, we believe that there is a population of all possible Yj values that

could be seen for, in the case of our example, men with the particular covariate values xj1, . . . , xjk.

This population is thought to have mean µj given above. εj reflects how such an observation might

deviate from this mean.

• The model itself has a particular interpretation. It says that if the value of one of the covariates,

xk, say, is increased by one unit, then the value of the mean increases by the amount βk.

• The usual assumption is that at any setting of the covariates, the population of possible Yj values

is well-represented by a normal distribution with mean µj and variance σ2. Note that the

variance σ2 is the same regardless of the covariate setting. More formally, we may state this as

εj ∼ N (0, σ2) or equivalently Yj ∼ N (µj , σ2).

• Furthermore, it is usually assumed that the Yj are independent. This would certainly make

sense in our example – we would expect that if the men were completely unrelated (chosen at

random from the population of all men of interest), then there should be no reason to expect

that the response observed for any one man would have anything to do with that observed for

another.

• The model is usually represented in matrix terms: letting the row vector x′j = (1, xj1, . . . , xjk),

the model is written

Yj = x′jβ + εj , Y = Xβ + ε,

with Y = (Y1, . . . , Yn)′, ε = (ε1, . . . , εn)′,

X =

1 x11 · · · x1k

......

......

1 xn1 · · · xnk

, β =

β0

β1

...

βk

(p× 1),

where p = k + 1 is the dimension of β, so that the (n× p) design matrix X has rows x′j .

PAGE 58

Page 68: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 3 ST 732, M. DAVIDIAN

• Thus, thinking of the data as the random vector Y , we may summarize the assumptions of

normality, independence, and constant variance succinctly. We may think of Y (n × 1)

as having a multivariate normal distribution with mean Xβ. Because the elements of Y are

assumed independent, all covariances among the Yj are 0, and the covariance matrix of y is

diagonal. Moreover, with constant variance σ2, the variance is the same for each Yj . Thus, the

covariance matrix is given by

σ2 0 · · · 0

0 σ2 · · · 0...

.... . .

...

0 · · · 0 σ2

= σ2I,

where I is a (n× n) identity matrix.

We thus may write

Y ∼ Nn(Xβ, σ2I).

• Note that the simple linear regression model is a special case of this with k = 1. The only

real difference is in the complexity of the assumed model for the mean of the population of Yj

values; for the general multiple linear regression model, this depends on k covariates. The simple

linear regression case is instructive because we are able to depict things graphically with ease; for

example, we may plot the relationship in a simple x-y plane. For the general model, this is not

possible, but in principle the issues are the same.

LEAST SQUARES ESTIMATION: The goal of an analysis of data of this form under assumption of

the multiple linear regression model (3.16) is to estimate the regression parameter β using the data

in order to characterize the relationship.

Under the usual assumptions discussed above, i.e.

• Yj (and equivalently εj) are normally distributed with variance σ2 for all j

• Yj (and equivalently εj) are independent

the usual estimator for β is found by minimizing the sum of squared deviations

n∑j=1

(Yj − β0 − xj1β1 − · · · − xjpβk)2.

PAGE 59

Page 69: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 3 ST 732, M. DAVIDIAN

In matrix terms, the sum of squared deviations may be written

(Y −Xβ)′(Y −Xβ). (3.17)

In these terms, the sum of squared deviations may be seen to be just a quadratic form.

• Note that we may write these equivalently as

n∑j=1

(Yj − β0 − xj1β1 − · · · − xjkβk)2/σ2,

and

(Y −Xβ)′I(Y −Xβ)/σ2;

because σ2 does not involve β, we may equally well talk about minimizing these quantities.

Of course, as we have previously discussed, this shows that all observations are getting “equal

weight” in determining β, which is sensible if we believe that the populations of all values of

Yj at any covariate setting are equally variable (same σ2). We now see that we are minimizing

the distance measure associated with a multivariate normal distribution where all of the Yj are

mutually independent with the same variance (all covariances/correlations = 0).

• Minimizing (3.17) means that we are trying to find the value of β that minimizes the distance

between responses and the means; by doing so, we are attributing as much of the overall differences

among the Yj that we have seen to the fact that they arise from different settings of xj , and as

little as possible to random variation.

• Because the quadratic form (3.17) is just a scalar function of the p elements of β, it is possible

to use calculus to determine that values of these p elements that minimize the quadratic form.

Formally, one would take the derivatives of (3.17) with respect to each of β0, β1, . . . , βk and set

these p expressions equal to zero. These p expressions represent a system of equations that may

be solved to obtain the solution, the estimator β.

PAGE 60

Page 70: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 3 ST 732, M. DAVIDIAN

• The set of p simultaneous equations that arise from taking derivatives of (3.17), expressed in

matrix notation, is

−2X ′Y + 2X ′Xβ = 0 or X ′Y = X ′Xβ.

We wish to solve for β. Note that X ′X is a square matrix (p× p) and X ′y is a (p× 1) vector.

Recall in Chapter 2 we saw how to solve a set of simultaneous equations like this; thus, we may

invoke that procedure to solve

X ′Y = X ′Xβ.

as long as the inverse of X ′X exists.

• Assuming this is the case, from Chapter 2, we know that X ′X will be of full rank (rank =

number of rows and columns = p) if X has rank p. We also know from Chapter 2 that if a square

matrix is of full rank, it is nonsingular, so its inverse exists. Thus, assuming X is of full rank,

we have that (X ′X)−1 exists, and we may premultiply both sides by (X ′X)−1 to obtain

(X ′X)−1X ′Y = (X ′X)−1X ′Xβ

= β.

• Thus, the least squares estimator for β is given by

β = (X ′X)−1X ′Y . (3.18)

• Computation for general p is not feasible by hand, of course; particularly nasty is the inversion of

the matrix X ′X. Software for multiple regression analysis includes routines for inverting a matrix

of any dimension; thus, estimation of β by least squares for a general multiple linear regression

model is best carried out in this fashion.

PAGE 61

Page 71: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 3 ST 732, M. DAVIDIAN

ESTIMATION OF σ2: It is often of interest to estimate σ2, the assumed common variance. The usual

estimator is

σ2 = (n− p)−1n∑

j=1

(Yj − x′jβ)2 = (n− p)−1(Y −Xβ)′(Y −Xβ).

• This makes intuitive sense. Each squared deviation (Yj − x′jβ)2 contains information about the

“spread” of values of Yj at xj . As we assume that this spread is the same for all xj , a natural

approach to estimating its magnitude, represented by the variance σ2, would be to pool this

information across all n deviations. Because we don’t know β, we replace it by the estimator β.

• We will see a more formal rationale later.

SAMPLING DISTRIBUTION: When we estimate a parameter (like β or σ2) that describes a popu-

lation by an estimator (like β or σ2), the estimator is some function of the responses, Y here. Thus,

the quality of the estimator, i.e. how reliable it is, depends on the variation inherent in the responses

and how much data on the responses we have.

• If we consider every possible set of data we might have ended up with of size n, each one of these

would give rise to a value of the estimator. We may think then of the population of all possible

values of the estimator we might have ended up with.

• We would hope that the mean of this population would be equal to the true value of the

parameter we are trying to estimate. This property is called unbiasedness.

• We would also hope that the variability in this population isn’t too large.

• If the values vary a lot across all possible data sets, then the estimator is not very reliable.

Indeed, we ended up with a particular data set, which yielded a particular estimate; however, had

we ended up with another data set, we might have ended up with quite a different estimate.

• If on the other hand these values vary little across all possible data sets, then the estimator is

reliable. Had we ended up with another set of data, we would have ended up with an estimate

that is quite similar to the one we have.

Thus, it is of interest to characterize the population of all possible values of an estimator. Because the

estimator depends on the response, the properties of this population will depend on those of Y . More

formally, we may think of the probability distribution of the estimator, describing how it takes on

all its possible values. This probability distribution will be connected with that of the Y .

PAGE 62

Page 72: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 3 ST 732, M. DAVIDIAN

A probability distribution that characterizes the population of all possible values of an estimator is

called a sampling distribution.

To understand the nature of the sampling distribution of β, we thus consider the probability distribution

of

β = (X ′X)−1X ′Y , (3.19)

which is a linear combination of the elements of Y . We may thus apply earlier facts to derive

mathematically the sampling distribution.

• We may determine the mean of this distribution by applying the expectation operator to the

expression (3.19); this represents averaging across all possible values of the expression (which

follow from all possible values of Y ). Now Y ∼ Nn(Xβ, σ2I) under the usual assumptions, thus

E(Y ) = Xβ. Thus, using the results in section 3.2,

E(β) = E{(X ′X)−1X ′Y } = (X ′X)−1X ′E(Y ) = (X ′X)−1X ′Xβ = β,

showing that β under our assumptions is an unbiased estimator of β.

• We may also determine the variance of this distribution. Formally, this would mean applying the

expectation operator to

{(X ′X)−1X ′Y − β}{(X ′X)−1X ′Y − β}′;

i.e. finding the covariance matrix of (3.19). Rather than doing this directly, it is simpler to exploit

the results in section 3.2, which yield

var{(X ′X)−1X ′Y } = (X ′X)−1X ′var(Y ){(X ′X)−1X ′}′

= (X ′X)−1X ′(σ2I)X(X ′X)−1 = σ2(X ′X)−1.

Note that the variability of the population of all possible values of β depends directly on σ2, the

variation in the response. It also depends on n, the sample size, because X is of dimension (n×p).

• In fact, we may say more – because under our assumptions Y has a multivariate normal distribu-

tion, it follows that the probability distribution of all possible values of β is multivariate normal

with this mean and covariance matrix; i.e.

β ∼ Np{β, σ2(X ′X)−1}.

PAGE 63

Page 73: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 3 ST 732, M. DAVIDIAN

This result is used to obtain estimated standard errors for the components of β; i.e. estimates of the

standard deviation of the sampling distributions of each component of β.

• In practice, σ2 is unknown, thus, it is replaced with the estimate σ2.

• The estimated standard error of the kth element of β is then the square root of the kth diagonal

element of σ2(X ′X)−1.

It is also possible to derive a sampling distribution for σ2. For now, we will note that it is possible to

show that σ2 is an unbiased estimator of σ2. That is, it may be shown that

E{(n− p)−1(Y −Xβ)′(Y −Xβ)} = σ2.

This may be shown by the following steps:

• First, it may be demonstrated that (try it!)

(Y −Xβ)′(Y −Xβ) = Y ′Y − Y ′Xβ − β′X ′Y + β

′X ′Xβ

= Y ′{I −X(X ′X)−1X ′}Y

We have just expressed the original quadratic form in a different way, which is still a quadratic

form.

• Fact: It may be shown that if Y is any random vector with mean µ and covariance matrix Σ that

for any square matrix A,

E(Y ′AY ) = tr(AΣ) + µ′Aµ.

Applying this to our problem, we have µ = Xβ, Σ = σ2I, and A = I −X(X ′X)−1X. Thus,

using results in Chapter 2,

E(Y −Xβ)′(Y −Xβ) = tr[{I −X(X ′X)−1X ′}σ2I] + β′X ′{I −X(X ′X)−1X ′}Xβ

= σ2tr{I −X(X ′X)−1X ′}+ β′X ′{I −X(X ′X)−1X ′}Xβ.

Thus, to find E(Y −Xβ)′(Y −Xβ), we must evaluate each term.

PAGE 64

Page 74: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 3 ST 732, M. DAVIDIAN

• We also have: If X is any (n × p) matrix of full rank, writing Iq to emphasize the dimension of

the identity matrix of dimension q, then

tr{X(X ′X)−1X ′} = tr{(X ′X)−1X ′X} = tr(Ip) = p,

so that

tr{In −X(X ′X)−1X ′} = tr(In)− tr(Ip) = n− p.

Furthermore,

{I −X(X ′X)−1X ′}X = X −X(X ′X)−1X ′X = X −X = 0.

Applying these to the above expression, we obtain

E(Y −Xβ)′(Y −Xβ) = σ2(n− p) + 0 = σ2(n− p).

Thus, we have E{(n− p)−1(Y −Xβ)′(Y −Xβ)} = σ2, as desired.

EXTENSION: The discussion above focused on the usual multiple linear regression model, where it is

assumed that

Y ∼ Nn(Xβ, σ2I).

In some situations, although it may be reasonable to think that the population of possible values of Yj

at xj might be normally distributed, the assumptions of constant variance and independence may not

be realistic.

• For example, recall the treadmill example, where Yj was oxygen intake rate after 20 minutes on

the treadmill for man j with covariates (age, weight, baseline characteristics) xj . Now each Yj was

measured on a different man, so the assumption of independence among the Yj seems realistic.

• However, the assumption of constant variance may be suspect. Young men in their 20s will all

tend to be relatively fit, simply by virtue of their age, so we might expect their rates of oxygen

intake to not vary too much. Older men in their 50s and beyond, on the other hand, might be

quite variable in their fitness – some may have exercised regularly, while others may be quite

sedentary. Thus, we might expect oxygen intake rates for older men to be more variable than for

younger men. More formally, we might expect the distributions of possible values of Yj at different

settings of xj to exhibit different variances as the ages of men differ.

PAGE 65

Page 75: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 3 ST 732, M. DAVIDIAN

• Recall the pine seedling example. Suppose the seedling is planted and its height is measured on

each of n consecutive days. Here, Yj would be the height measured at time xj , say, where xj is

the time measured in days from planting. We might model the mean of Yj as a function of xj , e.g.

Yj = β0 + β1xj + β2x2j + εj ,

a quadratic function of time. After n days, we have the vector Y . As discussed earlier, however,

it may not be realistic to think that the elements of Y are all mutually independent. In fact, we

do not expect the height to follow the “smooth” quadratic trend; rather, it “fluctuates” about it;

e.g. the seedling may undergo “growth spurts” or “dormant periods” along the way. Thus, we

would expect to see a “large” value of Y on one day followed by a “large” value the next day.

Thus, the elements of Yj covary (are correlated).

In these situations, we still wish to consider a multiple linear regression model; however, the standard

assumptions do not apply. More formally, we may still believe that each Yj follows a normal distribution,

so that Y is multivariate normal, but the assumption that

var(Y ) = σ2I

for some constant σ2 is no longer relevant. Rather, we think that

var(Y ) = Σ

for some covariance matrix Σ that summarizes the variances of each Yj and the covariances thought to

exist among them. Under these conditions, we would rather assume

Y ∼ Nn(Xβ,Σ).

Clearly, the usual method of least squares, discussed above, is inappropriate for estimating β; it mini-

mizes an inappropriate distance criterion.

WEIGHTED LEAST SQUARES: The appropriate distance condition is

(Y −Xβ)′Σ−1(Y −Xβ). (3.20)

Ideally, we would rather estimate β by minimizing (3.20), because it takes appropriate account of the

possibly different variances and the covariances among elements of Y .

• In the constant variance/independence situation, recall that σ2, the assumed common variance,

is not involved in estimation of β.

PAGE 66

Page 76: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 3 ST 732, M. DAVIDIAN

• In addition, if σ2 is unknown, as is usually the case in practice, we saw that an intuitively appealing,

unbiased estimator σ2 may be derived, which is based on “pooling” information on the common

σ2.

• Here, however, with possibly different variances for different Yj , and different covariances among

different pairs (Yj , Yk), things seem much more difficult! As we will see momentarily, estimation

of β by minimizing (3.20) will now involve Σ, which further complicates matters.

• We will delay discussion of the issue of how to estimate Σ in the event that it is unknown until

we talk about longitudinal data from several individuals later.

For now, assume that Σ is known, which is clearly unrealistic in practice, to gain insight into the

principle of minimizing (3.20).

• Analogous to the simpler case of constant variance/independence, to determine the value β that

minimizes (3.20), one may use calculus to derive a set of p simultaneous equations to solve, which

turn out to be

−2X ′Σ−1Y + 2X ′Σ−1Xβ = 0,

which leads to the solution

β = (X ′Σ−1X)−1X ′Σ−1Y . (3.21)

β in (3.21) is often called the weighted least squares estimator.

• Note that β is still a linear function of the elements of Y .

• Thus, it is straightforward to derive its sampling distribution. β is unbiased, as

E(β) = (X ′Σ−1X)−1X ′Σ−1Xβ = β.

var(β) = (X ′Σ−1X)−1X ′Σ−1ΣΣ−1X(X ′Σ−1X)−1 = (X ′Σ−1X)−1.

• Furthermore, because Y is multivariate normal, we have

β ∼ Np{β, (X ′Σ−1X)−1}.

• Thus, if we knew Σ, we would be able to construct estimated standard errors for elements of β,

etc.

The notion of weighted least squares will play a major role in our subsequent development of methods

for longitudinal data. We will revisit it and tackle the issue of how to estimate Σ later.

PAGE 67

Page 77: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 4 ST 732, M. DAVIDIAN

4 Introduction to modeling longitudinal data

We are now in a position to introduce a basic statistical model for longitudinal data. The models and

methods we discuss in subsequent chapters may be viewed as modifications of this model to incorporate

specific assumptions on sources of variation and the form of mean vectors.

We restrict our discussion here to the case of balanced data; i.e., where all units have repeated

measurements at the same n time points. Later, we will extend our thinking to handle the case of

unbalanced data.

4.1 Basic Statistical Model

Recall that the longitudinal (or more general repeated measurement data) situation involves observation

of the same response repeatedly over time (or some other condition) for each of a number of units

(individuals).

• In the simplest case, the units may be a random sample from a single population.

• More generally, the units may arise from different populations. Units may be randomly assigned

to different treatments or units may be of different types (e.g. male and female).

• In some cases, additional information on individual-unit characteristics like age and weight may

be recorded.

We first introduce a fundamental model for balanced longitudinal data for a single sample from a com-

mon population, and then discuss how it may be adapted to incorporate these more general situations.

MOST BASIC MODEL FOR BALANCED DATA: Suppose the response of interest is measured on

each individual at n times t1 < t2 < · · · < tn. The dental study (n = 4; t1, . . . , t4 = 8, 10, 12, 14) and

the guinea pig diet data (n = 6; t1, . . . , t6 = 1, 3, 4, 5, 6, 7) are balanced data sets (with units coming

from more than one population).

Consider the case where all the units are from a single population first. Corresponding to each tj ,

j = 1, . . . , n, there is a random variable Yj , j = 1, . . . , n, with a probability distribution that summarizes

the way in which responses at time tj among all units in the population take on their possible values.

PAGE 68

Page 78: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 4 ST 732, M. DAVIDIAN

As we discuss in detail shortly, values of the response at any time tj may vary due to the effects of

relevant sources of variation.

We may think of the generic random vector

Y =

Y1

Y2

...

Yn

(4.1)

where the variables are arranged in increasing time order.

• Y in (4.1) has a multivariate probability distribution summarizing the way in which all responses

at times t1, . . . , tn among all units in the population take on their possible values jointly.

• This probability distribution has mean vector E(Y ) = µ with elements µj = E(yj), j = 1, . . . , n,

and covariance matrix var(Y ) = Σ.

CONVENTION: Except when we discuss “classical” methods in the next two chapters, we will use i as

the subscript indexing units and j as the subscript indexing responses in time order within units.

We will also use m to denote the total number of units (across groups where relevant). E.g. for the

dental study and guinea pig diet data, m = 27 and m = 15, respectively.

Thus, in thinking about a random sample of units from a single population of interest, just as we do

for scalar response, we may thus think of m (n× 1) random vectors

Y 1, Y 2, . . . ,Y m,

corresponding to each of m individuals, each of which has features (e.g. multivariate probability distri-

bution) identical to Y in (4.1).

For the ith such vector,

Y i =

Yi1

Yi2

...

Yin

,

such that

E(Y i) = µ, var(Y i) = Σ.

PAGE 69

Page 79: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 4 ST 732, M. DAVIDIAN

• It natural to be concerned that components Yij , j = 1, . . . , n, are correlated.

• In particular, this may be due to the simple fact that observations on the same unit may tend to

be “more alike” than those compared across different units; e.g. a guinea pig with “low” weight at

any given time relative to other pigs will likely be “low” relative to other pigs at any other time.

• Alternatively, correlation may be due to biological “fluctuations” within a unit, as in the pine

seedling example of the last chapter.

We will discuss these sources of variation for longitudinal data shortly. For now, it is realistic to expect

that

cov(Yij , Yik) 6= 0 for any j 6= k = 1, . . . , n.

in general, so that Σ is unlikely to be a diagonal matrix.

INDEPENDENCE ACROSS UNITS: On the other hand, if each Y i corresponds to a different indi-

vidual, and individuals are not related in any way (e.g. different children or guinea pigs, treated and

handled separately), then it seems reasonable to suppose that the way any observation may turn out at

any time for unit i is unrelated to the way any observation may turn out for another unit ` 6= i; that is,

observations from different vectors are independent.

• Under this view, the random vectors Y 1, Y 2, . . . ,Y m are all mutually independent.

• It follows that if Yij is a response from unit i and Y`k is a response from unit `, cov(Yij , Y`k) = 0

even if j = k (same time point but different units).

BASIC STATISTICAL MODEL: Putting all this together, we have m mutually independent random

vectors Y i, i = 1, . . . , m, with E(Y i) = µ and var(Y i) = Σ.

• We may write this model equivalently similarly to the univariate case; specifically,

Y i = µ + εi, E(εi) = 0, var(εi) = Σ, (4.2)

where the εi, i = 1, . . . , m, are mutually independent.

• εi are random vector deviations such that εi = (εi1, . . . , εin)′, where each εij , j = 1, . . . , n,

E(εij) = 0 represents how Yij deviates from its mean µj due to aggregate effects of sources of

variation.

PAGE 70

Page 80: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 4 ST 732, M. DAVIDIAN

• In addition, the εij are correlated, but εi are mutually independent across i.

Questions of scientific interest are characterized as questions about the elements of µ, as will be for-

malized in later chapters.

MULTIVARIATE NORMALITY: If the response is continuous, it may be reasonable to assume that

the Yij and εij are normally distributed. In this case, adding the further assumption that εi ∼ N (0,Σ),

(4.2) implies

Y i ∼ Nn(µ,Σ), i = 1, . . . , m,

where the Y i are mutually independent.

EXTENSION TO MORE THAN ONE POPULATION: Suppose that individuals may be thought of as

sampled randomly from q different populations; e.g. q = 2 (males and females) in the dental study.

• We may again think of Y i, m independent random vectors, where, if Y i corresponds to a unit

from group `, ` = 1, . . . , q, then Y i has a multivariate probability distribution with

E(Y i) = µ`, var(Y i) = Σ`.

That is, each population may have a different mean vector and covariance matrix.

• Equivalently, we may express this as

Y i = µ` + εi, E(εi) = 0, var(εi) = Σ` for i from group ` = 1, . . . , q.

• We might also assume εi ∼ N (0,Σ`) for units in group `, so that

Y i ∼ N (µ`,Σ`)

for i from group `.

• If furthermore it is reasonable to assume that all sources of variation act similarly in each popu-

lation, we might assume that Σ` = Σ, a common covariance matrix for all populations.

With univariate responses, it is often reasonable to assume that population membership may

imply a change in mean response but not affect the nature of variation; e.g. the primary effect

of a treatment may be to shift responses on average relative to those for another, but to leave

variability unchanged. This reduces to the assumption of equal variances.

For the longitudinal case, such an assumption may also be reasonable, but is more involved, as

assuming the same “variation” in all groups must take into account both variance and covaria-

tion.

PAGE 71

Page 81: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 4 ST 732, M. DAVIDIAN

• Under this assumption, the model becomes

Y i = µ` + εi, E(εi) = 0, var(εi) = Σ for i from group ` = 1, . . . , q,

for a covariance matrix Σ common to all groups.

• Note that even though Σ is common to all populations, the diagonal elements of Σ may be

different across j = 1, . . . , n, so that variance may be different at different times; however, at any

given time, the variance is the same for all groups.

• Similarly, the covariances in Σ between the jth and kth elements of Y i may be different for

different choices of j and k, but for any particular pair (j, k), the covariance is the same for all

groups.

EXTENSION TO INDIVIDUAL INFORMATION: We may extend this thinking to take into account

other individual covariate information besides population membership by analogy to regression models

for univariate response.

• E.g., suppose age ai at the first time point is recorded for each unit i = 1, . . . , m.

• We may envision for each age ai a multivariate probability distribution describing the possible

values of Y i. The mean vector of this distribution would naturally depend on ai.

• We write this for now as E(Y i) = µi, where µi is the mean of random vectors from the population

corresponding to age ai, and the subscript i implies that the mean is “unique” to i in the sense

that it depends on ai somehow.

• Assuming that variation is similar regardless of age, we may write

Y i = µi + εi, E(εi) = 0, var(εi) = Σ.

We defer discussion of how dependence of µi on ai (and other factors) might be characterized to

later chapters.

All of the foregoing models represent random vectors Y i in terms of a mean vector plus a random

deviation vector εi that captures the aggregate effect of all sources of variation. This emphasizes the

two key aspects of modeling longitudinal data:

(1) Characterizing mean vectors in these models in a way that best captures how mean response

changes with time and depends on other factors, such as group or age, in order to address questions

of scientific interest;

PAGE 72

Page 82: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 4 ST 732, M. DAVIDIAN

(2) Taking into account important sources of variation by characterizing the nature of the random

deviations εi, so that these questions may be addressed by taking faithful account of all variation

in the data.

Models we discuss in subsequent chapters may be viewed as particular cases of this representation,

where (1) and (2) are approached differently.

We first take up the issue in (2), that of the sources of variation that εi may reflect.

4.2 Sources of variation in longitudinal data

For longitudinal data, potential sources of variation usually are thought of as being of two main types:

• Among-unit variation

• Within-units variation.

It is useful to conceptualize the way in which longitudinal response vectors may be thought to arise.

There are different perspectives on this; here, we consider one popular approach. For simplicity, consider

the case of a single population and the model

Y i = µ + εi.

The ideas are relevant more generally.

Figure 1 provides a convenient backdrop for thinking about the sources that might make up εi.

• Panel (a) shows the values actually observed for m = 3 units; these values include the effects of

all sources of variation.

• Panel (b) is a conceptual representation of possible underlying features of the situation.

The open circles on the thick, solid line represent the elements of µ at each of the n = 9 time

points. E.g., the leftmost circle represents the mean µ1 of all possible values that could be observed

at t1, thus averaging all deviations εi1 due to all among- and within-unit sources over all units i.

The means over time lie on a straight line, but this need not be true in general.

The solid diamonds represent the actual observations for each individual. If we focus on the first

time point, for example, it is clear that the observations for each i vary about µ1.

PAGE 73

Page 83: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 4 ST 732, M. DAVIDIAN

Figure 1: (a) Hypothetical longitudinal data from m = 3 units at n = 9 time points. (b) Conceptual

representation of sources of variation. The open circles connected by the thick solid line represent the

means µj, j = 1, . . . , n for the populations of all possible observations at each of the n time points.

The thin solid lines represent “trends” for each unit. The dotted lines represent the pattern of error-

free responses for the unit over time, which fluctuate about the trend. The diamonds represent the

observations of these responses, which are subject to measurement error.

time

resp

onse

(a)

time

resp

onse

(b)

• For each individual, we may envision a “trend,” depicted by the solid lines (the trend need not

follow a straight line in general). The “trend” places the unit in the population.

The vertical position of this trend at any time point dictates whether the individual is “high”

or “low” relative to the corresponding mean in µ. Thus, these “trends” highlight (biological)

variation among units.

Some units may be consistently “high” or “low,” others may be “high” at some times and “low”

at others relative to the mean.

• The dotted lines represent “fluctuations” about the smoother (straight-line) trend, representing

variation in how responses for that individual may evolve. In the pine seedling example cited

earlier, with response height of a growing plant over time, although the overall pattern of growth

may “track” a smooth trend, natural variation in the growth process may cause the responses to

fluctuate about the trend.

This phenomenon necessarily occurs within units; (biological) fluctuations about the trend are

the result of processes taking place only within that unit.

PAGE 74

Page 84: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 4 ST 732, M. DAVIDIAN

Note that values on the dotted line that are very close in time tend to be “larger” or “smaller”

than the trend together, while those farther apart seem just as likely to be larger or smaller than

the trend, with no relationship.

• Finally, the observations for a unit (diamonds) do not lie exactly on the dotted lines, but vary

about them. This is due to measurement error. Again, such errors take place within the unit

itself in the sense that the measuring process occurs at the specific-unit level.

We may formalize this thinking by refining how we view the basic model Y i = µ + εi. The jth element

of Y i, Yij , may be thought of as being the sum of several components, each corresponding to a different

source of variation; i.e.

Yij = µj + εij = µj + bij + eij = µj + bij + e1ij + e2ij , (4.3)

where E(bij) = 0, E(e1ij) = 0, and E(e2ij) = 0.

• bij is a deviation representing among unit variation at time tj due to the fact that unit i “sits”

somewhere in the population relative to µj due to biological variation.

We may think of bij as dictating the “inherent trend” for i at tj .

• e1ij represents the additional deviation due to within-unit fluctuations about the trend.

• e2ij is the deviation due to measurement error (within-units).

• The sum eij = e1ij + e2ij denotes the aggregate deviation due to all within-unit sources.

• The sum εij = bij + e1ij + e2ij thus represents the aggregate deviation from µj due to all sources.

Stacking the εij , bij , and eij , we may write

εi = bi + ei = bi + e1i + e2i,

which emphasizes that εi includes components due to among- and within-unit sources of variation.

SOURCES OF CORRELATION: This representation provides a framework for thinking about assump-

tions on among- and within-unit variation and how correlation among the Yij (equivalently, among the

εij) may be thought to arise.

• The bij determines the “inherent trend” in the sense that µj + bij represents position of the

“inherent trajectory” for unit i at time j. The Yij thus all tend to be in the vicinity of this trend

across time (j) for unit i. As can be seen from Figure 1, this makes the observations on i “more

alike” relative to observations from units.

PAGE 75

Page 85: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 4 ST 732, M. DAVIDIAN

Accordingly, we expect that the elements of εi (and hence those of Y i) are correlated due to the

fact that they share this common, underlying trend. We may refer to correlation arising in this

way as correlation due to among-unit sources.

In subsequent chapters, we will see that different longitudinal data models may make specific

assumptions about terms like bij that represent among-unit variation and hence this source of

correlation.

• Because e1ij are deviations due to the “fluctuation” process, it is natural to think that the e1ij

might be correlated across j. If the process is “high” relative to the inherent trend at time tj

(so e1ij is positive), it might be expected to be “high” at times tj′ close to tj (e1ij′ positive) as

well. Thus, we might expect the elements of εi and thus Y i to be correlated as a consequence

of such fluctuations (because the elements of e1i are correlated).

We may refer to correlation arising in this way as correlation due to within-unit sources.

Note that if the fluctuations occur in a very short time span relative to the spacing of the tj ,

whether the process is “high” at tj may have little or no relation to whether it is high at adjacent

times. In this case, we might believe such within-unit correlation is negligible. As we will see,

this is a common assumption, often justified by noting that the tj are far apart in time.

• The overall pattern of correlation for εi (and hence Y i) may be thought of as resulting from the

combined effects of these two sources (among- and within-units).

• As measuring devices tend to commit “haphazard” errors every time they are used, it may be

reasonable to assume that the e2ij are independent across j. Thus, we expect no contribution

to the overall pattern of correlation.

To complete the thinking, we must also consider the variances of the bij , e1ij , and e2ij . We defer

discussion of this to later chapters in the context of specific models.

4.3 Exploring mean and covariance structure

The aggregate effect of all sources of variation, such as those identified in the conceptual scheme of

Section 4.2, dictates the form of the covariance matrix of εi and hence that of Y i.

PAGE 76

Page 86: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 4 ST 732, M. DAVIDIAN

As was emphasized earlier in our discussion of weighted least squares, if observations are correlated

and have possibly different variances, it is important to acknowledge this in estimating parameters of

interest such as population means so that differences in data quality and associations are taken into

adequate account. Thus, an accurate representation of var(εi) is critically important.

A first step in an analysis is often to examine the data for clues about the likely nature of the form of

this covariance matrix as well as the structure of the means and how they change over time.

Consider first the model for a single population

Y i = µ + εi, E(εi) = 0, var(εi) = Σ.

Based on observed data, we would like to gain insight into the likely forms of µ and Σ.

• We illustrate with the data for the 11 girls in the dental study, so for now take m = 11 and n = 4.

• Thus, the µj , j = 1, . . . , 4, of µ are the population mean distance for girls at ages 8, 10, 12,

and 14, the diagonal elements of Σ are the population variances of distance at each age, and the

off-diagonal elements of Σ represent the covariances among distances at different ages.

Spaghetti plots for both the boys and girls are given in in Figure 2.

Figure 2: Spaghetti plots of the dental data. The open circles represent the sample mean distance at

each age; these are connected by the thick line to highlight the relationship among means over time.

8 9 10 11 12 13 14

2025

30

age (years)

dist

ance

(m

m)

Girls

8 9 10 11 12 13 14

2025

30

age (years)

dist

ance

(m

m)

Boys

PAGE 77

Page 87: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 4 ST 732, M. DAVIDIAN

SAMPLE MEAN VECTOR: As we have discussed, the natural estimator for the mean µj at the jth

time point is the sample mean

Y ·j = m−1m∑

i=1

Yij ,

where the “dot” subscript indicates averaging over the first index i (i.e. across units). The sample mean

may be calculated calculated for each time point j = 1, . . . , n, suggesting that the obvious estimator for

µ is the vector whose elements are the Y ·j , the sample mean vector given by

Y = m−1m∑

i=1

Y i =

Y ·1...

Y ·n

.

• It is straightforward to show that the random vector Y is an unbiased estimator for µ; i.e.

E(Y ) = µ.

We may apply this estimator to the dental study data on girls to obtain the estimate (rounded to three

decimal places)

y =

21.182

22.227

23.091

24.091

.

In the left panel of Figure 2, these values are plotted for each age by the open circles.

• The thick solid line, which connects the Y ·j , gives a visual impression of a “smooth,” indeed

straight line, relationship over time among the µj .

• Of course, we have no data at ages intermediate to those in the study, so it is possible that mean

distance in the intervals between these times deviates from a straight line relationship. However,

from a biological point of view, it seems sensible to suppose that dental distance would increase

steadily over time, at least on average, rather than “jumping” around.

Graphical inspection of sample mean vectors is an important tool for understanding possible relation-

ships among means over time. When there are q > 1 groups an obvious strategy is to carry this out

separately for the data from each group, so that possible differences in means can be evaluated.

For the dental data on the 16 boys, the estimated mean turns out to be y = (22.875, 23.813, 25.719, 27.469)′;

this is shown as the thick solid line with open circles in the right panel of Figure 2. This estimate seems

to also look like a “straight line,” but with steepness possibly different from that for girls.

PAGE 78

Page 88: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 4 ST 732, M. DAVIDIAN

SAMPLE COVARIANCE MATRIX: Gaining insight into the form of Σ may be carried out both

graphically and through an unbiased estimator for Σ and its associated correlation matrix.

• The diagonal elements of Σ are simply the variances σ2j of the distributions of Yj values at each

time j = 1, . . . , n. Thus, based on m units, the natural estimator for σ2j is the sample variance

at time j,

S2j = (m− 1)−1

m∑i=1

(Yij − Y ·j)2,

which may be shown to be an unbiased estimator for σ2j .

• The off-diagonal elements of Σ are the covariances

σjk = E{(Yj − µj)(Yk − µk)}.

Thus, a natural estimator for σjk is

Sjk = (m− 1)−1m∑

i=1

(Yij − Y ·j)(Yik − Y ·k),

which may also be shown to be unbiased.

• The obvious estimator for Σ is thus the matrix in which the variances σ2j and covariances σjk are

replaced by S2j and Sjk. It is possible to represent this matrix succinctly (verify) as

Σ = (m− 1)−1m∑

i=1

(Y i − Y )(Y i − Y )′.

This is known as the sample covariance matrix.

• The sum∑m

i=1(Y i − Y )(Y i − Y )′ is often called the sum of squares and cross-products

(SS&CP) matrix, as its entries are the sums of squared deviations and cross-products of deviations

from the sample mean.

• The sample covariance matrix is exactly as we would expect; recall that the covariance matrix

itself is defined as

Σ = E{(Y − µ)(Y − µ)′}.

The sample covariance matrix may be used to estimate the covariance matrix. However, although the

diagonal elements may provide information on the true variances at each time point, the off-diagonal ele-

ments may be difficult to interpret. Given the unitless nature of correlation, it may be more informative

to learn about associations from estimates of correlation.

PAGE 79

Page 89: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 4 ST 732, M. DAVIDIAN

SAMPLE CORRELATION MATRIX: If Σ is an estimator for a covariance matrix Σ with elements

Σjk, j, k = 1, . . . , n, then the natural estimator for the associated correlation matrix Γ is Γ, the (n×n)

matrix Γ with ones on the diagonal (as required for a correlation matrix) and (j, k) off-diagonal element

Σjk√ΣjjΣkk

.

• For a single population, where Σ is the sample covariance matrix, the off-diagonal elements are

Sjk

SjSk, (4.4)

which are obvious estimators for the correlations

ρjk =σjk

σjσk.

• In this case, the estimated matrix Γ is called the sample correlation matrix, as it is an estimate

of the correlation matrix corresponding to the sample covariance matrix for the single population.

• The expression in (4.4) is known as the sample correlation coefficient between the observations

at times tj and tk, as it estimates the correlation coefficient ρjk.

Shortly, we shall see how to estimate common covariance and correlation matrices based on data from

several populations.

For the 11 girls in the dental study, we obtain the estimated covariance and correlation matrices (rounded

to three decimal places)

ΣG =

4.514 3.355 4.332 4.357

3.355 3.618 4.027 4.077

4.332 4.027 5.591 5.466

4.357 4.077 5.466 5.941

, ΓG =

1.000 0.830 0.862 0.841

0.830 1.000 0.895 0.879

0.862 0.895 1.000 0.948

0.841 0.879 0.948 1.000

.

• The diagonal elements of ΣG suggest that the aggregate variance in dental distances roughly

increases over time from age 8 to 14.

However, keep in mind that the values shown are estimates of the corresponding parameters based

on only m = 11 observations; thus, they are subject to the usual uncertainty of estimation. It is

thus sensible to not “over-interpret” the numbers but rather to only examine them for suggestive

features.

PAGE 80

Page 90: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 4 ST 732, M. DAVIDIAN

• The off-diagonal elements of Γ represent the aggregate pattern of correlation due to among- and

within-girl sources. Here, the estimate of this correlation for any pair of time points is positive

and close to one, suggesting that “high” values at one time are strongly associated with “high”

values at another time, regardless of how far apart in time the observations occur.

In light of Figure 2, this is really not surprising. The data for individual girls in the figure show

pronounced trends that for the most part place a girl’s trajectory above or below the estimated

mean profile (thick line). Thus, a girl such as the topmost one is “high” throughout time, suggest-

ing a strong component of among-girl variation in the population, and the estimates of correlation

are likely reflecting this.

• Again, it is not prudent to attach importance to the numbers and differences among them, as they

are estimates from a rather small sample, so the observed difference between 0.948 and 0.830 may

or may not reflect a real difference in the true correlations.

SCATTERPLOT MATRICES: A useful supplement to numerical estimates is a graphical display of the

observed data known as a scatterplot matrix.

As correlation reflects associations among observations at different time points, initially one would think

that a natural way of graphically assessing these associations would be to make the following plot.

• For each pair of times tj and tk, graph the observed data values (yij , yik) for all i = 1, . . . , m units,

with yij values on the horizontal axis and yik values on the vertical axis. The observed pattern

might be suggestive of the nature of association among responses at times tj and tk.

• This is not exactly correct; in particular, if the means µj and µk and variances σ2j and σ2

k are not

the same, the patterns in the pairwise plots will in part be a consequence of this. It would make

better sense to plot the “centered” and “scaled” versions of these; i.e. plot the pairs(yij − µj

σj,yik − µk

σk

).

• Given we do not know the µj or σj , a natural strategy is to replace these by estimates and instead

plot the pairs (yij − y·j

sj,yik − y·k

sk

).

Following this reasoning, it is common to make these plots for all pairs (j, k), where j 6= k.

Figure 3 shows the scatterplot matrix for the girls in the dental study.

PAGE 81

Page 91: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 4 ST 732, M. DAVIDIAN

Figure 3: Scatterplot matrix for the girls in the dental study.

Age 8

-1.5 -1.0 -0.5 0.0 0.5 1.0 1.5

• ••

• ••

•-2 -1 0 1

-2-1

01

• ••

-1.5

-0.5

0.5

1.0

1.5

••

••

Age 10

••

••

••

••

•• •

• •

• • •

• •

Age 12

-10

12

• • •

••

-2 -1 0 1

-2-1

01

•• •

••

••

• • •

••

••

-1 0 1 2

• • •

••

••

Age 14

In each panel, the apparent association among centered and scaled distance observations appears strong.

The fact that the trend is from lower left to upper right in each panel, so that large centered and scaled

values at one time correspond to large ones at another time, indicates that the association is positive

for each pair of time points. Moreover, the nature of the association seems fairly similar regardless

of the separation in time; i.e. the pattern of the plot corresponding to ages 8 and 14 shows a similar

qualitative trend to those corresponding to ages 8 and 10, ages 8 and 12, and so on.

The evidence in the plots coincides with the numerical summary provided by the sample correlation

matrix, which suggests that correlation is of similar magnitude and direction for any pair of times.

Some remarks:

• Visual display offers the data analyst another perspective on the likely pattern of aggregate cor-

relation in the data in addition to that provided by the estimated correlation matrix. This

information taken with that on variance in the sample covariance matrix can help the analyst to

identify whether the pattern of variation has systematic features. If such systematic features

are identified, it may be possible to adopt a model for var(εi) that embodies them, allowing an

accurate characterization. We take up this issue shortly.

• The same principles may be applied in more complicated settings; e.g. with more than one group.

Here, one could estimate the covariance matrix Σ` and associated correlation matrix Γ`, say, for

each group ` separately and construct a separate scatterplot matrix.

• In the case of q > 1 groups, a natural objective would be to assess whether in fact it is reasonable

to assume that the covariance matrix is the same for all groups.

PAGE 82

Page 92: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 4 ST 732, M. DAVIDIAN

POOLED SAMPLE COVARIANCE AND CORRELATION MATRICES: To illustrate this last point,

consider the data for boys in the dental study. It may be shown that the sample covariance and

correlation matrices are

ΣB =

6.017 2.292 3.629 1.613

2.292 4.563 2.194 2.810

3.629 2.194 7.032 3.241

1.613 2.810 3.241 4.349

, ΓB =

1.000 0.437 0.558 0.315

0.437 1.000 0.387 0.631

0.558 0.387 1.000 0.586

0.315 0.631 0.586 1.000

.

• Comparing to ΣG for girls, aggregate variance does not seem to increase over time and seems

larger than that for girls at all but the last time. (These estimates are based on small samples,

11 and 16 units, so should be interpreted with care.)

• Comparing to ΓG for girls suggests that correlation for boys, although positive, is of smaller

magnitude. Moreover, the estimated correlations for boys tend to “jump around” more than

those for girls.

Figure 4 shows the scatterplot matrix for boys.

Figure 4: Scatterplot matrix for the boys in the dental study.

Age 8

-1 0 1 2

••

••

••

•••

••

••

••

• ••

-1.0 -0.5 0.0 0.5 1.0 1.5 2.0

-2-1

01

2

••

••

••

• ••

-10

12

• •

••

••

••

Age 10•

• •

••

••

••

• •

••

••

••

••

• •

• •

••

• • •

••

••

• •

• •

• ••

Age 12

-1.0

0.0

0.5

1.0

1.5

2.0

••

••

• •

• •

•• •

-2 -1 0 1 2

-1.0

0.0

0.5

1.0

1.5

2.0

••

••

••

••

•-1.0 -0.5 0.0 0.5 1.0 1.5 2.0

••

••

Age 14

Comparing this figure to that for girls in Figure 3 reveals that the trend in each panel seems less

profound for boys, although it is still positive in every case.

Overall, there seems to be informal evidence that both the mean and pattern of variance and cor-

relation in the populations of girls and boys may be different. We will study longitudinal data models

that allow such features to be taken into account.

PAGE 83

Page 93: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 4 ST 732, M. DAVIDIAN

Although this seems to be the case here, in many situations, the evidence may not be strong enough to

suggest a difference in variation across groups, or scientific considerations may dictate that an assump-

tion of a common pattern of overall variation is reasonable.

Under these conditions, it is natural to combine the information on variation across groups in order to

examine the features of the assumed common structure. Since ordinarily interest focuses on whether the

µ` are the same, as we will see, such an assessment continues to assume that the µ` may be different.

The assumed common covariance matrix Σ and its corresponding correlation matrix Γ from data for q

groups may be estimated as follows. Assume that there are r` units from the `th population, so that

m, the total number of units, is such that m = r1 + · · ·+ rq.

• As we continue to believe the µ` are different, estimate these by the sample means Y `, say, for

each group.

• Let Σ` denote the sample covariance matrix calculated for each group separately (based on Y `).

• A natural strategy if we believe that there is a common covariance matrix Σ is then to use as an

estimator for Σ a weighted average of the Σ`, ` = 1, . . . , q, that takes into account the differing

amount of information from each group:

Σ = (m− q)−1{(r1 − 1)Σ1 + · · ·+ (rq − 1)Σq}.

This matrix is referred to as the pooled sample covariance matrix.

• If the number of units from each group is the same, so that r` ≡ r, say, then Σ reduces to a

simple average; i.e. Σ = (1/q)(Σ1 + · · ·+ Σq).

• The quantity in braces is often called the Error SS&CP matrix, as we will see later.

• The pooled sample correlation matrix estimating the assumed common correlation matrix Γ

is naturally defined as the estimated correlation matrix corresponding to Σ.

From the definition, the diagonal elements of the pooled sample covariance matrix are weighted averages

of the sample variances from each group. That is, if S(`)2j is the sample variance of the observations

from group ` at time j, then the (j, j) element of Σ, Σjj , say, is equal to

Σjj = (m− q){(r1 − 1)S(1)2j + · · ·+ (rq − 1)S(q)2

j },

the so-called pooled sample variance at time tj .

PAGE 84

Page 94: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 4 ST 732, M. DAVIDIAN

If the analyst is willing to adopt the assumption of a common covariance matrix for all groups, then

inspection of the pooled estimate may be carried out as in the case of a single population. Similarly,

a pooled scatterplot matrix would be based on centered and scaled versions of the yij , where the

“centering” continues to be based on the sample means for each group but the “scaling” is based on

the common estimate of variance for yij from Σ. In particular, one would plot the observed pairsyij − y(`)·j√

Σjj

,yik − y

(`)·k√

Σkk

for all units i = 1, . . . , m from all groups ` = 1, . . . , q on the same graph for each pair of times tj and tk.

DENTAL STUDY: Although we are not convinced that it is appropriate to assume a common covariance

matrix for boys and girls in the dental study, for illustration we calculate the pooled sample covariance

and correlation matrix to obtain:

Σ = (1/25)(10ΣG + 15ΣB) =

5.415 2.717 3.910 2.710

2.717 4.185 2.927 3.317

3.910 2.927 6.456 4.131

2.710 3.317 4.131 4.986

and

Γ =

1.000 0.571 0.661 0.522

0.571 1.000 0.563 0.726

0.661 0.563 1.000 0.728

0.522 0.726 0.728 1.000

.

• Inspection of the diagonal elements shows that the pooled estimates seem to be a “compromise”

between the two group-specific estimates. This in fact illustrates how the pooled estimates combine

information across groups.

• For brevity, we do not display the combined scatterplot matrix for these data. Not surprisingly,

the pattern is somewhere “in between” those exhibited in Figures 3 and 4.

We have assumed throughout that we have balanced data. When the data are not balanced, either

because some individuals are missing observations at intended times or because the times are different

for different units, application of the above methods can be misleading. Later in the course, we consider

methods for unbalanced data.

PAGE 85

Page 95: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 4 ST 732, M. DAVIDIAN

4.4 Popular models for covariance structure

As we have noted previously, if estimated covariance and correlation matrices show systematic fea-

tures, the analyst may be led to consider models for covariance and associated correlation matrices.

We will see later in the course that common models and associated methods for longitudinal data either

explicitly or implicitly involve adopting particular models for var(εi).

In anticipation this, here, we introduce some popular such covariance models that embody different sys-

tematic patterns that are often seen with longitudinal data. Each covariance model has a corresponding

correlation model. We consider these models for balanced data only; modification for unbalanced

data is discussed later.

UNSTRUCTURED COVARIANCE MODEL: In some situations, there may be no evidence of an ap-

parent systematic pattern of variance and correlation. In this case, the covariance matrix is said to

follow the unstructured model. The unstructured covariance model was adopted in the discussion of

the last section as an initial assumption to allow assessment of whether a model with more structure

could be substituted.

The unstructured covariance matrix allows n different variances, one for each time point, and n(n−1)/2

distinct off-diagonal elements representing the possibly different covariances for each pair of times, for

a total of n + n(n − 1)/2 = n(n + 1)/2 variances and covariances. (Because a covariance matrix is

symmetric, the off-diagonal elements at positions (j, k) and (k, j) are the same, so we need only count

each covariance once in totaling up the number of variances and covariances involved.)

Thus, if the unstructured model is assumed, there are numerous parameters describing variation that

must be estimated, particularly if n is large. E.g., if n = 5, which does not seem that large, there are

5(6)/2 =15 parameters involved. If there are q different groups, each with a different covariance matrix,

there will be q times this many variances and covariances.

If the pattern of covariance does show a systematic structure, then not acknowledging this by maintain-

ing the unstructured assumption involves estimation of many more parameters than might otherwise

be necessary, thus making inefficient use of the available data. We now consider models that represent

things in terms of far fewer parameters.

As we will see in the following, it is sometimes easier to discuss the correlation model first and then

discuss the covariance matrix models to which it may correspond.

PAGE 86

Page 96: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 4 ST 732, M. DAVIDIAN

COMPOUND SYMMETRIC COVARIANCE MODELS: For both the boys and girls in the dental study,

the correlation between observations at any times tj and tk seemed similar, although the variances at

different times might be different.

These considerations suggest a covariance model that imposes equal correlation between all time points

but allows variance to differ at each time as follows. Suppose that ρ is a parameter representing the

common correlation for any two time points. For illustration, suppose that n = 5. Then the correlation

matrix is

Γ =

1 ρ ρ ρ ρ

ρ 1 ρ ρ ρ

ρ ρ 1 ρ ρ

ρ ρ ρ 1 ρ

ρ ρ ρ ρ 1

;

the same structure generalizes to any n. Here, −1 < ρ < 1. This is often referred to as the compound

symmetric or exchangeable correlation model, where the latter term emphasizes that the correlation

is the same even if we “exchange” two time points for two others.

Two popular covariance models with this correlation matrix are as follows.

• If σ2j and σ2

k are the overall variances at tj and tk (possibly different at different times), and σjk

is the corresponding covariance, then it must be that

ρ =σjk

σjσkor σjk = σjσkρ.

We thus have a covariance matrix of the form, in the case n = 5,

Σ =

σ21 ρσ1σ2 ρσ1σ3 ρσ1σ4 ρσ1σ5

ρσ1σ2 σ22 ρσ2σ3 ρσ2σ4 ρσ2σ5

ρσ1σ3 ρσ2σ3 σ23 ρσ3σ4 ρσ3σ5

ρσ1σ4 ρσ2σ4 ρσ3σ4 σ24 ρσ4σ5

ρσ1σ5 ρσ2σ5 ρσ3σ5 ρσ4σ5 σ25

,

which of course generalizes to any n. This covariance matrix is often said to have a heteroge-

neous compound symmetric structure – compound symmetric because it has corresponding

correlation as above and heterogeneous because it incorporates the assumption of different, or

heterogeneous, variances at each time point. Note that this model may be described with n + 1

parameters, the correlation ρ and the n variances.

PAGE 87

Page 97: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 4 ST 732, M. DAVIDIAN

• In some settings, the evidence may suggest that the overall variance at each time point is the

same, so that σ2j = σ2 for some common value σ2 for all j = 1, . . . , n. Under this condition,

ρ =σjk

σ2so that σjk = σ2ρ for all j, k.

Under these conditions, the covariance matrix is, in the case n = 5.

Σ =

σ2 ρσ2 ρσ2 ρσ2 ρσ2

ρσ2 σ2 ρσ2 ρσ2 ρσ2

ρσ2 ρσ2 σ2 ρσ2 ρσ2

ρσ2 ρσ2 ρσ2 σ2 ρσ2

ρσ2 ρσ2 ρσ2 ρσ2 σ2

= σ2Γ.

This covariance matrix for any n is said to have the compound symmetric or exchangeable

structure with no qualification.

This model involves only two parameters, σ2 and ρ, for any n.

Remarks:

• From the diagnostic calculations and plots for the dental study data, the heterogeneous compound

symmetric covariance model seems like a plausible model for each of the boys and girls, although

the values of ρ and the variances at each time may be potentially different in each group.

• The unstructured and compound symmetric models do not emphasize the fact that observations

are collected over time; neither has “built-in” features that really only make sense when the n

observations are in a particular order. Recall the two sources of correlation that contribute to the

overall pattern: that arising from among-unit sources (e.g. units being “high” or “low”) and those

due to within-unit sources (e.g. “fluctuations” about a smooth trend and measurement error).

The compound symmetric models seem to emphasize the among-unit component.

The models we now discuss instead may be thought of as emphasizing the within-unit component

through structures that are plausible when correlation depends on the times of observation in some

way. As “fluctuations” determine this source of correlation, these models may be thought of as assuming

that the variation attributable to these fluctuations dominates that from other sources (among-units or

measurement error). These models have roots in the literature on time series analysis.

PAGE 88

Page 98: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 4 ST 732, M. DAVIDIAN

ONE-DEPENDENT: Correlation due to within-unit fluctuation would be expected to be “stronger”

the closer observations are taken in time on a particular unit, as observations close in time would be

“more alike” than those far apart. Thus, we expect correlation due to within-unit sources to be largest

in magnitude among responses that are adjacent in time, that is, are at consecutive observation times,

and to become less pronounced as observations become farther apart. Relative to this magnitude

of correlation, that between two nonconsecutive observations might be for all practical purposes be

negligible.

A correlation matrix that reflects this (shown for n = 5) is

Γ =

1 ρ 0 0 0

ρ 1 ρ 0 0

0 ρ 1 ρ 0

0 0 ρ 1 ρ

0 0 0 ρ 1

.

Here, the correlation is the same, equal to ρ, −1 < ρ < 1, for any two consecutive observations. This

model is referred to as the one-dependent correlation structure, as dependence is nonnegligible only

for adjacent responses. Alternatively, such a matrix is also referred to as a banded Toeplitz matrix.

The one-dependent correlation model seems to make the most sense if observation times are equally-

spaced (separate by the same time interval).

If the overall variances σ2j , j = 1, . . . , n, are possibly different at each time tj , the corresponding

covariance matrix (n = 5) looks like

Σ =

σ21 ρσ1σ2 0 0 0

ρσ1σ2 σ22 ρσ2σ3 0 0

0 ρσ2σ3 σ23 ρσ3σ4 0

0 0 ρσ3σ4 σ24 ρσ4σ5

0 0 0 ρσ4σ5 σ25

and is called a heterogeneous one-dependent or banded Toeplitz matrix, for obvious reasons. Of

course, this structure may be generalized to any n.

PAGE 89

Page 99: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 4 ST 732, M. DAVIDIAN

If overall variance at each time point is the same, so that σ2j = σ2 for all j, then this becomes

Σ =

σ2 ρσ2 0 0 0

ρσ2 σ2 ρσ2 0 0

0 ρσ2 σ2 ρσ2 0

0 0 ρσ2 σ2 ρσ2

0 0 0 ρσ2 σ2

= σ2Γ,

which is usually called a one-dependent or banded Toeplitz matrix without qualification.

It is possible to extend this structure to a two-dependent or higher model. For example, two-

dependence implies that observations one or two intervals apart in time are correlated, but those farther

apart are not.

The one-dependent correlation model implies that correlation “falls off” as observations become farther

apart in time in a rather dramatic way, so that only consecutive observations are correlated. Alterna-

tively, it may be the case that correlation “falls off” more gradually.

AUTOREGRESSIVE STRUCTURE OF ORDER 1: Again, this model makes sense sense when the

observation times are equally spaced. The autoregressive, or AR(1), correlation model, formalizes the

idea that the magnitude of correlation among observations “decays” as they become farther apart. In

particular, for n = 5, the AR(1) correlation matrix has the form

Γ =

1 ρ ρ2 ρ3 ρ4

ρ 1 ρ ρ2 ρ3

ρ2 ρ 1 ρ ρ2

ρ3 ρ2 ρ 1 ρ

ρ4 ρ3 ρ2 ρ 1

,

where −1 < ρ < 1.

• As ρ is less than 1 in magnitude as we take it to higher powers, the result is values closer and

closer to zero. Thus, as the number of time intervals between pairs of observations increases, the

correlation decreases toward zero.

• With equally-spaced data, the time interval between tj and tj+1 is the same for all j; i.e., |tj −tj+1| = d for j = 1, . . . , n− 1, where d is the length of the interval. Note then that the power of ρ

corresponds to the number of intervals by which a pair of observations is separated.

PAGE 90

Page 100: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 4 ST 732, M. DAVIDIAN

As with the compound symmetric and one-dependent models, both heterogeneous and “standard”

covariance matrices with corresponding AR(1) correlation matrix are possible. In the case of overall

variances σ2j that may differ across j, the heterogeneous covariance matrix in the case n = 5 has the

form

Σ =

σ21 ρσ1σ2 ρ2σ1σ3 ρ3σ1σ4 ρ4σ1σ5

ρσ1σ2 σ22 ρσ2σ3 ρ2σ2σ4 ρ3σ2σ5

ρ2σ1σ3 ρσ2σ3 σ23 ρσ3σ4 ρ2σ3σ5

ρ3σ1σ4 ρ2σ2σ4 ρσ3σ4 σ24 ρσ4σ5

ρ4σ1σ5 ρ3σ2σ5 ρ2σ3σ5 ρσ4σ5 σ25

.

When the variance is assumed equal to the same value σ2 for all j = 1, . . . , n, the covariance matrix has

the form (n = 5)

Σ =

σ2 ρσ2 ρ2σ2 ρ3σ2 ρ4σ2

ρσ2 σ2 ρσ2 ρ2σ2 ρ3σ2

ρ2σ2 ρσ2 σ2 ρσ2 ρ2σ2

ρ3σ2 ρ2σ2 ρσ2 σ2 ρσ2

ρ4σ2 ρ3σ2 ρ2σ2 ρσ2 σ2

= σ2Γ,

The one-dependent and AR(1) models really only seem sensible when the observation times are spaced at

equal intervals, as in the dental study data. This is not always the case; for instance, for longitudinal data

collected in clinical trials comparing treatments for disease, it is routine to collect responses frequently

at the beginning of therapy but then to take them at wider intervals later.

The following offers a generalization of the AR(1) model to allow the possibility of unequally-spaced

times.

MARKOV STRUCTURE: Suppose that the observation times t1, . . . , tn are not necessarily equally

spaced, and let

djk = |tj − tk|

be the length of time between times tj and tk for all j, k = 1, . . . , n. Then the Markov correlation

model has the form, shown here for n = 5,

Γ =

1 ρd12 ρd13 ρd14 ρd15

ρd12 1 ρd23 ρd24 ρd25

ρd13 ρd23 1 ρd34 ρd35

ρd14 ρd24 ρd34 1 ρd45

ρd15 ρd25 ρd35 ρd45 1

.

PAGE 91

Page 101: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 4 ST 732, M. DAVIDIAN

• Here, we must have ρ ≥ 0 (why?).

• Comparing this to the AR(1) structure, the powers of ρ and thus the degree of decay of correlation

are also related to the length of the time interval between observations. Here, however, because

the time intervals djk are of unequal length, the powers are the actual lengths.

Corresponding covariance matrices are defined similarly to those in the one-dependent and AR(1) cases.

E.g., under the assumption of common variance σ2, we have

Σ =

σ2 σ2ρd12 σ2ρd13 σ2ρd14 σ2ρd15

σ2ρd12 σ2 σ2ρd23 σ2ρd24 σ2ρd25

σ2ρd13 σ2ρd23 σ2 σ2ρd34 σ2ρd35

σ2ρd14 σ2ρd24 σ2ρd34 σ2 σ2ρd45

σ2ρd15 σ2ρd25 σ2ρd35 σ2ρd45 σ2

= σ2Γ,

This model has two parameters, σ2 and ρ, for any n.

These are not the only such models available, but give a flavor of the types of considerations involved.

The documentation for the SAS procedure proc mixed, the use of which we will demonstrate in subse-

quent chapters, offers a rich catalog of possible covariance models.

If one believes that one of the foregoing models or some other model provides a realistic representation

of the pattern of variation and covariation in the data, then intuition suggests that a “better” estimate

of var(εi) could be obtained by exploiting this information. We will see this in action shortly.

We will also see that these models may be used not only to represent var(εi), but to represent covariance

matrices of components of εi corresponding to among- and within-unit variation.

4.5 Diagnostic calculations under stationarity

The one-dependent, AR(1), and Markov structures are popular models when it is thought that the

predominant source of correlation leading to the aggregate pattern is from within-individual sources.

All of these models are such that the correlation between Yij and Yik for any j 6= k depends only on

the time interval |tj − tk| and not only the specific times tj or tk themselves. This property is known

as stationarity.

• If stationarity is thought to hold, the analyst may wish to investigate which correlation structure

(e.g. one-dependent, AR(1), or other model for equally-spaced data) might be the best model.

PAGE 92

Page 102: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 4 ST 732, M. DAVIDIAN

• Variance at each tj may be assessed by examining the sample covariance matrix.

• If one believes in stationarity, an investigation of correlation that takes this into account may offer

more refined information than one that does not, as we now demonstrate.

The rationale is as follows:

• When the tj , j = 1, . . . , n, are equally spaced, with time interval d, under stationarity, all pairs

of observations corresponding to times whose subscripts differ by 1, e.g. j and j + 1, are d time

units apart and are correlated in an identical fashion.

• Similarly, all pairs with subscripts differing by 2, e.g. j and j + 2 are 2d time units apart and

correlated in the same way. In general, pairs with subscripts j and j + u are ud time units apart

and share the same correlation.

• The value of subscripts for n time points must range between 1 and n. Thus, when we write j

and j + u, it is understood that the values of j and u are chosen so that all possible distinct pairs

of unequal subscripts in this range are represented. E.g. if j = 1, then u may take on the values

1, . . . , n− 1 to give all pairs corresponding to time t1 and all other times t2, . . . , tn. If j = 2, then

u may take on values 1, . . . , n−2, and so on. If j = n−1, then u = 1 gives the pair corresponding

to times tn−1, tn.

• For example, under the AR(1) model, for a particular u, pairs at times tj and tj+u for satisfy

corr(Yij , Yi,j+u) = ρu,

suggesting that the correlation between observations u time intervals apart may be assessed using

information from all such pairs.

AUTOCORRELATION FUNCTION: The autocorrelation function is just the correlation corre-

sponding to pairs of observations u time intervals apart thought of as a function of the number of

intervals. That is, for all j = 1, . . . , n− 1 and appropriate u,

ρ(u) = corr(Yij , Yi,j+u).

• This depends only on u and is the same for all j because of stationarity.

• The value of ρ(0) is taken to be equal to one, as with u = 0 ρ(0) is just the correlation between

an observation and itself.

PAGE 93

Page 103: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 4 ST 732, M. DAVIDIAN

• The value u is often called the lag. The total number of possible lags is n− 1 for n time points.

• The autocorrelation function describes how correlation changes as the time between observations

gets farther apart, i.e. as u increases. As expected, the value of ρ(u) tends to decrease in

magnitude as u increases, reflecting the usual situation in which within-unit correlation “falls off”

as observations become more separated in time.

In practice, we may estimate the autocorrelation function if we are willing to assume that stationarity

holds. Inspection of the estimate can help the analyst decide which model might be appropriate; e.g. if

correlation falls off gradually with lag, it may suggest that an AR(1) model is appropriate.

For data from a single population, it is natural to base estimation of ρ(u) for each u = 1, . . . , n− 1 on

all pairs of observations (Yij , Yi,j+u) across all individuals i = 1, . . . , m and relevant choices of j.

• Care must be taken to ensure that the fact that responses have different means and overall

variances at each tj is taken into account, as with scatterplot matrices.

• Thus, we consider “centered” and “scaled” observations. In particular, ρ(u) for a particular lag

u may be estimated by calculating the sample correlation coefficient treating all pairs of the

formYij − Y ·j

Sj,Yi,j+u − Y ·j+u

Sj+u

as if they were observations on two random variables from a sample of m individuals, where each

individual contributes more than one pair.

• The resulting estimator as a function of u is called the sample autocorrelation function, which

we denote as ρ(u).

• ρ(u) may be calculated and plotted against u to provide the analyst with both numerical and

visual information on the nature of correlation if the stationarity assumption is plausible.

We illustrate using the data from girls in the dental study. Here, the time interval is of length d = 2

years, and n = 4, so u can take on values 1, . . . , n− 1 = 3.

• When u = 1, each girl has three pairs of values separated by d units (i.e. one time interval), the

values at (t1, t2), (t2, t3), and (t3, t4). Thus, there is a total of 33 possible pairs from all 11 girls.

• When u = 2, there are two pairs per girl, at (t1, t3) and (t2, t4), or 22 total pairs.

PAGE 94

Page 104: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 4 ST 732, M. DAVIDIAN

• When u = 3, each girl contributes a single pair at (t1, t4), 11 pairs in total).

Thus, the calculation of ρ(u) is carried out by calculating the sample correlation coefficient from 33, 22,

and 11 observations for u = 1, 2, and 3, respectively, and yields

u 1 2 3

ρ(u) 0.891 0.871 0.841

Because each estimated value is based on a decreasing number of pairs, they are not of equal quality,

so should be interpreted with care.

The estimates suggest that, if we are willing to believe stationarity, as observations become farther

apart in time (u increasing), correlation seems to stay fairly constant. This agrees with the evidence

from the calculation of the sample covariance matrix and the scatterplot matrix in Figure 3.

Figure 5 shows a plot of the sample autocorrelation function, displaying the same information graphi-

cally.

Figure 5: Sample autocorrelation function for data from girls in the dental study.

number of intervals, u

auto

corr

elat

ion

func

tion

0.0

0.2

0.4

0.6

0.8

1.0

0 1 2 3

An alternative way of displaying information on correlation under the assumption of stationarity is to

plot the pairs for each choice of lag u. From above, there are 33 pairs corresponding to lag u = 1, 22

for lag u = 2, and 11 for lag u = 3. In Figure 6, these pairs are plotted for each u. The plot gives a

similar impression as the numerical estimate. An advantage of the plot is that it clearly shows that the

information on correlation (total number of pairs) decreases as u increases.

For more than one group, these procedures may be carried out separately for each group.

PAGE 95

Page 105: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 4 ST 732, M. DAVIDIAN

Figure 6: Lag plots for data from girls in the dental study for lags u = 1, 2, and 3.

•• • •

• ••

•••••

•••

••

••• •

••

••

• ••

••

response at age

resp

onse

at a

ge+

1

-2 -1 0 1 2

-2-1

01

2

Lag 1

••

••• • ••

• •

••

•• ••

• •

••

response at age

resp

onse

at a

ge+

2

-2 -1 0 1 2

-2-1

01

2

Lag 2

•• •

••

••

response at age

resp

onse

at a

ge+

3

-2 -1 0 1 2

-2-1

01

2

Lag 3

When data are not equally spaced, extensions of the method for estimating the autocorrelation function

are available, but are beyond the scope of our discussion here. The reader is referred to Diggle, Heagerty,

Liang, and Zeger (2002).

It is important to recognize that whether stationarity holds is an assumption. The foregoing procedures

are relevant when this assumption is valid. Unfortunately, assessing with confidence whether stationarity

holds is not really possible in longitudinal data situations where the number of time points is usually

small. Because many popular models for correlation used in longitudinal data analysis embody the

stationarity assumption, it is often assumed without comment, and it is often reasonable.

4.6 Implementation with SAS

We demonstrate the use of various SAS procedures on the dental data. In particular, we show how the

following may be obtained:

• Sample mean vectors for each group (girls and boys)

• Group-specific sample covariance and correlation matrices

• Pooled sample covariance and correlation matrix

• Pairs for plotting scatterplot matrices for each group

• Autocorrelation functions for each gender and pairs for making lag plots

PAGE 96

Page 106: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 4 ST 732, M. DAVIDIAN

There are actually numerous ways to obtain the pooled sample covariance and correlation matrices. We

show one way here, using SAS PROC DISCRIM. Additional ways can be found in the program on the

course web site.

EXAMPLE 1 – DENTAL STUDY DATA: The data are in the file dental.dat.

PROGRAM:

/*******************************************************************

EXAMPLE 1, CHAPTER 4

Using SAS to obtain sample mean vectors, sample covariancematrices, and sample correlation matrices.

*******************************************************************/

options ls=80 ps=59 nodate; run;

/******************************************************************

The data are not in the correct from for use with the SAS proceduresCORR and DISCRIM we use below. These procedures require that thedata be in the form of one record (line) per experimental unit.The data in the file dental.dat are in the form of one record perobservation (so that each child has 4 data records).

In particular, the data set looks like

1 1 8 21 02 1 10 20 03 1 12 21.5 04 1 14 23 05 2 8 21 0

.

.

.

column 1 observation numbercolumn 2 child id numbercolumn 3 agecolumn 4 response (distance)column 5 gender indicator (0=girl, 1=boy)

We thus create a new data set such that each record in the dataset represents all 4 observations on each child plus genderidentifier. To do this, we use some data manipulation featuresof the SAS data step. The second data step does this.

We redefine the values of AGE so that we may use AGE as an "index"in creating the new data set DENT2. The DATA step that createsDENT2 demonstrates one way (using the notion of an ARRAY) totransform a data set in the form of one observation per record(the original form) into a data set in the form of one record perindividual. The data must be sorted prior to this operation; weinvoke PROC SORT for this purpose.

In the new data set, the observations at ages 8, 10, 12, and 14are placed in variables AGE1, AGE2, AGE3, and AGE4, respectively.

We use PROC PRINT to print out the first 5 records (so data forthe first 5 children, all girls) using the OBS= feature of theDATA= option.

*******************************************************************/

data dent1; infile ’dental.dat’;input obsno child age distance gender;

run;

data dent1; set dent1;if age=8 then age=1;if age=10 then age=2;if age=12 then age=3;if age=14 then age=4;drop obsno;

run;

proc sort data=dent1;by gender child;

run;

PAGE 97

Page 107: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 4 ST 732, M. DAVIDIAN

data dent2(keep=age1-age4 gender child);array aa{4} age1-age4;do age=1 to 4;set dent1;by gender child;aa{age}=distance;if last.child then return;

end;run;

title "TRANSFORMED DATA -- 1 RECORD/INDIVIDUAL";proc print data=dent2(obs=5); run;

/*******************************************************************

Here, we use PROC CORR to obtain the sample means at eachage (the means of the variables AGE1,...,AGE4 in DENT2 and tocalculate the sample covariance matrix and corresponding samplecorrelation matrix separately for each group (girls and boys).The COV option in the PROC CORR statement asks for the samplecovariance to be printed; without it, only the sample correlationmatrix would appear in the output.

*******************************************************************/

proc sort data=dent2; by gender; run;

title "SAMPLE COVARIANCE AND CORRELATION MATRICES BY GENDER";proc corr data=dent2 cov;by gender; var age1 age2 age3 age4;

run;

/*******************************************************************

We now obtain the "centered" and "scaled" valuesthat may be used for plotting scatterplot matrices such as thatin Figure 3. Here, we call PROC MEANS to calculate the samplemean (MAGE1,...,MAGE4) and standard deviation (SDAGE1,...,SDAGE4)for each of the variables AGE1,...,AGE4 for each gender. Theseare output to the data set DENTSTATS, which has two records, onefor each gender (see the output). We then MERGE this data setwith DENT2 BY GENDER, which has the effect of matching up theappropriate gender mean and SD to each child. We print out thefirst three records of the resulting data set to illustrate.We use the NOPRINT option with PROC MEANS to suppress printing ofits output.

The variables CSAGE1,...,CSAGE4 contain the centered/scaled values.These may be plotted against each other to obtain plots like Figure 3.We have not done this here to save space.

*******************************************************************/

proc sort data=dent2; by gender child; run;

proc means data=dent2 mean std noprint; by gender;var age1 age2 age3 age4;output out=dentstats mean=mage1 mage2 mage3 mage4

std=sdage1 sdage2 sdage3 sdage4;run;

title "SAMPLE MEANS AND SDS BY GENDER FROM PROC MEANS";proc print data=dentstats; run;

data dentstats; merge dentstats dent2; by gender;csage1=(age1-mage1)/sdage1;csage2=(age2-mage2)/sdage2;csage3=(age3-mage3)/sdage3;csage4=(age4-mage4)/sdage4;

run;

title "INDIVIDUAL DATA MERGED WITH MEANS AND SDS BY GENDER";proc print data=dentstats(obs=3); run;

/*******************************************************************

One straightforward way to have SAS calculate the pooled samplecovariance matrix and the corresponding estimated correlation matrixis using PROC DISCRIM. This procedure is focused on so-calleddiscriminant analysis, which is discussed in a standard text ongeneral multivariate analysis. The data are considered asin the form of vectors; here, the elements of a data vector aredenoted as AGE1,...,AGE4.

Here, we only use PROC DISCRIM for its facility to print out thesample covariance matrix and correlation matrix "automatically,"and disregard other portions of the output.

PAGE 98

Page 108: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 4 ST 732, M. DAVIDIAN

*******************************************************************/

proc discrim pcov pcorr data=dent2;class gender;var age1 age2 age3 age4;

run;

/*******************************************************************

Although it is a bit cumbersome, we may use some DATA stepmanipulations and PROC CORR to obtain the values of the autocorrelationfunction for each gender. We first drop variablesno longer needed from the data set DENTSTATS.

We create then three data sets, LAG1, LAG2, and LAG3, and describeLAG1 here; the other two are similar. We create two new variables,PAIR1 and PAIR2. For LAG1, PAIR1 and PAIR2 are the two values in (5.43)for u=1. As there are 4 ages, each child has 3 such pairs. The outputof PROC PRINT for LAG1 shows this for the first 2 children.We then sort the data by gender and call PROC CORR to find thesample correlation between the two variables for each gender.

The same principle is used to obtain the correlation by gender forlags 2 and 3 [u=2,3].

There are other, more sophisticated ways to obtain the valuesof the autocorrelation function; however, for longitudinal data setswhere the number of time points is small, the "manual" approachwe have demonstrated here is easy to implement and understand.

PAIR1 versus PAIR2 may be plotted for each lag to obtain visualpresentation of the results as in Figure 6.

*******************************************************************/

data dentstats; set dentstats;drop age1-age4 mage1-mage4 sdage1-sdage4;

run;

data lag1; set dentstats;by child;pair1=csage1; pair2=csage2; output;pair1=csage2; pair2=csage3; output;pair1=csage3; pair2=csage4; output;if last.child then return;drop csage1-csage4;

run;

title "AUTOCORRELATION FUNCTION AT LAG 1";proc print data=lag1(obs=6); run;proc sort data=lag1; by gender;

proc corr data=lag1; by gender;var pair1 pair2;

run;

data lag2; set dentstats;by child;pair1=csage1; pair2=csage3; output;pair1=csage2; pair2=csage4; output;if last.child then return;drop csage1-csage4;

run;

title "AUTOCORRELATION FUNCTION AT LAG 2";proc print data=lag2(obs=6); run;proc sort data=lag2; by gender;

proc corr data=lag2; by gender;var pair1 pair2;

run;

data lag3; set dentstats;by child;pair1=csage1; pair2=csage4; output;if last.child then return;drop csage1-csage4;

run;

title "AUTOCORRELATION FUNCTION AT LAG 3";proc print data=lag3(obs=6); run;proc sort data=lag3; by gender;

proc corr data=lag3; by gender;var pair1 pair2;

run;

PAGE 99

Page 109: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 4 ST 732, M. DAVIDIAN

OUTPUT: We have deleted some of the output of PROC DISCRIM that is irrelevant to our purposes here

to shorten the presentation. The full output from the call to this procedure is on the course web page.

TRANSFORMED DATA -- 1 RECORD/INDIVIDUAL 1

Obs age1 age2 age3 age4 child gender

1 21.0 20.0 21.5 23.0 1 02 21.0 21.5 24.0 25.5 2 03 20.5 24.0 24.5 26.0 3 04 23.5 24.5 25.0 26.5 4 05 21.5 23.0 22.5 23.5 5 0

SAMPLE COVARIANCE AND CORRELATION MATRICES BY GENDER 2

----------------------------------- gender=0 ---------------------------------

The CORR Procedure

4 Variables: age1 age2 age3 age4

Covariance Matrix, DF = 10

age1 age2 age3 age4

age1 4.513636364 3.354545455 4.331818182 4.356818182age2 3.354545455 3.618181818 4.027272727 4.077272727age3 4.331818182 4.027272727 5.590909091 5.465909091age4 4.356818182 4.077272727 5.465909091 5.940909091

Simple Statistics

Variable N Mean Std Dev Sum Minimum Maximum

age1 11 21.18182 2.12453 233.00000 16.50000 24.50000age2 11 22.22727 1.90215 244.50000 19.00000 25.00000age3 11 23.09091 2.36451 254.00000 19.00000 28.00000age4 11 24.09091 2.43740 265.00000 19.50000 28.00000

Pearson Correlation Coefficients, N = 11Prob > |r| under H0: Rho=0

age1 age2 age3 age4

age1 1.00000 0.83009 0.86231 0.841360.0016 0.0006 0.0012

age2 0.83009 1.00000 0.89542 0.879420.0016 0.0002 0.0004

age3 0.86231 0.89542 1.00000 0.948410.0006 0.0002 <.0001

age4 0.84136 0.87942 0.94841 1.000000.0012 0.0004 <.0001

SAMPLE COVARIANCE AND CORRELATION MATRICES BY GENDER 3

----------------------------------- gender=1 ----------------------------------

The CORR Procedure

4 Variables: age1 age2 age3 age4

Covariance Matrix, DF = 15

age1 age2 age3 age4

age1 6.016666667 2.291666667 3.629166667 1.612500000age2 2.291666667 4.562500000 2.193750000 2.810416667age3 3.629166667 2.193750000 7.032291667 3.240625000age4 1.612500000 2.810416667 3.240625000 4.348958333

Simple Statistics

Variable N Mean Std Dev Sum Minimum Maximum

age1 16 22.87500 2.45289 366.00000 17.00000 27.50000age2 16 23.81250 2.13600 381.00000 20.50000 28.00000age3 16 25.71875 2.65185 411.50000 22.50000 31.00000

PAGE 100

Page 110: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 4 ST 732, M. DAVIDIAN

age4 16 27.46875 2.08542 439.50000 25.00000 31.50000

Pearson Correlation Coefficients, N = 16Prob > |r| under H0: Rho=0

age1 age2 age3 age4

age1 1.00000 0.43739 0.55793 0.315230.0902 0.0247 0.2343

age2 0.43739 1.00000 0.38729 0.630920.0902 0.1383 0.0088

age3 0.55793 0.38729 1.00000 0.585990.0247 0.1383 0.0171

age4 0.31523 0.63092 0.58599 1.000000.2343 0.0088 0.0171

SAMPLE MEANS AND SDS BY GENDER FROM PROC MEANS 4

g _ _ s s s se T F m m m m d d d dn Y R a a a a a a a a

O d P E g g g g g g g gb e E Q e e e e e e e es r _ _ 1 2 3 4 1 2 3 4

1 0 0 11 21.1818 22.2273 23.0909 24.0909 2.12453 1.90215 2.36451 2.437402 1 0 16 22.8750 23.8125 25.7188 27.4688 2.45289 2.13600 2.65185 2.08542

INDIVIDUAL DATA MERGED WITH MEANS AND SDS BY GENDER 5

Obs gender _TYPE_ _FREQ_ mage1 mage2 mage3 mage4 sdage1 sdage2 sdage3

1 0 0 11 21.1818 22.2273 23.0909 24.0909 2.12453 1.90215 2.364512 0 0 11 21.1818 22.2273 23.0909 24.0909 2.12453 1.90215 2.364513 0 0 11 21.1818 22.2273 23.0909 24.0909 2.12453 1.90215 2.36451

Obs sdage4 age1 age2 age3 age4 child csage1 csage2 csage3 csage4

1 2.43740 21.0 20.0 21.5 23.0 1 -0.08558 -1.17092 -0.67283 -0.447572 2.43740 21.0 21.5 24.0 25.5 2 -0.08558 -0.38234 0.38447 0.578113 2.43740 20.5 24.0 24.5 26.0 3 -0.32093 0.93196 0.59593 0.78325

INDIVIDUAL DATA MERGED WITH MEANS AND SDS BY GENDER 6

The DISCRIM Procedure

Observations 27 DF Total 26Variables 4 DF Within Classes 25Classes 2 DF Between Classes 1

Class Level Information

Variable Priorgender Name Frequency Weight Proportion Probability

0 _0 11 11.0000 0.407407 0.5000001 _1 16 16.0000 0.592593 0.500000

INDIVIDUAL DATA MERGED WITH MEANS AND SDS BY GENDER 7

The DISCRIM Procedure

Pooled Within-Class Covariance Matrix, DF = 25

Variable age1 age2 age3 age4

age1 5.415454545 2.716818182 3.910227273 2.710227273age2 2.716818182 4.184772727 2.927159091 3.317159091age3 3.910227273 2.927159091 6.455738636 4.130738636age4 2.710227273 3.317159091 4.130738636 4.985738636

INDIVIDUAL DATA MERGED WITH MEANS AND SDS BY GENDER 8

The DISCRIM Procedure

Pooled Within-Class Correlation Coefficients / Pr > |r|

Variable age1 age2 age3 age4

age1 1.00000 0.57070 0.66132 0.52158

PAGE 101

Page 111: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 4 ST 732, M. DAVIDIAN

0.0023 0.0002 0.0063

age2 0.57070 1.00000 0.56317 0.726220.0023 0.0027 <.0001

age3 0.66132 0.56317 1.00000 0.728100.0002 0.0027 <.0001

age4 0.52158 0.72622 0.72810 1.000000.0063 <.0001 <.0001

AUTOCORRELATION FUNCTION AT LAG 1 11

Obs gender _TYPE_ _FREQ_ child pair1 pair2

1 0 0 11 1 -0.08558 -1.170922 0 0 11 1 -1.17092 -0.672833 0 0 11 1 -0.67283 -0.447574 0 0 11 2 -0.08558 -0.382345 0 0 11 2 -0.38234 0.384476 0 0 11 2 0.38447 0.57811

AUTOCORRELATION FUNCTION AT LAG 1 12

----------------------------------- gender=0 ---------------------------------

The CORR Procedure

2 Variables: pair1 pair2

Simple Statistics

Variable N Mean Std Dev Sum Minimum Maximum

pair1 33 0 0.96825 0 -2.20369 2.07616pair2 33 0 0.96825 0 -1.88353 2.07616

Pearson Correlation Coefficients, N = 33Prob > |r| under H0: Rho=0

pair1 pair2

pair1 1.00000 0.89130<.0001

pair2 0.89130 1.00000<.0001

AUTOCORRELATION FUNCTION AT LAG 1 13

----------------------------------- gender=1 ---------------------------------

The CORR Procedure

2 Variables: pair1 pair2

Simple Statistics

Variable N Mean Std Dev Sum Minimum Maximum

pair1 48 0 0.97849 0 -2.39513 1.99154pair2 48 0 0.97849 0 -1.55080 1.99154

Pearson Correlation Coefficients, N = 48Prob > |r| under H0: Rho=0

pair1 pair2

pair1 1.00000 0.470220.0007

pair2 0.47022 1.000000.0007

AUTOCORRELATION FUNCTION AT LAG 2 14

Obs gender _TYPE_ _FREQ_ child pair1 pair2

1 0 0 11 1 -0.08558 -0.672832 0 0 11 1 -1.17092 -0.447573 0 0 11 2 -0.08558 0.384474 0 0 11 2 -0.38234 0.578115 0 0 11 3 -0.32093 0.595936 0 0 11 3 0.93196 0.78325

PAGE 102

Page 112: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 4 ST 732, M. DAVIDIAN

AUTOCORRELATION FUNCTION AT LAG 2 15

----------------------------------- gender=0 ---------------------------------

The CORR Procedure

2 Variables: pair1 pair2

Simple Statistics

Variable N Mean Std Dev Sum Minimum Maximum

pair1 22 0 0.97590 0 -2.20369 1.56184pair2 22 0 0.97590 0 -1.88353 2.07616

Pearson Correlation Coefficients, N = 22Prob > |r| under H0: Rho=0

pair1 pair2

pair1 1.00000 0.87087<.0001

pair2 0.87087 1.00000<.0001

AUTOCORRELATION FUNCTION AT LAG 2 16

----------------------------------- gender=1 ---------------------------------

The CORR Procedure

2 Variables: pair1 pair2

Simple Statistics

Variable N Mean Std Dev Sum Minimum Maximum

pair1 32 0 0.98374 0 -2.39513 1.96044pair2 32 0 0.98374 0 -1.21378 1.99154

Pearson Correlation Coefficients, N = 32Prob > |r| under H0: Rho=0

pair1 pair2

pair1 1.00000 0.594430.0003

pair2 0.59443 1.000000.0003

AUTOCORRELATION FUNCTION AT LAG 3 17

Obs gender _TYPE_ _FREQ_ child pair1 pair2

1 0 0 11 1 -0.08558 -0.447572 0 0 11 2 -0.08558 0.578113 0 0 11 3 -0.32093 0.783254 0 0 11 4 1.09115 0.988395 0 0 11 5 0.14977 -0.242436 0 0 11 6 -0.55627 -0.65271

AUTOCORRELATION FUNCTION AT LAG 3 18

----------------------------------- gender=0 ---------------------------------

The CORR Procedure

2 Variables: pair1 pair2

Simple Statistics

Variable N Mean Std Dev Sum Minimum Maximum

pair1 11 0 1.00000 0 -2.20369 1.56184pair2 11 0 1.00000 0 -1.88353 1.60380

Pearson Correlation Coefficients, N = 11Prob > |r| under H0: Rho=0

pair1 pair2

PAGE 103

Page 113: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 4 ST 732, M. DAVIDIAN

pair1 1.00000 0.841360.0012

pair2 0.84136 1.000000.0012

AUTOCORRELATION FUNCTION AT LAG 3 19

----------------------------------- gender=1 ---------------------------------

The CORR Procedure

2 Variables: pair1 pair2

Simple Statistics

Variable N Mean Std Dev Sum Minimum Maximum

pair1 16 0 1.00000 0 -2.39513 1.88553pair2 16 0 1.00000 0 -1.18382 1.93307

Pearson Correlation Coefficients, N = 16Prob > |r| under H0: Rho=0

pair1 pair2

pair1 1.00000 0.315230.2343

pair2 0.31523 1.000000.2343

PAGE 104

Page 114: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 5 ST 732, M. DAVIDIAN

5 Univariate repeated measures analysis of variance

5.1 Introduction

As we will see as we progress, there are a number of approaches for representing longitudinal data in

terms of a statistical model. Associated with these approaches are appropriate methods of analysis

that focus on questions that are of interest in the context of longitudinal data. As noted previously, one

way to make distinctions among these models and methods has to do with what they assume about the

covariance structure of a data vector from an unit. Another has to do with what is assumed about

the form of the mean of an observation and thus the mean vector for a data vector.

We begin our investigation of the different models and methods by considering a particular statistical

model for representing longitudinal data. This model is really only applicable in the case where the

data are balanced; that is, where the measurements on each unit occur at the same n times for all

units, with no departures from these times or missing values for any units. Thus, each individual has

associated an n-dimensional random vector, whose jth element corresponds to the response at the jth

(common) time point.

Although, as we will observe, the model may be put into the general form discussed in Chapters 3 and

4, where we think of the data in terms of vectors for each individual and the means and covariances

of these vectors, it is motivated by considering a model for each individual observation separately.

Because of this motivation, the model and the associated method of analysis is referred to as univariate

repeated measures analysis of variance.

• This model imposes a very specific assumption about the covariances of the data vectors, one that

may often not be fulfilled for longitudinal data.

• Thus, because the method exploits this possibly incorrect assumption, there is the potential for

erroneous inferences in the case that the assumption made is not relevant for the data at hand.

• The model also provides a simplistic representation for the mean of a data vector that does not

exploit the fact that each vector represents what might appear to be a systematic trajectory

that appears to be a function of time (recall the examples in Chapter 1 and the sample mean

vectors for the dental data in the last chapter).

PAGE 105

Page 115: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 5 ST 732, M. DAVIDIAN

• However, because of its simplicity and connection to familiar analysis of variance techniques, the

model and method are quite popular, and are often adopted by default, sometimes without proper

attention to the validity of the assumptions.

We will first describe the model in the way it is usually represented, which will involve slightly different

notation than that we have discussed. This notation is conventional in this setting, so we begin by

using it. We will then make the connection between this representation and the way we have discussed

thinking about longitudinal data, as vectors.

5.2 Basic situation and statistical model

Recall Examples 1 and 2 in Chapter 1:

• In Example 1, the dental study, 27 children, 16 boys and 11 girls, were observed at each of ages 8,

10, 12, and 14 years. At each time, the response, a measurement of the distance from the center

of the pituitary to the pterygomaxillary fissure was made. Objectives were to learn whether there

is a difference between boys and girls with respect to this measure and its change over time.

• In Example 2, the diet study, 15 guinea pigs were randomized to receive zero, low, or high dose of

a vitamin E diet supplement. Body weight was measured at each of several time points (weeks 1,

3, 4, 5, 6, and 7) for each pig. Objectives were to determine whether there is a difference among

pigs treated with different doses of the supplement with respect to body weight and its change

over time.

Recall from Figures 1 and 2 of Chapter 1 that, each child or guinea pig exhibited a profile over time

(age or weeks) that appeared to increase with time; Figure 1 of Chapter 1 is reproduced in Figure 1

here for convenience.

In these examples, the response of interest is continuous (distance, body weight).

PAGE 106

Page 116: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 5 ST 732, M. DAVIDIAN

Figure 1: Orthodontic distance measurements (mm) for 27 children over ages 8, 10, 12, 14. The plotting

symbols are 0’s for girls, 1’s for boys.

age (years)

dist

ance

(m

m)

8 9 10 11 12 13 14

2025

30

0 0 0

0

0

0

0

0

0

0

0

1

1

1

1

1

1

1

1

1

1

1

1

1

11

1

0

0

0 0

0

0

0 0

0

0

01

11

1

1

1

11

1

1

11

1

1

1

1 0

0 0 0

0

0

0 0

0

0

0

1

1

1

1

1

1

11

11

11

111

1 0

0 0 0

0

0

0

0

0

0

0

1

1

11

1

1

1

11

1

1

1

1

1

1

1

Dental Study Data

STANDARD SETUP: These situations typify the usual setup of a standard (one-way) longitudinal or

repeated measurement study.

• Units are randomized to one of q ≥ 1 treatment groups. In the literature, these are often

referred to as the between-units factors or groups. (This is an abuse of grammar if the number

of groups is greater than 2; among-units would be better.) In the dental study, q = 2, boys and

girls (where randomly selecting boys from the population of all boys and similarly for girls is akin

to randomization of units). In the diet study, we think of q = 3 dose groups.

• The response of interest is measured on each of n occasions or under each of n conditions. Although

in a longitudinal study, this is usually “time,” it may also be something else. For example, suppose

men were randomized into two groups, regular and modified diet. The repeated responses might

be maximum heart rate measurements after separate occasions of 10, 20, 30, 45, and 60 minutes

walking on a treadmill. As is customary, we will refer to the repeated measurement factor as time

with the understanding that it might apply equally well to thing other than strictly chronological

“time.” It is often also referred to in the literature as the within-units factor. In the dental

study, this is age (n = 4); in the diet study, weeks (n = 6).

PAGE 107

Page 117: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 5 ST 732, M. DAVIDIAN

• For simplicity, we will consider in detail the case where there is a single factor making up the

groups (e.g. gender, dose); however, it is straightforward to extend the development to the case

where the groups are determined by a factorial design; e.g. if in the diet study there had been

q = 6 groups, determined by the factorial arrangement of 3 doses and 2 genders.

SOURCES OF VARIATION: As discussed in Chapter 4, the model recognizes two possible sources of

variation that may make observations on units in the same group taken at the same time differ:

• There is random variation in the population of units due to, for example, biological variation. For

example, if we think of the population of all possible guinea pigs if they were all given the low dose,

they would produce different responses at week 1 simply because guinea pigs vary biologically and

are not all identical.

We may thus identify random variation among individuals (units).

• There is also random variation due to within-unit fluctuations and measurement error, as

discussed in Chapter4.

We may thus identify random variation within individuals (units).

It is important that any statistical model take these two sources of variation into appropriate account.

Clearly, these sources will play a role in determining the nature of the covariance matrix of a data

vector; we will see this for the particular model we now discuss in a moment.

MODEL: To state the model in the usual way, we will use notation different from that we have discussed

so far. We will then show how the model in the standard notation may also be represented as we have

discussed. Define the random variable

Yh`j = observation on unit h in the `th group at time j.

• h = 1, . . . , r`, where r` denotes the number of units in group `. Thus, in this notation, h indexes

units within a particular group.

• ` = 1, . . . , q indexes groups

• j = 1, . . . , n indexes the levels of time

PAGE 108

Page 118: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 5 ST 732, M. DAVIDIAN

• Thus, the total number of units involved is m =q∑

`=1

r`. Each is observed at n time points.

The model for Yh`j is given by

Yh`j = µ + τ` + bh` + γj + (τγ)`j + eh`j (5.1)

• µ is an “overall mean”

• τ` is the deviation from the overall mean associated with being in group `

• γj is the deviation associated with time j

• (τγ)`j is an additional deviation associated with group ` and time j; (τγ)`j is the interaction

effect for group `, time j

• bh` is a random effect with E(bh`) = 0 representing the deviation caused by the fact that Yh`j

is measured on the hth particular unit in the `th group. That is, responses vary because of

random variation among units. If we think of the population of all possible units were they to

receive the treatment of group `, we may think of each unit as having its own deviation simply

because it differs biologically from other units. Formally, we may think of this population as

being represented by a probability distribution of all possible bh` values, one per unit in the

population. bh` thus characterizes the source of random variation due to among-unit causes. The

term random effect is customary to describe a model component that addresses among-unit

variation.

• eh`j is a random deviation with E(eh`j) = 0 representing the deviation caused by the aggregate

effect of within-unit fluctuations and measurement error (within-unit sources of variation). That

is, responses also vary because of variation within units. Recalling the model in Chapter 4, if we

think of the population of all possible combinations of fluctuations and measurement errors that

might happen, we may represent this population by a probability distribution of all possible

eh`j values. The term “random error” is usually used to describe this model component, but,

as we have remarked previously, we prefer random deviation, as this effect may be due to more

than just measurement error.

PAGE 109

Page 119: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 5 ST 732, M. DAVIDIAN

REMARKS:

• Model (5.1) has exactly the same form as the statistical model for observations arising from an

experiment conducted according to a split plot design. Thus, as we will see, the analysis is

identical; however, the interpretation and further analyses are different.

• Note that the actual values of the times of measurement (e.g. ages 8, 10, 12, 14 in the dental

study) do not appear explicitly in the model. Rather, a separate deviation parameter γj and

and interaction parameter (τγ)`j is associated with each time. Thus, the model takes no explicit

account of where the times of observation are chronologically; e.g. are they equally-spaced?

MEAN MODEL: The model (5.1) represents how we believe systematic factors like time and treatment

(group) and random variation due to various sources may affect the way a response turns out. To

exhibit this more clearly, it is instructive to re-express the model as

Yh`j = µ + τ` + γj + (τγ)`j︸ ︷︷ ︸µ`j

+ bh` + eh`j︸ ︷︷ ︸εh`j

(5.2)

• Because bh` and eh`j have mean 0, we have of course

E(Yh`j) = µ`j = µ + τ` + γj + (τγ)`j .

Thus, µ`j = µ+τ`+γj+(τγ)`j represents the mean for a unit in the `th group at the jth observation

time. This mean is the sum of deviations from an overall mean caused by a fixed systematic effect

on the mean due to group ` that happens at all time points (τ`), a fixed systematic effect on the

mean that happens regardless of group at time j (γj), and an additional fixed systematic effect

on the mean that occurs for group ` at time j ((τγ)`j).

• εh`j = bh` + eh`j the sum of random deviations that cause Yh`j to differ from the mean at time j

for the hth unit in group `. εh`j summarizes all sources random variation.

• Note that bh` does not have a subscript “j.” Thus, the deviation that “places” the hth unit in

group ` in the population of all such units relative to the mean response is the same for all time

points. This represents an assumption: if a unit is “high” at time j relative to the group mean

at j, it is “high” by the same amount at all other times.

This may or not be reasonable. For example, recall Figure 1 in Chapter 4, reproduced here as

Figure 2.

PAGE 110

Page 120: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 5 ST 732, M. DAVIDIAN

This assumption might be reasonable for the upper two units in panel (b), as the “inherent

trends” for these units are roughly parallel to the trajectory of means over time. But the lower

unit’s trend is far below the mean at early times but rises to be above it at later times; for this

unit, the deviation from the mean is not the same at all times.

As we will see shortly, violation of this assumption may not be critical as long as the overall

pattern of variance and correlation implied by this model is similar to that in the data.

Figure 2: (a) Hypothetical longitudinal data from m = 3 units at n = 9 time points. (b) Conceptual

representation of sources of variation.

time

resp

onse

(a)

time

resp

onse

(b)

NORMALITY AND VARIANCE ASSUMPTIONS: For continuous responses like those in the example,

it is often realistic to consider the normal distribution as a model for the way in which the various

sources of variation affect the response. If Yh`j is continuous, we would expect that the deviations due

to biological variation (among-units) and within-unit sources that affect how Yh`j turns out to also be

continuous. Thus, rather than assuming that Yh`j is normally distributed directly, it is customary to

assume that each random component arises from a normal distribution.

Specifically, the standard assumptions, which also incorporate assumptions about variance, are:

• bh` ∼ N (0, σ2b ) and are all independent. This says that the distribution of deviations in the popu-

lation of units is centered about 0 (some are negative, some positive), with variation characterized

by the variance component σ2b .

PAGE 111

Page 121: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 5 ST 732, M. DAVIDIAN

The fact that this normal distribution is identical for all ` = 1, . . . , q reflects an assumption

that units vary similarly among themselves in all q populations. The independence assumption

represents the reasonable view that the response one unit in the population gives at any time is

completely unrelated to that given by another unit.

• eh`j ∼ N (0, σ2e) and are all independent. This says that the distribution of deviations due to

within-unit causes is centered about 0 (some negative, some positive), with variation character-

ized by the (common) variance component σ2e .

That this distribution is the same for all ` = 1, . . . , q and j = 1, . . . , n again is an assumption.

The variance σ2e represents the “aggregate” variance of the combined fluctuation and measurement

error processes, and is assumed to be constant over time and group. Thus, the model assumes

that the combined effect of within-unit sources of variation is the same at any time in all groups.

E.g. the magnitude of within-unit fluctuations is similar across groups and does not change with

time, and the variability associated with errors in measurement is the same regardless of the size

of the thing being measured.

The independence assumption is something we must think about carefully. It is customary to

assume that the error in measurement introduced by, say, an imperfect scale at one time point

is not related to the error in measurement that occurs at a later time point; i.e. measurement

errors occur “haphazardly.” Thus, if eh`j represents mostly measurement error, the independence

assumption seems reasonable. However, fluctuations within a unit may well be correlated, as

discussed in the last chapter. Thus, if the time points are close enough together so that correlations

are not negligible, this may not be reasonable. (recall our discussion of observations close in time

tending to be “large” or “small” together).

• The bh` and eh`j are assumed to all be mutually independent. This represents the view that

deviations due to within-unit sources are of similar magnitude regardless of the the magnitudes

of the deviations bh` associated with the units on which the observations are made. This is often

reasonable; however, as we will see later in the course, there are certain situations where it may

not be reasonable.

With these assumptions it will follow that the Yh`js are normally distributed, as we will now demonstrate.

VECTOR REPRESENTATION AND COVARIANCE MATRIX: Now consider the data on a particular

unit. With this notation, the subscripts h and ` identify a particular unit as the hth unit in the `th

group.

PAGE 112

Page 122: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 5 ST 732, M. DAVIDIAN

For this unit, we may summarize the observations at the n times in a vector and write

Yh`1

Yh`2

...

Yh`n

=

µ + τ` + γ1 + (τγ)`1

µ + τ` + γ2 + (τγ)`2

...

µ + τ` + γn + (τγ)`n

+

bh`

bh`

...

bh`

+

eh`1

eh`2

...

eh`n

(5.3)

Y h` = µ` + 1bh` + eh`,

where 1 is a (n× 1) vector of 1s, or more succinctly,

Yh`1

Yh`2

...

Yh`n

=

µ`1

µ`2

...

µ`n

+

εh`1

εh`2

...

εh`n

(5.4)

Y h` = µ` + εh`,

so, for the data vector from the hth unit in group `,

E(Y h`) = µ`.

We see that the model implies a very specific representation of a data vector. Note that for all units

from the same group (`) µ` is the same.

We will now see that the model implies something very specific about how observations within and

across units covary and about the structure of the mean of a data vector.

• Because bh` and eh`j are independent, we have

var(Yh`j) = var(bh`) + var(eh`j) + 2cov(bh`, eh`j) = σ2b + σ2

e + 0 = σ2b + σ2

e .

• Furthermore, because each random component bh` and eh`j is normally distributed, each Yh`j is

normally distributed.

• In fact, the Yh`j values making up the vector Y h` are jointly normally distributed.

Thus, a data vector Y h` under the assumptions of this model has a multivariate (n-dimensional) normal

distribution with mean vector µ`. We now turn to the form of the covariance matrix of Y h`.

PAGE 113

Page 123: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 5 ST 732, M. DAVIDIAN

FACT: First we note the following result. If b and e are two random variables with means µb and µe,

then cov(b, e) = 0 implies that E(be) = E(b)E(e) = µbµe. This is shown as follows:

cov(b, e) = E(b− µb)(e− µe) = E(be)− E(b)µe − µbE(e) + µbµe = E(be)− µbµe.

Thus, cov(b, e) = 0 = E(be)− µbµe, and the result follows.

• We know that if b and e are jointly normally distributed and independent, then cov(b, e) = 0.

• Thus, b and e independent and normal implies E(be) = µbµe. If furthermore b and e have means

0, i.e. E(b) = 0, E(e) = 0, then in fact

E(be) = 0.

We now use this result to examine the covariances.

• First, let Yh`j and Yh′`′j′ be two observations taken from different units (h and h′) from different

groups (` and `′) at different times (j and j′).

cov(Yh`j , Yh′`′j′) = E(Yh`j − µ`j)(Yh′`′j′ − µ`′j′) = E(bh` + eh`j)(bh′`′ + eh′`′j′)

= E(bh`bh′`′) + E(eh`jbh′`′) + E(bh`eh′`′j′) + E(eh`jeh′`′j′) (5.5)

Note that, since all the random components are assumed to be mutually independent with 0

means, by the above result, we have that each term in (5.5) is equal to 0! Thus, (5.5) implies that

two responses from different units in different groups at different times are not correlated.

• In fact, the same argument goes through if ` = `′, i.e. the observations are from two different

units in the same group and/or j = j′, i.e. the observations are from two different units at the

same time. That is (try it!),

cov(Yh`j , Yh′`j′) = 0, cov(Yh`j , Yh′`′j) = 0, cov(Yh`j , Yh′`j) = 0.

• Thus, we may conclude that the model (5.1) automatically implies that any two observations

from different units have 0 covariance. Furthermore, because these observations are all normally

distributed, this implies that any two observations from different units are independent! Thus,

two vectors Y h` and Y h′`′ from different units, where ` 6= `′ or ` = `′, are independent under

this model!

Recall that at the end of Chapter 3, we noted that it seems reasonable to assume that data vectors

from different units are indeed independent; this model automatically induces this assumption.

PAGE 114

Page 124: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 5 ST 732, M. DAVIDIAN

• Now consider 2 observations on the same unit, say the hth unit in group `, Yh`j and Yh`j′ . We

have

cov(Yh`j , Yh`j′) = E(Yh`j − µ`j)(Yh`j′ − µ`j′) = E(bh` + eh`j)((bh` + eh`j′)

= E(bh`bh`) + E(eh`jbh`) + E(bh`eh`j′) + E(eh`jeh`j′)

= σ2b + 0 + 0 + 0 = σ2

b . (5.6)

This follows because all of the random variables in the last three terms are mutually independent

according to the assumptions and

E(bh`bh`) = E(bh` − 0)2 = var(bh`) = σ2b

by the assumptions.

COVARIANCE MATRIX: Summarizing this information in the form of a covariance matrix, we see

that

var(Y h`) =

σ2b + σ2

e σ2b · · · σ2

b

σ2b σ2

b + σ2e · · · σ2

b

......

......

σ2b σ2

b · · · σ2b + σ2

e

(5.7)

• Actually, we could have obtained this matrix more directly by using matrix operations applied to

the matrix form of (5.3). Specifically, because bh` and the elements of eh` are independent and

normal, 1bh` and eh` are independent, multivariate normal random vectors,

var(Y h`) = var(1bh`) + var(eh`) = 1var(bh`)1′ + var(eh`). (5.8)

Now var(bh`) = σ2b . Furthermore (try it),

11′ = Jn =

1 · · · 1

1 · · · 1...

......

1 · · · 1

and var(eh`) = σ2

eIn;

applying these to (5.8) gives

var(Y h`) = σ2bJn + σ2

eIn = Σ. (5.9)

It is straightforward to observe by writing out (5.9) in detail that it is just a compact way, in

matrix notation, to state (5.7).

PAGE 115

Page 125: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 5 ST 732, M. DAVIDIAN

• It is customary to use J to denote a square matrix of all 1s, where we add the subscript when we

wish to emphasize the dimension.

• We thus see that we may summarize the assumptions of model (5.1) in matrix form: The m data

vectors Y h`, h = 1, . . . , r`, ` = 1, . . . , q are all independent and multivariate normal with

Y h` ∼ Nn(µ`,Σ),

where Σ is given in (5.9).

COMPOUND SYMMETRY: We thus see from given in (5.7) and (5.9) is that this model assumes that

the covariance of a random data vector has the compound symmetry or exchangeable correlation

structure (see Chapter 4).

• Note that the off-diagonal elements of this matrix (the covariances among elements of Y h`) are

equal to σ2b . Thus, if we compute the correlations, they are all the same and equal to (verify)

σ2b/(σ2

b + σ2e). This is called the intra-class correlation in some contexts.

• As we noted earlier, this model says that no matter how far apart or near in time two elements

of Y h` were taken, the degree of association between them is the same. Hence, with respect to

association, they are essentially interchangeable (or exchangeable).

• Moreover, the association is positive; i.e. because both σ2b and σ2

e are variances, both are

positive. Thus, the correlation, which depends on these two positive quantities, must also be

positive.

• The diagonal elements of are also all the same, implying that the variance of each element of Y h`

is the same.

• This covariance structure is a special case of something called a Type H covariance structure.

More on this later.

• As we have noted previously, the compound symmetric structure may be a rather restrictive

assumption for longitudinal data, as it tends to emphasize among-unit sources of variation. If

the within-unit source of correlation (due to fluctuations) is non-negligible, this may be a poor

representation. Thus, assuming the model (5.1) implies this fairly restrictive assumption on the

nature of variation within a data vector.

PAGE 116

Page 126: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 5 ST 732, M. DAVIDIAN

• The implied covariance matrix (5.7) is the same for all units, regardless of group.

As we mentioned earlier, using model (5.1) as the basis for analyzing longitudinal data is quite common

but may be inappropriate. We now see why – the model implies a restrictive and possibly unrealistic

assumption about correlation among observations on the same unit over time!

ALTERNATIVE NOTATION: We may in fact write the model in our previous notation. Note that h

indexes units within groups, and ` indexes groups, for a total of m =∑q

`=1 r` units. We could thus

reindex units by a single index, i = 1, . . . , m, where the value of i for any given unit is determined by

its (unique) values of h and `. We could reindex bh` and eh` in the same way. Thus, let Y i, i = 1, . . . , m,

i.e.

Y i =

Yi1

...

Yin

,

denote the vectors Y h`, h = 1, . . . , r`, ` = 1, . . . , q reindexed, and similarly write bi and ei. To express

the model with this indexing, the information on group membership must somehow be incorporated

separately, as it is no longer explicit from the indexing. To do this, it is common to write the model as

follows.

Let M denote the matrix of all means µ`j implied by the model (5.1), i.e.

M =

µ11 µ12 · · · µ1n

......

......

µq1 µq2 · · · µqn

. (5.10)

The `th row of the matrix M in (5.10) is thus the transpose of the mean vector µ` (n× 1), i.e.

M =

µ′

1

...

µ′q

.

PAGE 117

Page 127: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 5 ST 732, M. DAVIDIAN

Also, using the new indexing system, let, for ` = 1, . . . , q,

ai` = 1 if unit i is from group `

= 0 otherwise

Thus, the ai` record the information on group membership. Now let ai be the vector (q × 1) of ai`

values corresponding to the ith unit, i.e.

a′i = (ai1, ai2, . . . , aiq);

because any unit may only belong to one group, ai will be a vector of all 0s except for a 1 in the position

corresponding to i’s group. For example, if there are q = 3 groups and n = 4 times, then

M =

µ11 µ12 µ13 µ14

µ21 µ22 µ23 µ24

µ31 µ32 µ33 µ34

and if the ith unit is from group 2, then

a′i = (0, 1, 0),

so that (verify)

a′iM = (µ21, µ22, µ23, µ24) = µ′

i,

say, the mean vector for the ith unit. The particular elements of µi are determined by the group

membership of unit i, and are the same for all units in the same group.

Using these definitions, it is straightforward (try it) to verify that we may rewrite the model in (5.3)

and (5.4) as

Y ′i = a′

iM + 1′bi + e′i, i = 1, . . . , m.

and

Y ′i = a′

iM + ε′i, i = 1, . . . , m. (5.11)

This one standard way of writing the model when indexing units is done with a single subscript (i in

this case).

In particular, this way of writing the model is used in the documentation for SAS PROC GLM. The

convention is to put the model “on its side,” which can be confusing.

PAGE 118

Page 128: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 5 ST 732, M. DAVIDIAN

Another way of writing the model that is more familiar and more germane to our later development is

as follows. Let β be the vector of all parameters in the model (5.1) for all groups and times; i.e. all of

µ, the τ`, γj , and (τγ)`j , ` = 1, . . . , q, j = 1, . . . , n. For example, with q = 2 groups and n = 3 time

points,

β =

µ

τ1

τ2

γ1

γ2

γ3

(τγ)11

(τγ)12

(τγ)13

(τγ)21

(τγ)22

(τγ)23

.

Now E(Y i) = µi. If, for example, i is in group 2, then

µi =

µ21

µ22

µ23

=

µ + τ2 + γ1 + (τγ)21

µ + τ2 + γ2 + (τγ)22

µ + τ2 + γ3 + (τγ)23

.

Note that if we define

Xi =

1 0 1 1 0 0 0 0 0 1 0 0

1 0 1 0 1 0 0 0 0 0 1 0

1 0 1 0 0 1 0 0 0 0 0 1

,

then (verify), we can write

µi = Xiβ.

Thus, in any general model, we see that, if we define β and Xi appropriately, we can write the model

as

Y i = Xiβ + 1bi + ei or Y i = Xiβ + εi, i = 1, . . . , m.

Xi would be the appropriate matrix of 0s and 1s, and would be the same for each i in the same group.

PAGE 119

Page 129: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 5 ST 732, M. DAVIDIAN

PARAMETERIZATION: Just as with any model of this type, we note that representing the means µ`j

in terms of parameters µ, τ`, γj , and (τγ)`j leads to a model that is overparameterized. That is,

while we do have enough information to figure out how the means µ`j differ, we do not have enough

information to figure out how they break down into all of these components. For example, if we had 2

treatment groups, we can’t tell where all of µ, τ1, and τ2 ought to be just from the information at hand.

To see what we mean, suppose we knew that µ + τ1 = 20 and µ + τ2 = 10. Then one way this could

happen is if

µ = 15, , τ1 = 5, τ2 = −5;

another way is

µ = 12, , τ1 = 8, τ2 = −2;

in fact, we could write zillions of more ways. Equivalently, this issue may also be seen by realizing that

the matrix Xi is not of full rank.

Thus, the point is that, although this type of representation of a mean µ`j used in the context of analysis

of variance is convenient for helping us think about effects of different factors as deviations from an

“overall” mean, we can’t identify all of these components. In order to identify them, it is customary to

impose constraints that make the representation unique by forcing only one of the possible zillions of

ways to hold:q∑

`=1

τ` = 0,n∑

j=1

γj = 0,q∑

`=1

(τγ)`j = 0 =n∑

j=1

(τγ)`j for all j, `.

Imposing these constraints is equivalent to redefining the vector of parameters β and the matrices Xi

so that Xi will always be a full rank matrix for all i.

REGRESSION INTERPRETATION: The interesting feature of this representation is that it looks like

we have a set of m “regression” models, indexed by i, each with its own “design matrix” Xi and

“deviations” εi. We will see later that more flexible models for repeated measurements are also of this

form; thus, writing (5.1) this way will allow us to compare different models and methods directly.

Regardless of how we write the model, it is important to remember that an important assumption of

the model is that all data vectors are multivariate normal with the same covariance matrix having a

very specific form; i.e. with this indexing, we have

Y i ∼ Nn(µi,Σ), Σ = σ2bJn + σ2

eIn.

PAGE 120

Page 130: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 5 ST 732, M. DAVIDIAN

5.3 Questions of interest and statistical hypotheses

We now focus on how questions of scientific interest may be addressed in the context of such a model

for longitudinal data. Recall that we may write the model as in (5.11), i.e.

Y ′i = a′

iM + ε′i, i = 1, . . . , m, (5.12)

where

M =

µ11 µ12 · · · µ1n

......

......

µq1 µq2 · · · µqn

and

µ`j = µ + τ` + γj + (τγ)`j . (5.13)

The constraintsq∑

`=1

τ` = 0,n∑

j=1

γj = 0,q∑

`=1

(τγ)`j = 0 =n∑

j=1

(τγ)`j

are assumed to hold.

The model (5.12) is sometimes written succinctly as

Y = AM + ε, (5.14)

where Y is the (m× n) matrix with ith row Y ′i and similarly for ε, and A is the (m× q) matrix with

ith row a′i. We will not make direct use of this way of writing the model; we point it out as it is the

way the model is often written in texts on general multivariate models. It is also the way the model is

referred to in the documentation for PROC GLM in the SAS software package.

GROUP BY TIME INTERACTION: As we have noted, a common objective in the analysis of longi-

tudinal data is to assess whether the way in which the response changes over time is different across

treatment groups. This is usually phrased in terms of means. For example, in the dental study, is the

profile of distance over time different on average for boys and girls? That is, is the pattern of change

in mean response different for different groups?

This is best illustrated by picture. For the case of q = 2 groups and n = 3 time points, Figure 3 shows

two possible scenarios. In each panel, the lines represent the mean responses µ`j for each group. In

both panels, the mean response at each time is higher for group 2 than for group 1 at all time points,

and the pattern of change in mean response seems to follow a straight line. However, in the left panel,

the rate of change of the mean response over time is the same for both groups.

PAGE 121

Page 131: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 5 ST 732, M. DAVIDIAN

I.e. the time profiles are parallel. In the right panel, the rate of change is faster for group 2; thus,

the profiles are not parallel.

Figure 3: Group by time interaction. Plotting symbol indicates group number.

time

mea

n re

spon

se

1 2 3

010

2030

40

1

1

1

2

2

2

No group by time interaction (parallel profiles)

time

mea

n re

spon

se

1 2 3

010

2030

40

1

1

1

2

2

2

Group by time interaction (lack of parallelism)

In the model, each point in the figure is represented by the form (5.13),

µ`j = µ + τ` + γj + (τγ)`j .

Here, the terms (τγ)`j represent the special amounts by which the mean for group ` at time j may differ

from the overall mean. The difference in mean between groups 1 and 2 at any specific time j is, under

the model,

µ1j − µ2j = (τ1 − τ2) + {(τγ)1j − (τγ)2j}.

Thus, the terms (τγ)`j allow for the possibility that the difference between groups may be different

at different times, as in the right panel of Figure 3 – the amount {(τγ)1j − (τγ)2j)} is specific to the

particular time j.

Now, if the (τγ)`j were all the same, the difference would reduce to

µ1j − µ2j = (τ1 − τ2),

as the second piece would be equal to zero. Here, the difference in mean response between groups is the

same at all time points and equal to (τ1 − τ2) (which does not depend on j). This is the situation of

the left panel of Figure 3.

PAGE 122

Page 132: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 5 ST 732, M. DAVIDIAN

Under the constraintsq∑

`=1

(τγ)`j = 0 =n∑

j=1

(τγ)`j for all `, j,

if (τγ)`j are all the same for all `, j, then it must be that

(τγ)`j = 0 for all `, j.

Thus, if we wished to discern between a situation like that in the left panel, of parallel profiles, and

that in the right panel (lack of parallelism), addressing the issue of a common rate of change over time,

we could state the null hypothesis as

H0 : all (τγ)`j = 0.

There are qn total parameters (τγ)`j ; however, if the constraints above hold, then having (q−1)(n−1) of

the (τγ)`j equal to 0 automatically requires the remaining ones to be zero as well. Thus, the hypothesis

is really one about the behavior of (q − 1)(n − 1) parameters, hence there are (q − 1)(n − 1) degrees

of freedom associated with this hypothesis.

GENERAL FORM OF HYPOTHESES: It turns out that, with the model expressed in the form (5.12),

it is possible to express H0 and other hypotheses of scientific interest in a unified way. This unified

expression is not necessary to appreciate the hypotheses of interest; however, it is used in many texts

on the subject and in the documentation for PROC GLM in SAS, so we digress for a moment to describe

it.

Specifically, noting that M is the matrix whose rows are the mean vectors for the different treatment

groups, it is possible to write formal statistical hypotheses as linear functions of the elements of M .

Let

• C be a (c× q) matrix with c ≤ q of full rank.

• U be a (n× u) matrix with u ≤ n of full rank.

Then it turns out that the null hypothesis corresponding to questions of scientific interest may be written

in the form

H0 : CMU = 0.

Depending on the choice of the matrices C and U , the linear function CMU of the elements of

M (the individual means for different groups at different time points) may be made to address these

different questions.

PAGE 123

Page 133: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 5 ST 732, M. DAVIDIAN

We now exhibit this for H0 for the group by time interaction. For definiteness, consider the situation

where there are q = 2 groups and n = 3 time points. Consider

C =(

1 −1)

,

so that c = 1 = q − 1. Then note that

CM =(

1 −1) µ11 µ12 µ13

µ21 µ22 µ23

=(

µ11 − µ21, µ12 − µ22, µ13 − µ23

)

=(

τ1 − τ2 + (τγ)11 − (τγ)21, τ1 − τ2 + (τγ)12 − (τγ)22, τ1 − τ2 + (τγ)13 − (τγ)23

)Thus, this C matrix has the effect of taking differences among groups.

Now let

U =

1 0

−1 1

0 −1

,

so that u = 2 = n− 1. It is straightforward (try it) to show that

CMU =(

µ11 − µ21 − µ12 + µ22, µ12 − µ22 − µ13 + µ23

)=

((τγ)11 − (τγ)21 − (τγ)12 + (τγ)22, (τγ)12 − (τγ)22 − (τγ)13 + (τγ)23

).

It is an exercise in algebra to verify that, under the constraints, if each of these elements equals zero,

then H0 follows.

In the jargon associated with repeated measurements, the test for group by time interaction is sometimes

called the test for parallelism. Later, we will discuss some further hypotheses involving different

choices of U that allow one to investigate different aspects of the change in mean response over time

and how it differs across groups. Generally, in the analysis of longitudinal data from different groups,

testing the group by time interaction is of primary interest, as it addresses whether the change in mean

response differs across groups.

It is important to recognize that parallelism does not necessarily mean that the mean response over

time is restricted to look like a straight line in each group. In Figure 4, the left panel exhibits

parallelism; the right panel does not.

PAGE 124

Page 134: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 5 ST 732, M. DAVIDIAN

Figure 4: Group by time interaction. Plotting symbol indicates group number.

time

mea

n re

spon

se

1 2 3

010

2030

40

1

11

2

22

No group by time interaction (parallel profiles)

timem

ean

resp

onse

1 2 3

010

2030

40

1

1

1

2

2

2

Group by time interaction (lack of parallelism)

MAIN EFFECT OF GROUPS: Clearly, if profiles are parallel, then the obvious question is whether

they are in fact coincident; that is, whether, at each time point, the mean response is in fact the same.

A little thought shows that, if the profiles are parallel, then if the profiles are furthermore coincident,

then the average of the mean responses over time will be the same for each group. Asking the question

of whether the average of the mean responses over time is the same for each group if the profiles are

not parallel may or may not be interesting or relevant.

• For example, if the true state of affairs were that depicted in the right panels of Figures 3 and

4 whether the average of mean responses over time is different for the two groups might be

interesting, as it would be reflecting the fact that the mean response for group 2 is larger at all

times.

• On the other hand, consider the left panel of Figure 5. If this were the true state of affairs, a test

of this issue would be meaningless; the change of mean response over time is in the opposite

direction for the two groups; thus, how it averages out over time is of little importance – because

the phenomenon of interest does indeed happen over time, the average of what it does over

time may be something that cannot be achieved – we can’t make time stand still!

PAGE 125

Page 135: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 5 ST 732, M. DAVIDIAN

• Similarly, if the issue under study is something like growth, the average over time of the response

may have little meaning; instead, one may be interested in, for example, how different the mean

response is at the end of the time period of study. For example, in the right panel of Figure 5,

the mean response over time increases for each group at different rates, but has the same average

over time. Clearly, the group with the faster rate will have a larger mean response at the end of

the time period.

Figure 5: Group by time interaction. Plotting symbol indicates group number.

time

mea

n re

spon

se

1 2 3

010

2030

40

1

1

12

2

2

Group by time interaction (opposite direction)

time

mea

n re

spon

se

1 2 3

010

2030

40

1

1

1

2

2

2

Group by time interaction (lack of parallelism)

Generally, then, whether the average of the mean response is the same across groups in a longitudinal

study is of most interest in the case where the mean profiles over time are approximately parallel. For

definiteness, consider the case of q = 2 groups and n = 3 time points.

We are interested in whether the average of mean responses over time is the same in each group. For

group `, this average is, with n = 3,

n−1(µ`1 + µ`2 + µ`3) = µ + τ` + n−1(γ1 + γ2 + γ3) + n−1{(τγ)`1 + (τγ)`2 + (τγ)`3}.

Taking the difference of the averages between ` = 1 and ` = 2, some algebra yields (verify)

τ1 − τ2 + n−1n∑

j=1

(τγ)1j − n−1n∑

j=1

(τγ)2j .

Note, however, that the constraints we impose so that the model is of full rank dictate that∑nj=1(τγ)`j = 0 for each `; thus, the two sums in this expression are 0 by assumption, so that we

are left with τ1 − τ2.

PAGE 126

Page 136: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 5 ST 732, M. DAVIDIAN

Thus, the hypothesis may be expressed as

H0 : τ1 − τ2 = 0.

Furthermore, under the constraint∑q

`=1 τ` = 0, if the τ` are equal as in H0, then they must satisfy

τ` = 0 for each `. Thus, the hypothesis may be rewritten as

H0 : τ1 = τ2 = 0.

For general q and n, the reasoning is the same; we have

H0 : τ1 = . . . = τq = 0.

The appropriate null hypothesis that addresses this issue may also be stated in the general form H0 :

CMU = 0 for suitable choices of C and U . The form of U in particular shows the interpretation as

that of “averaging” over time. Continuing to take q = 2 and n = 3, let

C =(

1 −1)

,

so that c = 1 = q − 1. Then note that

CM =(

1 −1) µ11 µ12 µ13

µ21 µ22 µ23

=(

µ11 − µ21, µ12 − µ22, µ13 − µ23

)

=(

τ1 − τ2 + (τγ)11 − (τγ)21, τ1 − τ2 + (τγ)12 − (τγ)22, τ1 − τ2 + (τγ)13 − (τγ)23

)Now let (n = 3 here)

U =

1/n

1/n

1/n

.

It is straightforward to see that, with n = 3,

CMU = τ1 − τ2 + n−1n∑

j=1

(τγ)1j − n−1n∑

j=1

(τγ)2j .

That is, this choice of U dictates an averaging operation across time. Imposing the constraints as

above, we thus see that we may express H0 in the form H0 : CMU = 0 with these choices of C

and U . For general q and n, one may specify appropriate choices of C and U , where the latter is a

column vector of 1’s implying the “averaging” operation across time, and arrive at the general hypothesis

H0 : τ1 = . . . = τq = 0.

PAGE 127

Page 137: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 5 ST 732, M. DAVIDIAN

MAIN EFFECT OF TIME: Another question of interest may be whether the mean response is in fact

constant over time. If the profiles are parallel, then this is like asking whether the mean response

averaged across groups is the same at each time. If the profiles are not parallel, then this may or may

not be interesting. For example, note that in the left panel of Figure 5, the average of mean responses for

groups 1 and 2 are the same at each time point. However, the mean response is certainly not constant

across time for either group. If the groups represent things like genders, then what happens on average

is something that can never be achieved.

Consider again the special case of q = 2 and n = 3. The average of mean responses across groups for

time j is

q−1q∑

`=1

µ`j = γj + q−1q∑

`=1

τ` + q−1q∑

`=1

(τγ)`j = γj

using the constraints∑q

`=1 τ` = 0 and∑q

`=1(τγ)`j = 0. Thus, having all these averages be the same at

each time is equivalent to

H0 : γ1 = γ2 = γ3.

Under the constraint∑n

j=1 γj = 0, then, we have H0 : γ1 = γ2 = γ3 = 0.

For general q and n, the hypothesis is of the form

H0 : γ1 = . . . = γn = 0.

We may also state this hypothesis in the form H0 : CMU = 0. In the special case q = 2, n = 3, taking

U =

1 0

−1 1

0 −1

, C =(

1/2 1/2)

gives

MU =

µ11 µ12 µ13

µ21 µ22 µ23

1 0

−1 1

0 −1

=

µ11 − µ12 µ12 − µ13

µ21 − µ22 µ22 − µ23

=

γ1 − γ2 + (τγ)11 − (τγ)12, γ2 − γ3 + (τγ)12 − (τγ)13

γ1 − γ2 + (τγ)21 − (τγ)22, γ2 − γ3 + (τγ)22 − (τγ)23

.

from whence it is straightforward to derive, imposing the constraints, that (verify)

CMU =(

γ1 − γ2, γ2 − γ3

).

Setting this equal to zero gives H0 : γ1 = γ2 = γ3. For general q and n, we may choose the matrices C

and U in a similar fashion. Note that this type of C matrix averages across groups.

PAGE 128

Page 138: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 5 ST 732, M. DAVIDIAN

OBSERVATION: These are, of course, exactly the hypotheses that one tests for a split plot experiment,

where, here, “time” plays the role of the “split plot” factor and “group” is the “whole plot factor.” What

is different lies in the interpretation; because “time” has a natural ordering (longitudinal), what is

interesting may be different; as noted above, of primary interest is whether the change in mean response

is different over (the levels of) time. We will see more on this shortly.

5.4 Analysis of variance

Given the fact that the statistical model and hypotheses in this setup are identical to that of a split

plot experiment, it should come as no surprise that the analysis performed is identical. That is, under

the assumption that the model (5.1) is correct and that the observations are normally distributed, it is

possible to show that the usual F ratios one would construct under the usual principles of analysis of

variance provide the basis for valid tests of the hypotheses above. We write out the analysis of variance

table here using the original notation with three subscripts, i.e., Yh`j represents the measurement at the

j time on the hth unit in the `th group.

Define

• Y h`· = n−1 ∑nj=1 Yh`j , the sample average over time for the hth unit in the `th group (over all

observations on this unit)

• Y ·`j = r−1`

∑r`h=1 Yh`j , the sample average at time j in group ` over all units

• Y ·`· = (r`n)−1 ∑r`h=1

∑nj=1 Yh`j , the sample average of all observations in group `

• Y ··j = m−1 ∑q`=1

∑r`h=1 Yh`j , the sample average of all observations at the jth time

• Y ··· = the average of all mn observations.

Let

SSG =q∑

`=1

nr`(Y ·`· − Y ···)2, SSTot,U = nq∑

`=1

r∑h=1

(Y h`· − Y ···)2

SST = mn∑

j=1

(Y ··j − Y ···)2, SSGT =n∑

j=1

q∑`=1

r`(Y ·`j − Y ···)2 − SST − SSG

SSTot,all =q∑

`=1

r∑h=1

n∑j=1

(Yh`j − Y ···)2.

Then the following analysis of variance table is usually constructed.

PAGE 129

Page 139: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 5 ST 732, M. DAVIDIAN

Source SS DF MS F

Among Groups SSG q − 1 MSG FG = MSG/MSEU

Among-unit Error SSTot,U − SSG m− q MSEU

Time SST n− 1 MST FT = MST /MSE

Group × Time SSGT (q − 1)(n− 1) MSGT FGT = MSGT /MSE

Within-unit Error SSE (m− q)(n− 1) MSE

Total SSTot,all nm− 1

where SSE = SSTot,all − SSGT − SST − SSTot,U .

“ERROR”: Keep in mind that, although it is traditional to use the term “error” in analysis of variance,

the among-unit error term includes variation due to among-unit biological variation and the

within-unit error term includes variation due to both fluctuations and measurement error.

F-RATIOS: It may be shown that, as long as the model is correct and the observations are normally

distributed, the F ratios in the above table do indeed have sampling distributions that are F distribu-

tions under the null hypotheses discussed above. It is instructive to state this another way. If we think

of the data in terms of vectors, then this is equivalent to saying that we require that

Y i ∼ Nn(µi,Σ), Σ = σ2bJn + σ2

eIn. (5.15)

That is, as long as the data vectors are multivariate normal and exhibit the compound symmetry

covariance structure, then the F ratios above, which may be seen to be based on calculations on

individual observations, do indeed have sampling distributions that are F with the obvious degrees of

freedom.

EXPECTED MEAN SQUARES: In fact, under (5.15), it is possible to derive the expectations of the

mean squares in the table. That is, we find the average over all data sets we might have ended up

with, of the MSs that are used to construct the F ratios by applying the expectation operator to each

expression (which is a function of the data).

The calculations are messy (one place where they are done is in section 3.3 of Crowder and Hand, 1990),

so we do not show them here. The following summarizes the expected mean squares under (5.15).

PAGE 130

Page 140: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 5 ST 732, M. DAVIDIAN

Source MS Expected mean square

Among Groups MSG σ2e + nσ2

b + n∑q

`=1 r`τ2` /(q − 1)

Among-unit error MSEU σ2e + nσ2

b

Time MST σ2e + m

∑nj=1 γ2

j /(n− 1)

Group × Time MSGT σ2e +

∑q`=1 r`

∑nj=1(τγ)2`j/(q − 1)(n− 1)

Within-unit Error MSE σ2e

It is critical to recognize that these calculations are only valid if the model is correct, i.e. if (5.15)

holds.

Inspection of the expected mean squares shows informally that we expect the F ratios in the analysis

of variance table to test the appropriate issues. For example, we would expect FGT to be large if

the (τγ)`j were not all zero. Note that FG uses the appropriate denominator; intuitively, because we

base our assessment on averages of across all units and time points, we would wish to compare the

mean square for groups against an “error term” that takes into account all sources of variation among

observations we have on the units – both that attributable to the fact that units vary in the population

(σ2b ) and that attributable to the fact that individual observations vary within units (σ2

e). The other

two tests are on features that occur within units; thus, the denominator takes account of the relevant

source of variation, that within units (σ2e).

We thus have the following test procedures.

• Test of the Group by Time interaction (parallelism).

H0 : (τγ)`j = 0 for all j, ` vs. H1 : at least one (τγ)`j 6= 0.

A valid test rejects H0 at level of significance α if

FGT > F(q−1)(n−1),(n−1)(m−q),α

or, equivalently, if the probability is less than α that one would see a value of the test statistic as

large or larger than FGT if H0 were true (that is, the p-value is less than α).

PAGE 131

Page 141: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 5 ST 732, M. DAVIDIAN

• Test of Main effect of Time (constancy).

H0 : γj = 0 for all j vs. H1 : at least one γj 6= 0.

A valid test rejects H0 at level α if

FT > Fn−1,(n−1)(m−q),α

or, equivalently, if the probability is less than α that one would see a value of the test statistic as

large or larger than FT if H0 were true.

• Test of Main effect of Group (coincidence).

H0 : τ` = 0 for all ` vs. H1 : at least one τ` 6= 0.

A valid test rejects H0 at level of significance α if

FG > Fq−1,m−q,α

or, equivalently, if the probability is less than α that one would see a value of the test statistic as

large or larger than FG if H0 were true.

In the above, Fa,b,α critical value corresponding to α for an F distribution with a numerator and b

denominator degrees of freedom.

In section 5.8, we show how one may use SAS PROC GLM to perform these calculations.

5.5 Violation of covariance matrix assumption

In the previous section, we emphasized that the procedures based on the analysis of variance are only

valid if the assumption of compound symmetry holds for the covariance matrix of a data vector. In

reality, these procedures are still valid under slightly more general conditions. However, the important

issue remains that the covariance matrix must be of a special form; if it is not, the tests above will be

invalid and may lead to erroneous conclusions. That is, the F ratios FT and FGT will no longer have

exactly an F distribution.

PAGE 132

Page 142: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 5 ST 732, M. DAVIDIAN

A (n× n) matrix Σ is said to be of Type H if it may be written in the form

Σ =

λ + 2α1 α1 + α2 · · · α1 + αn

α2 + α1 λ + 2α2 · · · α2 + αn

......

......

αn + α1 αn + α2 · · · λ + 2αn

. (5.16)

It is straightforward (convince yourself) that a matrix that exhibits compound symmetry is of Type

H.

It is possible to show, although we will not pursue this here, that, as long as the data vectors Y i are

multivariate normal with common covariance matrix Σ that is of the form (5.16), the F tests discussed

above will be valid. Thus, because (5.16) includes the compound symmetry assumption as a special

case, these F tests will be valid if model (5.1) holds (along with normality).

• If the covariance matrix Σ is not of Type H, but these F tests are conducted nonetheless, they

will be too liberal; that is, they will tend to reject the null hypothesis more often then they

should.

• Thus, one possible consequence of using the analysis of variance procedures when they are not

appropriate is to conclude that group by time interactions exist when they really don’t.

TEST OF SPHERICITY: It is thus of interest to be able to test whether the true covariance structure of

data vectors in a repeated measurement context is indeed of Type H. One such test is known as Mauchly’s

test for sphericity. The form and derivation of this test are beyond the scope of our discussion here; a

description of the test is given by Vonesh and Chinchilli (1997, p. 85), for example. This test provides

a test statistic for testing the null hypothesis

H0 : Σ is of Type H,

where Σ is the true covariance matrix of a data vector.

The test statistic, which we do not give here, has approximately a χ2 (chi-square) distribution when

the number of units m on test is “large” with degrees of freedom equal to (n− 2)(n + 1)/2. Thus, the

test is performed at level of significance α by comparing the value of the test statistic to the χ2α critical

value with (n− 2)(n + 1)/2 degrees of freedom. SAS PROC GLM may be instructed to compute this test

when repeated measurement data are being analyzed; this is shown in section 5.8.

PAGE 133

Page 143: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 5 ST 732, M. DAVIDIAN

The test has some limitations:

• It is not very powerful when the numbers of units in each group is not large

• It can be misleading if the data vectors really do not have a multivariate normal distribution.

These limitations are one of the reasons we do not discuss the test in more detail; it may be of limited

practical value.

In section 5.7, we will discuss one approach to handling the problem of what to do if the null hypothesis

is rejected or if one is otherwise dubious about the assumption of Type H covariance.

5.6 Specialized within-unit hypotheses and tests

The hypotheses of group by time interaction (parallelism) and main effect of time have to do with

questions about what happens over time; as time is a within-unit factor, these tests are often referred

to as focusing on within-unit issues. These hypotheses address these issues in an “overall” sense; for

example, the group by time interaction hypothesis asks whether the pattern of mean response over time

is different for different groups.

Often, it is of interest to carry out a more detailed study of specific aspects of how the mean response

behaves over time, as we now describe. We first review the following definition.

CONTRASTS: Formally, if c is a (n × 1) vector and µ is a (n × 1) vector of means, then the linear

combination

c′µ = µ′c

is called a contrast if c is such that its elements sum to zero.

Contrasts are of interest in the sense that hypotheses about differences of means can be expressed in

terms of them. In particular, if c′µ = 0, there is no difference.

PAGE 134

Page 144: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 5 ST 732, M. DAVIDIAN

For example, consider q = 2 and n = 3. The contrasts

µ11 − µ12 and µ21 − µ22 (5.17)

compare the mean response at the first and second time points for each of the 2 groups; similarly, the

contrasts

µ12 − µ13 and µ22 − µ23 (5.18)

compare the mean response at the second and third time points for each group. Thus, these contrasts

address the issue of how the mean differs from one time to the next in each group.

Recalling

µ′1 =

(µ11 µ12 µ13

), µ′

2 =(

µ21 µ22 µ23

),

we see that the contrasts in (5.17) result from postmultiplying these mean vectors for each group by

c =

1

−1

0

;

similarly, those in (5.18) result from postmultiplying by

c =

0

1

−1

.

Specialized questions of interest pertaining to how the mean differs from one time to the next may then

be stated.

• We may be interested in whether the way in which the mean differs from, say, time 1 to time 2

is different for different groups. This is clearly part of the overall group by time interaction,

focusing particularly on what happens between times 1 and 2.

For our two groups, we would thus be interested in the difference of the contrasts in (5.17).

We may equally well wish to know whether the way in which the mean differs from time 2 to time

3 is different across groups; this is of course also a part of the group by time interaction, and is

represented formally by the difference of the contrasts in (5.18).

• We may be interested in whether there is a difference in mean from, say, time 1 to time 2, averaged

across groups. This is clearly part of the main effect of time and would be formally represented

by averaging the contrasts in (5.17). For times 2 and 3, we would be interested in the average

of the contrasts in (5.18).

PAGE 135

Page 145: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 5 ST 732, M. DAVIDIAN

Specifying these specific contrasts and then considering their differences among groups or averages across

groups is a way of “picking apart” how the overall group by time effect and main effect of time occur

and can thus provide additional insight on how and whether things change over time.

It turns out that we may express such contrasts succinctly through the representation CMU ; indeed,

this is the way in which such specialized hypotheses are presented documentation for PROC GLM in SAS.

To obtain the contrasts in (5.17) and (5.18), in the case q = 2 and n = 3, consider the n× (n−1) matrix

U =

1 0

−1 1

0 −1

.

Then note that

MU =

µ11 µ12 µ13

µ21 µ22 µ23

1 0

−1 1

0 −1

=

µ11 − µ12 µ12 − µ13

µ21 − µ22 µ22 − µ23

. (5.19)

Each element of the resulting matrix is one of the above contrasts. This choice of the contrast matrix

U thus summarizes contrasts that have to do with differences in means from one time to the next. Each

column represents a different possible contrast of this type.

Note that the same matrix U would be applicable for larger q – the important point is that it has n− 1

columns, each of which applies one of the n− 1 possible comparisons of a mean at a particular time to

that subsequent. For general n, the matrix would have the form

U =

1 0 · · · 0

−1 1 · · · 0

0 −1 · · · 0...

......

...

0 · · · · · · 1

0 · · · 0 −1

(5.20)

with n and n− 1 columns. Postmultiplication of M by the general form of contrast matrix U in (5.20)

is often called the profile transformation of within-unit means.

Other contrasts may be of interest. Instead of asking what happens from one time to the next, we may

focus on how the mean at each time differs from what happens over all subsequent times. This may

help us to understand at what point in time things seem to change (if they do).

PAGE 136

Page 146: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 5 ST 732, M. DAVIDIAN

For example, taking q = 2 and n = 4, consider the contrast

µ11 − (µ12 + µ13 + µ14)/3.

This contrast compares, for group 1, the mean at time 1 to the average of the means at all other times.

Similarly

µ12 − (µ13 + µ14)/2

compares for group 1 the mean at time 2 to the average of those at subsequent times. The final contrast

of this type for group 1 is

µ13 − µ14,

which compares what happens at time 3 to the “average” of what comes next, which is the single mean

at time 4.

We may similarly specify such contrasts for the other group.

We may express all such contrasts by a different contrast matrix U . In particular, let

U =

1 0 0

−1/3 1 0

−1/3 −1/2 1

−1/3 −1/2 −1

, (5.21)

Then if q = 2 (verify),

MU =

µ11 − µ12/3− µ13/3− µ14/3, µ12 − µ13/2− µ14/2, µ13 − µ14

µ21 − µ22/3− µ23/3− µ24/3, µ22 − µ23/2− µ24/2, µ23 − µ24

,

which expresses all such contrasts; the first row gives the ones for group 1 listed above.

For general n, the (n×n−1) matrix whose columns define contrasts of this type is the so-called Helmert

transformation matrix of the form

U =

1 0 0 · · · 0

−1/(n− 1) 1 0 · · · 0

−1/(n− 1) −1/(n− 2) 1 · · · 0...

... −1/(n− 3)...

...

−1/(n− 1) −1/(n− 2)... · · · 1

−1/(n− 1) −1/(n− 2) −1/(n− 3) · · · −1

, (5.22)

Postmultiplication of M by a matrix of the form (5.22) in contrasts representing comparisons of each

mean against the average of means at all subsequent times.

PAGE 137

Page 147: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 5 ST 732, M. DAVIDIAN

It is straightforward to verify (try it!) that with n = 3 and q = 2, this transformation would lead to

MU =

µ11 − µ12/2− µ13/2 µ12 − µ13

µ21 − µ22/2− µ23/2 µ22 − µ23

(5.23)

How do we use all of this?

OVERALL TESTS: We have already seen the use of the CMU representation for the overall tests of

group by time interaction and main effect of time. Both contrast matrices U in (5.19) (profile) and

(5.23) (Helmert) contain sets of n− 1 contrasts that “pick apart” all possible differences in means over

time in different ways. Thus, intuitively we would expect that either one of them would lead us to the

overall tests for group by time interaction and main effect of time given the right C matrix (one that

takes differences over groups or one that averages over groups, respectively).

This is indeed the case: It may be shown that premultiplication of either (5.19) or (5.23) by the same

matrix C will lead to the same overall hypotheses in terms of the model components γj and (τγ)`j . For

example, we already saw that premultiplying (5.19) by C = (1, 1) gives with the constraints on (τγ)`j

CMU =(

γ1 − γ2, γ2 − γ3

)= 0.

It may be shown that premultiplying (5.23) by the same matrix C yields (try it)

CMU =(

γ1 − 0.5γ2 − 0.5γ3, γ2 − γ3

)= 0.

It is straightforward to verify that, these both imply the same thing, namely, that we are testing

γ1 = γ2 = γ3.

OVERALL TESTS: This shows the general phenomenon that the choice of the matrix of contrasts U

is not important for dictating the general tests of Time main effects and Group by Time interaction.

As long as the matrix is such that it yields differences of mean responses at different times, it will give

the same form of the overall hypotheses.

The choice of U matrix is important when we are interested in “picking apart” these overall effects, as

above.

We now return to how we might represent hypotheses for and conduct tests of issues like those laid

out on page 135. for a given contrast matrix U of interest. Premultiplication of U by M will yield

the q × (n− 1) matrix MU whose `th row contains whatever contrasts are of interest (dictated by the

columns of U) for group `.

PAGE 138

Page 148: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 5 ST 732, M. DAVIDIAN

• If we premultiply MU by the (q − 1)× q matrix

C =

1 −1 0 · · · 0

1 0 −1 · · · 0...

......

......

1 0 0 · · · −1

(we considered earlier the special case where q = 2), then for each contrast defined in U , the

result is to consider how that contrast differs across groups. The contrast considers a specific part

of the way that mean response differs among the times, so is a component of the Group by Time

interaction (how the difference in mean across groups is different at different times.)

• If we premultiply by C = (1/q, 1/q, . . . , 1/q), each of the n−1 elements of the resulting 1× (n−1)

matrix correspond to the average of each of these contrasts over groups, which all together

constitute the Time main effect. If we consider one of these elements on its own, we see that it

represents the contrast of mean response at time j to average mean response at all times after j,

averaged across groups. If that contrast were equal to zero, it would say that, averaged across

groups, the mean response at time j, is equal to the average of subsequent mean responses.

As we noted earlier, we may wish to look at each of these separately to explore particular aspects of

how the mean response over time behaves. That is, we may wish to consider separate hypothesis tests

addressing these issues.

SEPARATE TESTS: Carrying out separate hypothesis tests for each contrast in U may be accomplished

operationally as follows. Consider the kth column of U , ck, k = 1, . . . , n− 1.

• Apply the function dictated by that column of U to each unit’s data vector. That is, for each

vector Y h`, the operation implied is

y′h`ck = c′

kY h`.

This distills down the repeated measurements on each unit to a single number representing the

value of the contrast for that unit. If each unit’s data vector has the same covariance matrix Σ,

then each of these “distilled” data values has the same variance across all units (see below).

• Perform analyses on the resulting “data;” e.g. to test whether the contrast differs across groups,

one may conduct a usual one-way analysis of variance on these “data.”

• To test whether the contrast is zero averaged across groups, test whether the overall mean of the

“data” is equal to zero using using a standard t test (or equivalently, the F test based on the

square of the t statistic).

PAGE 139

Page 149: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 5 ST 732, M. DAVIDIAN

• These tests will be valid regardless of whether compound symmetry holds; all that matters

is that Σ, whatever it is, is the same for all units. The variance of a distilled data value c′kY h`

for the hth unit in group ` is

var c′kY h` = c′

kΣck.

This is a constant for all h and ` as long as Σ is the same. Thus, the usual assumption of

constant variance that is necessary for a one-way analysis of variance is fulfilled for the “data”

corresponding to each contrast.

ORTHOGONAL CONTRASTS: In some instances, note that the contrasts making up one of these

transformation matrices have an additional property. Specifically, if c1 and c2 are any two columns for

the matrix, then if

c′1c2 = 0;

i.e. the sum of the product of corresponding elements of the two columns is zero, the vectors c1 and c2

are said to be orthogonal. The contrasts corresponding to these vectors are said to be orthogonal

contrasts.

• The contrasts making up the profile transformation are not orthogonal (verify).

• The contrasts making up the Helmert transformation are orthogonal (verify).

The advantage of having a transformation whose contrasts are orthogonal is as follows.

NORMALIZED ORTHOGONAL CONTRASTS: For a set of orthogonal contrasts, the separate

tests for each have a nice property not possessed by sets of nonorthogonal contrasts. As intuition

might suggest, if contrasts are indeed orthogonal, they ought to partition the total Group by Time

interaction and Within-Unit Error sums of squares into n−1 distinct or “nonoverlapping” components.

This means that the outcome of one of the tests may be viewed without regard to the outcome of the

others.

It turns out that if one works with a properly “normalized” version of a U matrix whose columns are

orthogonal, then this property can be seen very clearly. In particular, the sums of squares for group

in each separate ANOVA for each contrasts add up to the sum of squares SSGT ! Similarly, the error

sums of squares add up to SSE .

PAGE 140

Page 150: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 5 ST 732, M. DAVIDIAN

To appreciate this, consider the Helmert matrix in (5.21),

U =

1 0 0

−1/3 1 0

−1/3 −1/2 1

−1/3 −1/2 −1

.

Each column corresponds to a different function to be applied to the data vectors for each unit, i.e.

the kth column describes the kth contrast function c′kY h` of a data vector. Now the constants that

make up each ck are different for each k; thus, the values of c′kY h` for each k are on different scales

of measurement. They are not comparable across all n−1 contrasts, and thus the sums of squares from

each individual ANOVA are not comparable, because they each work with “data” on different scales.

It is possible to modify each contrast without affecting the orthogonality condition or the issue addressed

by each contrast so that the resulting “data” are scaled similarly. Note that the sums of the squared

elements of each column are different, i.e. the sums of squares of the first, second, and third columns

are

12 + (−1/3)2 + (−1/3)2 + (−1/3)2 = 4/3,

3/2 and 2, respectively. This illustrates that the contrasts are indeed not scaled similarly and suggests

the modification.

• Multiply each contrast by an appropriate constant so that the sums of the squared elements is

equal to 1.

• In our example, note that if we multiply the first column by√

3/4, the second by√

2/3, and the

third by√

1/2, then it may be verified that the sum of squares of the modified elements is equal

to 1 in each case; e.g. {√3/4(1)}2 + {√3/4(−1/3)}2 + {√3/4(−1/3)}2 + {√3/4(−1/3)}2 = 1.

• Note that multiplying each contrast by a constant does not change the spirit of the hypothesis

tests to which it corresponds; e.g. for the first column, testing

H0 : µ11 − µ12/3− µ13/3− µ14/3 = 0

is the same as testing H0 :√

3/4µ11 −√

3/4µ12/3 − √3/4µ13/3 − √

3/4µ14/3 = 0. When all

contrasts in an orthogonal transformation are scaled similarly in this way, then they are said to

be orthonormal.

PAGE 141

Page 151: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 5 ST 732, M. DAVIDIAN

• The resulting “data” corresponding to the modified versions of the contrasts will be on the same

scale. It then is the case that the sums of squares for each individual ANOVA do indeed add up.

Although this is a pleasing property, it is not necessary to use the normalized version of contrasts

to obtain the correct test statistics for each contrast. Even if a set of n − 1 orthogonal contrasts is

not normalized in this way, the same test statistics will result. Although each separate ANOVA is

on a different scale so that the sums of squares for group and error in each will not add up to SSGT

and SSE , the F ratios formed will be the same, because the scaling factor will “cancel out” from the

numerator and denominator of the F ratio and give the same statistic. The orthonormal version of the

transformation is often thought of simply because it leads to the nice, additive property.

If contrasts are not orthogonal, the interpretation of the separate tests is more difficult because the

separate tests no longer are “nonoverlapping.” The overall sum of squares for Group by Time is no

longer partitioned as above. Thus, how one test comes out is related to how another one comes out.

ORTHOGONAL POLYNOMIAL CONTRASTS: As we saw in the examples in Chapter 1, a common

feature of longitudinal data is that each unit appears to exhibit a “smooth” time trajectory. In some

cases, like the dental study, this appears to be a straight line. In other cases, like the soybean growth

study (Example 3), the trajectories seem to “curve.” Thus, if we were to consider the trajectory of a

single unit, it might be reasonable to think of it as a linear, quadratic, cubic, in general, a polynomial

function of time. (Later in the course, we will be much more explicit about this view.) Figure 6 shows

such trajectories.

Figure 6: Polynomial trajectories: linear (solid), quadratic (dots), cubic (dashes)

time

mea

n re

spon

se

0 1 2 3 4 5

010

2030

4050

PAGE 142

Page 152: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 5 ST 732, M. DAVIDIAN

In this situation, it would be advantageous to be able to consider behavior of the mean response over

time (averaged across and among groups) in a way that acknowledges this kind of pattern. For example,

in the dental study, we might like to ask

• Averaged across genders, is there a linear (straight line) trend over time? Is there a quadratic

trend?

• Does this linear or quadratic trend differ across genders?

There is a particular type of contrast that focuses on this issue, whose coefficients are referred to as

orthogonal polynomial coefficients.

If we have data at n time points on each unit, then, in principle, it would be possible to fit up to a

(n− 1) degree polynomial in time. Thus, for such a situation, it is possible to define n− 1 orthogonal

polynomial contrasts, each measuring the strength of the linear, quadratic, cubic, and so on contri-

bution to the n− 1 degree polynomial. This is possible both for time points that are equally spaced

over time and unequally spaced. The details of how these contrasts are defined are beyond our scope

here. For equally-spaced times, the coefficients of the n − 1 orthogonal polynomials are available in

tables in many statistics texts (e.g. Steel, Torrie, and Dickey, 1997, p. 390); for unequally-spaced times

points, the computations depend on the time points themselves.

Statistical software such as SAS PROC GLM offers computation of orthogonal polynomial contrasts, so

that the user may focus on interpretation rather than nasty computation. As an example, the following

U matrix has columns corresponding to the n− 1 orthogonal polynomial contrasts (in the order linear,

quadratic, cubic) in the case n = 4:

U =

−3 1 −1

−1 −1 3

1 −1 −3

3 1 1

.

With the appropriate set of orthogonal polynomial contrasts, one may proceed as above to conduct

hypothesis tests addressing the strength of the linear, quadratic, and so on components of the profile

over time. The orthogonal polynomial transformation may also be “normalized” as discussed above.

PAGE 143

Page 153: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 5 ST 732, M. DAVIDIAN

5.7 Adjusted tests

We now return to the issue discussed in section 5.5. Suppose that we have reason to doubt that Σ

is of Type H. This may be because we do not believe that the limitations of the test for sphericity

discussed in section 5.5 are too serious, and we have rejected the null hypothesis when performing this

test. Alternatively, this may be because we question the assumption of Type H covariance to begin with

as being unrealistic (more in a moment). In any event, we do not feel comfortable assuming that Σ is of

Type H (thus, certainly does not exhibit compound symmetry, as stated by the model). Thus, the

usual F tests for Time and Group by Time are invalid. Several suggestions are available for “adjusting”

the usual F tests.

Define

ε =tr2(U ′ΣU)

(n− 1)tr(U ′ΣUU ′ΣU),

where U is any (n×n−1) (so u = n−1) matrix whose columns are normalized orthogonal contrasts.

It may be shown that the constant ε defined in this way must satisfy

1/(n− 1) ≤ ε ≤ 1

and that

ε = 1

if, and only if, Σ is of Type H.

Because the usual F tests are too liberal (see above) if Σ is not of Type H, one suggestion is as follows.

Rather than compare the F ratios to the usual critical values with a and b numerator and denominator

degrees of freedom, say, compare them to F critical values with εa and εb numerator and denominator

degrees of freedom instead. This will make the degrees of freedom smaller than usual. A quick look

at a table of F critical values shows that, as the numerator and denominator degrees of freedom get

smaller, the value of the critical value gets larger. Thus, the effect of this “adjustment” would be

to compare F ratios to larger critical values, making it harder to reject the null hypothesis and thus

making the test less liberal.

• Of course, ε is not known, because it depends on the unknown Σ matrix.

• Several approaches are based on estimating Σ (to be discussed in the next chapter of the course)

and then using the result to form an estimate for ε.

PAGE 144

Page 154: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 5 ST 732, M. DAVIDIAN

• This may be done in different ways; two such approaches are known as the Greenhouse-Geisser

and Huynh-Feldt adjustments. Each estimates ε in a different way; the Huynh-Feldt estimate

is such that the adjustment to the degrees of freedom is not as severe as that of the Greenhouse-

Geisser adjustment. These adjustments are available in most software for analyzing repeated

measurements; e.g. SAS PROC GLM computes the adjustments automatically, as we will see in the

examples in section 5.8. They are, however, approximate.

• The general utility of these adjustments is unclear, however. That is, it is not necessarily the case

that making the adjustments in a real situation where the numbers of units are small will indeed

lead to valid tests.

SUMMARY: The spirit of the methods discussed above may be summarized as follows. One adopts a

statistical model that makes a very specific assumption about associations among observations on the

same unit (compound symmetry). If this assumption is correct, then familiar analysis of variance

methods are available. It is possible to test whether it is correct; however, the testing procedures

available are not too reliable. In the event that one doubts the compound symmetry assumption,

approximate methods are available to still allow “adjusted” versions of the methods to be used. However,

these adjustments are not necessarily reliable, either.

This suggests that, rather then try to “force” the issue of compound symmetry, a better approach might

be to start back at the beginning, with a more realistic statistical model! In later chapters we will

discuss other methods for analyzing longitudinal data that do not rely on the assumption of compound

symmetry (or more generally, Type H covariance). We will also see that it is possible to adopt much

more general representations for the form of the mean of a data vector.

5.8 Implementation with SAS

We consider two examples:

1. The dental study data. Here, q = 2 and n = 4, with the “time” factor being the age of the children

and equally-spaced “time” points at 8, 10, 12, and 14 years of age.

2. the guinea pig diet data. Here, q = 3 and n = 6, with the “time” factor being weeks and

unequally-spaced “time” points at 1, 3, 4, 5, 6, and 7 weeks.

PAGE 145

Page 155: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 5 ST 732, M. DAVIDIAN

In each case, we use SAS PROC GLM to carry out the computations. These examples thus serve to

illustrate how this SAS procedure may be used to conduct univariate repeated measures analysis of

variance.

Each program carries out construction of the analysis of variance table in two ways

• Using the same specification that would be used for the analysis of a split plot experiment

• Using the special REPEATED statement in PROC GLM. This statement and its associated options allow

the user to request various specialized analyses, like those involving contrasts discussed in the last

section. A full description of the features available may be found in the SAS documentation for

PROC GLM.

PAGE 146

Page 156: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 5 ST 732, M. DAVIDIAN

EXAMPLE 1 – DENTAL STUDY DATA: The data are read in from the file dental.dat.

PROGRAM:

/*******************************************************************

CHAPTER 5, EXAMPLE 1

Analysis of the dental study data by repeatedmeasures analysis of variance using PROC GLM

- the repeated measurement factor is age (time)

- there is one "treatment" factor, gender

*******************************************************************/

options ls=80 ps=59 nodate; run;

/******************************************************************

The data set looks like

1 1 8 21 02 1 10 20 03 1 12 21.5 04 1 14 23 05 2 8 21 0

.

.

.

column 1 observation numbercolumn 2 child id numbercolumn 3 agecolumn 4 response (distance)column 5 gender indicator (0=girl, 1=boy)

The second data step changes the ages from 8, 10, 12, 14to 1, 2, 3, 4 so that SAS can count them when it creates adifferent data set later

*******************************************************************/

data dent1; infile ’dental.dat’;input obsno child age distance gender;

run;

data dent1; set dent1;if age=8 then age=1;if age=10 then age=2;if age=12 then age=3;if age=14 then age=4;drop obsno;

run;

/*******************************************************************

Create an alternative data set with the data record for each childon a single line.

*******************************************************************/

proc sort data=dent1;by gender child;

data dent2(keep=age1-age4 gender);array aa{4} age1-age4;do age=1 to 4;set dent1;by gender child;aa{age}=distance;if last.child then return;

end;run;

proc print;

/*******************************************************************

Find the means of each gender-age combination and plot meanvs. age for each gender

*******************************************************************/

proc sort data=dent1; by gender age; run;proc means data=dent1; by gender age;var distance;output out=mdent mean=mdist; run;

PAGE 147

Page 157: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 5 ST 732, M. DAVIDIAN

proc plot data=mdent; plot mdist*age=gender; run;

/*******************************************************************

Construct the analysis of variance using PROC GLMvia a "split plot" specification. This requires that thedata be represented in the form they are given in data set dent1.

Note that the F ratio that PROC GLM prints out automaticallyfor the gender effect (averaged across age) will use theMSE in the denominator. This is not the correct F ratio fortesting this effect.

The RANDOM statement asks SAS to compute the expected meansquares for each source of variation. The TEST option asksSAS to compute the test for the gender effect (averaged acrossage), treating the child(gender) effect as random, giving thecorrect F ratio. Other F-ratios are correct.

In older versions of SAS that do not recognize this option,this test could be obtained by removing the TEST optionfrom the RANDOM statement and adding the statement

test h=gender e = child(gender);

to the call to PROC GLM.

*******************************************************************/

proc glm data=dent1;class age gender child;model distance = gender child(gender) age age*gender;random child(gender) / test;

run;

/*******************************************************************

Now carry out the same analysis using the REPEATED statement inPROC GLM. This requires that the data be represented in theform of data set dent2.

The option NOUNI suppresses individual analyses of variancefor the data at each age value from being printed.

The PRINTE option asks for the test of sphericity to be performed.

The NOM option means "no multivariate," which means just dothe univariate repeated measures analysis under the assumptionthat the exchangable (compound symmetry) model is correct.

*******************************************************************/

proc glm data=dent2;class gender;model age1 age2 age3 age4 = gender / nouni;repeated age / printe nom;

/*******************************************************************

This call to PROC GLM redoes the basic analysis of the last.However, in the REPEATED statement, a different contrast ofthe parameters is specified, the POLYNOMIAL transformation.The levels of "age" are equally spaced, and the values arespecified. The transformation produced is orthogonal polynomialsfor polynomial trends (linear, quadratic, cubic).

The SUMMARY option asks that PROC GLM print out the results oftests corresponding to the contrasts in each column of the Umatrix.

The NOU option asks that printing of the univariate analysisof variance be suppressed (we already did it in the previousPROC GLM call).

THE PRINTM option prints out the U matrix corresponding to theorthogonal polynomial contrasts. SAS calls this matrix M, andactuallly prints out its transponse (our U’).

For the orthogonal polynomial transformation, SAS uses thenormalized version of the U matrix. Thus, the SSs from theindividual ANOVAs for each column will add up to the Gender byAge interaction SS (and similarly for the within-unit error SS).

*******************************************************************/

proc glm data=dent2;class gender;

PAGE 148

Page 158: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 5 ST 732, M. DAVIDIAN

model age1 age2 age3 age4 = gender / nouni;repeated age 4 (8 10 12 14) polynomial /summary nou nom printm;

run;

/*******************************************************************

For comparison, we do the same analysis as above, but use theHelmert matrix instead.

SAS does NOT use the normalized version of the Helmerttransformation matrix. Thus, the SSs from the individual ANOVAsfor each column will NOT add up to the Gender by Age interactionSS (similarly for within-unit error). However, the F ratiosare correct.

********************************************************************/

proc glm data=dent2;class gender;model age1 age2 age3 age4 = gender / nouni;repeated age 4 (8 10 12 14) helmert /summary nou nom printm;

run;

/*******************************************************************

Here, we manually perform the same analysis, but using theNORMALIZED version of the Helmert transformation matrix.We get each individual test separately using the PROC GLMMANOVA statement.

********************************************************************/

proc glm data=dent2;model age1 age2 age3 age4 = gender /nouni;manova h=gender

m=0.866025404*age1 - 0.288675135*age2- 0.288675135*age3 - 0.288675135*age4;manova h=gender m= 0.816496581*age2-0.40824829*age3-0.40824829*age4;manova h=gender m= 0.707106781*age3- 0.707106781*age4;run;

/*******************************************************************

To compare, we apply the contrasts (normalized version) to eachchild’s data. We thus get a single value for each child correspondingto each contrast. These are in the variables AGE1P -- AGE3P.We then use PROC GLM to perform each separate ANOVA. It may beverified that the separate gender sums of squares add up tothe interaction SS in the analysis above.

********************************************************************/

data dent3; set dent2;age1p = sqrt(0.75)*(age1-age2/3-age3/3-age4/3);age2p = sqrt(2/3)*(age2-age3/2-age4/2);age3p = sqrt(1/2)*(age3-age4);

run;

proc glm; class gender; model age1p age2p age3p = gender;run;

OUTPUT: One important note – it is important to always inspect the result of the Test for Sphericity

using Mauchly’s Criterion applied to Orthogonal Components. The test must be performed using an

orthogonal, normalized transformation matrix. If the selected transformation (e.g. helmert) is not

orthogonal and normalized, SAS will both do the test anyway, which is not appropriate, and do it

using an orthogonal, normalized transformation, which is appropriate.

1

Obs age1 age2 age3 age4 gender

1 21.0 20.0 21.5 23.0 02 21.0 21.5 24.0 25.5 03 20.5 24.0 24.5 26.0 04 23.5 24.5 25.0 26.5 05 21.5 23.0 22.5 23.5 06 20.0 21.0 21.0 22.5 0

PAGE 149

Page 159: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 5 ST 732, M. DAVIDIAN

7 21.5 22.5 23.0 25.0 08 23.0 23.0 23.5 24.0 09 20.0 21.0 22.0 21.5 0

10 16.5 19.0 19.0 19.5 011 24.5 25.0 28.0 28.0 012 26.0 25.0 29.0 31.0 113 21.5 22.5 23.0 26.5 114 23.0 22.5 24.0 27.5 115 25.5 27.5 26.5 27.0 116 20.0 23.5 22.5 26.0 117 24.5 25.5 27.0 28.5 118 22.0 22.0 24.5 26.5 119 24.0 21.5 24.5 25.5 120 23.0 20.5 31.0 26.0 121 27.5 28.0 31.0 31.5 122 23.0 23.0 23.5 25.0 123 21.5 23.5 24.0 28.0 124 17.0 24.5 26.0 29.5 125 22.5 25.5 25.5 26.0 126 23.0 24.5 26.0 30.0 127 22.0 21.5 23.5 25.0 1

2

-------------------------------- gender=0 age=1 --------------------------------

The MEANS Procedure

Analysis Variable : distance

N Mean Std Dev Minimum Maximum-------------------------------------------------------------------11 21.1818182 2.1245320 16.5000000 24.5000000

-------------------------------------------------------------------

-------------------------------- gender=0 age=2 --------------------------------

Analysis Variable : distance

N Mean Std Dev Minimum Maximum-------------------------------------------------------------------11 22.2272727 1.9021519 19.0000000 25.0000000

-------------------------------------------------------------------

-------------------------------- gender=0 age=3 --------------------------------

Analysis Variable : distance

N Mean Std Dev Minimum Maximum-------------------------------------------------------------------11 23.0909091 2.3645103 19.0000000 28.0000000

-------------------------------------------------------------------

-------------------------------- gender=0 age=4 --------------------------------

Analysis Variable : distance

N Mean Std Dev Minimum Maximum-------------------------------------------------------------------11 24.0909091 2.4373980 19.5000000 28.0000000

-------------------------------------------------------------------

-------------------------------- gender=1 age=1 --------------------------------

Analysis Variable : distance

N Mean Std Dev Minimum Maximum-------------------------------------------------------------------16 22.8750000 2.4528895 17.0000000 27.5000000

-------------------------------------------------------------------

3

-------------------------------- gender=1 age=2 --------------------------------The MEANS Procedure

Analysis Variable : distance

N Mean Std Dev Minimum Maximum-------------------------------------------------------------------16 23.8125000 2.1360009 20.5000000 28.0000000

-------------------------------------------------------------------

-------------------------------- gender=1 age=3 --------------------------------

Analysis Variable : distance

N Mean Std Dev Minimum Maximum-------------------------------------------------------------------16 25.7187500 2.6518468 22.5000000 31.0000000

PAGE 150

Page 160: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 5 ST 732, M. DAVIDIAN

-------------------------------------------------------------------

-------------------------------- gender=1 age=4 --------------------------------

Analysis Variable : distance

N Mean Std Dev Minimum Maximum-------------------------------------------------------------------16 27.4687500 2.0854156 25.0000000 31.5000000

-------------------------------------------------------------------4

Plot of mdist*age. Symbol is value of gender.

mdist ||

28 +||| 1||

27 +|||||

26 +|| 1|||

25 +||||| 0

24 +| 1|||| 0

23 +| 1|||| 0

22 +||||| 0

21 +|---+------------------+------------------+------------------+--

1 2 3 4

age5

The GLM Procedure

Class Level Information

Class Levels Values

age 4 1 2 3 4gender 2 0 1child 27 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23

24 25 26 27

Number of observations 108

6

The GLM Procedure

Dependent Variable: distance

Sum ofSource DF Squares Mean Square F Value Pr > F

Model 32 769.5642887 24.0488840 12.18 <.0001

PAGE 151

Page 161: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 5 ST 732, M. DAVIDIAN

Error 75 148.1278409 1.9750379

Corrected Total 107 917.6921296

R-Square Coeff Var Root MSE distance Mean

0.838587 5.850026 1.405360 24.02315

Source DF Type I SS Mean Square F Value Pr > F

gender 1 140.4648569 140.4648569 71.12 <.0001child(gender) 25 377.9147727 15.1165909 7.65 <.0001age 3 237.1921296 79.0640432 40.03 <.0001age*gender 3 13.9925295 4.6641765 2.36 0.0781

Source DF Type III SS Mean Square F Value Pr > F

gender 1 140.4648569 140.4648569 71.12 <.0001child(gender) 25 377.9147727 15.1165909 7.65 <.0001age 3 209.4369739 69.8123246 35.35 <.0001age*gender 3 13.9925295 4.6641765 2.36 0.0781

7

The GLM Procedure

Source Type III Expected Mean Square

gender Var(Error) + 4 Var(child(gender)) + Q(gender,age*gender)

child(gender) Var(Error) + 4 Var(child(gender))age Var(Error) + Q(age,age*gender)

age*gender Var(Error) + Q(age*gender)8

The GLM ProcedureTests of Hypotheses for Mixed Model Analysis of Variance

Dependent Variable: distance

Source DF Type III SS Mean Square F Value Pr > F

* gender 1 140.464857 140.464857 9.29 0.0054

Error 25 377.914773 15.116591Error: MS(child(gender))

* This test assumes one or more other fixed effects are zero.

Source DF Type III SS Mean Square F Value Pr > F

child(gender) 25 377.914773 15.116591 7.65 <.0001* age 3 209.436974 69.812325 35.35 <.0001

age*gender 3 13.992529 4.664176 2.36 0.0781

Error: MS(Error) 75 148.127841 1.975038

* This test assumes one or more other fixed effects are zero.9

The GLM Procedure

Class Level Information

Class Levels Values

gender 2 0 1

Number of observations 2710

The GLM ProcedureRepeated Measures Analysis of Variance

Repeated Measures Level Information

Dependent Variable age1 age2 age3 age4

Level of age 1 2 3 4

Partial Correlation Coefficients from the Error SSCP Matrix / Prob > |r|

DF = 25 age1 age2 age3 age4

age1 1.000000 0.570699 0.661320 0.5215830.0023 0.0002 0.0063

age2 0.570699 1.000000 0.563167 0.726216

PAGE 152

Page 162: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 5 ST 732, M. DAVIDIAN

0.0023 0.0027 <.0001

age3 0.661320 0.563167 1.000000 0.7280980.0002 0.0027 <.0001

age4 0.521583 0.726216 0.728098 1.0000000.0063 <.0001 <.0001

E = Error SSCP Matrix

age_N represents the contrast between the nth level of age and the last

age_1 age_2 age_3

age_1 124.518 41.879 51.375age_2 41.879 63.405 11.625age_3 51.375 11.625 79.500

Partial Correlation Coefficients from the Error SSCP Matrix of theVariables Defined by the Specified Transformation / Prob > |r|

DF = 25 age_1 age_2 age_3

age_1 1.000000 0.471326 0.5163590.0151 0.0069

age_2 0.471326 1.000000 0.1637380.0151 0.4241

age_3 0.516359 0.163738 1.0000000.0069 0.4241

11

The GLM ProcedureRepeated Measures Analysis of Variance

Sphericity Tests

Mauchly’sVariables DF Criterion Chi-Square Pr > ChiSq

Transformed Variates 5 0.4998695 16.449181 0.0057Orthogonal Components 5 0.7353334 7.2929515 0.1997

12

The GLM ProcedureRepeated Measures Analysis of Variance

Tests of Hypotheses for Between Subjects Effects

Source DF Type III SS Mean Square F Value Pr > F

gender 1 140.4648569 140.4648569 9.29 0.0054Error 25 377.9147727 15.1165909

13

The GLM ProcedureRepeated Measures Analysis of Variance

Univariate Tests of Hypotheses for Within Subject Effects

Source DF Type III SS Mean Square F Value Pr > F

age 3 209.4369739 69.8123246 35.35 <.0001age*gender 3 13.9925295 4.6641765 2.36 0.0781Error(age) 75 148.1278409 1.9750379

Adj Pr > FSource G - G H - F

age <.0001 <.0001age*gender 0.0878 0.0781Error(age)

Greenhouse-Geisser Epsilon 0.8672Huynh-Feldt Epsilon 1.0156

14

The GLM Procedure

Class Level Information

Class Levels Values

gender 2 0 1

PAGE 153

Page 163: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 5 ST 732, M. DAVIDIAN

Number of observations 27

15

The GLM ProcedureRepeated Measures Analysis of Variance

Repeated Measures Level Information

Dependent Variable age1 age2 age3 age4

Level of age 8 10 12 14

age_N represents the nth degree polynomial contrast for age

M Matrix Describing Transformed Variables

age1 age2 age3 age4

age_1 -.6708203932 -.2236067977 0.2236067977 0.6708203932age_2 0.5000000000 -.5000000000 -.5000000000 0.5000000000age_3 -.2236067977 0.6708203932 -.6708203932 0.2236067977

16

The GLM ProcedureRepeated Measures Analysis of Variance

Tests of Hypotheses for Between Subjects Effects

Source DF Type III SS Mean Square F Value Pr > F

gender 1 140.4648569 140.4648569 9.29 0.0054Error 25 377.9147727 15.1165909

17

The GLM ProcedureRepeated Measures Analysis of Variance

Analysis of Variance of Contrast Variables

age_N represents the nth degree polynomial contrast for age

Contrast Variable: age_1

Source DF Type III SS Mean Square F Value Pr > F

Mean 1 208.2660038 208.2660038 88.00 <.0001gender 1 12.1141519 12.1141519 5.12 0.0326Error 25 59.1673295 2.3666932

Contrast Variable: age_2

Source DF Type III SS Mean Square F Value Pr > F

Mean 1 0.95880682 0.95880682 0.92 0.3465gender 1 1.19954756 1.19954756 1.15 0.2935Error 25 26.04119318 1.04164773

Contrast Variable: age_3

Source DF Type III SS Mean Square F Value Pr > F

Mean 1 0.21216330 0.21216330 0.08 0.7739gender 1 0.67882997 0.67882997 0.27 0.6081Error 25 62.91931818 2.51677273

18

The GLM Procedure

Class Level Information

Class Levels Values

gender 2 0 1

Number of observations 27

19

The GLM ProcedureRepeated Measures Analysis of Variance

Repeated Measures Level Information

Dependent Variable age1 age2 age3 age4

PAGE 154

Page 164: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 5 ST 732, M. DAVIDIAN

Level of age 8 10 12 14

age_N represents the contrast between the nthlevel of age and the mean of subsequent levels

M Matrix Describing Transformed Variables

age1 age2 age3 age4

age_1 1.000000000 -0.333333333 -0.333333333 -0.333333333age_2 0.000000000 1.000000000 -0.500000000 -0.500000000age_3 0.000000000 0.000000000 1.000000000 -1.000000000

20

The GLM ProcedureRepeated Measures Analysis of Variance

Tests of Hypotheses for Between Subjects Effects

Source DF Type III SS Mean Square F Value Pr > F

gender 1 140.4648569 140.4648569 9.29 0.0054Error 25 377.9147727 15.1165909

21

The GLM ProcedureRepeated Measures Analysis of Variance

Analysis of Variance of Contrast Variables

age_N represents the contrast between the nth level of age and the mean ofsubsequent levels

Contrast Variable: age_1

Source DF Type III SS Mean Square F Value Pr > F

Mean 1 146.8395997 146.8395997 45.43 <.0001gender 1 4.5679948 4.5679948 1.41 0.2457Error 25 80.8106061 3.2324242

Contrast Variable: age_2

Source DF Type III SS Mean Square F Value Pr > F

Mean 1 111.9886890 111.9886890 39.07 <.0001gender 1 13.0998001 13.0998001 4.57 0.0425Error 25 71.6548295 2.8661932

Contrast Variable: age_3

Source DF Type III SS Mean Square F Value Pr > F

Mean 1 49.29629630 49.29629630 15.50 0.0006gender 1 3.66666667 3.66666667 1.15 0.2932Error 25 79.50000000 3.18000000

22

The GLM Procedure

Number of observations 27

23

The GLM ProcedureMultivariate Analysis of Variance

M Matrix Describing Transformed Variables

age1 age2 age3 age4

MVAR1 0.866025404 -0.288675135 -0.288675135 -0.288675135

24

The GLM ProcedureMultivariate Analysis of Variance

Characteristic Roots and Vectors of: E Inverse * H, whereH = Type III SSCP Matrix for gender

E = Error SSCP Matrix

Variables have been transformed by the M Matrix

Characteristic Characteristic Vector V’EV=1Root Percent MVAR1

PAGE 155

Page 165: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 5 ST 732, M. DAVIDIAN

0.05652717 100.00 0.12845032

MANOVA Test Criteria and Exact F Statistics forthe Hypothesis of No Overall gender Effect

on the Variables Defined by the M Matrix TransformationH = Type III SSCP Matrix for gender

E = Error SSCP Matrix

S=1 M=-0.5 N=11.5

Statistic Value F Value Num DF Den DF Pr > F

Wilks’ Lambda 0.94649719 1.41 1 25 0.2457Pillai’s Trace 0.05350281 1.41 1 25 0.2457Hotelling-Lawley Trace 0.05652717 1.41 1 25 0.2457Roy’s Greatest Root 0.05652717 1.41 1 25 0.2457

25

The GLM ProcedureMultivariate Analysis of Variance

M Matrix Describing Transformed Variables

age1 age2 age3 age4

MVAR1 0 0.816496581 -0.40824829 -0.40824829

26

The GLM ProcedureMultivariate Analysis of Variance

Characteristic Roots and Vectors of: E Inverse * H, whereH = Type III SSCP Matrix for gender

E = Error SSCP Matrix

Variables have been transformed by the M Matrix

Characteristic Characteristic Vector V’EV=1Root Percent MVAR1

0.18281810 100.00 0.14468480

MANOVA Test Criteria and Exact F Statistics forthe Hypothesis of No Overall gender Effect

on the Variables Defined by the M Matrix TransformationH = Type III SSCP Matrix for gender

E = Error SSCP Matrix

S=1 M=-0.5 N=11.5

Statistic Value F Value Num DF Den DF Pr > F

Wilks’ Lambda 0.84543853 4.57 1 25 0.0425Pillai’s Trace 0.15456147 4.57 1 25 0.0425Hotelling-Lawley Trace 0.18281810 4.57 1 25 0.0425Roy’s Greatest Root 0.18281810 4.57 1 25 0.0425

27

The GLM ProcedureMultivariate Analysis of Variance

M Matrix Describing Transformed Variables

age1 age2 age3 age4

MVAR1 0 0 0.707106781 -0.707106781

28

The GLM ProcedureMultivariate Analysis of Variance

Characteristic Roots and Vectors of: E Inverse * H, whereH = Type III SSCP Matrix for gender

E = Error SSCP Matrix

Variables have been transformed by the M Matrix

Characteristic Characteristic Vector V’EV=1Root Percent MVAR1

0.04612159 100.00 0.15861032

PAGE 156

Page 166: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 5 ST 732, M. DAVIDIAN

MANOVA Test Criteria and Exact F Statistics forthe Hypothesis of No Overall gender Effect

on the Variables Defined by the M Matrix TransformationH = Type III SSCP Matrix for gender

E = Error SSCP Matrix

S=1 M=-0.5 N=11.5

Statistic Value F Value Num DF Den DF Pr > F

Wilks’ Lambda 0.95591182 1.15 1 25 0.2932Pillai’s Trace 0.04408818 1.15 1 25 0.2932Hotelling-Lawley Trace 0.04612159 1.15 1 25 0.2932Roy’s Greatest Root 0.04612159 1.15 1 25 0.2932

29

The GLM Procedure

Class Level Information

Class Levels Values

gender 2 0 1

Number of observations 27

30

The GLM Procedure

Dependent Variable: age1p

Sum ofSource DF Squares Mean Square F Value Pr > F

Model 1 3.42599607 3.42599607 1.41 0.2457

Error 25 60.60795455 2.42431818

Corrected Total 26 64.03395062

R-Square Coeff Var Root MSE age1p Mean

0.053503 -73.36496 1.557022 -2.122297

Source DF Type I SS Mean Square F Value Pr > F

gender 1 3.42599607 3.42599607 1.41 0.2457

Source DF Type III SS Mean Square F Value Pr > F

gender 1 3.42599607 3.42599607 1.41 0.2457

31

The GLM Procedure

Dependent Variable: age2p

Sum ofSource DF Squares Mean Square F Value Pr > F

Model 1 8.73320006 8.73320006 4.57 0.0425

Error 25 47.76988636 1.91079545

Corrected Total 26 56.50308642

R-Square Coeff Var Root MSE age2p Mean

0.154561 -76.82446 1.382315 -1.799317

Source DF Type I SS Mean Square F Value Pr > F

gender 1 8.73320006 8.73320006 4.57 0.0425

Source DF Type III SS Mean Square F Value Pr > F

gender 1 8.73320006 8.73320006 4.57 0.0425

32

The GLM Procedure

Dependent Variable: age3p

PAGE 157

Page 167: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 5 ST 732, M. DAVIDIAN

Sum ofSource DF Squares Mean Square F Value Pr > F

Model 1 1.83333333 1.83333333 1.15 0.2932

Error 25 39.75000000 1.59000000

Corrected Total 26 41.58333333

R-Square Coeff Var Root MSE age3p Mean

0.044088 -123.4561 1.260952 -1.021376

Source DF Type I SS Mean Square F Value Pr > F

gender 1 1.83333333 1.83333333 1.15 0.2932

Source DF Type III SS Mean Square F Value Pr > F

gender 1 1.83333333 1.83333333 1.15 0.2932

EXAMPLE 2 – GUINEA PIG DIET DATA: The data are read in from the file diet.dat.

PROGRAM:

/*******************************************************************

CHAPTER 5, EXAMPLE 2

Analysis of the vitamin E data by univariate repeatedmeasures analysis of variance using PROC GLM

- the repeated measurement factor is week (time)

- there is one "treatment" factor, dose

*******************************************************************/

options ls=80 ps=59 nodate; run;

/******************************************************************

The data set looks like

1 455 460 510 504 436 466 12 467 565 610 596 542 587 13 445 530 580 597 582 619 14 485 542 594 583 611 612 15 480 500 550 528 562 576 16 514 560 565 524 552 597 27 440 480 536 484 567 569 28 495 570 569 585 576 677 29 520 590 610 637 671 702 210 503 555 591 605 649 675 211 496 560 622 622 632 670 312 498 540 589 557 568 609 313 478 510 568 555 576 605 314 545 565 580 601 633 649 315 472 498 540 524 532 583 3

column 1 pig numbercolumns 2-7 body weights at weeks 1, 3, 4, 5, 6, 7column 8 dose group (1=zero, 2 = low, 3 = high dose

*******************************************************************/

data pigs1; infile ’diet.dat’;input pig week1 week3 week4 week5 week6 week7 dose;

/*******************************************************************

Create a data set with one data record per pig/week -- thisrepeated measures data are often recorded in this form.

Create a new variable "weight" containing the body weightat time "week."

The second data step fixes up the "week" values, as the weeksof observations were not equally spaced but rather have thevalues 1, 3, 4, 5, 6, 7.

*******************************************************************/

PAGE 158

Page 168: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 5 ST 732, M. DAVIDIAN

data pigs2; set pigs1;array wt(6) week1 week3 week4 week5 week6 week7;do week = 1 to 6;

weight = wt(week);output;

end;drop week1 week3-week7;

run;

data pigs2; set pigs2;if week>1 then week=week+1;

run;

proc print; run;

/*******************************************************************

Find the means of each dose-week combination and plot meanvs. week for each dose;

*******************************************************************/

proc sort data=pigs2; by dose week; run;proc means data=pigs2; by dose week;var weight;output out=mpigs mean=mweight; run;

proc plot data=mpigs; plot mweight*week=dose; run;

/*******************************************************************

First construct the analysis of variance using PROC GLMvia a "split plot" specification. This requires that thedata be represented in the form they are given in data set pigs2.

Note that the F ratio that PROC GLM prints out automaticallyfor the dose effect (averaged across week) will use theMSE in the denominator. This is not the correct F ratio fortesting this effect.

The RANDOM statement asks SAS to compute the expected meansquares for each source of variation. The TEST option asksSAS to compute the test for the dose effect (averaged acrossweek), treating the pig(dose) effect as random, giving thecorrect F ratio. Other F-ratios are correct.

In older versions of SAS that do not recognize this option,this test could be obtained by removing the TEST optionfrom the RANDOM statement and adding the statement

test h=dose e=pig(gender)

to the call to PROC GLM.

*******************************************************************/

proc glm data=pigs2;class week dose pig;model weight = dose pig(dose) week week*dose;random pig(dose) / test;

run;

/*******************************************************************

Now carry out the same analysis using the REPEATED statement inPROC GLM. This requires that the data be represented in theform of data set pigs1.

The option NOUNI suppresses individual analyses of varianceat each week value from being printed.

The PRINTE option asks for the test of sphericity to be performed.

The NOM option means "no multivariate," which means univariatetests under the assumption that the compound symmetry modelis correct.

*******************************************************************/

proc glm data=pigs1;class dose;model week1 week3 week4 week5 week6 week7 = dose / nouni;repeated week / printe nom;

run;

/*******************************************************************

These calls to PROC GLM redo the basic analysis of the last.

PAGE 159

Page 169: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 5 ST 732, M. DAVIDIAN

However, in the REPEATED statement, different contrasts ofthe parameters are specified.

The SUMMARY option asks that PROC GLM print out the results oftests corresponding to the contrasts in each column of the Umatrix.

The NOU option asks that printing of the univariate analysisof variance be suppressed (we already did it in the previousPROC GLM call).

THE PRINTM option prints out the U matrix corresponding to thecontrasts being used . SAS calls this matrix M, andactually prints out its transpose (our U’).

*******************************************************************/

proc glm data=pigs1;class dose;model week1 week3 week4 week5 week6 week7 = dose / nouni;repeated week 6 (1 3 4 5 6 7) polynomial /summary printm nom;

run;

proc glm data=pigs1;class dose;model week1 week3 week4 week5 week6 week7 = dose / nouni;repeated week 6 (1 3 4 5 6 7) profile /summary printm nom ;

run;

proc glm data=pigs1;class dose;model week1 week3 week4 week5 week6 week7 = dose / nouni;repeated week 6 helmert /summary printm nom;

run;

OUTPUT: The same warning about the test for sphericity applies here.

1

Obs pig dose week weight

1 1 1 1 4552 1 1 3 4603 1 1 4 5104 1 1 5 5045 1 1 6 4366 1 1 7 4667 2 1 1 4678 2 1 3 5659 2 1 4 610

10 2 1 5 59611 2 1 6 54212 2 1 7 58713 3 1 1 44514 3 1 3 53015 3 1 4 58016 3 1 5 59717 3 1 6 58218 3 1 7 61919 4 1 1 48520 4 1 3 54221 4 1 4 59422 4 1 5 58323 4 1 6 61124 4 1 7 61225 5 1 1 48026 5 1 3 50027 5 1 4 55028 5 1 5 52829 5 1 6 56230 5 1 7 57631 6 2 1 51432 6 2 3 56033 6 2 4 56534 6 2 5 52435 6 2 6 55236 6 2 7 59737 7 2 1 44038 7 2 3 48039 7 2 4 53640 7 2 5 48441 7 2 6 56742 7 2 7 56943 8 2 1 49544 8 2 3 57045 8 2 4 56946 8 2 5 585

PAGE 160

Page 170: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 5 ST 732, M. DAVIDIAN

47 8 2 6 57648 8 2 7 67749 9 2 1 52050 9 2 3 59051 9 2 4 61052 9 2 5 63753 9 2 6 67154 9 2 7 70255 10 2 1 503

2

Obs pig dose week weight

56 10 2 3 55557 10 2 4 59158 10 2 5 60559 10 2 6 64960 10 2 7 67561 11 3 1 49662 11 3 3 56063 11 3 4 62264 11 3 5 62265 11 3 6 63266 11 3 7 67067 12 3 1 49868 12 3 3 54069 12 3 4 58970 12 3 5 55771 12 3 6 56872 12 3 7 60973 13 3 1 47874 13 3 3 51075 13 3 4 56876 13 3 5 55577 13 3 6 57678 13 3 7 60579 14 3 1 54580 14 3 3 56581 14 3 4 58082 14 3 5 60183 14 3 6 63384 14 3 7 64985 15 3 1 47286 15 3 3 49887 15 3 4 54088 15 3 5 52489 15 3 6 53290 15 3 7 583

3

-------------------------------- dose=1 week=1 ---------------------------------

The MEANS Procedure

Analysis Variable : weight

N Mean Std Dev Minimum Maximum------------------------------------------------------------------5 466.4000000 16.7272233 445.0000000 485.0000000

------------------------------------------------------------------

-------------------------------- dose=1 week=3 ---------------------------------

Analysis Variable : weight

N Mean Std Dev Minimum Maximum------------------------------------------------------------------5 519.4000000 40.6423425 460.0000000 565.0000000

------------------------------------------------------------------

-------------------------------- dose=1 week=4 ---------------------------------

Analysis Variable : weight

N Mean Std Dev Minimum Maximum------------------------------------------------------------------5 568.8000000 39.5878769 510.0000000 610.0000000

------------------------------------------------------------------

-------------------------------- dose=1 week=5 ---------------------------------

Analysis Variable : weight

N Mean Std Dev Minimum Maximum------------------------------------------------------------------5 561.6000000 42.8404015 504.0000000 597.0000000

------------------------------------------------------------------

PAGE 161

Page 171: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 5 ST 732, M. DAVIDIAN

-------------------------------- dose=1 week=6 ---------------------------------

Analysis Variable : weight

N Mean Std Dev Minimum Maximum------------------------------------------------------------------5 546.6000000 66.8789952 436.0000000 611.0000000

------------------------------------------------------------------

4

-------------------------------- dose=1 week=7 ---------------------------------

The MEANS Procedure

Analysis Variable : weight

N Mean Std Dev Minimum Maximum------------------------------------------------------------------5 572.0000000 61.8182821 466.0000000 619.0000000

------------------------------------------------------------------

-------------------------------- dose=2 week=1 ---------------------------------

Analysis Variable : weight

N Mean Std Dev Minimum Maximum------------------------------------------------------------------5 494.4000000 31.9108132 440.0000000 520.0000000

------------------------------------------------------------------

-------------------------------- dose=2 week=3 ---------------------------------

Analysis Variable : weight

N Mean Std Dev Minimum Maximum------------------------------------------------------------------5 551.0000000 41.8927201 480.0000000 590.0000000

------------------------------------------------------------------

-------------------------------- dose=2 week=4 ---------------------------------

Analysis Variable : weight

N Mean Std Dev Minimum Maximum------------------------------------------------------------------5 574.2000000 27.9946423 536.0000000 610.0000000

------------------------------------------------------------------

-------------------------------- dose=2 week=5 ---------------------------------

Analysis Variable : weight

N Mean Std Dev Minimum Maximum------------------------------------------------------------------5 567.0000000 62.0604544 484.0000000 637.0000000

------------------------------------------------------------------

5

-------------------------------- dose=2 week=6 ---------------------------------

The MEANS Procedure

Analysis Variable : weight

N Mean Std Dev Minimum Maximum------------------------------------------------------------------5 603.0000000 53.3057220 552.0000000 671.0000000

------------------------------------------------------------------

-------------------------------- dose=2 week=7 ---------------------------------

Analysis Variable : weight

N Mean Std Dev Minimum Maximum------------------------------------------------------------------5 644.0000000 57.5499783 569.0000000 702.0000000

------------------------------------------------------------------

PAGE 162

Page 172: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 5 ST 732, M. DAVIDIAN

-------------------------------- dose=3 week=1 ---------------------------------

Analysis Variable : weight

N Mean Std Dev Minimum Maximum------------------------------------------------------------------5 497.8000000 28.6740301 472.0000000 545.0000000

------------------------------------------------------------------

-------------------------------- dose=3 week=3 ---------------------------------

Analysis Variable : weight

N Mean Std Dev Minimum Maximum------------------------------------------------------------------5 534.6000000 29.7623924 498.0000000 565.0000000

------------------------------------------------------------------

-------------------------------- dose=3 week=4 ---------------------------------

Analysis Variable : weight

N Mean Std Dev Minimum Maximum------------------------------------------------------------------5 579.8000000 29.9532970 540.0000000 622.0000000

------------------------------------------------------------------

6

-------------------------------- dose=3 week=5 ---------------------------------

The MEANS Procedure

Analysis Variable : weight

N Mean Std Dev Minimum Maximum------------------------------------------------------------------5 571.8000000 39.2390112 524.0000000 622.0000000

------------------------------------------------------------------

-------------------------------- dose=3 week=6 ---------------------------------

Analysis Variable : weight

N Mean Std Dev Minimum Maximum------------------------------------------------------------------5 588.2000000 43.7058349 532.0000000 633.0000000

------------------------------------------------------------------

-------------------------------- dose=3 week=7 ---------------------------------

Analysis Variable : weight

N Mean Std Dev Minimum Maximum------------------------------------------------------------------5 623.2000000 35.3723056 583.0000000 670.0000000

------------------------------------------------------------------

PAGE 163

Page 173: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 5 ST 732, M. DAVIDIAN

7

Plot of mweight*week. Symbol is value of dose.

mweight ||

660 +||| 2

640 +||| 3

620 +||| 2

600 +|| 3|

580 + 3| 2| 1 3 1| 2

560 + 1|| 2| 1

540 +| 3||

520 + 1|||

500 + 3| 2||

480 +||| 1

460 +|---+----------+----------+----------+----------+----------+----------+--

1 2 3 4 5 6 7

week8

The GLM Procedure

Class Level Information

Class Levels Values

week 6 1 3 4 5 6 7

dose 3 1 2 3

pig 15 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15

Number of observations 909

The GLM Procedure

Dependent Variable: weight

Sum ofSource DF Squares Mean Square F Value Pr > F

Model 29 276299.5000 9527.5690 17.56 <.0001

Error 60 32552.6000 542.5433

Corrected Total 89 308852.1000

R-Square Coeff Var Root MSE weight Mean

0.894601 4.166081 23.29256 559.1000

Source DF Type I SS Mean Square F Value Pr > F

PAGE 164

Page 174: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 5 ST 732, M. DAVIDIAN

dose 2 18548.0667 9274.0333 17.09 <.0001pig(dose) 12 105434.2000 8786.1833 16.19 <.0001week 5 142554.5000 28510.9000 52.55 <.0001week*dose 10 9762.7333 976.2733 1.80 0.0801

Source DF Type III SS Mean Square F Value Pr > F

dose 2 18548.0667 9274.0333 17.09 <.0001pig(dose) 12 105434.2000 8786.1833 16.19 <.0001week 5 142554.5000 28510.9000 52.55 <.0001week*dose 10 9762.7333 976.2733 1.80 0.0801

10

The GLM Procedure

Source Type III Expected Mean Square

dose Var(Error) + 6 Var(pig(dose)) + Q(dose,week*dose)

pig(dose) Var(Error) + 6 Var(pig(dose))

week Var(Error) + Q(week,week*dose)

week*dose Var(Error) + Q(week*dose)

11

The GLM ProcedureTests of Hypotheses for Mixed Model Analysis of Variance

Dependent Variable: weight

Source DF Type III SS Mean Square F Value Pr > F

* dose 2 18548 9274.033333 1.06 0.3782

Error: MS(pig(dose)) 12 105434 8786.183333* This test assumes one or more other fixed effects are zero.

Source DF Type III SS Mean Square F Value Pr > F

pig(dose) 12 105434 8786.183333 16.19 <.0001* week 5 142555 28511 52.55 <.0001

week*dose 10 9762.733333 976.273333 1.80 0.0801

Error: MS(Error) 60 32553 542.543333* This test assumes one or more other fixed effects are zero.

12

The GLM Procedure

Class Level Information

Class Levels Values

dose 3 1 2 3

Number of observations 15

13

The GLM ProcedureRepeated Measures Analysis of Variance

Repeated Measures Level Information

Dependent Variable week1 week3 week4 week5 week6 week7

Level of week 1 2 3 4 5 6

Partial Correlation Coefficients from the Error SSCP Matrix / Prob > |r|

DF = 12 week1 week3 week4 week5 week6 week7

week1 1.000000 0.707584 0.459151 0.543739 0.492366 0.5020980.0068 0.1145 0.0548 0.0874 0.0804

week3 0.707584 1.000000 0.889996 0.874228 0.676753 0.8348990.0068 <.0001 <.0001 0.0111 0.0004

week4 0.459151 0.889996 1.000000 0.881217 0.789575 0.8477860.1145 <.0001 <.0001 0.0013 0.0003

PAGE 165

Page 175: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 5 ST 732, M. DAVIDIAN

week5 0.543739 0.874228 0.881217 1.000000 0.803051 0.9193500.0548 <.0001 <.0001 0.0009 <.0001

week6 0.492366 0.676753 0.789575 0.803051 1.000000 0.8956030.0874 0.0111 0.0013 0.0009 <.0001

week7 0.502098 0.834899 0.847786 0.919350 0.895603 1.0000000.0804 0.0004 0.0003 <.0001 <.0001

E = Error SSCP Matrix

week_N represents the contrast between the nth level of week and the last

week_1 week_2 week_3 week_4 week_5

week_1 25083.6 13574.0 12193.2 4959.0 2274.8week_2 13574.0 10638.4 9099.2 4354.6 -968.2week_3 12193.2 9099.2 11136.8 4293.8 1623.6week_4 4959.0 4354.6 4293.8 5194.4 -365.8week_5 2274.8 -968.2 1623.6 -365.8 7425.2

14

The GLM ProcedureRepeated Measures Analysis of Variance

Partial Correlation Coefficients from the Error SSCP Matrix of theVariables Defined by the Specified Transformation / Prob > |r|

DF = 12 week_1 week_2 week_3 week_4 week_5

week_1 1.000000 0.830950 0.729529 0.434442 0.1666840.0004 0.0047 0.1380 0.5863

week_2 0.830950 1.000000 0.835959 0.585791 -0.1089360.0004 0.0004 0.0354 0.7231

week_3 0.729529 0.835959 1.000000 0.564539 0.1785440.0047 0.0004 0.0444 0.5595

week_4 0.434442 0.585791 0.564539 1.000000 -0.0589010.1380 0.0354 0.0444 0.8484

week_5 0.166684 -0.108936 0.178544 -0.058901 1.0000000.5863 0.7231 0.5595 0.8484

Sphericity Tests

Mauchly’sVariables DF Criterion Chi-Square Pr > ChiSq

Transformed Variates 14 0.0160527 41.731963 0.0001Orthogonal Components 14 0.0544835 29.389556 0.0093

15

The GLM ProcedureRepeated Measures Analysis of Variance

Tests of Hypotheses for Between Subjects Effects

Source DF Type III SS Mean Square F Value Pr > F

dose 2 18548.0667 9274.0333 1.06 0.3782Error 12 105434.2000 8786.1833

16

The GLM ProcedureRepeated Measures Analysis of Variance

Univariate Tests of Hypotheses for Within Subject Effects

Source DF Type III SS Mean Square F Value Pr > F

week 5 142554.5000 28510.9000 52.55 <.0001week*dose 10 9762.7333 976.2733 1.80 0.0801Error(week) 60 32552.6000 542.5433

Adj Pr > FSource G - G H - F

week <.0001 <.0001week*dose 0.1457 0.1103Error(week)

Greenhouse-Geisser Epsilon 0.4856Huynh-Feldt Epsilon 0.7191

PAGE 166

Page 176: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 5 ST 732, M. DAVIDIAN

17

The GLM Procedure

Class Level Information

Class Levels Values

dose 3 1 2 3

Number of observations 15

18

The GLM ProcedureRepeated Measures Analysis of Variance

Repeated Measures Level Information

Dependent Variable week1 week3 week4 week5 week6 week7

Level of week 1 3 4 5 6 7

week_N represents the nth degree polynomial contrast for week

M Matrix Describing Transformed Variables

week1 week3 week4

week_1 -.6900655593 -.2760262237 -.0690065559week_2 0.5455447256 -.3273268354 -.4364357805week_3 -.2331262021 0.6061281254 0.0932504808week_4 0.0703659384 -.4817360399 0.5196253913week_5 -.0149872662 0.2248089935 -.5994906493

week_N represents the nth degree polynomial contrast for week

M Matrix Describing Transformed Variables

week5 week6 week7

week_1 0.1380131119 0.3450327797 0.5520524475week_2 -.3273268354 0.0000000000 0.5455447256week_3 -.4196271637 -.4662524041 0.4196271637week_4 0.2760509891 -.6062296232 0.2219233442week_5 0.6744269805 -.3596943896 0.0749363312

19

The GLM ProcedureRepeated Measures Analysis of Variance

Tests of Hypotheses for Between Subjects Effects

Source DF Type III SS Mean Square F Value Pr > F

dose 2 18548.0667 9274.0333 1.06 0.3782Error 12 105434.2000 8786.1833

20

The GLM ProcedureRepeated Measures Analysis of Variance

Univariate Tests of Hypotheses for Within Subject Effects

Source DF Type III SS Mean Square F Value Pr > F

week 5 142554.5000 28510.9000 52.55 <.0001week*dose 10 9762.7333 976.2733 1.80 0.0801Error(week) 60 32552.6000 542.5433

Adj Pr > FSource G - G H - F

week <.0001 <.0001week*dose 0.1457 0.1103Error(week)

Greenhouse-Geisser Epsilon 0.4856Huynh-Feldt Epsilon 0.7191

21

The GLM ProcedureRepeated Measures Analysis of Variance

Analysis of Variance of Contrast Variables

week_N represents the nth degree polynomial contrast for week

PAGE 167

Page 177: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 5 ST 732, M. DAVIDIAN

Contrast Variable: week_1

Source DF Type III SS Mean Square F Value Pr > F

Mean 1 131764.8029 131764.8029 87.35 <.0001dose 2 2495.2133 1247.6067 0.83 0.4608Error 12 18100.8743 1508.4062

Contrast Variable: week_2

Source DF Type III SS Mean Square F Value Pr > F

Mean 1 2011.479365 2011.479365 6.67 0.0240dose 2 4489.677778 2244.838889 7.45 0.0079Error 12 3617.509524 301.459127

Contrast Variable: week_3

Source DF Type III SS Mean Square F Value Pr > F

Mean 1 2862.193623 2862.193623 9.19 0.0104dose 2 694.109855 347.054928 1.11 0.3597Error 12 3736.192174 311.349348

Contrast Variable: week_4

Source DF Type III SS Mean Square F Value Pr > F

Mean 1 3954.881058 3954.881058 17.28 0.0013dose 2 1878.363604 939.181802 4.10 0.0439Error 12 2746.984214 228.915351

Contrast Variable: week_5

Source DF Type III SS Mean Square F Value Pr > F

Mean 1 1961.143097 1961.143097 5.41 0.0384dose 2 205.368763 102.684382 0.28 0.7583Error 12 4351.039802 362.586650

22

The GLM Procedure

Class Level Information

Class Levels Values

dose 3 1 2 3

Number of observations 15

23

The GLM ProcedureRepeated Measures Analysis of Variance

Repeated Measures Level Information

Dependent Variable week1 week3 week4 week5 week6 week7

Level of week 1 3 4 5 6 7

week_N represents the nth successive difference in week

M Matrix Describing Transformed Variables

week1 week3 week4

week_1 1.000000000 -1.000000000 0.000000000week_2 0.000000000 1.000000000 -1.000000000week_3 0.000000000 0.000000000 1.000000000week_4 0.000000000 0.000000000 0.000000000week_5 0.000000000 0.000000000 0.000000000

week_N represents the nth successive difference in week

M Matrix Describing Transformed Variables

week5 week6 week7

week_1 0.000000000 0.000000000 0.000000000week_2 0.000000000 0.000000000 0.000000000

PAGE 168

Page 178: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 5 ST 732, M. DAVIDIAN

week_3 -1.000000000 0.000000000 0.000000000week_4 1.000000000 -1.000000000 0.000000000week_5 0.000000000 1.000000000 -1.000000000

24

The GLM ProcedureRepeated Measures Analysis of Variance

Tests of Hypotheses for Between Subjects Effects

Source DF Type III SS Mean Square F Value Pr > F

dose 2 18548.0667 9274.0333 1.06 0.3782Error 12 105434.2000 8786.1833

25

The GLM ProcedureRepeated Measures Analysis of Variance

Univariate Tests of Hypotheses for Within Subject Effects

Source DF Type III SS Mean Square F Value Pr > F

week 5 142554.5000 28510.9000 52.55 <.0001week*dose 10 9762.7333 976.2733 1.80 0.0801Error(week) 60 32552.6000 542.5433

Adj Pr > FSource G - G H - F

week <.0001 <.0001week*dose 0.1457 0.1103Error(week)

Greenhouse-Geisser Epsilon 0.4856Huynh-Feldt Epsilon 0.7191

26

The GLM ProcedureRepeated Measures Analysis of Variance

Analysis of Variance of Contrast Variables

week_N represents the nth successive difference in week

Contrast Variable: week_1

Source DF Type III SS Mean Square F Value Pr > F

Mean 1 35721.60000 35721.60000 50.00 <.0001dose 2 1112.40000 556.20000 0.78 0.4810Error 12 8574.00000 714.50000

Contrast Variable: week_2

Source DF Type III SS Mean Square F Value Pr > F

Mean 1 23128.06667 23128.06667 77.59 <.0001dose 2 1980.13333 990.06667 3.32 0.0711Error 12 3576.80000 298.06667

Contrast Variable: week_3

Source DF Type III SS Mean Square F Value Pr > F

Mean 1 836.266667 836.266667 1.30 0.2772dose 2 2.133333 1.066667 0.00 0.9983Error 12 7743.600000 645.300000

Contrast Variable: week_4

Source DF Type III SS Mean Square F Value Pr > F

Mean 1 2331.26667 2331.26667 2.10 0.1734dose 2 6618.53333 3309.26667 2.97 0.0893Error 12 13351.20000 1112.60000

Contrast Variable: week_5

Source DF Type III SS Mean Square F Value Pr > F

Mean 1 17136.60000 17136.60000 27.69 0.0002dose 2 619.20000 309.60000 0.50 0.6184Error 12 7425.20000 618.76667

PAGE 169

Page 179: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 5 ST 732, M. DAVIDIAN

27

The GLM Procedure

Class Level Information

Class Levels Values

dose 3 1 2 3

Number of observations 15

28

The GLM ProcedureRepeated Measures Analysis of Variance

Repeated Measures Level Information

Dependent Variable week1 week3 week4 week5 week6 week7

Level of week 1 2 3 4 5 6

week_N represents the contrast between the nthlevel of week and the mean of subsequent levels

M Matrix Describing Transformed Variables

week1 week3 week4

week_1 1.000000000 -0.200000000 -0.200000000week_2 0.000000000 1.000000000 -0.250000000week_3 0.000000000 0.000000000 1.000000000week_4 0.000000000 0.000000000 0.000000000week_5 0.000000000 0.000000000 0.000000000

week_N represents the contrast between the nthlevel of week and the mean of subsequent levels

M Matrix Describing Transformed Variables

week5 week6 week7

week_1 -0.200000000 -0.200000000 -0.200000000week_2 -0.250000000 -0.250000000 -0.250000000week_3 -0.333333333 -0.333333333 -0.333333333week_4 1.000000000 -0.500000000 -0.500000000week_5 0.000000000 1.000000000 -1.000000000

29

The GLM ProcedureRepeated Measures Analysis of Variance

Tests of Hypotheses for Between Subjects Effects

Source DF Type III SS Mean Square F Value Pr > F

dose 2 18548.0667 9274.0333 1.06 0.3782Error 12 105434.2000 8786.1833

30

The GLM ProcedureRepeated Measures Analysis of Variance

Univariate Tests of Hypotheses for Within Subject Effects

Source DF Type III SS Mean Square F Value Pr > F

week 5 142554.5000 28510.9000 52.55 <.0001week*dose 10 9762.7333 976.2733 1.80 0.0801Error(week) 60 32552.6000 542.5433

Adj Pr > FSource G - G H - F

week <.0001 <.0001week*dose 0.1457 0.1103Error(week)

Greenhouse-Geisser Epsilon 0.4856Huynh-Feldt Epsilon 0.7191

31

The GLM ProcedureRepeated Measures Analysis of Variance

Analysis of Variance of Contrast Variables

PAGE 170

Page 180: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 5 ST 732, M. DAVIDIAN

week_N represents the contrast between the nth level of week and the mean ofsubsequent levels

Contrast Variable: week_1

Source DF Type III SS Mean Square F Value Pr > F

Mean 1 114791.2560 114791.2560 93.69 <.0001dose 2 343.6960 171.8480 0.14 0.8705Error 12 14701.9680 1225.1640

Contrast Variable: week_2

Source DF Type III SS Mean Square F Value Pr > F

Mean 1 35065.83750 35065.83750 64.01 <.0001dose 2 481.90000 240.95000 0.44 0.6541Error 12 6574.32500 547.86042

Contrast Variable: week_3

Source DF Type III SS Mean Square F Value Pr > F

Mean 1 2200.185185 2200.185185 3.10 0.1037dose 2 3888.059259 1944.029630 2.74 0.1046Error 12 8512.755556 709.396296

Contrast Variable: week_4

Source DF Type III SS Mean Square F Value Pr > F

Mean 1 12936.01667 12936.01667 20.93 0.0006dose 2 8797.73333 4398.86667 7.12 0.0092Error 12 7416.50000 618.04167

Contrast Variable: week_5

Source DF Type III SS Mean Square F Value Pr > F

Mean 1 17136.60000 17136.60000 27.69 0.0002dose 2 619.20000 309.60000 0.50 0.6184Error 12 7425.20000 618.76667

PAGE 171

Page 181: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 6 ST 732, M. DAVIDIAN

6 Multivariate repeated measures analysis of variance

6.1 Introduction

The statistical model underlying the univariate repeated measures analysis of variance procedures dis-

cussed in the last chapter involves a very restrictive assumption about the form of the covariance matrix

of a data vector. Specifically, if yi is the data vector of observations at the n time points from the ith

unit, then the model may be written as

Y ′i = a′

iM + ε′i, i = 1, . . . , m, (6.1)

where ai and M are defined in Chapter 5 as, respectively, the (1×q) indicator vector of group member-

ship and the (q×n) matrix whose rows are the transposes of the mean vectors for each group. The error

vector ei associated with the ith unit has, by virtue of the way the model is constructed, covariance

matrix

Σ = σ2bJn + σ2

eIn;

that is, the model implies the assumption of compound symmetry. With the normality assumptions,

the model also implies that each data vector has a multivariate normal distribution:

Y i ∼ Nn(µi,Σ), µ′i = a′

iM .

The elements of µi under the model have a very specific form; if unit i is from the `th group, the jth

element of this vector, j = 1, . . . , n, has the form

µ + τ` + γj + (τγ)`j .

We saw that, as long as the assumption of compound symmetry is correct, valid tests of statistical

hypotheses of interest based on familiar analysis of variance techniques are available. The test of great

interest is that of whether there exists a Group by Time interaction, addressing the issue of whether the

change in mean response over time differs among groups (“parallelism”). As long as the assumptions

of compound symmetry and normality hold, the usual test statistic based on the ratio of two mean

squares has an F sampling distribution, so that the value of the statistic may be compared with F

critical values to conduct the test. However, if the assumption of compound symmetry does not hold,

this is no longer true, and application of the testing procedure may lead to erroneous conclusions.

PAGE 172

Page 182: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 6 ST 732, M. DAVIDIAN

One approach discussed in Chapter 5 to address this problem was to “adjust” the tests. However, this is

a somewhat unsatisfying approach, as it skirts the real problem, which is that the compound symmetry

assumption is not appropriate. The simple fact is that this assumption is too restrictive to characterize

the kind of correlation patterns that might be seen with longitudinal data. Thus, a more appealing

alternative to “adjustment” of tests that are not correct is to return to the statistical model, make a less

restrictive assumption, and develop new procedures appropriate for the model under this assumption.

MORE GENERAL MODEL: The most general alternative to the compound symmetry is to go entirely

in the opposite direction and assume very little about the nature of the covariance structure of a data

vector. Recall that in Chapter 5, the deviation εi in (6.1) had a very specific form,

ε′i = 1′bi + e′i,

which implied the compound symmetry structure. An alternative view is to consider the model (6.1) as

the starting point and make an assumption directly about the covariance structure associated with εi.

We may still believe that the covariance matrix of the data vectors Y i is the same for all i, regardless

of group membership; however, we may not believe that this matrix exhibits the compound symmetry

structure. We may state this formally by considering the model

Y ′i = a′

iM + ε′i, i = 1, . . . , m, εi ∼ N (0,Σ), (6.2)

where Σ is now an arbitrary covariance matrix assumed to possess no particular structure. That is,

the most we are willing to say about Σ is that it is a symmetric matrix with the unstructured form

(see Chapter 4)

Σ =

σ2

1 σ12 · · · σ1n

......

......

σn1 σn2 · · · σ2n

and is the same for all i.

• This modeling perspective does not explicitly acknowledge how among-unit and within-unit

sources of variation contribute to the overall variation of observations in a data vector. Rather,

it is assumed that the aggregate of both sources produces a covariance structure of arbitrary,

unstructured form; nothing specific about how the two sources combine is characterized.

• The resulting unstructured matrix depends on n(n + 1)/2 parameters (rather than the two

parameters σ2b and σ2

e under the compound symmetry assumption. Thus, a great many more

parameters are required to describe how observations within a data vector vary and covary.

PAGE 173

Page 183: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 6 ST 732, M. DAVIDIAN

MULTIVARIATE PROCEDURES: With model (6.2) as the starting point, it is possible to develop

valid testing procedures for hypotheses of interest. However, the model is much more complicated

because there is no longer a nice, simple assumption about covariance. The result is that it is no

longer possible as it was under compound symmetry to think on an individual observation basis

and be able to obtain nice results about ratios of simple mean squares. Thus, familiar procedures

based on simple F ratios no longer apply. It is necessary instead to consider the data in the form of

vectors. Hence, the procedures we now discuss are known as multivariate repeated measures analysis

of variance methods. This is because they arise as a particular case of a way of thinking about general

multivariate problems, known as multivariate analysis of variance methods (MANOVA). These

may be viewed as extensions of usual analysis of variance methods, where now, an “observation” is an

entire vector from an unit rather than just a single, scalar response.

PERSPECTIVE: Although a lengthy exposition on multivariate analysis of variance methods and mod-

els is possible, we will consider these methods only briefly. A full, general treatment would be found in

a full course on multivariate analysis; a typical reference would be Johnson and Wichern (2002).

• This is because, just as the univariate methods of the previous chapter make too restrictive an

assumption about covariance for many longitudinal data problems, multivariate methods make

too general an assumption. Indeed, the overall covariance matrix in many longitudinal data

settings has some sort of systematic pattern.

• The consequence is that they may not be very powerful in the statistical sense for detecting

departures from null hypotheses of interest, because they must allow for the possibility that

the covariance matrix of a data vector may be virtually anything! There are now n(n + 1)/2

parameters defining the covariance structure rather than just 2.

• Thus, the perspective of this instructor is that these methods may be of limited practical utility

for longitudinal data problems.

As we will see in subsequent chapters, although we may not be willing to be as narrow as assuming

compound symmetry, we may have some basis for assuming something about the covariance structure

of a data vector, for example, how among- and within-sources of variation affect the response. By taking

advantage of what we are willing to assume, we may be able to construct more powerful statistical

procedures. Moreover, although the model (6.2) gets away from compound symmetry, it still uses a

restrictive assumption about the form of the mean vector, not incorporating time explicitly. Other

models we will see later will address all of these issues and lead to more interpretable methods.

PAGE 174

Page 184: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 6 ST 732, M. DAVIDIAN

6.2 General multivariate problem

GENERAL SET-UP: In order to appreciate the perspective behind the multivariate approach, we

consider a general case of a multivariate problem, that usually addressed in a full course on multivariate

analysis. Consider the following situation; we use the notation with two subscripts for convenience later.

• Units are randomized into q groups.

• Data vector Y h` is observed for the hth unit in the `th group.

• Y h` is assumed to satisfy

Y h` ∼ N (µ`,Σ),

where µ` is the mean response vector for group ` and Σ is an arbitrary covariance matrix assumed

to be the same for each group.

• There are r` units in each group, so for group `, h = 1, . . . , r`.

• The components of Y h` may not necessarily all be measurements of the same response.

Instead, each component of Y h` may represent the measurement of a different response. For

example, suppose the units are birds of two species. Measurements on n different features of the

birds may be taken and collected into a vector Y h`; e.g. yh`1 may be tail length, yh`2 may be wing

span, yh`3 may be body weight, and so on. That is, the elements Yh`j , j = 1, . . . , n, may consist

of measurements of different characteristics.

• Of course, the longitudinal data situation is a special case of this set-up where the Yh`j happen to

be measurements on the same response (over time).

COMPARISON OF INTEREST: Clearly, the main interest is focused on comparing the groups on

the basis of the responses that make up a data vector somehow.

• Recall in our discussion of univariate methods, we noted that when the responses are all the same

within a data vector, a natural approach is to think of averaging the responses over time and

comparing the averages. This was the interpretation of the hypotheses developed for testing the

main effect of groups. (Of course, this may be dubious if the profiles are not parallel, as discussed

in Chapter 5).

PAGE 175

Page 185: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 6 ST 732, M. DAVIDIAN

• Here, however, it is clear that averaging over all responses and comparing the averages across

groups would be nonsensical. In the example above, we would be averaging tail length, wing span,

body weight, etc, variables that measure entirely different characteristics on different scales!

• Thus, the best we can hope for is to compare all the different responses “simultaneously” somehow.

In doing this, it would naturally be important to take into account that observations on the same

unit are correlated.

FORMALLY: In our statistical model, µ` is the mean for data vectors (composed of the n different

responses) observed on units in the `th group. Thus, we may formally state our desire to compare the

n responses “simultaneously” as the desire to compare the q mean vectors µ`, ` = 1, . . . , q, on the basis

of all their components. That is, we are interested in testing the null hypothesis

H0 : µ1 = · · · = µq (6.3)

versus the alternative that H0 is not true. As long as the n responses that make up a data vector are

different and hence not comparable (e.g. cannot be “averaged”), this is the best we can do to address

our general question.

6.3 Hotelling’s T 2

The standard methods to test the null hypothesis (6.3) are simply generalizations of standard methods

in the case where the data on each unit are just scalar observations yh`, say. That is, Y h` is a vector of

length n = 1. In this section, we give brief statements of these generalizations without much justification.

A more in-depth treatment of the general multivariate problem may be found in Johnson and Wichern

(1992).

First, consider the case of just q = 2 groups.

SCALAR CASE: If the observations were just scalars rather than vectors, then we would be interested

in the comparison of two scalar means µ`, ` = 1, 2, and H0 would reduce to

H0 : µ1 = µ2 or µ1 − µ2 = 0.

Furthermore, the unknown covariance matrix Σ would reduce to a single scalar variance value, σ2,

say. Under our normality assumption, the standard test of H0 would be the two-sample t test.

PAGE 176

Page 186: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 6 ST 732, M. DAVIDIAN

• Because σ2 is unknown, it must be estimated. This is accomplished by estimating σ2 based on

the observations for each group and then “pooling” the result. That is, letting Y ·` denote the

sample mean of the r` observations yh` for group `, find the sample variance

S2` = (r` − 1)−1

r∑h=1

(Yh` − Y ·`)2

and construct the estimate of σ2 from data in both groups as the “weighted average”

S2 = (r1 + r2 − 2)−1{(r1 − 1)S21 + (r2 − 1)S2

2}.

• Now, form the test statistic

t =Y ·1 − Y ·2√

(r−11 + r−1

2 )s2.

The statistic t may be shown to have a Student’s t distribution with r1 +r2−2 degrees of freedom.

MULTIVARIATE CASE: The hypothesis is now

H0 : µ1 = µ2 or µ1 − µ2 = 0. (6.4)

A natural approach is to seek a multivariate analogue to the t test.

• The analogue of the assumed common variance σ2 is now the assumed common covariance

matrix Σ, which is of course unknown. We would like to estimate this matrix for each group

and then “pool” the results as in Chapter 4.

• In particular, we may calculate the pooled sample covariance matrix. If we collect the sample

means Y ·`j , j = 1, . . . , n into a vector

Y ·` =

y·`1...

y·`n

,

then the sample covariance matrix for group ` is the (n× n) matrix

Σ` = (r` − 1)−1r∑

h=1

(Y h` − Y ·`)(Y h` − Y ·`)′. (6.5)

Recall that the sum in 6.5) is called a sum of squares and cross-products (SS&CP) matrix.

• The overall pooled sample covariance, an estiamtor for Σ, is then the “weighted average”

Σ = (r1 + r2 − 2)−1{(r1 − 1)Σ1 + (r2 − 1)Σ2}.

PAGE 177

Page 187: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 6 ST 732, M. DAVIDIAN

• The test statistic analogous to the (square of) the t statistic is known as Hotelling’s T 2 statistic

and is given by

T 2 = (r−11 + r−1

2 )−1(Y ·1 − Y ·2)′Σ−1

(Y ·1 − Y ·2).

It may be shown thatr1 + r2 − n− 1(r1 + r2 − 2)n

T 2 ∼ Fn,r1+r2−n−1.

Thus, the test of H0 may be carried out at level α by comparing this version of T 2 to the

appropriate α critical value.

Note that if n = 1, the multiplicative factor is equal to 1 and the statistic has an F distribution

with 1 and r1 + r2 − 2 degrees of freedom, which is just the square of the tr1+r2−2 distribution.

That is, the multivariate test reduces to the scalar t test if the dimension of a data vector n = 1.

EXAMPLE: For illustration, consider the dental data. Here, the q = 2 groups are genders, r1 = 11

(girls), r2 = 16 (boys), and n = 4 ages (8, 10, 12, 14). Recall that we found

Y ·1 = (21.182, 22.227, 23.091, 24.091)′,

Y ·2 = (22.875, 23.813, 25.719, 27.469)′.

The estimates of Σ for each group are, from Chapter 4,

Σ1 =

4.514 3.355 4.332 4.357

3.355 3.618 4.027 4.077

4.332 4.027 5.591 5.466

4.357 4.077 5.466 5.9401

,

Σ2 =

6.017 2.292 3.629 1.613

2.292 4.563 2.194 2.810

3.629 2.194 7.032 3.241

1.613 2.810 3.241 4.349

.

PAGE 178

Page 188: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 6 ST 732, M. DAVIDIAN

The pooled estimate is then easily calculated (Chapter 4) as

Σ =

5.415 2.717 3.910 2.710

2.717 4.185 2.927 3.317

3.910 2.927 6.456 4.131

2.710 3.317 4.131 4.986

.

From these quantities, it is straightforward to calculate

r1 + r2 − n− 1(r1 + r2 − 2)n

T 2 = 3.63,

which under our assumptions has an F distribution with 4 and 22 degrees of freedom. F4,22,0.05 = 2.816;

thus, we would reject H0 at level α = 0.05.

In section 6.6 we will see these calculations done using SAS PROC GLM.

HYPOTHESIS IN MATRIX FORM: It is worth noting that the hypothesis in (6.4) may be expressed

in the form we have used previously. Specifically, if we define M as before as the (2× n) matrix whose

rows are the transposed mean vectors µ′1 and µ′

2, i.e.

M =

µ11 · · · µ1n

µ21 · · · µ2n

,

it should be clear that, defining C = (1,−1), we have (verify)

CM =(

µ11 − µ21, · · · , µ1n − µ2n

)= (µ1 − µ2)

′.

Thus, we may express the hypothesis in the form

H0 : CMU = 0, U = In.

6.4 One-way MANOVA

Just as the case of comparing 2 group means for scalar response may be generalized to q > 2 groups

using analysis of variance techniques, the multivariate analysis above also may be generalized.

PAGE 179

Page 189: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 6 ST 732, M. DAVIDIAN

SCALAR CASE: Again, if the observations were just scalars, we would be interested in the comparison

of q scalar means µ`, ` = 1, . . . , q, and H0 would reduce to

H0 : µ1 = · · · = µq,

and again the unknown covariance matrix Σ would reduce to a single scalar variance value σ2. Under

the normality assumption, the standard test of H0 via one-way analysis of variance is based on the

ratio of two estimators for σ2. The following is the usual one-way analysis of variance; recall that

m =∑q

`=1 r` is the total number of units:

ANOVA Table

Source SS DF MS F

Among Groups SSG =∑q

`=1 r`(Y ·` − Y ··)2 q − 1 MSG MSG/MSE

Among-unit Error SSE =∑q

`=1

∑r`h=1(Yh` − Y ·`)2 m− q MSE

Total∑q

`=1

∑r`h=1(Yh` − Y ··)2 m− 1

Note that the “error” sum of squares SSE may be written as (try it)

SSE = (r1 − 1)S21 + · · ·+ (rq − 1)S2

q , S2` = (r` − 1)−1

r∑h=1

(Yh` − Y ·`)2,

where S2` is the sample variance for the `th group, so that MSE has the interpretation as the pooled

sample variance estimator for σ2 across all q groups. MSG is an estimator for σ2 based on deviations of

the group means from the overall mean, and will overestimate σ2 if the means are different. It may be

shown that the ratio F has sampling distribution that is F with (q−1) and (m− q) degrees of freedom,

so that the test is conducted at level α by comparing the calculated value of F to Fq−1,m−q,α.

PAGE 180

Page 190: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 6 ST 732, M. DAVIDIAN

MULTIVARIATE CASE: The hypothesis is now H0 : µ1 = · · · = µq.

As in the case of q = 2 groups above, the multivariate generalization involves the fact that there

is now an entire covariance matrix Σ to estimate rather than just a single variance. Consider the

following analogue to the scalar one-way analysis of variance above. Let Y ··j be the sample mean of all

observations across all units and groups for the jth element and define the overall mean vector

Y ·· =

Y ··1

...

Y ··n

.

MANOVA Table

Source SS&CP DF

Among Groups QH =∑q

`=1 r`(Y ·` − Y ··)(Y ·` − Y ··)′ q − 1

Among-unit Error QE =∑q

`=1

∑r`h=1(Y h` − Y ·`)(Y h` − Y ·`)′ m− q

Total QH + QE =∑q

`=1

∑r`h=1(Y h` − Y ··)(Y h` − Y ··)′ m− 1

Comparing the entries in this table to those in the scalar ANOVA table, we see that they appear to be

multivariate generalizations. In particular, the entries are now matrices. Each may be viewed as an

attempt to estimate Σ.

It is straightforward to verify (try it) that the Among-unit Error sum of squares and cross products

matrix QE may be written

QE = (r1 − 1)Σ1 + · · ·+ (rq − 1)Σq,

where Σ` is the estimate (6.5) of Σ based on the data vectors from group `. Thus, just as in the scalar

case, this quantity divided by its degrees of freedom has the interpretation as a “pooled” estimate of Σ

across groups.

MULTIVARIATE TESTS: Unfortunately, because these entries are matrices, it is no longer straight-

forward to construct a unique generalization of the F ratio that may be used to test H0. Clearly, one

would like to compare the “magnitude” of the SS&CP matrices QH and QE somehow, but there is no

one way to do this. There are a number of statistics that have been proposed based on these quantities

that have this interpretation.

PAGE 181

Page 191: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 6 ST 732, M. DAVIDIAN

• The most commonly discussed statistic is known as Wilks’ lambda and may be motivated

informally as follows. In the scalar case, the F ratio is

SSG/(q − 1)SSE/(m− q)

;

thus, in the scalar case, H0 is rejected when the ratio SSG/SSE is large. This is equivalent to

rejecting for large values of 1 + SSG/SSE or small values of

11 + SSG/SSE

=SSE

SSG + SSE.

For the multivariate problem, the Wilks’ lambda statistic is the analogue of this quantity,

TW =|QE |

|QH + QE |;

here, the determinant of each SS&CP matrix is taken, reducing the matrix to a single number.

This number is often referred to as the generalized sample variance; see Johnson and Wichern

(2002) for a deeper discussion. One rejects H0 for small values of TW (how small will be discussed

in a moment).

• Another statistic is referred to as the Lawley-Hotelling trace; reject H0 for large values of

TLH = tr(QHQ−1E ).

• Other statistics are Pillai’s trace and Roy’s greatest root.

• None of these approaches been shown to be superior to the others in general. In addition, all are

equivalent to using the Hotelling T 2 statistic in the case q = 2.

A full discussion of the theoretical underpinnings of these methods is beyond the scope of our discussion.

Here, we note briefly the salient points:

• It is possible in certain special cases to work out the exact sampling distribution of these statistics.

As mentioned above, when q = 2 and we are testing whether the two means are the same, all

of these statistics may be shown to be the same and equivalent to conducting the test based on

Hotelling’s T 2 statistics.

• When n = 1, 2 and q ≥ 2 or when n ≥ 1 and q = 2, 3, it is possible to show that certain functions

of TW have an F sampling distribution, and this may be used to conduct the test exactly. These

are listed in Johnson and Wichern (2002).

PAGE 182

Page 192: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 6 ST 732, M. DAVIDIAN

• In other situations, it is possible to show that the sampling distributions may be approximated

by F or other distributions.

• SAS PROC GLM calculates all of these statistics and provides either exact or approximate p-values,

depending on the situation.

We will consider the application of these methods to the dental study data and the guinea pig diet data

in section 6.6.

HYPOTHESIS IN MATRIX FORM: It is again worth noting that the hypothesis of interest (6.3) may

be expressed in the form H0 : CMU = 0 for suitable choice of C and with U = In. For example,

consider the case q = 3, with

M =

µ11 · · · µ1n

µ21 · · · µ2n

µ31 · · · µ3n

, C =

1 −1 0

1 0 −1

, (6.6)

CM =

µ11 − µ21 · · · µ1n − µ2n

µ11 − µ31 · · · µ1n − µ3n

=

(µ1 − µ2)′

(µ1 − µ3)′

.

Setting this equal to 0 may thus be seen to be equivalent to saying that all of the mean vectors µ` are

the same.

SUMMARY: We have seen that, in situations where a data vector consists of n observations on possibly

different characteristics on different scales, it is possible to test whether the entire mean vectors

for each group are the same using what are usually called one-way MANOVA methods.

• If the null hypothesis (6.3) is rejected, then this means we have evidence to suggest that at least

one of the q mean vectors differs from the others in at least one of the n components. This is not

particularly informative, particularly if q and/or n are somewhat large.

• In addition, it seems intuitively that it would be difficult to detect such a difference – with q

vectors and n components, there are a lot of comparisons that must be taken into account when

looking for a difference.

• Furthermore, the methods are requiring estimation of all n(n + 1)/2 elements of the (assumed

common across groups) covariance matrix Σ.

• Thus, the basis for our earlier remark that multivariate procedures may lack power for detecting

differences should now be clear.

PAGE 183

Page 193: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 6 ST 732, M. DAVIDIAN

• Furthermore, when the n elements of a data vector are all observations on the same characteristic

as in the case of longitudinal data, these methods do not seem to really get at the heart of matters.

Focusing on H0 in (6.3) ignores the questions of interest, such as that of parallelism.

6.5 Profile Analysis

It turns out that one can conduct more focused multivariate tests that make no particular assumption

about the form of Σ. Recall that the MANOVA test of (6.3), H0 : µ1 = · · · = µq could be regarded as

testing a particular hypothesis of the form

H0 : CMU = 0

for suitable choice of C and with U = In. It should thus come as no surprise that it is possible to

develop such multivariate procedures for more general choices of C and U .

HYPOTHESIS OF PARALLELISM: Of particular interest in the case of longitudinal data is the test

of parallelism or group by time interaction. In the last chapter, we saw that the null hypothesis

corresponding to parallelism could be expressed in terms of the elements of the mean vectors µ` or

equivalently in terms of the taugam`j :

H0 : all (τγ)`j = 0.

In particular, in the case of q = 2 and n = 3, we saw that this test could be represented with

C =(

1 −1)

, U =

1 0

−1 1

0 −1

, M =

µ11 µ12 µ13

µ21 µ22 µ23

.

For general q and n, we may write this in a streamlined fashion. If we let jp denote a column vector of

1’s of length p, then (try it!) choosing

C =(

jq−1 −Iq−1

)(q − 1× q), U =

j′n−1

−In−1

(n× n− 1) (6.7)

gives the null hypothesis of parallelism.

MULTIVARIATE TEST FOR PARALLELISM: Recall that the univariate test of this null hypothesis

discussed in Chapter 5 was predicated on the assumption of compound symmetry. Here, we seek a

test in the same spirit of those in the last section that make no assumption about the form of Σ.

PAGE 184

Page 194: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 6 ST 732, M. DAVIDIAN

To understand this, we first consider the multivariate test of (6.3). Recall in the MANOVA table of the

last section that this test boiled down to making a comparison between 2 SS&CP matrices, QH and

QE that focused on the particular issue of the hypothesis.

• QE effectively measured the distance of individual data vectors from the means for their group.

• QH measured the distance of group mean vectors from the overall mean vector.

• We would expect QH to be “large” relative to QE if there really were a difference among the q

means µ`, ` = 1 . . . , q.

We would clearly like to do something similar for the null hypothesis of parallelism.

HEURISTIC DESCRIPTION: It turns out that for the test of (6.3), H0 : µ1 = . . . = µq, which may be

expressed in the form H0 : CMU = 0 with C as in (6.6) and U = In, we may express QH and QE in

an alternative form as functions of C, M , and U (= In here). Specifically, recall that we may express

the underlying statistical model as in (6.1), i.e.

Y ′i = a′

iM + ε′i, i = 1, . . . , m.

We saw in Chapter 5 that this may be written more succinctly as (5.14), i.e.

Y = AM + ε,

where Y is the (m × n) matrix with rows Y ′i and similarly for ε, and A (m × q) has rows a′

i. It is an

exercise in matrix algebra to show that we may write QH and QE in terms of this model as

QH = (CMU)′{C(A′A)−1C ′}−1(CMU) (6.8)

QE = U ′Y ′{In −A(A′A)−1A′}YU (6.9)

with

M = (A′A)−1A′Y , U = In.

A technical justification of (6.8) and (6.9) may be found in, for example, Vonesh and Chinchilli (1997, p.

50); they show that this representation and the form of the Wilks’ lambda statistic TW may be derived

using the principles of maximum likelihood, which we will discuss later in the course in a different

context.

PAGE 185

Page 195: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 6 ST 732, M. DAVIDIAN

The above results are in fact valid for any suitable choice of C and U , such as those corresponding to

the null hypothesis of parallelism.

• That is, for a null hypothesis of the form H0 : CMU = 0, one may construct corresponding

SS&CP matrices QH and QE . These are often called the hypothesis and error SS&CP matrices,

respectively.

• One may then construct any of the test statistics such as Wilks’ lambda TW discussed in the last

section. It may be shown that these will provide either approximate or exact tests, depending on

the circumstances, for the null hypothesis corresponding to the choice of C and U .

• These test are multivariate in the sense that no assumption of a particular structure for Σ is

made.

PROFILE ANALYSIS: In the particular context of repeated measurement data, where the n observa-

tions in a data vector are all on the same characteristic, conducting appropriate multivariate tests

for parallelism and other issues of interest is known as profile analysis. This is usually carried out in

practice as follows.

• The test of primary interest is that of parallelism or Group by Time interaction. This may be

represented in the form H0 : CMU = 0 with C and U as in(6.7), so that suitable QH and QE

may be calculated. Thus, test statistics such as Wilks’ lambda, Pillai’s trace, and so on may be

used to conduct the test. Depending on the dimensions q and n, these tests may be exact or

approximate and may or may not coincide.

• The next test is usually only conducted if the hypothesis of parallelism is not rejected.

The test of H0 : µ1 = · · · = µq may be written in the form H0 : CMU = 0 with C as in

(6.7) U = In. This is just the usual MANOVA test discussed in the last section; when repeated

measurements are involved, this test is often called the test for coincidence. Clearly, if the

profiles are not parallel, then testing coincidence seems ill-advised, as it is not clear what it

means.

PAGE 186

Page 196: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 6 ST 732, M. DAVIDIAN

As we discussed in Chapter 5, if the profiles are parallel, then it turns out that we may refine

this test. Specifically, it may be shown that testing this H0 with the additional assumption that

the profiles are parallel is equivalent to testing the hypothesis H0 : CMU = 0 with C as in (6.7)

but with U = jn/n. Note that this is exactly the same hypothesis we discussed in Chapter 5 – if

the profiles are parallel, then testing whether they in fact coincide is the same as testing whether

the averages of the means over time is the same for each group; that is, the test we called main

effect of group.

It turns out that, for testing this hypothesis, the multivariate tests are all equivalent. Fur-

thermore, they reduce to the univariate F test for the main effect of groups we discussed in

Chapter 5! Intuitively, this makes sense – we are basing the test on averaging observations over

time, thus effectively “distilling” the data for each unit down to a single average. The “distilling”

operation averages across time, so how observations within a data vector are correlated is being

“averaged away.” As long as Σ is the same for all data vectors, these “distilled” data are all have

the same variance, so we would expect an ordinary F ratio to apply.

• This test is also usually conducted only if the hypothesis of parallelism is not rejected.

It is also of interest to know whether the profiles are in fact constant over time. It may be shown

(try it!) that this may be represented in the form H0 : CMU = 0 with U as in (6.7) and C = Iq.

As with the test for coincidence, if the profiles are not parallel, then testing whether they are

constant over time seems inappropriate.

If there is strong evidence of parallelism, then we may refine this test also. It may be shown

that testing H0 for constancy with the additional assumption that the profiles are parallel is

equivalent to testing H0 : CMU = 0 with the choices U as in (6.7) and C = j′q/q, a (1 × q)

vector of 1/q’s. Note (try it) that this is the exactly the same hypothesis discussed for the main

effect of time discussed in Chapter 5 – if we know the profiles are parallel, then asking whether

the means are constant over time is the same as asking whether the mean response averaged

across groups is the same at each time.

It turns out that, for testing this hypothesis, the multivariate tests are again all equivalent.

However, the multivariate test is different from the univariate tests. Intuitively, this also

makes sense – we are basing the test on averaging observations across groups. Thus, although

we are again “distilling” the data, we are now doing it over groups, so that time, and how

observations are correlated over time, is not being “averaged away.” As a result, what is being

assumed about the form of Σ still plays a role.

PAGE 187

Page 197: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 6 ST 732, M. DAVIDIAN

The (common) multivariate test statistic boils down to a statistic that is a generalization of

the form of the Hotelling’s T 2 statistic, and it may be shown that this statistic multiplied by a

suitable factor thus has exactly an F distribution. It is important to recognize that, although

both the univariate and multivariate test statistics both have F sampling distributions, they

are different tests, being based on different assumptions on the form of Σ. Which one is more

appropriate depends on the true form of Σ.

6.6 Implementation with SAS

We consider again the two examples of Chapter 5:

1. The dental study data. Here, q = 2 and n = 4, with the “time” factor being the age of the children

and equally-spaced “time” points at 8, 10, 12, and 14 years of age.

2. the guinea pig diet data. Here, q = 3 and n = 6, with the “time” factor being weeks and

unequally-spaced “time” points at 1, 3, 4, 5, 6, and 7 weeks.

In each case, we use SAS PROC GLM and its various options to carry out both the one-way MANOVA

analysis comparing the group mean vectors and the refined hypotheses of profile analysis. These

examples thus serve to illustrate how this SAS procedure may be used to conduct multivariate repeated

measures analysis of variance.

EXAMPLE 1 – DENTAL STUDY DATA: The data are read in from the file dental.dat.

PROGRAM:

/*******************************************************************

CHAPTER 6, EXAMPLE 1

Analysis of the dental study data by multivariate repeatedmeasures analysis of variance using PROC GLM

- the repeated measurement factor is age (time)

- there is one "treatment" factor, gender

*******************************************************************/

options ls=80 ps=59 nodate; run;

/******************************************************************

See Example 1 in Chapter 4 for the form of the input data set.It is not in the correct from for the analysis; thus we createa new data set such that each record in the data set representsthe observations from a different unit.

*******************************************************************/

data dent1; infile ’dental.dat’;input obsno child age distance gender;

run;

PAGE 188

Page 198: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 6 ST 732, M. DAVIDIAN

data dent1; set dent1;if age=8 then age=1;if age=10 then age=2;if age=12 then age=3;if age=14 then age=4;drop obsno;

run;

proc sort data=dent1;by gender child;

data dent2(keep=age1-age4 gender);array aa{4} age1-age4;do age=1 to 4;set dent1;by gender child;aa{age}=distance;if last.child then return;

end;run;

/*******************************************************************

The sample mean vectors for each gender were found in Example 1of Chapter 4. Here, we use PROC CORR to calculate the estimatesof Sigma, the assumed common covariance matrix, separately foreach group. The COV option asks for the covariance matrixto be printed.

*******************************************************************/

proc sort data=dent2; by gender; run;proc corr data=dent2 cov; by gender; var age1 age2 age3 age4; run;

/*******************************************************************

Use PROC GLM to carry out the multivariate analysis.

First, call PROC GLM and use the MANOVA statement to get theMANOVA test of equality of gender means. Here, this isequivalent to Hotelling’s T^2 test because there are 2 groups.

The PRINTH and PRINTE options print the SS&CP matricesQ_H and Q_E corresponding to the null hypothesis of equal means.

The option NOUNI suppresses individual analyses of variancefor the data at each age value from being printed. Withoutthe NOUNI option in the MODEL statement, note that PROC GLM doesa separate univariate ANOVA on the data at each age separately.

*******************************************************************/

proc glm data=dent2;class gender;model age1 age2 age3 age4 = gender;manova h=gender / printh printe;

/*******************************************************************

Now use the REPEATED option to do profile analysis. The"between subjects" (units) test is that for coincidence assumingprofiles are parallel, based on averaging across times.Thus, as discussed in section 5.5, it is the same as theunivariate test.

The tests for age and age*gender resulting from this analysisare the multivariate tests for profile constancy and parallelism,respectively. The test for constancy (age effect here) is themultivariate test for constancy assuming that the profiles areparallel, as discussed in section 5.5 Both of these tests aredifferent from the corresponding univariate tests we saw insection 4.8 that are based on the assumption of compound symmetry.

The NOU option in the REPEATED statement suppresses printing of theunivariate tests of these factors.

The within-unit analyses using different contrast matrices willbe the same as in the univariate case (see the discussion insection 4.6. Thus, we do not do this analysis here.

*******************************************************************/

proc glm data=dent2;class gender;model age1 age2 age3 age4 = gender / nouni;repeated age / nou;

PAGE 189

Page 199: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 6 ST 732, M. DAVIDIAN

OUTPUT:

1

----------------------------------- gender=0 -----------------------------------

The CORR Procedure

4 Variables: age1 age2 age3 age4

Covariance Matrix, DF = 10

age1 age2 age3 age4

age1 4.513636364 3.354545455 4.331818182 4.356818182age2 3.354545455 3.618181818 4.027272727 4.077272727age3 4.331818182 4.027272727 5.590909091 5.465909091age4 4.356818182 4.077272727 5.465909091 5.940909091

Simple Statistics

Variable N Mean Std Dev Sum Minimum Maximum

age1 11 21.18182 2.12453 233.00000 16.50000 24.50000age2 11 22.22727 1.90215 244.50000 19.00000 25.00000age3 11 23.09091 2.36451 254.00000 19.00000 28.00000age4 11 24.09091 2.43740 265.00000 19.50000 28.00000

Pearson Correlation Coefficients, N = 11Prob > |r| under H0: Rho=0

age1 age2 age3 age4

age1 1.00000 0.83009 0.86231 0.841360.0016 0.0006 0.0012

age2 0.83009 1.00000 0.89542 0.879420.0016 0.0002 0.0004

age3 0.86231 0.89542 1.00000 0.948410.0006 0.0002 <.0001

age4 0.84136 0.87942 0.94841 1.000000.0012 0.0004 <.0001

2

----------------------------------- gender=1 -----------------------------------

The CORR Procedure

4 Variables: age1 age2 age3 age4

Covariance Matrix, DF = 15

age1 age2 age3 age4

age1 6.016666667 2.291666667 3.629166667 1.612500000age2 2.291666667 4.562500000 2.193750000 2.810416667age3 3.629166667 2.193750000 7.032291667 3.240625000age4 1.612500000 2.810416667 3.240625000 4.348958333

Simple Statistics

Variable N Mean Std Dev Sum Minimum Maximum

age1 16 22.87500 2.45289 366.00000 17.00000 27.50000age2 16 23.81250 2.13600 381.00000 20.50000 28.00000age3 16 25.71875 2.65185 411.50000 22.50000 31.00000age4 16 27.46875 2.08542 439.50000 25.00000 31.50000

Pearson Correlation Coefficients, N = 16Prob > |r| under H0: Rho=0

age1 age2 age3 age4

age1 1.00000 0.43739 0.55793 0.315230.0902 0.0247 0.2343

age2 0.43739 1.00000 0.38729 0.630920.0902 0.1383 0.0088

age3 0.55793 0.38729 1.00000 0.58599

PAGE 190

Page 200: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 6 ST 732, M. DAVIDIAN

0.0247 0.1383 0.0171

age4 0.31523 0.63092 0.58599 1.000000.2343 0.0088 0.0171

3

The GLM Procedure

Class Level Information

Class Levels Values

gender 2 0 1

Number of observations 27

4

The GLM Procedure

Dependent Variable: age1

Sum ofSource DF Squares Mean Square F Value Pr > F

Model 1 18.6877104 18.6877104 3.45 0.0750

Error 25 135.3863636 5.4154545

Corrected Total 26 154.0740741

R-Square Coeff Var Root MSE age1 Mean

0.121290 10.48949 2.327113 22.18519

Source DF Type I SS Mean Square F Value Pr > F

gender 1 18.68771044 18.68771044 3.45 0.0750

Source DF Type III SS Mean Square F Value Pr > F

gender 1 18.68771044 18.68771044 3.45 0.0750

5

The GLM Procedure

Dependent Variable: age2

Sum ofSource DF Squares Mean Square F Value Pr > F

Model 1 16.3806818 16.3806818 3.91 0.0590

Error 25 104.6193182 4.1847727

Corrected Total 26 121.0000000

R-Square Coeff Var Root MSE age2 Mean

0.135378 8.830238 2.045672 23.16667

Source DF Type I SS Mean Square F Value Pr > F

gender 1 16.38068182 16.38068182 3.91 0.0590

Source DF Type III SS Mean Square F Value Pr > F

gender 1 16.38068182 16.38068182 3.91 0.0590

6

The GLM Procedure

Dependent Variable: age3

Sum ofSource DF Squares Mean Square F Value Pr > F

Model 1 45.0139415 45.0139415 6.97 0.0141

Error 25 161.3934659 6.4557386

PAGE 191

Page 201: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 6 ST 732, M. DAVIDIAN

Corrected Total 26 206.4074074

R-Square Coeff Var Root MSE age3 Mean

0.218083 10.30834 2.540815 24.64815

Source DF Type I SS Mean Square F Value Pr > F

gender 1 45.01394150 45.01394150 6.97 0.0141

Source DF Type III SS Mean Square F Value Pr > F

gender 1 45.01394150 45.01394150 6.97 0.0141

7

The GLM Procedure

Dependent Variable: age4

Sum ofSource DF Squares Mean Square F Value Pr > F

Model 1 74.3750526 74.3750526 14.92 0.0007

Error 25 124.6434659 4.9857386

Corrected Total 26 199.0185185

R-Square Coeff Var Root MSE age4 Mean

0.373709 8.557512 2.232877 26.09259

Source DF Type I SS Mean Square F Value Pr > F

gender 1 74.37505261 74.37505261 14.92 0.0007

Source DF Type III SS Mean Square F Value Pr > F

gender 1 74.37505261 74.37505261 14.92 0.0007

8

The GLM ProcedureMultivariate Analysis of Variance

E = Error SSCP Matrix

age1 age2 age3 age4

age1 135.38636364 67.920454545 97.755681818 67.755681818age2 67.920454545 104.61931818 73.178977273 82.928977273age3 97.755681818 73.178977273 161.39346591 103.26846591age4 67.755681818 82.928977273 103.26846591 124.64346591

Partial Correlation Coefficients from the Error SSCP Matrix / Prob > |r|

DF = 25 age1 age2 age3 age4

age1 1.000000 0.570699 0.661320 0.5215830.0023 0.0002 0.0063

age2 0.570699 1.000000 0.563167 0.7262160.0023 0.0027 <.0001

age3 0.661320 0.563167 1.000000 0.7280980.0002 0.0027 <.0001

age4 0.521583 0.726216 0.728098 1.0000000.0063 <.0001 <.0001

9

The GLM ProcedureMultivariate Analysis of Variance

H = Type III SSCP Matrix for gender

age1 age2 age3 age4

age1 18.687710438 17.496212121 29.003577441 37.281355219age2 17.496212121 16.380681818 27.154356061 34.904356061

PAGE 192

Page 202: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 6 ST 732, M. DAVIDIAN

age3 29.003577441 27.154356061 45.013941498 57.861163721age4 37.281355219 34.904356061 57.861163721 74.375052609

Characteristic Roots and Vectors of: E Inverse * H, whereH = Type III SSCP Matrix for gender

E = Error SSCP Matrix

Characteristic Characteristic Vector V’EV=1Root Percent age1 age2 age3 age4

0.66030051 100.00 0.01032388 -0.04593889 -0.01003125 0.118411260.00000000 0.00 -0.07039943 0.13377597 0.00249339 -0.029432570.00000000 0.00 -0.08397385 -0.01167207 0.12114416 -0.046675290.00000000 0.00 0.05246789 0.05239507 0.05062221 -0.09027154

MANOVA Test Criteria and Exact F Statistics forthe Hypothesis of No Overall gender Effect

H = Type III SSCP Matrix for genderE = Error SSCP Matrix

S=1 M=1 N=10

Statistic Value F Value Num DF Den DF Pr > F

Wilks’ Lambda 0.60230061 3.63 4 22 0.0203Pillai’s Trace 0.39769939 3.63 4 22 0.0203Hotelling-Lawley Trace 0.66030051 3.63 4 22 0.0203Roy’s Greatest Root 0.66030051 3.63 4 22 0.0203

10

The GLM Procedure

Class Level Information

Class Levels Values

gender 2 0 1

Number of observations 27

11

The GLM ProcedureRepeated Measures Analysis of Variance

Repeated Measures Level Information

Dependent Variable age1 age2 age3 age4

Level of age 1 2 3 4

Manova Test Criteria and Exact F Statistics for the Hypothesis of no age EffectH = Type III SSCP Matrix for age

E = Error SSCP Matrix

S=1 M=0.5 N=10.5

Statistic Value F Value Num DF Den DF Pr > F

Wilks’ Lambda 0.19479424 31.69 3 23 <.0001Pillai’s Trace 0.80520576 31.69 3 23 <.0001Hotelling-Lawley Trace 4.13362211 31.69 3 23 <.0001Roy’s Greatest Root 4.13362211 31.69 3 23 <.0001

Manova Test Criteria and Exact F Statisticsfor the Hypothesis of no age*gender EffectH = Type III SSCP Matrix for age*gender

E = Error SSCP Matrix

S=1 M=0.5 N=10.5

Statistic Value F Value Num DF Den DF Pr > F

Wilks’ Lambda 0.73988739 2.70 3 23 0.0696Pillai’s Trace 0.26011261 2.70 3 23 0.0696Hotelling-Lawley Trace 0.35155702 2.70 3 23 0.0696Roy’s Greatest Root 0.35155702 2.70 3 23 0.0696

12

The GLM ProcedureRepeated Measures Analysis of Variance

Tests of Hypotheses for Between Subjects Effects

PAGE 193

Page 203: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 6 ST 732, M. DAVIDIAN

Source DF Type III SS Mean Square F Value Pr > F

gender 1 140.4648569 140.4648569 9.29 0.0054Error 25 377.9147727 15.1165909

EXAMPLE 2 – GUINEA PIG DIET DATA: The data are read in from the file diet.dat.

PROGRAM:

/*******************************************************************

CHAPTER 6, EXAMPLE 2

Analysis of the vitamin E data by multivariate repeatedmeasures analysis of variance using PROC GLM

- the repeated measurement factor is week (time)

- there is one "treatment" factor, dose

*******************************************************************/

options ls=80 ps=59 nodate; run;

/******************************************************************

The data set is shown in Example 2 of Chapter 5. It isalready in the form required for PROC GLM to perform themultivariate analysis; that is, each line in the data setcontains all the data for a given unit. Thus,we need only input the data as is and do not need to createa new data set.

*******************************************************************/

data pigs1; infile ’diet.dat’;input pig week1 week3 week4 week5 week6 week7 dose;

/*******************************************************************

We use PROC CORR to calculate the estimates of Sigma, the assumedcommon covariance matrix, separately for each dose group. The COVoption asks for the covariance matrix to be printed.

*******************************************************************/

proc sort data=pigs1; by dose; run;proc corr data=pigs1 cov; by dose;var week1 week3 week4 week5 week6 week7; run;

/*******************************************************************

Use PROC GLM to carry out the multivariate analysis and profileanalysis, respectively. The description is exactly the same asfor Example 1 (the dental study). In the first call, we also showuse of the MEANS statement to calculate the means for each dosegroup at each time.

*******************************************************************/

proc glm data=pigs1;class dose;model week1 week3 week4 week5 week6 week7 = dose / nouni;means dose;manova h=dose / printh printe;

run;

proc glm data=pigs1;class dose;model week1 week3 week4 week5 week6 week7 = dose / nouni;repeated week / printe nou;

run;

PAGE 194

Page 204: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 6 ST 732, M. DAVIDIAN

OUTPUT:

1

------------------------------------ dose=1 ------------------------------------

The CORR Procedure

6 Variables: week1 week3 week4 week5 week6 week7

Covariance Matrix, DF = 4

week1 week3 week4

week1 279.800000 158.550000 167.100000week3 158.550000 1651.800000 1606.100000week4 167.100000 1606.100000 1567.200000week5 -34.800000 1625.200000 1592.900000week6 476.950000 1972.950000 2010.900000week7 252.500000 2076.250000 2077.500000

Covariance Matrix, DF = 4

week5 week6 week7

week1 -34.800000 476.950000 252.500000week3 1625.200000 1972.950000 2076.250000week4 1592.900000 2010.900000 2077.500000week5 1835.300000 2081.550000 2251.750000week6 2081.550000 4472.800000 3989.000000week7 2251.750000 3989.000000 3821.500000

Simple Statistics

Variable N Mean Std Dev Sum Minimum Maximum

week1 5 466.40000 16.72722 2332 445.00000 485.00000week3 5 519.40000 40.64234 2597 460.00000 565.00000week4 5 568.80000 39.58788 2844 510.00000 610.00000week5 5 561.60000 42.84040 2808 504.00000 597.00000week6 5 546.60000 66.87900 2733 436.00000 611.00000week7 5 572.00000 61.81828 2860 466.00000 619.00000

Pearson Correlation Coefficients, N = 5Prob > |r| under H0: Rho=0

week1 week3 week4 week5 week6 week7

week1 1.00000 0.23322 0.25234 -0.04856 0.42634 0.244190.7058 0.6822 0.9382 0.4741 0.6922

week3 0.23322 1.00000 0.99823 0.93341 0.72585 0.826390.7058 <.0001 0.0204 0.1650 0.0845

week4 0.25234 0.99823 1.00000 0.93923 0.75952 0.848910.6822 <.0001 0.0178 0.1363 0.0689

2

------------------------------------ dose=1 ------------------------------------

The CORR Procedure

Pearson Correlation Coefficients, N = 5Prob > |r| under H0: Rho=0

week1 week3 week4 week5 week6 week7

week5 -0.04856 0.93341 0.93923 1.00000 0.72651 0.850260.9382 0.0204 0.0178 0.1645 0.0680

week6 0.42634 0.72585 0.75952 0.72651 1.00000 0.964840.4741 0.1650 0.1363 0.1645 0.0079

week7 0.24419 0.82639 0.84891 0.85026 0.96484 1.000000.6922 0.0845 0.0689 0.0680 0.0079

3

------------------------------------ dose=2 ------------------------------------

The CORR Procedure

6 Variables: week1 week3 week4 week5 week6 week7

PAGE 195

Page 205: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 6 ST 732, M. DAVIDIAN

Covariance Matrix, DF = 4

week1 week3 week4

week1 1018.300000 1270.750000 738.900000week3 1270.750000 1755.000000 998.500000week4 738.900000 998.500000 783.700000week5 1450.500000 2182.500000 1654.250000week6 769.750000 1105.000000 1298.000000week7 1232.500000 1978.750000 1430.750000

Covariance Matrix, DF = 4

week5 week6 week7

week1 1450.500000 769.750000 1232.500000week3 2182.500000 1105.000000 1978.750000week4 1654.250000 1298.000000 1430.750000week5 3851.500000 2800.750000 3519.500000week6 2800.750000 2841.500000 2394.000000week7 3519.500000 2394.000000 3312.000000

Simple Statistics

Variable N Mean Std Dev Sum Minimum Maximum

week1 5 494.40000 31.91081 2472 440.00000 520.00000week3 5 551.00000 41.89272 2755 480.00000 590.00000week4 5 574.20000 27.99464 2871 536.00000 610.00000week5 5 567.00000 62.06045 2835 484.00000 637.00000week6 5 603.00000 53.30572 3015 552.00000 671.00000week7 5 644.00000 57.54998 3220 569.00000 702.00000

Pearson Correlation Coefficients, N = 5Prob > |r| under H0: Rho=0

week1 week3 week4 week5 week6 week7

week1 1.00000 0.95057 0.82713 0.73243 0.45252 0.671130.0131 0.0840 0.1593 0.4442 0.2149

week3 0.95057 1.00000 0.85140 0.83946 0.49482 0.820740.0131 0.0672 0.0753 0.3967 0.0886

week4 0.82713 0.85140 1.00000 0.95216 0.86981 0.888060.0840 0.0672 0.0125 0.0553 0.0442

4

------------------------------------ dose=2 ------------------------------------

The CORR Procedure

Pearson Correlation Coefficients, N = 5Prob > |r| under H0: Rho=0

week1 week3 week4 week5 week6 week7

week5 0.73243 0.83946 0.95216 1.00000 0.84661 0.985420.1593 0.0753 0.0125 0.0704 0.0021

week6 0.45252 0.49482 0.86981 0.84661 1.00000 0.780380.4442 0.3967 0.0553 0.0704 0.1194

week7 0.67113 0.82074 0.88806 0.98542 0.78038 1.000000.2149 0.0886 0.0442 0.0021 0.1194

5

------------------------------------ dose=3 ------------------------------------

The CORR Procedure

6 Variables: week1 week3 week4 week5 week6 week7

Covariance Matrix, DF = 4

week1 week3 week4

week1 822.200000 705.400000 298.950000week3 705.400000 885.800000 718.650000week4 298.950000 718.650000 897.200000week5 712.700000 1061.400000 1022.200000week6 930.800000 1180.600000 1013.050000week7 632.050000 953.850000 916.050000

Covariance Matrix, DF = 4

PAGE 196

Page 206: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 6 ST 732, M. DAVIDIAN

week5 week6 week7

week1 712.700000 930.800000 632.050000week3 1061.400000 1180.600000 953.850000week4 1022.200000 1013.050000 916.050000week5 1539.700000 1674.300000 1385.050000week6 1674.300000 1910.200000 1493.450000week7 1385.050000 1493.450000 1251.200000

Simple Statistics

Variable N Mean Std Dev Sum Minimum Maximum

week1 5 497.80000 28.67403 2489 472.00000 545.00000week3 5 534.60000 29.76239 2673 498.00000 565.00000week4 5 579.80000 29.95330 2899 540.00000 622.00000week5 5 571.80000 39.23901 2859 524.00000 622.00000week6 5 588.20000 43.70583 2941 532.00000 633.00000week7 5 623.20000 35.37231 3116 583.00000 670.00000

Pearson Correlation Coefficients, N = 5Prob > |r| under H0: Rho=0

week1 week3 week4 week5 week6 week7

week1 1.00000 0.82657 0.34807 0.63343 0.74273 0.623160.0844 0.5659 0.2513 0.1505 0.2614

week3 0.82657 1.00000 0.80613 0.90885 0.90760 0.906040.0844 0.0994 0.0326 0.0332 0.0341

week4 0.34807 0.80613 1.00000 0.86971 0.77383 0.864590.5659 0.0994 0.0553 0.1246 0.0586

6

------------------------------------ dose=3 ------------------------------------

The CORR Procedure

Pearson Correlation Coefficients, N = 5Prob > |r| under H0: Rho=0

week1 week3 week4 week5 week6 week7

week5 0.63343 0.90885 0.86971 1.00000 0.97628 0.997890.2513 0.0326 0.0553 0.0044 0.0001

week6 0.74273 0.90760 0.77383 0.97628 1.00000 0.966020.1505 0.0332 0.1246 0.0044 0.0075

week7 0.62316 0.90604 0.86459 0.99789 0.96602 1.000000.2614 0.0341 0.0586 0.0001 0.0075

7

The GLM Procedure

Class Level Information

Class Levels Values

dose 3 1 2 3

Number of observations 15

8

The GLM Procedure

Level of ------------week1----------- ------------week3-----------dose N Mean Std Dev Mean Std Dev

1 5 466.400000 16.7272233 519.400000 40.64234252 5 494.400000 31.9108132 551.000000 41.89272013 5 497.800000 28.6740301 534.600000 29.7623924

Level of ------------week4----------- ------------week5-----------dose N Mean Std Dev Mean Std Dev

1 5 568.800000 39.5878769 561.600000 42.84040152 5 574.200000 27.9946423 567.000000 62.06045443 5 579.800000 29.9532970 571.800000 39.2390112

Level of ------------week6----------- ------------week7-----------dose N Mean Std Dev Mean Std Dev

PAGE 197

Page 207: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 6 ST 732, M. DAVIDIAN

1 5 546.600000 66.8789952 572.000000 61.81828212 5 603.000000 53.3057220 644.000000 57.54997833 5 588.200000 43.7058349 623.200000 35.3723056

9

The GLM ProcedureMultivariate Analysis of Variance

E = Error SSCP Matrix

week1 week3 week4

week1 8481.2 8538.8 4819.8week3 8538.8 17170.4 13293week4 4819.8 13293 12992.4week5 8513.6 19476.4 17077.4week6 8710 17034.2 17287.8week7 8468.2 20035.4 17697.2

E = Error SSCP Matrix

week5 week6 week7

week1 8513.6 8710 8468.2week3 19476.4 17034.2 20035.4week4 17077.4 17287.8 17697.2week5 28906 26226.4 28625.2week6 26226.4 36898 31505.8week7 28625.2 31505.8 33538.8

Partial Correlation Coefficients from the Error SSCP Matrix / Prob > |r|

DF = 12 week1 week3 week4 week5 week6 week7

week1 1.000000 0.707584 0.459151 0.543739 0.492366 0.5020980.0068 0.1145 0.0548 0.0874 0.0804

week3 0.707584 1.000000 0.889996 0.874228 0.676753 0.8348990.0068 <.0001 <.0001 0.0111 0.0004

week4 0.459151 0.889996 1.000000 0.881217 0.789575 0.8477860.1145 <.0001 <.0001 0.0013 0.0003

week5 0.543739 0.874228 0.881217 1.000000 0.803051 0.9193500.0548 <.0001 <.0001 0.0009 <.0001

week6 0.492366 0.676753 0.789575 0.803051 1.000000 0.8956030.0874 0.0111 0.0013 0.0009 <.0001

week7 0.502098 0.834899 0.847786 0.919350 0.895603 1.0000000.0804 0.0004 0.0003 <.0001 <.0001

10

The GLM ProcedureMultivariate Analysis of Variance

H = Type III SSCP Matrix for dose

week1 week3 week4

week1 2969.2 2177.2 859.4week3 2177.2 2497.6 410week4 859.4 410 302.53333333week5 813 411.6 280.4week6 4725.2 4428.8 1132.1333333week7 5921.6 5657.6 1392.5333333

H = Type III SSCP Matrix for dose

week5 week6 week7

week1 813 4725.2 5921.6week3 411.6 4428.8 5657.6week4 280.4 1132.1333333 1392.5333333week5 260.4 1096.4 1352week6 1096.4 8550.9333333 10830.933333week7 1352 10830.933333 13730.133333

Characteristic Roots and Vectors of: E Inverse * H, whereH = Type III SSCP Matrix for dose

E = Error SSCP Matrix

Characteristic Characteristic Vector V’EV=1Root Percent week1 week3 week4 week5

week6 week7

PAGE 198

Page 208: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 6 ST 732, M. DAVIDIAN

2.76663572 57.81 0.01008494 -0.00856690 0.00598260 -0.01350074-0.00631967 0.01895546

2.01931265 42.19 0.02377927 -0.04047800 0.03355915 0.00129118-0.01481413 0.01295337

0.00000000 0.00 -0.00022690 -0.00372379 -0.01380715 0.01173179-0.00015021 0.00199588

0.00000000 0.00 -0.00425334 0.00094691 0.00882637 -0.00027390-0.00381939 0.00358891

0.00000000 0.00 -0.00592948 -0.00835257 0.00451460 -0.00286298-0.00450358 0.00937569

0.00000000 0.00 -0.00257775 -0.00142122 0.00128210 -0.000843500.01035699 -0.00651966

11

The GLM ProcedureMultivariate Analysis of Variance

MANOVA Test Criteria and F Approximations forthe Hypothesis of No Overall dose Effect

H = Type III SSCP Matrix for doseE = Error SSCP Matrix

S=2 M=1.5 N=2.5

Statistic Value F Value Num DF Den DF Pr > F

Wilks’ Lambda 0.08793025 2.77 12 14 0.0363Pillai’s Trace 1.40330988 3.14 12 16 0.0176Hotelling-Lawley Trace 4.78594837 2.63 12 8.2712 0.0852Roy’s Greatest Root 2.76663572 3.69 6 8 0.0464

NOTE: F Statistic for Roy’s Greatest Root is an upper bound.NOTE: F Statistic for Wilks’ Lambda is exact.

12

The GLM Procedure

Class Level Information

Class Levels Values

dose 3 1 2 3

Number of observations 15

13

The GLM ProcedureRepeated Measures Analysis of Variance

Repeated Measures Level Information

Dependent Variable week1 week3 week4 week5 week6 week7

Level of week 1 2 3 4 5 6

Partial Correlation Coefficients from the Error SSCP Matrix / Prob > |r|

DF = 12 week1 week3 week4 week5 week6 week7

week1 1.000000 0.707584 0.459151 0.543739 0.492366 0.5020980.0068 0.1145 0.0548 0.0874 0.0804

week3 0.707584 1.000000 0.889996 0.874228 0.676753 0.8348990.0068 <.0001 <.0001 0.0111 0.0004

week4 0.459151 0.889996 1.000000 0.881217 0.789575 0.8477860.1145 <.0001 <.0001 0.0013 0.0003

week5 0.543739 0.874228 0.881217 1.000000 0.803051 0.9193500.0548 <.0001 <.0001 0.0009 <.0001

week6 0.492366 0.676753 0.789575 0.803051 1.000000 0.8956030.0874 0.0111 0.0013 0.0009 <.0001

week7 0.502098 0.834899 0.847786 0.919350 0.895603 1.0000000.0804 0.0004 0.0003 <.0001 <.0001

E = Error SSCP Matrix

week_N represents the contrast between the nth level of week and the last

week_1 week_2 week_3 week_4 week_5

PAGE 199

Page 209: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 6 ST 732, M. DAVIDIAN

week_1 25083.6 13574.0 12193.2 4959.0 2274.8week_2 13574.0 10638.4 9099.2 4354.6 -968.2week_3 12193.2 9099.2 11136.8 4293.8 1623.6week_4 4959.0 4354.6 4293.8 5194.4 -365.8week_5 2274.8 -968.2 1623.6 -365.8 7425.2

14

The GLM ProcedureRepeated Measures Analysis of Variance

Partial Correlation Coefficients from the Error SSCP Matrix of theVariables Defined by the Specified Transformation / Prob > |r|

DF = 12 week_1 week_2 week_3 week_4 week_5

week_1 1.000000 0.830950 0.729529 0.434442 0.1666840.0004 0.0047 0.1380 0.5863

week_2 0.830950 1.000000 0.835959 0.585791 -0.1089360.0004 0.0004 0.0354 0.7231

week_3 0.729529 0.835959 1.000000 0.564539 0.1785440.0047 0.0004 0.0444 0.5595

week_4 0.434442 0.585791 0.564539 1.000000 -0.0589010.1380 0.0354 0.0444 0.8484

week_5 0.166684 -0.108936 0.178544 -0.058901 1.0000000.5863 0.7231 0.5595 0.8484

Sphericity Tests

Mauchly’sVariables DF Criterion Chi-Square Pr > ChiSq

Transformed Variates 14 0.0160527 41.731963 0.0001Orthogonal Components 14 0.0544835 29.389556 0.0093

Manova Test Criteria and Exact F Statistics for the Hypothesis of no week EffectH = Type III SSCP Matrix for week

E = Error SSCP Matrix

S=1 M=1.5 N=3

Statistic Value F Value Num DF Den DF Pr > F

Wilks’ Lambda 0.03881848 39.62 5 8 <.0001Pillai’s Trace 0.96118152 39.62 5 8 <.0001Hotelling-Lawley Trace 24.76092347 39.62 5 8 <.0001Roy’s Greatest Root 24.76092347 39.62 5 8 <.0001

15

The GLM ProcedureRepeated Measures Analysis of Variance

Manova Test Criteria and F Approximationsfor the Hypothesis of no week*dose EffectH = Type III SSCP Matrix for week*dose

E = Error SSCP Matrix

S=2 M=1 N=3

Statistic Value F Value Num DF Den DF Pr > F

Wilks’ Lambda 0.17905151 2.18 10 16 0.0793Pillai’s Trace 1.07058517 2.07 10 18 0.0856Hotelling-Lawley Trace 3.19076786 2.42 10 9.6 0.0937Roy’s Greatest Root 2.66824588 4.80 5 9 0.0205

NOTE: F Statistic for Roy’s Greatest Root is an upper bound.NOTE: F Statistic for Wilks’ Lambda is exact.

16

The GLM ProcedureRepeated Measures Analysis of Variance

Tests of Hypotheses for Between Subjects Effects

Source DF Type III SS Mean Square F Value Pr > F

dose 2 18548.0667 9274.0333 1.06 0.3782Error 12 105434.2000 8786.1833

PAGE 200

Page 210: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 7 ST 732, M. DAVIDIAN

7 Drawbacks and limitations of classical methods

7.1 Introduction

It is worth noting that both the univariate and multivariate “classical” methods we have discussed so

far may be extended to more complicated situations. For example

• The group designations may in fact be the result of a factorial arrangement, e.g. in an

experiment to compare the change over time of body weight of rats, the groups may be defined by

the (2×3) factorial arrangement of genders and drugs. Interest may focus on how the rate of change

in body weight over time differs across genders averaged over drugs and doses averaged across

genders. Interest may also focus on whether the way this change differs across drugs is different

for the two genders (the drug by gender interaction). These are “between-unit” comparisons.

• The “time” factor may in fact be the result of a factorial arrangement, e.g. in an agricultural

study, plots may be randomized to different rates of fertilizer. Then, at each of 4 different time

points, core samples are taken from each plot at 3 different depths, and a measurement of nutrient

content is recorded for each. Here, then, each plot is seen under 4× 3 = 12 different conditions.

We do not discuss these extensions; see, for example, Vonesh and Chinchilli (1997, section 3.3).

The fact that these fancy extensions are possible still does not alter the fact that the “classical” models

and methods have some serious limitations, some of which we have remarked upon in our development

so far. Now that we are familiar with these so-called “classical” methods and the statistical models

underlying them, we are in a position to be more specific about these limitations.

7.2 Assumptions and restrictions of classical methods

Here, we provide a “laundry list” of the assumptions made by classical methods and the restrictions

that they impose. The rest of the course will be devoted to statistical models and associated analysis

methods that seek to address some or all of these restrictions.

PAGE 201

Page 211: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 7 ST 732, M. DAVIDIAN

1. BALANCE. A prominent feature both of the univariate and multivariate classical models and meth-

ods is the requirement that all units be observed at the same n “time” points. That is, not only must

each data vector Y i be of the same length, n, for all units, but each element Yij , j = 1, . . . , n must

have been observed at the same set of times t1, . . . , tn, say.

• In some situations, this may not be much of a restriction. For example, in agricultural or industrial

experimentation where it is possible to have a good deal of control over experimental conditions,

an experiment may be carefully planned and executed. It may thus be perfectly reasonable to

expect that observations expected to be taken at certain times would be available.

• However, even in the best of situations, it is often the case that things may go awry. For example,

suppose that the Yij are are responses on plots planted with different varieties of soybean over the

growing season. At a given time, 3 plants from a plot are sampled, their leaves are harvested, ag-

gregated, and ground up, and the resulting leaf sample is assayed for concentration of a particular

chemical substance. It is an unfortunate fact of life that samples may be misplaced or mistakenly

discarded or that error may be made in conducting the assay, leading to erroneous measurements.

In such circumstances, measurements may thus be unavailable at certain time points for certain

plots, thus destroying the balance necessary for classical models and methods to be applied.

• When the units are humans, this becomes even more of a problem, even if a study is carefully

designed. For example, suppose that a study is conducted to compare several cholesterol-lowering

drugs. Subjects are randomly assigned to take regular doses of one of the drugs and are required

to return at 3 month intervals for 2 years so that a measure of serum cholesterol may be taken from

blood samples drawn at each visit. Thus, if “time” for each subject is measured from the subject’s

entry into the study, the subject should have observations on serum cholesterol at n = 12 times 3,

6, 9, 12, . . . , 21, and 24 months. However, reality may cause this ideal set-up to be compromised.

– Subjects may move away during the course of the study, so that only measurements up to

their last visit before moving are available.

– A subject may be out of town and miss his 9 month visit but come to the clinic at 10.5

months instead.

PAGE 202

Page 212: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 7 ST 732, M. DAVIDIAN

– Blood samples may be mislabelled or dropped in the lab, so that observations on serum

cholesterol for some times for some subjects may be impossible to obtain.

– Errors by technicians in performing the analytic laboratory techniques required to measure

the cholesterol level may render other measurements erroneous or unavailable.

The bottom line is that real life often conspires to make balance an unachievable ideal for many

longitudinal studies. Although some researchers have discussed ways to “adjust” the classical approaches

to handle some types of imbalance, just as with the “adjusted” F tests in univariate analysis, these

“fix-ups” skirt the real issue, which is that a model that requires balance may simply be too restrictive

to represent real life!

2. FORM OF COVARIANCE MATRIX. Both the “classical” univariate and multivariate procedures

we have discussed assume that the covariance matrix of each data vector Y i, i = 1, . . . , m is the same

for all i, regardless of group membership or anything else; we discuss this assumption below. Provided

we believe this assumption is reasonable, and take Σ to be this common (n× n) covariance matrix, we

are still faced with the issue of what we assume about the structure of Σ.

• The univariate methods make the assumption of compound symmetry, which implies a very

specific pattern of correlation among observations taken on the same unit at different times, one

that may be quite unrealistic for longitudinal data. This model says that the correlation among

all observations on a given unit is the same regardless of how near or far apart the observations

are taken in time. Thus, the univariate methods are based on an assumption about the covariance

structure that may be too restrictive if within-unit sources of correlation are not negligible.

• The multivariate methods make no assumption about the structure of Σ. Thus, these methods

do not attempt to take into account at all the way in which observations arise in the longitudinal

setting. There are two acknowledged sources of variation:

– Random (biological) variation among units

– Within-unit variation due to the way in which measurements are taken on a unit (error in

measuring device, correlation due to time separation, etc)

PAGE 203

Page 213: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 7 ST 732, M. DAVIDIAN

The model underlying the multivariate methods does not explicitly recognize these two distinct sources.

Rather, the methods allow for the possibility that the covariance structure could be virtually anything,

thus including as possibilities structures that are unlikely to represent data subject to the two distinct

sources above. Thus, the multivariate methods are based on an assumption about the covariance

structure that is likely too vague.

3. COMMON COVARIANCE MATRIX. Both the univariate and multivariate approaches assume that

the covariance matrix of a data vector is the same for all units, regardless of group or anything else.

(This is akin to making the usual assumption in linear regression or scalar analysis of variance that

variance is the same for all scalar observations.) This is often adopted without much thought; however,

it is quite reasonable to expect that this assumption may be incorrect.

For example, suppose the units are human subjects and the groups are determined by assignment to

either a particular hypertension medication or placebo. A common observation with such data is that

subjects with “high” systolic blood pressure tend to exhibit much more variability in their within-

individual measured pressures than do subjects with “low” systolic blood pressure. That is, in terms

of the conceptual model in Chapter 4, the within-subject “flucutations” for subjects with high blood

pressure tend to be of greater magnitude than those for subjects with low blood pressure. More formally,

var(e1ij is smaller for subjects with low blood pressure than for those with high blood pressure. This

would lead to overall variance of Yij that is smaller for lower values of Yij .

Suppose the drug is quite effective in lowering systolic blood pressure. We would thus expect observa-

tions on subjects in the drug group, particularly toward the end of the study, to be “lower” than those

for the placebo group. In symbols, if Y i is a data vector for a subject in the drug group (1), we might

expect

Y i =

Yi1

...

Yin

, var(Yin) = σ2n(1),

while for a subject in the placebo group (0), we might expect

Y i =

Yi1

...

Yin

, var(Yin) = σ2n(0),

σ2n(1) < σ2

n(0).

PAGE 204

Page 214: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 7 ST 732, M. DAVIDIAN

Under these conditions, assuming that Y i from both groups have the same covariance matrix Σ would

be inappropriate, because we would doubt that the (n, n) element is the same for data vectors from both

groups. A better model would say that there are two different covariance matrices, i.e. var(Y i) = Σ0

is subject i is in the placebo group, and var(Y i) = Σ1 is subject i is in the drug group.

It is possible to modify the classical models and methods to handle this situation. One common approach

is to work on a transformed scale on which one believes variances may be similar; e.g. one may model

the logarithmically transformed data. A problem with this approach is that the results may be difficult

to interpret, as inferences about what happens on the original scale of measurement are of interest.

Alternatively, methods such as Hotelling’s T 2 may be modified to allow a different covariance matrix for

each group. However, this may make statistical power even lower – now, we must estimate a separate

covariance matrix for each group. Later in the course we will see methods that address the issue of lack

of common covariance matrix in more realistic ways.

4. INCORPORATION OF INFORMATION. A characteristic shared both by the univariate and mul-

tivariate classical methods we have discussed is that, because balance is assumed, time itself does not

appear explicitly in the model for the mean of a data vector. Rather, “time” enters the model only

through the specification of separate parameters γj and (τγ)`j . As will become clear when we study

more flexible models, this can pose an obstacle to answering some key questions of interest (see 5. be-

low, too). This problem may be partially addressed by inspecting, for example, orthogonal polynomial

contrasts in time, but a more direct representation of time in the model is much more useful.

In addition, we may wish to incorporate other covariate information. For example, in the cholesterol

study in 1. above, we may believe that a subject’s age at the start of the study may play a role in

how he/she responds to cholesterol-lowering medication. Or we may believe that this response over

time may be affected by a subject’s systolic blood pressure, which may also be changing over time.

Just as ordinary analysis of variance is modified to incorporate covariates by analysis of covariance, one

may wish to do something similar in the case of repeated measurements. Things are more complicated,

however.

• In the first example, the covariate, age at start of study, is something that is time-

independent, or fixed over the time points at which the unit is observed, being measured only

once (at the start of the study). Both univariate and multivariate analyses may be modified to

take account of time-independent covariates; these are discussed in sections 2.6 and 3.4 of Vonesh

and Chinchilli (1997).

PAGE 205

Page 215: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 7 ST 732, M. DAVIDIAN

We do not discuss them here because, as discussed above, they still require balance; moreover, the

way in which the covariates may be included in the model is limited. Models we will discuss later

in the course allow more flexibility to address common questions about the effect of covariates.

• In the second example, the covariate, systolic blood pressure, may be measured at each of

the same time points as the response, and thus is time-dependent, or changing with time.

Incorporation of such covariate information poses difficult conceptual challenges. The models

we have discussed represent the mean response at each time point as a function of information

such as group membership; i.e. possibly different means for each group. If we consider models

that incorporate changing information, important questions arise. For example, does the mean

cholesterol at a particular time only depend on systolic blood pressure at that time? Or does it

depend on systolic blood pressure at several previous times as well?

We will return to this issue later; for now, note that although it is possible to introduce time-

dependent covariates into modeling of repeated measurements, a key issue is this conceptual

one. It is possible to modify the univariate analysis to incorporate time-dependent covariates;

however, modification of the MANOVA analyses is not possible.

Still another issue arises in the inclusion of group information. Recall the guinea pig diet example.

Here, dose groups were labelled “zero,” “low,” and “high.” In the model, the parameters τ` and (τγ)`j

incorporate different groups. Suppose, however, that the actual numerical dose values were available,

say 0, 100, and 500 µg/g. As we discuss in 5. below, it might be useful if the actual dose levels rather

than just classifications were incorporated in the model.

We will discuss other models and methods where inclusion of such covariate information is more direct

and interpretable.

5. QUESTIONS OF INTEREST AND INTERPRETATION. The analysis based on “classical” methods

focuses on hypothesis testing, i.e. general questions of interest are stated in terms of the model and

the quality of the evidence in the data to refute the null hypothesis is assessed. A pronouncement is

then made (we do or don’t reject the null hypothesis).

However, in many situations, this does not really address the objectives of the investigator. For example,

consider the cholesterol study described in 1. above. The investigators may wish to do more than just

claim that the way in which cholesterol changes on average over time on the different drugs is different.

They may actually wish to use the results of their study to make recommendations on how to treat

future patients. Thus, they may wish to make more specialized inferences.

PAGE 206

Page 216: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 7 ST 732, M. DAVIDIAN

• How different is the rate of cholesterol lowering among the drugs? E.g. if they knew that Drug

1 lowered cholesterol at the rate of 5 mm Hg per month and Drug 2 lowered cholesterol at rate

15 mm Hg per month, this information might help them to decide which drug (mild Drug 1 or

aggressive Drug 2) might be more appropriate for a certain patient. Thus, the investigators might

be interested in actually estimating the rate of change in the mean response over time for each

group!

• What would the cholesterol trajectory look like for a new male patient 45 years of age after

8 months on one of the drugs? That is, before treatment, the investigators might wish to be

able to predict what the cholesterol profile might look like over 8 months for a patient with

specific characteristics and what his cholesterol level might be at the end of that time based on

his measurement at time zero. Note that 8 months is not even one of the time points (every 3

months) included in the original study.

Clearly, in order to address such questions, a more flexible model that incorporates time and rate of

change in a more explicit way is needed.

A further illustration is provided by the guinea pig diet example as discussed in 4. above. Suppose the

investigators would like to be able to understand how the rate of change in body weight of the pigs over

time is associated with the actual numerical dose. Does rate of change increase as we change the dose?

By how much per unit change of dose? If the actual dose amount could be incorporated explicitly in

the model, these questions could be addressed.

It should be clear from this brief discussion that the “classical” models and methods have serious

limitations with respect to these important issues. A serious drawback alone is that of the need for

balance. Another is failure of the models to represent explicitly important features like rate of change

with time. We begin our discussion in the next chapter with models and methods that seek to address

these problems..

PAGE 207

Page 217: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 8 ST 732, M. DAVIDIAN

8 General linear models for longitudinal data

8.1 Introduction

We have seen that the classical methods of univariate and multivariate repeated measures analysis

of variance may be thought of as being based on a statistical model for a data vector from the ith

individual, i = 1, . . . , m. So far, we have written this model in different ways. Following convention, we

wrote the model as

Y ′i = a′

iM + ε′i,

where M is the (q × n) matrix

M =

µ11 · · · µ1n

......

...

µq1 · · · µqn

,

and the individual means µ`j are for the `th group at the jth time.

We could equally well write this model as

Y i = µ` + εi

for unit i coming from the `th population, ` = 1, . . . , q. Regardless of how we write the model, we note

that it represents Y i as having two components:

• a systematic component, which describes the mean response over time (depending on group

membership). The individual elements of µ`, µ`j for the `th group at the jth time, are further

represented in terms of an overall mean and deviations as

µ`j = µ + τ` + γj + (τγ)`j

along with constraints∑q

`=1 τ` = 0, etc in order to give a unique representation.

As noted in the last chapter, this representation

(i) Requires that the length of each data vector Y i be the same, n.

(ii) Does not explicitly incorporate the actual times of measurement or other information.

PAGE 208

Page 218: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 8 ST 732, M. DAVIDIAN

• an overall random deviation εi which describes how observations within a data vector vary

about the mean and covary among each other. Both univariate and multivariate ANOVA models

assume that

var(εi) = Σ

is the same (n× n) matrix for all data vectors. Furthermore,

(i) Σ is assumed to have the compound symmetry structure in the univariate model. This

came from the assumption that each element of εi is actually the sum of two random terms,

i.e.

εij = bi + eij ,

where the random effect bi has to do with variation among units and eij has to do with

variation within units.

(ii) Σ is assumed to have no particular structure in the multivariate model.

We also noted in Chapter 5 that this model could be written in an alternative way. Specifically, we

defined β as the column vector containing all of µ, τ`, γj , (τγ)`j stacked and Xi to be a matrix of 0’s

and 1’s with n rows that “picks” off the appropriate elements of β for each element of Y i. We wrote

the model in the alternative form

Y i = Xiβ + εi, (8.1)

where again εi is the “overall deviation” vector with var(εi) = Σ. Note that both the univariate and

multivariate ANOVA models could be written in this way; what would distinguish them would again

be the assumption on Σ. This model, along with the usual constraints, has the flavor of a “regression”

model for the ith unit.

Regardless of how we write the model, it says that, for a unit in group `,

Yij = µ + τ` + γj + (τγ)`j + εij , (8.2)

so that E(Yij) is taken to have this specific form.

As we will now discuss, a representation like (8.1) offers a convenient framework for thinking about

more general model for longitudinal data. In this chapter, we will discuss such a model, writing it in the

form (8.1). We will see that we will be able to address several of the issues raised in the last chapter:

• Alternative definitions of Xi and β will allow for unbalanced data and explicit incorporation of

time and other covariates

PAGE 209

Page 219: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 8 ST 732, M. DAVIDIAN

• Refined consideration of the form of var(εi) will allow more realistic and general assumptions

about covariance, including the possibility of different covariance matrices for different groups.

8.2 Simplest case – one group, balanced data

To fix ideas, we first consider a very simple special case of the longitudinal data situation, focusing

mainly on the issue of allowing the model to contain explicitly information on the times of observation

on each individual. For this purpose, we will continue to assume that the data are balanced.

Formally, consider the following situation:

• Suppose Y i, i = 1, . . . , m are all (n× 1), where the jth element Yij is observed at time tj . Here,

the times t1, . . . , tn are the same for all units.

• Suppose that there is only one group, so that all units are thought to behave similarly. The mean

vector is thus simply (no group subscript necessary)

µ = (µ1, . . . , µn)′.

We observed in the dental study that the sample means for girls and for boys seem to follow an

approximate smooth, straight-line trajectory. Figure 1 illustrates; the figure shows the sample means

at each time (age) and an estimated straight line (to be discussed later) for the data for each group

(gender).

Figure 1: Dental data: Sample means at each time across children compared with straight line fits

age

dist

ance

(m

m)

8 10 12 14

2224

2628

Boys

age

dist

ance

(m

m)

8 10 12 14

2224

2628

Girls

PAGE 210

Page 220: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 8 ST 732, M. DAVIDIAN

The sample means suggest that the true means µj at each time point may very well fall on a straight

line.

This observation suggests that we may be able to refine our view about the means. Rather than

thinking of the mean vector as simply as set of n unrelated means µj , we might think of these means

as satisfying

µj = β0 + β1tj ;

that is, the means fall on the line with intercept β0 and slope β1.

This suggests replacing (8.2) by

Yij = β0 + β1tj + εij . (8.3)

Model (8.3) says that, at the jth time tj , Yij values we might see have mean β0 + β1tj and vary about

it according to the overall deviations εij .

• In contrast to (8.2), this model represents the mean as explicitly depending on the time of

measurement tj . (With just one group, ` and hence τ` would be the same for all units in that

model, and the mean depends on time through γj and (τγ)`j .)

• Instead of requiring n=4 separate parameters µj , j = 1, . . . , n to describe the means at each

time, (8.3) requires only two (the intercept and slope). Thus,if we are willing to believe that the

true means do indeed fall on a straight line, (8.3) is a more parsimonious representation of the

systematic component.

• Under the new model (8.3), we are automatically including the belief that the trajectory of means

should be a straight line. Our best guess (estimate) for this trajectory would be, intuitively,

found by estimating the intercept and slope β0 and β1 (coming up).

• An additional possible advantage would be as follows. If we wanted to use these data to learn

about, for example, mean distance at age 11 years, the straight line provides us with a natural

estimate, while it is not clear what to do with the sample means to get such an estimate (connect

the dots?). How would we assess the quality of such an estimate (e.g. provide a standard error)?

To summarize, if we really believe that the mean trajectory follows a straight line, model (8.3) seems

more appropriate, because it exploits this assumption.

PAGE 211

Page 221: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 8 ST 732, M. DAVIDIAN

MATRIX REPRESENTATION: The model (8.3) may be written in matrix form. With Y i as usual

the (n× 1) data vector, defining

X =

1 t1

1 t2...

...

1 tn

, β =

β0

β1

,

we can write the model as

Y i = Xβ + εi. (8.4)

This has the form of model (8.1). Because all units are seen at the same n times, the matrix X is the

same for all units.

COVARIANCE MATRIX: The above development offers an alternative way to represent mean response.

To complete the model, we need to also make an assumption about the covariance matrix of the random

vector εi. For example, as in the classical models, we could assume that this matrix is the same for all

data vectors, i.e.

var(εi) = Σ,

for some matrix Σ. Momentarily, we will address the issue of specification of Σ more carefully; for now,

as we consider the situation of only a single population, it is natural to take this matrix to be the same

for all units.

MULTIVARIATE NORMALITY: Suppose we further assume that the responses Yij are normally dis-

tributed at each time point, so that the Y i are multivariate normal. Thus, we may summarize the

model as

Y i ∼ Nn(Xβ,Σ),

where X and β are as above.

8.3 General case – several groups, unbalanced data, covariates

The modeling strategy for the mean above may be generalized. We consider several possibilities:

• units from more than one group

• different numbers/times of observations for each unit

• other covariates

PAGE 212

Page 222: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 8 ST 732, M. DAVIDIAN

MORE THAN ONE GROUP: For definiteness, suppose there are q = 2 groups, as in the dental study

example. From Figure 1, the data support a model that says, for each group, the means at each age

fall on a straight line, but perhaps the straight line is different depending on group (gender). This

suggests that if unit i is a girl, we might have

Yij = β0,G + β1,Gtj + εij , (8.5)

where β0,G and β1,G are the intercept and slope, respectively, describing the means at each time for

girls as a function of time. Similarly, if unit i is a boy, we might have

Yij = β0,B + β1,Btj + εij , (8.6)

where β0,B and β1,B are the intercept and slope, possibly different from β0,G and β1,G.

Defining for the ith unit

δi = 0 if unit i is a girl

= 1 if unit i is a boy,

note that we can write (8.5) and (8.6) together as

Yij = (1− δi)β0,G + δiβ0,B + (1− δi)tjβ1,G + δitjβ1,B + εij (8.7)

This may be summarized in matrix form as follows. The full set of intercept and slopes β0,G, β1,G β0,B,

and β1,B characterize the means under these models for both groups. Define the parameter vector

summarizing these:

β =

β0,G

β1,G

β0,B

β1,B

(8.8)

Then define

Xi =

(1− δi) (1− δi)t1 δi δit1

......

......

(1− δi) (1− δi)tn δi δitn

(8.9)

PAGE 213

Page 223: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 8 ST 732, M. DAVIDIAN

It is straightforward to see that this is a slick way of noting that if i is a girl or boy, respectively, we are

defining

Xi =

1 t1 0 0...

......

...

1 tn 0 0

, Xi =

0 0 1 t1...

......

...

0 0 1 tn

,

respectively.

With these definitions, it is a simple matrix exercise to verify that Xiβ yields the (n× 1) vector whose

elements are β0,G + β1,Gtj or β0,B + β1,Btj , depending on whether i is a boy or girl. We may thus write

the model succinctly as

Y i = Xiβ + εi,

where β and Xi are defined in (8.8) and (8.9), respectively.

• Note that the matrix Xi is different depending group membership.

• Note that Xi is not of full rank (a boy does not have information about the mean for girls, and

vice versa).

• Note that β contains all parameters describing the mean trajectory for both groups.

MULTIVARIATE NORMALITY: With the additional assumption of normality, each Y i under this

model is n-variate normal with mean Xiβ, where Xi depends on group membership. With some

additional assumption about the covariance matrix, e.g. var(εi) = Σ for all i, we have

Y i ∼ Nn(Xiβ,Σ).

IMBALANCE: It is possible to be even more general. For definiteness, we consider two examples.

ULTRAFILTRATION DATA FOR LOW FLUX DIALYZERS: These data are given in Vonesh and

Chinchilli (1997, section 6.6). Low flux dialyzers are used to treat patients with end stage renal disease

to remove excess fluid and waste from their blood. In low flux hemodialysis, the ultrafiltration rate

(ml/hr) at which fluid is removed is thought to follow a straight line relationship with the transmembrane

pressure (mmHg) applied across the dialyzer membrane. A study was conducted to compare the average

ultrafiltration rate (the response) of such dialyzers across three dialysis centers where they are used on

patients. A total of m = 41 dialyzers (units) were involved. The experiment involved recording the

ultrafiltration rate at several transmembrane pressures for each dialyzer.

PAGE 214

Page 224: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 8 ST 732, M. DAVIDIAN

Figure 2 shows individual dialyzer profiles for the dialyzers in each center. A notable feature of the

figure is that the 4 pressures (“time” here) at which each dialyzer was observed are not necessarily the

same. Thus, the ith dialyzer has its own set of times tij , j = 1, . . . , n = 4. Hence, we cannot calculate

sample means, because each dialyzer is seen at potentially different pressures. However, if we envision

taking means in each panel of the figure across all time points, it seems reasonable that the means would

very likely fall approximately on a straight line.

Figure 2: Dialyzer profiles (ultrafiltration rate vs. transmembrane pressure) for 41 dialyzers in 3 centers

tranmembrane pressure (mmHg)

ultr

afilt

ratio

n ra

te (

ml/h

r)

100 200 300 400 500

500

1000

1500

2000

Center 1

tranmembrane pressure (mmHg)ul

traf

iltra

tion

rate

(m

l/hr)

100 200 300 400 500

500

1000

1500

2000

••

••

••

Center 2

tranmembrane pressure (mmHg)

ultr

afilt

ratio

n ra

te (

ml/h

r)

100 200 300 400 500

500

1000

1500

2000

••

••

••

••

••

• •

Center 3

With the modeling strategy we have adopted, this does not really pose any additional difficulty. From

the figure, a reasonable model for the ith dialyzer is

Yij = β1 + β2tij + εij , dialyzer i in center 1

Yij = β3 + β4tij + εij , dialyzer i in center 2

Yij = β5 + β6tij + εij , dialyzer i in center 3 (8.10)

Here, β1, β3, β5 are the intercepts and β2, β4, β6 are the slopes for the means (straight lines) for each

center.

PAGE 215

Page 225: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 8 ST 732, M. DAVIDIAN

Defining

β = (β1, β2, . . . , β6)′,

we can define a separate (n × 1) Xi matrix for each unit, based on its group membership and unique

set of times tij ; for example, for unit i from the first center,

Xi =

1 ti1 0 0 0 0...

......

...

1 tin 0 0 0 0

.

We may thus again write the model (8.10) as

Y i = Xiβ + εi,

where Xi is defined appropriately for each unit and β is defined as above.

HIP-REPLACEMENT STUDY: These data are adapted from Crowder and Hand (1990, section 5.2).

30 patients underwent hip-replacement surgery, 13 males and 17 females. Hæmatocrit, the ratio of

volume packed red blood cells relative to volume of whole blood recorded on a percentage basis, was

supposed to be measured for each patient at week 0, before the replacement, and then at weeks 1, 2,

and 3, after the replacement.

The primary interest was to determine whether there are possible differences in mean response following

replacement for men and women. Spaghetti plots of the profiles for each patient are shown in the left-

hand panels of Figure 3. (We will discuss the right-hand panels later.)

PAGE 216

Page 226: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 8 ST 732, M. DAVIDIAN

Figure 3: Hæmatocrit trajectories for hip replacement patients. The left hand panels are individual

profiles by gender; the right hand panels show a fitted quadratic model for the mean superimposed.

weeks

haem

atoc

rit

0.0 0.5 1.0 1.5 2.0 2.5 3.0

2030

4050

• •

••

••

••

••

••

••

• ••

••

• •••

• ••

Males, individual trajectories

weeks

haem

atoc

rit

0.0 0.5 1.0 1.5 2.0 2.5 3.0

2030

4050

• •

••

••

••

••

••

••

• ••

••

• •••

• ••

Males, mean at age = 65.52 superimposed

weeks

haem

atoc

rit

0.0 0.5 1.0 1.5 2.0 2.5 3.0

2030

4050

• •

••

• ••

••

••

••

• ••

••

• • •

••

• • ••

• • •

•• •

Females, individual trajectories

weeks

haem

atoc

rit

0.0 0.5 1.0 1.5 2.0 2.5 3.020

3040

50

• •

••

• ••

••

••

••

• ••

••

• • •

••

• • ••

• • •

•• •

Females, mean at age 66.07 superimposed

It may be seen from the figure that a number of both male and female patients are missing the mea-

surement at week 2; in fact, there is one female missing the pre-replacement measurement and week 2.

The reason for this is not given by Crowder and Hand; however, because it is so systematic, happening

only at this occasion and for about half of the male and half of the female patients, it suggests that

the reason has nothing to do with the patients’ health or recovery from the replacement. Perhaps the

centrifuge used to obtain hæmatocrit values went on the blink that week before all patients’ values

could be obtained! We will assume that the reason for these missing observations has nothing to do

with the thing of primary interest, gender; this seems reasonable in light of the pattern of missingness

for week 2.

Thus, we have a situation where the data vectors Y i are of possibly different lengths for different

units. In particular, we now have that Y i is (ni × 1), where ni is the number of observations on unit i.

Thus, the total number of observations from all units is

N =m∑

i=1

ni.

PAGE 217

Page 227: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 8 ST 732, M. DAVIDIAN

To determine an appropriate parsimonious representation for the mean of a data vector for each group,

we could calculate the sample means at each time point for males and females. We must be a bit careful,

however; because of the missingness, the sample means at different times will be of different quality.

Nonetheless, it seems clear from the figure that a model that says the means fall on a straight line

for either gender would be inappropriate. For almost all patients, the pre-replacement reading is high;

then, following replacement, the hæmatocrit goes down and then slowly rebounds over the next 3 weeks.

This suggests that the relationship of the means with time might look more like a quadratic function

of time. These observations suggest the following model:

Yij = β1 + β2tij + β3t2ij + εij , males

Yij = β4 + β5tij + β6t2ij + εij , females. (8.11)

In (8.11), we have allowed for the possibility that the times for each i are not the same, writing tij . For

this data set, the times that are potentially available for each individual are the same; however, as we

saw in the dialyzer example above, this need not be the case.

To write the model in matrix form, define

β = (β1, . . . , β6)′.

Clearly, the matrix Xi for a given unit will depend on the times of observation for that unit and will

have number of rows ni, each row corresponding to one of the ni elements of Yij . For example, for a

male with ni observations, we have

Xi =

1 ti1 t2i1 0 0 0...

......

......

...

1 tini t2ini0 0 0

.

We may thus summarize the model as

Y i = Xiβ + εi, (ni × 1),

where Xi is the (ni × 6) matrix defined appropriately for individual i.

PAGE 218

Page 228: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 8 ST 732, M. DAVIDIAN

COVARIANCE MATRIX: We have to be a little more careful here. Because now we are dealing with

data vectors Y i of different lengths ni, note that the corresponding covariance matrices must be of

dimension (ni × ni). Thus, it is not possible to assume that the covariance matrix of all data vectors

is identical across i. For now, we will write

var(εi) = Σi

to recognize this issue – the i subscript indicates that, at the very least, the covariance matrix depends

on i through its dimension ni.

For example, suppose we believed that the assumption of compound symmetry was reasonable such

that all observations Yij have the same overall variance σ2, say, and all are equally correlated, no

matter where they are taken in time. Thus, this would be a valid choice even for a situation where the

times are different somehow on different units, either as in the dialyzer example or because of missing

observations. As in Chapter 4, to represent this, we would have a second parameter ρ. For a data vector

of length ni, then, no matter where its ni observations in time were taken, the matrix Σi would be the

(ni × ni) matrix

Σi = σ2

1 ρ · · · ρ

ρ 1 · · · ρ...

.... . .

...

ρ · · · ρ 1

.

No matter what the dimension or the time points, under this assumption, the matrix Σi would depend

on the 2 parameters σ2 and ρ for all i, and depend only on i because of the dimension.

We will discuss covariance matrices more shortly.

MULTIVARIATE NORMALITY: With the assumption of normality, we can thus write the model

succinctly as

Y i ∼ Nni(Xiβ,Σi).

ADDITIONAL COVARIATES: We in fact can write even more general models, which allow for the

possibility that we may wish to incorporate the effect of other covariates. In reality, this does not

represent a further extension of the type of models we have already considered, as group membership

is of course itself a covariate. Recall that we wrote in (8.9) the Xi matrix in terms of a group membership

indicator δi; technically, this is just a covariate like any other. The point we emphasize here is that

there is nothing preventing us from incorporating several covariates into a model for the mean. These

covariates may be indicators of other things or continuous.

PAGE 219

Page 229: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 8 ST 732, M. DAVIDIAN

HIP REPLACEMENT, CONTINUED: In the hip replacement study, the age of each participant was

also recorded, and in fact an objective of the investigators was not only to understand differences in

hæmatocrit response across genders but also to elucidate whether the age of the patient has an effect

on response. It turns out that the sample mean age for males was 65.52 years and that for females was

66.07 years. From Figure 3, the patterns look pretty similar for both genders; of course, there is no

easy way of discerning from the plot whether age affects the response.

To illustrate inclusion of the age covariate, consider the following modified model, where ai is the age

of the ith patient:

Yij = β1 + β2tij + β3t2ij + β7ai + εij , males

Yij = β4 + β5tij + β6t2ij + β7ai + εij , females. (8.12)

Model (8.12) says that, regardless of whether a person is male or female, the mean hæmatocrit response

at any time increases by β7 for every year increase in age (keep in mind that β7 could be negative).

One can envision fancier models where this also depends on gender. It is straightforward to write this

in matrix notation as before; with

β = (β1, . . . , β7)′,

we can define appropriate Xi matrices, i.e. for a male of age ai

Xi =

1 ti1 t2i1 0 0 0 ai

......

......

......

1 tini t2ini0 0 0 ai

.

PARAMETERIZATION: It is possible to represent models like those above in different ways. For

definiteness, consider the dialyzer example. We wrote the model in (8.10) as

Yij = β1 + β2tij + εij , dialyzer i in center 1

Yij = β3 + β4tij + εij , dialyzer i in center 2

Yij = β5 + β6tij + εij , dialyzer i in center 3

It is sometimes more convenient, although entirely equivalent, to write the model in an alternative

parameterization. As we have discussed, a question of interest is often to compare the rate of change

of the mean response over time (pressure here) among groups. In this situation, we would like to

compare the three slopes β2, β4, and β6.

PAGE 220

Page 230: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 8 ST 732, M. DAVIDIAN

Define

δi1 = 1 unit i from center 1; = 0 o.w.

δi2 = 1 unit i from center 2; = 0 o.w.

Then write the model as

Yij = β1 + β2δi1 + β3δi2 + β4tij + β5δi1tij + β6δi2tij + εij (8.13)

There are still 6 parameters overall, but the ones in (8.13) have an entirely different interpretation

from those in the first model.

It is straightforward to observe by simply plugging in the values of δi1 and δi2 for each center that the

following is true:

Center Intercept Slope

1 β1 + β2 β4 + β5

2 β1 + β3 β4 + β6

3 β1 β4

Note that β2 and β3 have the interpretation of the difference in intercept between Centers 1 and 3

and Centers 2 and 3, respectively, and β1 is the intercept for Center 3. Similarly, β5 and β6 have the

interpretation of the difference in slope between Centers 1 and 3 and Centers 2 and 3, respectively, and

β1 is the slope for Center 3. This parameterization allows us to estimate, as we will talk about shortly,

the differences of interest directly. This same type of parameterization is used in ordinary linear

regression for similar reasons.

This type of parameterization is the default used by SAS PROC GLM and PROC MIXED, which we will use

to implement the analyses we will discuss shortly. The different parameterizations yield equivalent

models; the only thing that differs is the interpretation of the parameters.

PAGE 221

Page 231: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 8 ST 732, M. DAVIDIAN

8.4 Models for covariance

In the last section, we noted in gory detail how one may model the mean of each element of a data vector

in very flexible and general ways. We did not say much about the assumption on covariance matrix,

except to note that, when the data are unbalanced with possibly different numbers of observations for

each i, it is not possible to think in terms of an assumption where the covariance matrix is strictly

identical for all i, at least in terms of its dimension.

We have noted previously that the classical methods make assumptions about the covariance matrix in

the balanced case that are either too restrictive or too vague. For the approach we are taking in

this chapter, in contrast to the “classical” models and methods, as we will soon see, there is nothing

really stopping us from making other assumptions about the covariance matrix in the sense that we

will be able to estimate parameters of interest, obtain (approximate) sampling distributions for the

estimators, and carry out tests of hypotheses regardless of the assumption we make.

In Chapter 4 we reviewed a number of covariance structures. Here, we consider using these as possible

models for var(εi) = Σi. We will be using SAS PROC MIXED to fit the models in this chapter using

the method of maximum likelihood to be discussed in section 8.5. Thus, it is useful to recall these

structures and note how they are accessed in PROC MIXED.

Note that by modeling var(εi) directly, we do not explicitly distinguish between among-unit and

within-unit sources of variation. In this strategy, we just consider models for the aggregate of

all sources. In the next two chapters, we will discuss a refined version of our regression model for

longitudinal data that explictly acknowledges these sources.

BALANCED CASE: It is easiest to discuss first the case of balanced data. Suppose we have a model

Y i = Xiβ + εi, (n× 1).

Under these conditions, we may certainly consider the same assumptions of covariance matrix as in the

classical case. That is, assume that the covariance matrix var(εi) is the same for all i and equal to Σ,

where Σ has the form of

• Compound symmetry. SAS PROC MIXED uses the designation type = cs to refer to this as-

sumption.

• Completely unstructured. SAS PROC MIXED uses the designation type = un to refer to this

assumption.

PAGE 222

Page 232: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 8 ST 732, M. DAVIDIAN

ALTERNATIVE MODELS: We now recall the other models. Actually, there is nothing stopping us

from allowing var(εi) to be different for different groups; e.g., in the dental study, allow different

covariance matrices for each gender. We discuss this further below.

• One-dependent. Recall that it seems reasonable that observations taken more closely together

in time might tend to be “more alike” than those taken farther apart. If the observation times are

spaced so that the time between 2 nonconsecutive observations is fairly long, we might conjecture

that correlation is likely to be the largest among observations that are adjacent in time; that is,

occur at consecutive times. Relative to the magnitude of this correlation, the correlation between

observations separated by two time intervals might for all practical purposes be negligible.

An example of a one-dependent model embodying this assumption is

Σ = var(εi) =

σ2 ρσ2 0 · · · 0

ρσ2 σ2 ρσ2 · · · 0...

......

......

0 0 · · · ρσ2 σ2

.

This model would make sense even if the times are not equally-spaced in time (as they are, for

example, in the dental study: 8, 10, 12, 14). It is possible to extend this to a two-dependent or

higher dependent model or to heterogeneous variances over time, as discussed in Chapter 4.

SAS PROC MIXED uses the designation type = toep(2) (for “Toeplitz” with 2 diagonal bands) to

refer to this assumption with the same variance at all times.

With groups, we could believe the one-dependent assumption holds for each group, but allow the

possibility that the variance σ2 and correlation ρ are different in each group. The same holds true

for the rest of the models we consider.

• Autoregressive of order 1 (equally-spaced in time). This model says that correlation drops

off as observations get farther apart from each other in time. The following model really only

makes sense if the times of observation are equally-spaced. The so-called AR(1) model with

homogeneous variance over time is

Σ = var(εi) = σ2

1 ρ ρ2 · · · ρn−1

ρ 1 ρ · · · ρn−2

......

......

...

ρn−1 ρn−2 · · · ρ 1

.

SAS PROC MIXED uses the designation type = ar(1) to refer to this assumption.

PAGE 223

Page 233: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 8 ST 732, M. DAVIDIAN

• Markov (unequally spaced in time). The AR(1) model may be generalized to times that are

unequally-spaced. (e.g. 1, 3, 4, 5, 6, 7 as in the guinea pig diet data). The powers of ρ are

taken to be the distances in time between the observations. That is, if

djk = |tij − tik|, j, k = 1, . . . , n,

then the model is

Σ = var(εi) = σ2

1 ρd12 · · · ρd1n

......

......

ρdn1 ρdn2 · · · 1

.

SAS PROC MIXED allows this type of model to be implemented in more than one way, e.g with the

type - sp(pow)(.) designation.

We will consider examples of fitting these structures to several of our examples in section 8.8. The SAS

PROC MIXED documentation, as well as the books by Diggle, Heagerty, Liang, and Zeger (2002) and

Vonesh and Chinchilli (1997), discuss other assumptions.

DECIDING AMONG COVARIANCE STRUCTURES: In the balanced case, one may use the tech-

niques discussed in Chapter 4 to gain informal insight into the structure of var(εi). Inspection of sample

covariance matrices, scatterplot matrices, autocorrelation functions, and lag plots can aid the analyst

in identifying possible reasonable models.

These methods can be modified to take into account the fact that one believes that the mean vectors

follow smooth trajectories over time, such as a straight line. For instance, instead of using the sample

means for “centering” in these approaches, one might estimate β somehow; e.g. by least squares

treating all the individual responses from all units as if they were independent (even though we know

they are probably not). Least squares is clearly not the best way to estimate β (recall our discussion

in Chapter 3); however, this estimator may be “good enough” to provide reasonable estimates of the

means at each time tj that take advantage of our willingness to believe they follow a smooth trajectory,

so might be preferred to using sample means at each j on this account. In particular, if

µj = β0 + β1tj ,

say, for a single group, we would estimate µj by β0 + β1tj and use this in place of the sample mean.

A complete discussion of graphical and other techniques along these lines may be found in Diggle,

Heagerty, Liang, and Zeger (2002).

PAGE 224

Page 234: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 8 ST 732, M. DAVIDIAN

It is also possible to use other methods to deduce which structure might give an appropriate model; we

will see this shortly. Later in the course, we will discuss a popular way of thinking about the problem of

modeling covariance and a popular way of taking into account the possibility that we might be wrong

when adopting a particular covariance model.

UNBALANCED CASE: Suppose first that we are in a situation like that of the hip-replacement data;

i.e., all times of observation are the same for all units; however, some observations are missing on some

units. For definiteness, suppose as in the hip data we have times (t1, t2, t3, t4) = (0, 1, 2, 3), and suppose

we have a unit i for which the observation at time t3 is not available. Thus, the vector Y i for this unit

is of length ni = 3. We could represent this situation notationally two different ways:

(i) For this unit, write Y i = (Yi1, Yi2, Yi3)′ to denote the observations at times (ti1, ti2, ti3)′ = (0, 1, 3)′.

Thus, in this notation, j indexes the number of observations within the unit, regardless of the

actual values of the times. There are 3 times for this unit, so j = 1, 2, 3. This is the standard way

of representing things generically.

(ii) To think more productively about covariance modeling, consider an alternative. Here, let j index

the intended times of observation. This unit is missing time j = 3; thus, represent things as

Y i = (Yi1, Yi2, Yi4)′, at times (t1, t2, t4)′ = (0, 1, 3). (8.14)

Now consider the models discussed above and the alternative notation. Assume we believe that

var(Yij) = σ2 for all j. We thus want a model for

Σi = var(Y i) =

σ2 cov(Yi1, Yi2) cov(Yi1, Yi4)

cov(Yi2, Yi1) σ2 cov(Yi2, Yi4)

cov(Yi4, Yi1) cov(Yi4, Yi2) σ2

.

• The compound symmetry assumption would be represented in the same way regardless of the

missing value; all it says is that observations any distance apart have the same correlation. Thus,

under this assumption, Σi would be the (3× 3) version of this matrix.

• Under an unstructured assumption, this matrix becomes (convince yourself!)

Σi =

σ2

1 σ12 σ14

σ12 σ22 σ24

σ14 σ24 σ24

.

PAGE 225

Page 235: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 8 ST 732, M. DAVIDIAN

• Under the one-dependent model, which says that only observations adjacent in time are corre-

lated, this matrix becomes (convince yourself!)

Σi =

σ2 ρσ2 0

ρσ2 σ2 0

0 0 σ2

.

• Under the AR(1) model, this matrix becomes (convince yourself!)

Σi = σ2

1 ρ ρ3

ρ 1 ρ2

ρ3 ρ2 1

.

These examples illustrate the main point – if all observations were intended to be taken at the same

times, but some are not available, the covariance matrix must be carefully constructed according to the

particular time pattern for each unit, using the convention of the assumed covariance model.

Now consider the situation of the ultrafiltration data. Here, the actual times of observation are different

for each unit. Consider again the above models.

• Here, the unstructured assumptions are difficult to justify. Because each unit was seen at a

different set of times, they cannot share the same covariance parameters, so the matrix Σi must

depend on entirely different quantities for each i.

• The compound symmetry assumption could still be used, as it does not pay attention to the

actual values of the times. Of course, it still suffers from the drawbacks for longitudinal data we

have already noted.

• We might still be willing to adopt something like the one-dependent assumption in the same

spirit as with compound symmetry, saying that observations that are adjacent in time, regardless

of how far apart they might be, are correlated, but those farther are not. However, it is possible

that the distance in time for adjacent observations for one unit might be longer than the distance

for nonconsecutive observations for another unit, making this seem pretty nonsensical!

• The AR(1) assumption is clearly inappropriate by the same type of reasoning.

• The so-called Markov assumption seems more promising in this situation – the correlation among

observations within a unit would depend on the time distances between observations within a

unit.

PAGE 226

Page 236: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 8 ST 732, M. DAVIDIAN

Clearly, with different times for different units, modeling covariance is more challenging! In fact, it is

even hard to investigate the issue informally, because the information from each unit is different. In

the next two chapters of the course, we will talk about another approach to modeling longitudinal data

that obviates the need to think quite so hard about all of this!

INDEPENDENCE ASSUMPTION: An alternative to all of the above, in both cases of balanced and

unbalanced data, is the assumption that observations within a unit are uncorrelated, which, with the

assumption of multivariate normality implies that they are independent. That is, if we believe that

all observations have constant variance var(Yij) = σ2, take

Σi = var(εi) = σ2Ini .

• This assumption seems incredibly unrealistic for longitudinal data. It says that observations on

the same unit are no more alike than those compared across units! In a practical sense, it implies

variation among units must be negligible; otherwise, we would expect observations on the same

individual to be correlated due to this source.

• It also says that there is no correlation induced by within-unit fluctuations over time. This

might be okay if the observations are all taken sufficiently far apart in time from one another,

however, may be unrealistic if they are close in time.

• Occasionally, this model might be sensible, e.g. suppose the units are genetically-engineered mice,

bred specifically to be as alike as possible. Under such conditions, we might expect that the

component of variation due to variation among mice might indeed be so small as to be regarded

as negligible. If furthermore the observations on a given mouse are all far apart in time, then we

would expect no correlation for this reason, either.

• In most situations, however, this assumption represents an obvious model misspecification, i.e.

the model almost certainly does not accurately represent the truth.

• However, sometimes, this assumption is adopted nonetheless, even though the data analyst is

fully aware it is likely to be incorrect. The rationale will be discussed later in the course.

SUMMARY: The important message is that, by thinking about the situation at hand, it is possible to

specify models for covariance that represent the main features in terms of a few parameters. Thus,

just as we model the systematic component in terms of a regression parameter β, we may model

the random component.

PAGE 227

Page 237: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 8 ST 732, M. DAVIDIAN

With models like those above, this is accomplished through a few covariance parameters (sometimes

called variance or covariance components), which are the distinct elements of the covariance matrix

or matrices assumed in the model.

8.5 Inference by maximum likelihood

We have devoted considerable discussion to the idea of modeling longitudinal data directly. However,

we have not tackled the issue of how to address questions of scientific interest within the context of such

a model:

• With a more flexible representation of mean response, we have more latitude for stating such

questions, as we have already mentioned.

• For example, consider the dental study. A question of interest has to do with the rate of change

of distance over time – is it the same for boys and girls? In the context of the classical ANOVA

models discussed earlier, we phrased this question as one of whether or not the mean profiles are

parallel, and expressed this in terms of the (τγ)`j . Of course, in the context of the model given

in (8.5) and (8.6), the assumption of parallelism is still the focus, but it may be stated more

clearly directly in terms of slope parameters, i.e.

H0 : β1,G = β1,B.

• Furthermore, we can do more. Because we have an explicit representation of the notion of “rate of

change” in these slopes, we can also estimate the slopes for each gender and provide an estimate

of the difference! If the evidence in the data is not strong enough to conclude the need for 2

separate slopes, we could estimate a common slope.

• Even more than this is possible. Because we have a representation for the entire trajectory as a

function of time, we can estimate the mean distance at any age for a boy or girl.

To carry out these analyses formally, then, we need to develop a framework for estimation in our model

and a procedure to do hypothesis testing. The standard approach under the assumption of multivariate

normality is to use the method of maximum likelihood.

MAXIMUM LIKELIHOOD: This is a general method, although we state it here specifically for our

model. Maximum likelihood inference is the cornerstone of much of statistical methodology.

PAGE 228

Page 238: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 8 ST 732, M. DAVIDIAN

The basic premise of maximum likelihood is as follows. We would like to estimate the parameters that

characterize our model based on the data we have. One approach would be to use as the estimator a

value that “best explains” the data we saw. To formalize this

• Find the parameter value that maximizes the probability, or “likelihood” that the observations

we might see for a situation like the one of interest would be end up being equal to the data we

saw.

• That is, find the value of the parameter that is best supported by the data we saw.

Recall that we have a general model of the form

Y i ∼ Nni(Xiβ,Σi),

where Σi is a (ni × ni) covariance model depending on some parameters.

• The regression parameter β characterizes the mean. Suppose it has dimension p.

• Denote the parameters that characterize Σi as ω.

• For example, in the AR(1) model, ω = (σ2, ρ).

For us, the data are the collection of data vectors Y i, i = 1, . . . , m, one from each unit. It will prove

convenient to summarize all the data together in a single, long vector of length N (recall N is the total

number of observations∑m

i=1 ni), which “stacks” them on one another:

Y =

Y 1

Y 2

...

Y m

.

INDEPENDENCE ACROSS UNITS: Recall that we have argued that a reasonable assumption is that

the way the data turn out for one unit should be unrelated to how they turn out for another. Formally,

this may be represented as the assumption that the Y i, i = 1, . . . , m are independent.

• This assumption is standard in the context of longitudinal data, and we will adopt it for the rest

of the course.

• Recall that this assumption also underlied the univariate and multivariate classical methods.

PAGE 229

Page 239: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 8 ST 732, M. DAVIDIAN

JOINT DENSITY OF Y : We may represent the probability of seeing data we saw as a function of the

values of the parameters β and ω by appealing to our multivariate normal assumption. Specifically,

recall that if we believe Y i ∼ Nni(Xiβ,Σi), then the probability that this data vector takes on the

particular value yi is represented by the joint density function for the multivariate normal (recall

Chapter 3).

For our model, this is

fi(yi) = (2π)−ni/2|Σi|−1/2 exp{−(yi −Xiβ)′Σ−1i (yi −Xiβ)/2} (8.15)

Because the Y i are independent, the joint density function for Y is the product of the m individual

joint densities (8.15); i.e. letting f(y) be the joint density function for all the data Y (thus representing

probabilities of all the data vectors taking on the values in y together)

f(y) =m∏

i=1

fi(yi) =m∏

i=1

(2π)−ni/2|Σi|−1/2 exp{−(yi −Xiβ)′Σ−1i (yi −Xiβ)/2}. (8.16)

MAXIMUM LIKELIHOOD ESTIMATORS: The method of maximum likelihood for our problem thus

boils down to maximizing f(y) (evaluated at the data values we saw) in the unknown parameters

β and ω. The maximizing values will be functions of y. These functions applied to the random vector

Y yield the so-called maximum likelihood (ML) estimators.

• (8.16) is a complicated function of β and ω. Thus, finding the values that maximize it for a given

set of data is not something that can be done in closed form in general. Rather, fancy numerical

algorithms, the details of which are beyond the scope of this course, are used. These algorithms

form the “guts” of software for this purpose, such as SAS PROC MIXED and others.

SPECIAL CASE – ω KNOWN: We first consider an “ideal” situation unlikely to occur in practice.

Suppose we were lucky enough to know ω; e.g., if the covariance model were AR(1), this means we

know σ2 and ρ. In this case, all the elements of the matrix Σi for all i are known. In this case, it is

possible to show using matrix calculus that the maximizer of f(y) in β, evaluated at Y , is

β =

(m∑

i=1

X ′iΣ

−1i Xi

)−1 m∑i=1

X ′iΣ

−1i Y i. (8.17)

WEIGHTED LEAST SQUARES: Note that this has a similar flavor to the weighted least squares

estimator we discussed in Chapter 3. In fact, the estimator β is usually called weighted least squares

estimator in this context as well!

PAGE 230

Page 240: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 8 ST 732, M. DAVIDIAN

• In fact, it may be shown that maximizing the likelihood (8.16) evaluated at Y is equivalent to

minimizing the sum of quadratic formsm∑

i=1

(Y i −Xiβ)′Σ−1i (Y i −Xiβ). (8.18)

ALTERNATIVE REPRESENTATION: The following alternative representation makes this even more

clear. Define

X =

X1

X2

...

Xm

, (N × p).

With this. definition, and defining ε as the N -vector of εi stacked as in Y , we may write the model

succinctly as (convince yourself)

Y = Xβ + ε.

Note that we thus have E(Y ) = Xβ.

• This way of representing the general model is standard and is used in most texts on longitudinal

data analysis. It is also used in SAS documentation.

Also define the (N ×N) matrix

Σ =

Σ1 0 · · · 0

0 Σ2 · · · 0...

......

...

0 0 · · · Σm

,

the block diagonal matrix with the m (ni × ni) covariance matrices along the “diagonal.”

• It is a matrix exercise to realize that we may thus write the assumption on the covariance matrices

of all m Y i succinctly as (try it)

var(Y ) = Σ.

• It may then be shown that the weighted least squares estimator β may be written (try it!)

β = (X ′Σ−1

X)−1X ′Σ−1

Y .

Compare this to the form for usual regression in Chapter 3.

• It may be shown in this notation that β minimizes the quadratic form (rewrite (8.18)

(Y −Xβ)′Σ−1

(Y −Xβ).

PAGE 231

Page 241: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 8 ST 732, M. DAVIDIAN

INTERPRETATION: In either form, the weighted least squares estimator β has the same interpretation.

Consider (8.17). Note that the contribution of each data vector to β is being weighted in accordance

with its covariance matrix. Data vectors with “more variation” as measured through the covariance

matrix get weighted less, and conversely. The same interpretation may be made from inspection of

the alternative representation. Here, we see how this weighting is occurring across the entire data set;

each part of Y is getting weighted by its covariance matrix, so that the data vector as a whole is being

weighted by the overall covariance matrix Σ.

SAMPLING DISTRIBUTION: By identical arguments as used in Chapter 3, it may thus be shown that

β is unbiased and the sampling distribution of β is multivariate normal, i.e.

E(β) = (X ′Σ−1

X)−1X ′Σ−1

Xβ = β.

var(β) = (X ′Σ−1

X)−1X ′Σ−1

ΣΣ−1

X(X ′Σ−1

X)−1 = (X ′Σ−1

X)−1.

It thus follows that

β ∼ Np{β, (X ′Σ−1

X)−1}.

• This fact could be used to construct standard errors for the elements of β. For example, we could

attach a standard error to the estimate of the slope of the distance-age relationship for boys in

the dental study.

ω UNKNOWN: Of course, the chances that we would actually know ω are pretty remote. The more

relevant case is where both β and ω are unknown. In this situation, we would have to maximize(8.16)

in both to obtain the ML estimators. Unlike the case above, it is not possible to write down nice

expressions for the estimators; rather, their values must be found by numerical algorithms. However, it

is possible to show that the ML estimator for β may be written, in the original notation

β =

(m∑

i=1

X ′iΣ

−1i Xi

)−1 m∑i=1

X ′iΣ

−1i Y i

where Σi is the covariance matrix for Y i with the estimator for ω plugged in.

• It is not possible to write down an expression for the estimator for ω, ω; thus, the expression for

β is really not a closed form expression, either, despite its tidy appearance.

• This estimator is often called the (estimated) generalized least squares estimator for β. The

designation “generalized” emphasizes that Σi is not known and its parameters estimated.

PAGE 232

Page 242: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 8 ST 732, M. DAVIDIAN

LARGE SAMPLE THEORY: It is a standard problem in statistical methodology that estimators for

complicated models often cannot be written down in a nice compact, closed form. There is a further

implication.

• In our problem, note that when ω was known, it was possible to derive the sampling distribu-

tion of β exactly and to show that it is an unbiased estimator for β.

• With ω unknown, the matrices Σi are replaced by Σi in the form of β. The result is that it is no

longer possible to calculate the mean, covariance matrix, or anything else for β exactly; e.g.

E(β) = E

(

m∑i=1

X ′iΣ

−1i Xi

)−1 m∑i=1

X ′iΣ

−1i Y i

.

Because Σi depends on ω, which in turn depends on the data Y i, it is generally the case that it

is not possible to do this calculation in closed form. Similarly, it is no longer necessarily the case

that β has exactly a p-variate normal sampling distribution.

In situations such as these, it is hopeless to try to derive these needed quantities. The best that can be

hoped for is to try to approximate them under some simplifying conditions. The usual simplifying

conditions involve letting the sample size (i.e. number of units m in our case) get large. That is, the

behavior of β is evaluated under the mathematical condition that

m →∞.

• It turns out that, mathematically, under this condition, it is possible to evaluate the sampling

distribution of β and show that β is “unbiased” in a certain sense.

• Such results are not exact. Rather, they are approximations in the following sense. We find

what happens in the “ideal” situation where the sample size grows infinitely large. We then hope

that this will be approximately true if the sample size m is finite. Often, if m is moderately

large, the approximation is very good; however, how “large” is “large” is difficult to determine.

Such arguments are far beyond our scope here, but be aware that all but the most basic statistical

methodology relies on them. We now state the large sample theory results applicable to our problem.

It may be shown that, approximately, for m “large,”

β·∼ Np{β, (XΣ

−1X)−1}. (8.19)

PAGE 233

Page 243: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 8 ST 732, M. DAVIDIAN

That is, the sampling distribution of β may be approximated by a multivariate normal distribution

with mean β and covariance matrix (XΣ−1

X)−1, which may be written in the alternative form(m∑

i=1

X ′iΣ

−1i Xi

)−1

.

• Note that the form of the covariance matrix depends on the true values of the Σi matrices,

which in turn depend on the unknown parameter ω.

• Thus, for practical use, a further approximation is made. The covariance matrix of the sampling

distribution of β is approximated by

V β =

(m∑

i=1

X ′iΣ

−1i Xi

)−1

, (8.20)

where as before Σi denote the matrices Σi with the estimated value for ω plugged in. We will use

the symbol V β in the sequel to refer to this estimator for the covariance matrix of the sampling

distribution of β.

• Standard errors for the components of β are then found in practice by evaluating (8.20) at the

data and taking the square roots of the diagonal elements.

• It is important to recognize that these standard errors and other inferences based on this ap-

proximation are exactly that, approximate! Thus, one should not get too carried away – as we

now discuss, if a test statistic gives borderline evidence of a different for a particular level of

significance α (e.g. = 0.05), it is best to state that the evidence is inconclusive. This is in fact

true even for statistical methods where the sampling distributions are known exactly. In any case,

the data may not really satisfy all assumptions exactly, so it is always best to interpret borderline

evidence with care.

It is also possible to derive an approximate sampling distribution for ω; however, usually, interest

focuses on hypotheses about β and its elements, so this is not often done. Moreover, any inference

on parameters that describe covariance matrices, exact or approximate, is usually quite sensitive to

the assumption of multivariate normality being exactly correct. If it is not, the tests can be quite

misleading. For these reasons, we will focus on inference about β.

QUESTIONS OF INTEREST: Often, questions of interest may be phrased in terms of a linear func-

tion of the elements of β. For example, consider the dental study data.

PAGE 234

Page 244: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 8 ST 732, M. DAVIDIAN

• Suppose we wish to investigate the difference between the slopes β1,G and β1,B for boys and girls

and have parameterized the model explicitly in terms of these values. Then we are interested in

the quantity

β1,G − β1,B.

With β defined as in (8.8),

β =

β0,G

β1,G

β0,B

β1,B

,

we may write this as Lβ, where L = (0, 1, 0,−1) (verify).

• Suppose we want to investigate whether the two lines coincide; that is, both intercepts and slopes

are the same for both genders. We are thus interested in the two contrasts

β0,G − β0,B, β1,G − β1,B

simultaneously. We may state this as Lβ, where L is the (2× 4) matrix

L =

1 0 −1 0

0 1 0 −1

.

• Suppose we are interested in the mean distance for a boy 11 years of age; that is, we are interested

in the quantity

β0,B + β1,Bt0, t0 = 11.

We can write this in the form Lβ by defining

L = (0, 0, 1, t0).

It should be clear that, given knowledge of how a model has been parameterized, one may specify

appropriate matrices L of dimension (r × p) to represent various questions of interest.

ESTIMATION: The natural estimate of a quantity or quantities represented as Lβ is to substitute the

estimator for β; i.e. Lβ.

• For example, in the final example above, we may wish to obtain an estimate of the mean distance

for a boy 11 years of age.

• To accompany the estimate, we would like an estimated standard error. This would also allow us

to construct confidence intervals for the quantity of interest.

PAGE 235

Page 245: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 8 ST 732, M. DAVIDIAN

If we treat the approximate covariance matrix (8.20) and the multivariate normality of β as exactly

correct, then we may apply standard results to obtain the following:

• The approximate covariance matrix of Lβ is given by

var(Lβ) = Lvar(β)L′ = LV βL′.

• Thus, we approximate the sampling distribution of the linear function Lβ as

Lβ·∼ Nr(Lβ, LV βL′). (8.21)

The approximation (8.21) may be used as follows:

• If L is a single row vector (r = 1), as in the case of estimating the mean for 11 year old boys,

then LV βL′ is a scalar, and is thus the estimated sampling variance of Lβ. The square root of

this quantity is thus an estimated standard error for Lβ. Based on the approximate normality, we

might form a confidence interval in the usual way; letting SE(Lβ) be the estimated standard

error, form the interval as

Lβ ± zα/2SE(Lβ)

where zα/2 is the value with with α/2 area to the right under the standard normal probability

density curve. Some people use a t critical value in place of the normal critical value, with degrees

of freedom chosen in various ways. Because of the large sample approximation, it is not clear

which method gives the most accurate intervals for any given problem.

WALD TESTS OF STATISTICAL HYPOTHESES: For a given choice of L, we might be interested in

a test of the issue addressed by L; e.g. testing whether the girl and boy slopes are different.

In general, we may interested in a test of the hypotheses

H0 : Lβ = h vs. H1 : Lβ 6= h,

where h is a specified (r × 1) vector. Most often, h will be equal to 0.

• If r = 1 so that L is a row vector, then the obvious approach (approximate, of course) is to form

the test statistic

z =Lβ − h

SE(Lβ)and compare z to the critical values of the standard normal distribution. (Some people compare

z to the t distribution with degrees of freedom picked in different ways.)

PAGE 236

Page 246: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 8 ST 732, M. DAVIDIAN

• Recall that if Z is a standard normal random variable, then Z2 has a χ2 distribution with one

degree of freedom. Thus, we could conduct the identical test by comparing z2 to the appropriate

χ21 critical value. In fact, we can write z2 equivalently as

(Lβ − h)′(LV βL′)−1(Lβ − h).

• This may be generalized to L of row dimension r, representing simultaneous testing of r separate

contrasts. If L is of full rank (so that none of the contrasts duplicates the others) then

TL = (Lβ − h)′(LV βL′)−1(Lβ − h)

is still a scalar, of course. Because Lβ is approximately normally distributed, it may be argued

that a generic statistic of form TL has approximately a χ2 distribution with r degrees of freedom.

Thus, a test of such hypotheses may be conducted by comparing TL to the appropriate χ2r critical

value: Reject H0 in favor of H1 at level α if TL > χ2r,1−α, where χ2

r,1−α is the value such that the

area under the χ2 distribution to the right is equal to α.

The above methods exploit the multivariate normal approximation (8.19) to the sampling distribution

of β (and hence Lβ). These approaches treat this approximation as exact and then construct familiar

test statistics that would have a χ2 distribution if it were. This is usually referred to in this context as

Wald inference. Unfortunately, Wald inferential methods may have a drawback.

• When the sample size m is not too large, the resulting inferences may not be too reliable. This

is because they rely on a normal approximation to the sampling distribution that may be a lousy

approximation unless m is relatively large.

• Sometimes, the χ2 distribution is replaced with an F distribution to make the test more reliable

in small samples (PROC MIXED implements this).

LIKELIHOOD RATIO TEST: An alternative to Wald approximate methods is that of the likelihood

ratio test. This is also an approximate method, also based on large sample theory (i.e large m);

however, it has been observed that this approach tends to be more reliable when m is not too large

than the Wald approach.

The likelihood ratio test is applicable in the situation in which we wish to test what are often called

“reduced” versus “full” model hypotheses. For example, consider the dental data. Suppose we are

interested in testing whether the slopes for boys and girls are the same, i.e.

H0 : β1,G − β1,B = 0 versus H1 : β1,G − β1,B 6= 0.

PAGE 237

Page 247: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 8 ST 732, M. DAVIDIAN

These hypotheses allow the intercepts to be anything, focusing only on the slopes. If we think of the

alternative hypothesis H1 as specifying the “full” model, i.e. with no restrictions on any of the values

of intercepts or slopes, then the null hypothesis H0 represents a “reduced” model in the sense that it

requires two of the parameters (the slopes) to be the same.

• The “reduced” model is just a special instance of the “full” model. Thus, the “reduced” model

and the null hypothesis are said to be nested within the “full” model and alternative hypothesis.

When hypotheses are nested in this way, so that we may think naturally of a “full” (H1) and “reduced”

(H0) model, a fundamental result of statistical theory is that one may construct an approximate test

of H0 vs. H1 based on the likelihoods for the two nested models under consideration. Suppose the

model for the mean of a data vector Y i under the “full” model is Xiβ. Recall that the likelihood is

Lfull(β, ω) =m∏

i=1

(2π)−ni/2|Σi|−1/2 exp{−(yi −Xiβ)′Σ−1i (yi −Xiβ)/2}.

Under the “reduced” model, the likelihood is the same except that the mean of a data vector is

restricted to have the form specified under H0. For our dental example, the restriction is that the

two slope parameters are the same; thus, thus the regression parameter β for the reduced model

contains one less element than does the full model, and the matrices Xi must be adjusted accordingly;

e.g. if β1 equals the common slope value, then

Yij = β0,G + β1tj + eij for girls,

Yij = β0,B + β1tj + eij for boys.

Let β0 denote the new definition of regression parameter if the restriction of H0 is imposed. Then let

Lred(β0, ω)

denote the likelihood for this reduced model.

Suppose now that we fit each model by the method of maximum likelihood by maximizing the likelihoods

Lfull(β, ω) and Lred(β0, ω),

respectively. For the reduced model, this means estimating β0 and ω corresponding to the reduced

model. Let Lfull and Lred denote the values of the likelihoods with the estimates plugged in:

Lfull = Lfull(β, ω) and Lred = Lred(β0, ω).

PAGE 238

Page 248: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 8 ST 732, M. DAVIDIAN

Then the likelihood ratio statistic is given by

TLRT = −2{log Lred − log Lfull} = −2 log Lred + 2 log Lfull (8.22)

Technical arguments may be used to show that, for m →∞, TLRT has approximately a χ2 distribution

with degrees of freedom equal to the difference in number of parameters in two models (# in full model

− # in reduced model). Thus, if this difference is equal to r, say, then we reject H0 in favor of H1 at

level of significance α if

TLRT > χ2r,1−α.

• The likelihood ratio test is an approximate test, as it is based on using the large sample approx-

imation. Thus, it is unwise to get too excited about “borderline” evidence on the basis of this

test.

• The test is often thought to be more reliable than Wald-type tests when m is not too large.

• It is in fact the case that Wilks’ lambda is the likelihood ratio test statistic for the MANOVA

model.

ALTERNATIVE METHODS FOR MODEL COMPARISON: One drawback of the likelihood ratio test

is that it requires the model under the null hypothesis to be nested within that of the alternative. Other

approaches to comparing models have been proposed that do not require this restriction. These are

based on the notion of comparing penalized versions of the logarithm of the likelihoods obtained under

H0 and H1, where that “penalty” adjusts each log-likelihood according to the number of parameters

that must be fitted. It is a fact that, the more parameters we add to a model, the larger the (log)

likelihood becomes. Thus, if we wish to compare two models with different numbers of parameters

fairly, it seems we must take this fact into account. Then, one compares the “penalized” versions of the

log-likelihoods. Depending on how these “penalized” versions are defined, one prefers the model that

gives either the smaller or larger value.

Let log L denote a log-likelihood for a fitted model. Two such “penalized” versions of the log-likelihood

are

• Akaike’s information criterion (AIC). The penalty is to subtract the number of parameters

fitted for each model. That is, if s is the number of parameters in the model,

AIC = log L− s;

one would prefer the model with the larger AIC value.

PAGE 239

Page 249: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 8 ST 732, M. DAVIDIAN

• Schwarz’s Bayesian information criterion (BIC). The penalty is to subtract the number

of parameters fitted further adjusted for the number of observations. If as before N is the total

number of observations,

BIC = log L− s log N/2.

One would prefer the model with the larger BIC value.

In the current version of SAS PROC MIXED, a negative version of these is used, so that one prefers the

model with the smaller value instead; see Section 8.8.

A full discussion of this approach and the theory underlying these methods is beyond our scope. Com-

parison of AIC and BIC values is often used as follows: one might fit the same mean model with

several different covariance models, and choose the covariance model the seems to “do best” in terms

of giving the “largest” AIC, BIC, and (log) likelihood values overall. Here, s would be the number

of covariance parameters. It is customary to consider the logarithm of the likelihood rather than the

likelihood itself, partly because of the form of the likelihood ratio test. Because log is a monotone

transformation (meaning it preserves order), operating on the log scale instead doesn’t change anything.

8.6 Restricted maximum likelihood

A widely acknowledged problem with maximum likelihood estimation has to do with the estimation of

the parameters ω that characterize the covariance structure. Although the ML estimates of β for a

particular model are (approximately) unbiased, the estimators for ω have been observed to be biased

when m is not too large; for parameters that represent variances, it is usually the case that the

estimated values are too small, thus giving an optimistic picture of how variable things really are.

LINEAR REGRESSION: The problem may be appreciated by recalling the simpler problem of linear

regression; here, we use the notation in the way it was used in Chapter 3. Recall in this model that we

the data y (n× 1) are assumed to have covariance matrix σ2I, so that the elements of y are assumed

independent, each with variance σ2. If β is the least squares estimator for the (p × 1) regression

parameter, then the usual estimator for σ2 is

σ2 = (n− p)−1(Y −Xβ)′(Y −Xβ).

PAGE 240

Page 250: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 8 ST 732, M. DAVIDIAN

• Thus, σ2 has the form of the average of a sum of n squared deviations, with the exception that

we divide by (n− p) rather than n to form the average. We showed in Chapter 3 that this is done

so that the estimator is unbiased; recall we showed

E(Y −Xβ)′(Y −Xβ) = (n− p)σ2.

• If we divided by n instead, note that we would be dividing by something that is too big, leading

to an estimator that is too small

• Informally, the reason for this bias has to do with the fact that we have replaced β with the

estimator β in the quadratic form above. It is straightforward to see that if we knew β and

replaced β by β in the quadratic form, we have

E(Y −Xβ)′(Y −Xβ) = nσ2

(convince yourself). Thus, the fact that we don’t know β requires us to divide the quadratic form

by (n− p) rather than n.

It is not surprising that it is desirable to do something similar when estimating covariance parameters

ω in our more complicated regression models for longitudinal data. A detailed treatment of the more

technical aspects may be found in Diggle, Heagerty, Liang, and Zeger (2002). Here, we just give a

heuristic rationale for an “adjusted” form of maximum likelihood that acts in the same spirit as “using

(n− p) rather then n” in the ordinary regression model.

• It turns out that the ML estimator for ω in our longitudinal data regression model has the form

we would use if we knew β. Thus, it does not acknowledge the fact that β must be estimated

along with ω. The result is the biased estimation mentioned above.

• The “adjustment” involves replacing the usual likelihood

m∏i=1

(2π)−ni/2|Σi|−1/2 exp{−(yi −Xiβ)′Σ−1i (yi −Xiβ)/2}

bym∏

i=1

(2π)−ni/2|Σi|−1/2|X ′iΣ

−1i Xi|−1/2 exp{−(yi −Xiβ)′Σ−1

i (yi −Xiβ)/2}. (8.23)

The “extra” determinant term in (8.23) serves to “automatically” introduce the necessary correc-

tion in a manner similar to changing the divisor as in linear regression above.

PAGE 241

Page 251: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 8 ST 732, M. DAVIDIAN

• It may be shown by matrix calculus that the form estimator for β found by maximizing (8.23) is

identical to that before; i.e.

β =

(m∑

i=1

X ′iΣ

−1i Xi

)−1 m∑i=1

X ′iΣ

−1i Y i

where now Σi is the covariance matrix for Y i with the estimator for ω found by maximizing (8.23)

jointly plugged in.

• The difference is that the estimator for ω found by maximizing (8.23) jointly with β instead of

the usual likelihood is used.

• The resulting estimator for ω has been observed to be less biased for for finite values of m than

the ML estimator.

The objective function (8.23) and the resulting estimation method are known as restricted maxi-

mum likelihood, or REML.

• Estimates of ω obtained by this approach are often preferred in practice. In fact, PROC MIXED in

SAS uses this method as the default method for finding estimates if the user does not specify

otherwise (see section 8.8.

• Formulæ for standard errors for β obtained this way are identical to those for the ML estimator,

except that the REML estimator is used to form Σi instead. Wald tests may be constructed in

the same way and are valid tests (except for the concern about the quality of the large sample

approximation just as for tests based on ML).

• Some people use the REML function in place of the usual likelihood to form likelihood ratio tests

and the AIC and BIC criteria. If the test concerns different mean models, this is generally not

recommended, as it is not clear that the “restricted likelihood ratio” statistic ought to have a

χ2 distribution when m is large. Thus, it has been advocated to carry out tests involving the

components of β using ML to fit the model. However, if one’s main interest is in estimates of the

covariance parameters ω (e.g estimating σ2 and ρ in the AR(1) model), then REML estimators

should be employed because of they are likely to be less biased.

• Use of the AIC and BIC criteria based on the REML objective function to choose among covariance

models for the same mean model is often used. In this case, the number of parameters s is equal

to the number of covariance parameters only.

• There is really no “right” or “wrong” approach; most of what is done in practice is based on ad

hoc procedures and some subjectivity. We will exhibit this in section 8.8.

PAGE 242

Page 252: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 8 ST 732, M. DAVIDIAN

8.7 Discussion

We have given a brief overview of the main features of taking a more direct regression modeling approach

to longitudinal data. In this approach, we are able to incorporate information in a straightforward

fashion. A key aspect is the flexibility allowed in choosing models for the covariance structure. Inference

within this model framework may be conducted using the standard techniques of maximum likelihood,

which gives approximate tests and standard errors.

Here, we comment on additional features, advantages, and disadvantages of this approach;

BALANCED DATA: When the data are balanced, so that each unit is seen at the same time points,

it turns out that, under certain conditions for certain models, the weighted and generalized least

squares estimators for β are identical to the estimator obtained by simply taking Σi = Σ = σ2I for

all i.

• This estimator may be thought of as the ordinary least squares estimator treating the combined

data vector y of all the data (N ×1) as if they came from one huge individual. That is, all the N

observations within and across all the Y i are being treated independent under the normality

assumption! In the sequel, we will call this estimator βOLS .

• Formally,

βOLS = (X ′X)−1X ′Y =

(m∑

i=1

X ′iXi

)−1 m∑i=1

X ′iY i.

Thus, the weighted and generalized least squares estimators reduce to being the same as an

estimator that does no weighting by covariance matrices at all!

• This feature is exhibited in the dental study example analysis in section 8.8.

• It may seem curious that this is the case; we will say more about this curiosity in the next two

chapters. It turns out that when the covariance model has a certain form, this correspondence is

to be expected.

PAGE 243

Page 253: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 8 ST 732, M. DAVIDIAN

• This feature might make one question the need to bother with worrying about covariance modeling

at all under these conditions! Why not just pretend the issue doesn’t exist, as the estimates of

β are the same? However, although the estimates of β have the same value, the standard

errors we calculate for them will not! I.e., the estimated covariance matrix calculated as if the

data were all independent would be

σ2(X ′X)−1 = σ2

(m∑

i=1

X ′iXi

)−1

while that calculated using an assumed covariance structure acknowledging correlation would be

V β =

(m∑

i=1

X ′iΣ

−1i Xi

)−1

.

Wald tests conducted using the first matrix to compute standard errors will be incorrect if the

data really are correlated as we expect.

• The same comment is true for likelihood and restricted likelihood inferences such as the likelihood

ratio test. If the data really are correlated within units as we expect, basing inferences on a

model that explicitly acknowledges this is preferred.

CHOOSING AN APPROPRIATE COVARIANCE MODEL: Because we are dealing with longitudinal

data, we fully expect that the covariance matrix of a data vector to be something that incorporates

correlations among observations within a vector that are thought to arise because of

• Variation among units – observations on the same unit are “more alike” than those compared

across units simply because they are from the same unit.

• Variation due to the way the observations within a unit were collected. A main feature is, of

course, that they are collected over time.

In the approach we have discussed here, a covariance model is to be chosen that hopefully characterizes

well the aggregate variation from both of these sources. We have discussed several covariance models;

many of these, such as the AR(1) model, seemed to focus primarily on the longitudinal aspect (how data

within a unit are collected). Obviously, identifying an appropriate model will be difficult, particularly

when it is supposed to represent all of the variation.

• Thus, choosing among models is to some extent an “art form.” Formal techniques, such as

inspection of the AIC and BIC criteria may be used to aid in this, but a good dose of subjectivity

is also involved.

PAGE 244

Page 254: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 8 ST 732, M. DAVIDIAN

• Informal graphical and other techniques may be used based on a preliminary fit using ordinary

least squares, as described earlier. In the next chapter we will discuss a special class of models

that make the job of specifying covariance a bit easier.

• It may be that none of the models we have discussed is truly appropriate to capture all the sources

of variation. The models of the next chapters offer another approach.

We now summarize the main features of the general regression approach and its advantages over the

classical techniques. We also point out some of the possible pitfalls.

ADVANTAGES:

• The regression approach gives the analyst much flexibility in representing the form of the mean

response. The fact that the mean may be modeled as smoothly changing functions of time and

other covariates means that it is straightforward to obtain meaningful estimates of quantities of

interest, such as slopes representing rates of change and estimates of precision (standard errors)

for them. Tests of hypotheses are also straightforward. Moreover, this type of modeling readily

allows estimation of the mean response at any time point and covariate setting, not just those in

the experiment (as long as we think the model is reasonable).

• The approach does not require balance. Data vectors may be of different lengths, and observations

may have been made a different times for each unit. It is, however, important to note that if

imbalance is caused by data intended to be collected but missing at some time points, then

there may still be problems. If the missingness is completely unrelated to the issues under study

(e.g. a sample for a certain subject at a certain time is mistakenly destroyed or misplaced in the

lab), then the fact that the data are imbalanced does not raise any concerns – analysis using the

methods we have discussed will be valid. However, if missingness is suspected to be related to

the issues under study (e.g. in a study to compare 2 treatments for AIDS a subject does not show

up for scheduled visits because he is too sick to come to the clinic), then the fact that the data

are imbalanced itself has information in it about the issues! In this case, fancier methods that

acknowledge this may be needed. Such methods are an area of active statistical research and are

beyond our scope here. We discuss the issue of missing data again later in the course.

PAGE 245

Page 255: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 8 ST 732, M. DAVIDIAN

• The regression approach offers the analyst much latitude in modeling the covariance matrix of

a data vector. The analyst may select from a variety of possible models based on knowledge of

the situation and the evidence in the data. In contrast, the classical methods “force” certain

structures to be assumed.

DISADVANTAGES:

• Although there is flexibility in modeling covariance, the approach forces the analyst to model the

aggregate variation from all sources together. The analyst is forced to think about this in the

context of specifying a single covariance matrix form for each unit. The standard models, such

as AR(1), seem to focus mainly on the part of correlation we might expect because of the way

the data were collected (over time). It is not clear how correlation induced because of among-

unit variation is captured in these models. The problem is that statistical model itself does not

acknowledge explicitly the two main sources of variation separately: within and among units.

The univariate ANOVA model does acknowledge these, but the form of the model assumed results

in a very restrictive form for the covariance matrices Σi (compound symmetry). In future chapters

we study models that do account for these sources in the model separately, but are more flexible

than the ANOVA model.

• The regression approach involves direct modeling of the mean response vector. That is, the

analyst focuses attention on the the means at each time point, and then how these means change

over time, and does not consider individual unit trajectories. However, an alternative perspective

arises from thinking about the conceptual model in Chapter 4. In particular, one might start

from the view that each unit has its own “inherent trajetory” over time and develop a model on

this basis. In the dental study, these might be thought of as straight lines, which may vary in

placement and steepness across children. Thinking about individual trajectories rather natural,

and leads to another class of models, covered in the next few chapters. The univariate ANOVA

model actually represents a crude way of trying to do this; the models we will discuss are more

sophisticated.

PAGE 246

Page 256: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 8 ST 732, M. DAVIDIAN

• In fact, In some situations, scientific interest may not focus only on characterizing the mean

vector describing the “typical” response vector or covariance parameters describing the nature

of variation in the response. Investigators may be interested in characterizing trajectories for

individual units; we will discuss examples in the next chapters. The models we have discussed

up to now do not offer any framework for doing this. Those we consider next do.

• The inferences carried out on the basis of the model rely on large sample approximations.

It is in fact true that most inferential methods for complex statistical models are based on large

sample approximations, so this is not at all unusual. However, one is always concerned that the

approximation is not too good for the finite sample sizes of real life; thus, one has to be cautious

and pragmatic when interpreting results. The classical methods often produce exact tests; e.g. F

statistics have exactly F distributions for any sample size. However, these results are only true

if the assumptions, such as that of multivariate normality, hold exactly; otherwise, the results

may be unreliable. In contrast, the large sample results are a good approximation even if the

assumption of normality does not hold! The bottom line is that the complexity of modeling and

need for assumptions may make all methods subject to the disadvantage of possibly erroneous

conclusions!

8.8 Implementation with SAS

We illustrate how to carry out analyses based on general regression models for the three examples

discussed in this section:

1. The dental study data

2. The ultrafiltration data

3. The hip replacement study data

For each data set, we state some particular questions of interest, statistical models (e.g. “full” and

“reduced” models), give examples of how to carry out inferences on the regression parameter β and the

covariance parameter ω.

PAGE 247

Page 257: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 8 ST 732, M. DAVIDIAN

In all cases, we use SAS PROC MIXED with the REPEATED statement to fit several regression models

for these data with different assumptions about the covariance structure. The capabilities of PROC

MIXED are much broader than illustrated here – the options available are much more extensive, and the

procedure is capable of fitting a much larger class of statistical models, including those we consider in

the next two chapters. Thus, the examples here only begin to show the possibilities.

IMPORTANT: Version 8.2 of SAS, used here, defines AIC and BIC as −2 times the definitions given

in Sections 8.5 and 8.6. Thus, one would prefer the smaller value. Older versions of SAS are different;

the user can deduce the differences by examining the output.

EXAMPLE 1 – DENTAL STUDY DATA: In the following program, we consider the following issues:

• Recall that these data are balanced. We remarked in the last section that for balanced data under

certain conditions for certain models, the generalized least squares estimator for β will be identical

to the ordinary least squares estimator. We thus obtain both to illustrate this phenomenon and

give a hint about the “certain conditions” that apply.

• Based on our previous observations, we consider a model that says the mean response vector is

a straight line over time. We first consider the “full” model that says this line is different for

different genders. This model may be written using different parameterizations as either

Yij = β0,B + β1,Btij + eij , boys

= β0,G + β1,Gtij + eij , girls

or

Yij = β0,B + β1,Btij + eij , boys

= (β0,B + β0,G−B) + (β1,B + β1,G−B)tij + eij , girls (8.24)

• We fit the “full” model for several different candidate covariance structures and use AIC and BIC

criteria to aid in selection.

• We then consider Wald, likelihood ratio tests, and the information criteria using the preferred

covariance structure. We compare the “full” model to a “reduced” model that says the slopes are

the same for both genders (we do this in the context of parameterization (8.24)). We use ML for

all fits, but show the REML fit of one of the models for comparison. We also consider estimation

of the mean response for a boy of 11 years of age under the preferred model.

PAGE 248

Page 258: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 8 ST 732, M. DAVIDIAN

PROGRAM: The following program carries out many of these analyses and prints out information

enabling others to be carried out separately by hand. See the documentation for PROC MIXED for fancy

ways to do more of this in SAS.

/*******************************************************************

CHAPTER 8, EXAMPLE 1

Analysis of the dental study data by fitting a general linearregression model in time and gender structures using PROC MIXED.

- the repeated measurement factor is age (time)

- there is one "treatment" factor, gender

For each gender, the "full" mean model is a straight line in time.

We use the REPEATED statement of PROC MIXED with theTYPE= options to fit the model assuming several differentcovariance structures.

*******************************************************************/

options ls=80 ps=59 nodate; run;

/******************************************************************

Read in the data set (See Example 1 of Chapter 4)

*******************************************************************/

data dent1; infile ’dental.dat’;input obsno child age distance gender;ag = age*gender;

run;

/*******************************************************************

Sort the data so we can do gender-by-gender fits.

*******************************************************************/

proc sort data=dent1; by gender; run;

/*******************************************************************

First the straight line model separately for each gender andsimultaneously for both genders assuming that the covariancestructure of a data vector is diagonal with constant variance; thatis, use ordinary least squares for each gender separately andthen together.

*******************************************************************/

title "ORDINARY LEAST SQUARES FITS BY GENDER";proc reg data=dent1; by gender;model distance = age;

run;

title "ORDINARY LEAST SQUARES FIT WITH BOTH GENDERS";proc reg data=dent1;model distance = gender age ag;

run;

/*******************************************************************

Now use PROC MIXED to fit the more general regression model withassumptions about the covariance matrix of a data vector. For allof the fits, we use usual normal maximum likelihood (ML) ratherthan restricted maximum likelihood (REML), which is the default.

We do this for each gender separately first using the unstructuredassumption. The main goal is to get insight into whether it mightbe the case that the covariance matrix is different for each gender(e.g. variation is different for each).

The SOLUTION option in the MODEL statement requests that theestimates of the regression parameters be printed.

The R option in the REPEATED statement as used here requests thatthe covariance matrix estimate be printed in matrix form. TheRCORR option requests that the corresponding correlation matrixbe printed.

*******************************************************************/

PAGE 249

Page 259: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 8 ST 732, M. DAVIDIAN

* unstructured covariance matrix;

title "FIT WITH UNSTRUCTURED COVARIANCE FOR EACH GENDER";proc mixed method=ml data=dent1; by gender;class child;model distance = age / solution;repeated / type = un subject=child r rcorr;

run;

/*******************************************************************

Now do the same analyses with both genders simultaneously.Consider several models, allowing the covariance matrix tobe either the same or different for each gender using theGROUP = option, which allows for different covarianceparameters for each GROUP (genders here).

For the fit using TYPE = CS (Compound symmetry) assumed thesame for each group, we illustrate how to fit the twodifferent parameterizations of the full model. For all otherfits, we just use the second parameterization.

The CHISQ option in the MODEL statement requests that the Wald chi-squaretest statistics be printed for certain contrasts of the regressionparameters (see the discussion of the OUTPUT). We only use this forthe second parameterization -- the TESTS OF FIXED EFFECTS are testsof interest (different intercepts, slopes) in this case.

*******************************************************************/

* compound symmetry with separate intercept and slope for;* each gender;

title "COMMON COMPOUND SYMMETRY STRUCTURE";proc mixed method=ml data=dent1;class gender child;model distance = gender gender*age / noint solution ;repeated / type = cs subject = child r rcorr;

run;

* compound symmetry with the "difference" parameterization;* same for each gender;

title "COMMON COMPOUND SYMMETRY STRUCTURE";proc mixed method=ml data=dent1;class gender child;model distance = gender age gender*age / solution chisq;repeated / type = cs subject = child r rcorr;

run;

* ar(1) same for each gender;

title "COMMON AR(1) STRUCTURE";proc mixed method=ml data=dent1;class gender child ;model distance = gender age age*gender / solution chisq;repeated / type = ar(1) subject=child r rcorr;

run;

* one-dependent same for each gender;

title "COMMON ONE-DEPENDENT STRUCTURE";proc mixed method=ml data=dent1;class gender child ;model distance = gender age age*gender / solution chisq;repeated / type = toep(2) subject=child r rcorr;

run;

* compound symmetry, different for each gender;

title "SEPARATE COMPOUND SYMMETRY FOR EACH GENDER";proc mixed method=ml data=dent1;class gender child ;model distance = gender age age*gender / solution chisq;repeated / type = cs subject=child r rcorr group=gender;

run;

* ar(1), different for each gender;

title "SEPARATE AR(1) FOR EACH GENDER";proc mixed method=ml data=dent1;class gender child ;model distance = gender age age*gender / solution chisq;repeated / type = ar(1) subject=child r rcorr group=gender;

run;

PAGE 250

Page 260: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 8 ST 732, M. DAVIDIAN

* one-dependent, different for each gender;

title "SEPARATE ONE-DEPENDENT FOR EACH GENDER";proc mixed method=ml data=dent1;class gender child;model distance = gender age age*gender / solution chisq;repeated / type = toep(2) subject=child r rcorr group=gender;

run;

/*******************************************************************

Examination of the AIC, BIC, and loglikelihood ratios from theabove fits indicates that

- a model that allows a separate covariance matrix of the sametype for each gender is preferred

- the compound symmetry structure for each gender is preferred

Thus, for this model, we fit

- the full model again, now asking for the covariance matrixof beta-hat to be printed using the COVB option;

- the reduced model (equal slopes)

- the full model using REML

This will allow a "full" vs. "reduced" likelihood ratio test ofequal slopes to be performed (by hand from the output).

We fit the first parameterization this time, so that the estimatesare interpreted as the gender-specific intercepts and slopes.Thus, the TESTS OF FIXED EFFECTS in the output should be disregarded.

*******************************************************************/

* full model again with covariance matrix of betahat printed;

title "FULL MODEL WITH COMPOUND SYMMETRY FOR EACH GENDER";proc mixed method=ml data=dent1;class gender child;model distance = gender gender*age / noint solution covb;repeated / type=cs subject=child r rcorr group=gender;

run;

* reduced model;

title "REDUCED MODEL WITH COMPOUND SYMMETRY FOR EACH GENDER";proc mixed method=ml data=dent1;class gender child;model distance = gender age / noint solution covb;repeated / type=cs subject=child r rcorr group=gender;

run;

* full model using REML (the default, so no METHOD= is specified);* use ESTIMATE statement to estimate the mean for a boy of age 11;

title "FULL MODEL WITH COMPOUND SYMMETRY FOR EACH GENDER, REML";proc mixed data=dent1;class gender child;model distance = gender gender*age / noint solution covb;repeated / type=cs subject=child r rcorr group=gender;estimate ’boy at 11’ gender 0 1 gender*age 0 11;

run;

* also fit full model in first parameterization to get chi-square tests;

title "FULL MODEL, DIFFERENCE PARAMETERIZATION";proc mixed method=ml data=dent1;class gender child;model distance = gender age gender*age / solution chisq covb;repeated / type=cs subject=child r rcorr group=gender;

run;

PAGE 251

Page 261: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 8 ST 732, M. DAVIDIAN

OUTPUT: First we display the output; following this, we interpret the output.

ORDINARY LEAST SQUARES FITS BY GENDER 1

----------------------------------- gender=0 -----------------------------------

The REG ProcedureModel: MODEL1

Dependent Variable: distance

Analysis of Variance

Sum of MeanSource DF Squares Square F Value Pr > F

Model 1 50.59205 50.59205 10.80 0.0021Error 42 196.69773 4.68328Corrected Total 43 247.28977

Root MSE 2.16409 R-Square 0.2046Dependent Mean 22.64773 Adj R-Sq 0.1856Coeff Var 9.55543

Parameter Estimates

Parameter StandardVariable DF Estimate Error t Value Pr > |t|

Intercept 1 17.37273 1.63776 10.61 <.0001age 1 0.47955 0.14590 3.29 0.0021

ORDINARY LEAST SQUARES FITS BY GENDER 2

----------------------------------- gender=1 -----------------------------------

The REG ProcedureModel: MODEL1

Dependent Variable: distance

Analysis of Variance

Sum of MeanSource DF Squares Square F Value Pr > F

Model 1 196.87813 196.87813 36.65 <.0001Error 62 333.05938 5.37193Corrected Total 63 529.93750

Root MSE 2.31774 R-Square 0.3715Dependent Mean 24.96875 Adj R-Sq 0.3614Coeff Var 9.28257

Parameter Estimates

Parameter StandardVariable DF Estimate Error t Value Pr > |t|

Intercept 1 16.34063 1.45437 11.24 <.0001age 1 0.78438 0.12957 6.05 <.0001

ORDINARY LEAST SQUARES FIT WITH BOTH GENDERS 3

The REG ProcedureModel: MODEL1

Dependent Variable: distance

Analysis of Variance

Sum of MeanSource DF Squares Square F Value Pr > F

Model 3 387.93503 129.31168 25.39 <.0001Error 104 529.75710 5.09382Corrected Total 107 917.69213

Root MSE 2.25695 R-Square 0.4227Dependent Mean 24.02315 Adj R-Sq 0.4061Coeff Var 9.39489

Parameter Estimates

Parameter StandardVariable DF Estimate Error t Value Pr > |t|

PAGE 252

Page 262: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 8 ST 732, M. DAVIDIAN

Intercept 1 17.37273 1.70803 10.17 <.0001gender 1 -1.03210 2.21880 -0.47 0.6428age 1 0.47955 0.15216 3.15 0.0021ag 1 0.30483 0.19767 1.54 0.1261

FIT WITH UNSTRUCTURED COVARIANCE FOR EACH GENDER 4

----------------------------------- gender=0 -----------------------------------

The Mixed Procedure

Model Information

Data Set WORK.DENT1Dependent Variable distanceCovariance Structure UnstructuredSubject Effect childEstimation Method MLResidual Variance Method NoneFixed Effects SE Method Model-BasedDegrees of Freedom Method Between-Within

Class Level Information

Class Levels Values

child 11 1 2 3 4 5 6 7 8 9 10 11

Dimensions

Covariance Parameters 10Columns in X 2Columns in Z 0Subjects 11Max Obs Per Subject 4Observations Used 44Observations Not Used 0Total Observations 44

Iteration History

Iteration Evaluations -2 Log Like Criterion

0 1 190.755646561 2 130.64154698 0.00000000

Convergence criteria met.

Estimated R Matrix for child 1

Row Col1 Col2 Col3 Col4

1 4.1129 3.0512 3.9496 3.96892 3.0512 3.2894 3.6632 3.70803 3.9496 3.6632 5.0966 4.97884 3.9689 3.7080 4.9788 5.4076

FIT WITH UNSTRUCTURED COVARIANCE FOR EACH GENDER 5

----------------------------------- gender=0 -----------------------------------

The Mixed Procedure

Estimated R Correlation Matrix for child 1

Row Col1 Col2 Col3 Col4

1 1.0000 0.8295 0.8627 0.84162 0.8295 1.0000 0.8946 0.87923 0.8627 0.8946 1.0000 0.94844 0.8416 0.8792 0.9484 1.0000

Covariance Parameter Estimates

Cov Parm Subject Estimate

UN(1,1) child 4.1129UN(2,1) child 3.0512UN(2,2) child 3.2894UN(3,1) child 3.9496UN(3,2) child 3.6632UN(3,3) child 5.0966UN(4,1) child 3.9689

PAGE 253

Page 263: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 8 ST 732, M. DAVIDIAN

UN(4,2) child 3.7080UN(4,3) child 4.9788UN(4,4) child 5.4076

Fit Statistics

-2 Log Likelihood 130.6AIC (smaller is better) 154.6AICC (smaller is better) 164.7BIC (smaller is better) 159.4

Null Model Likelihood Ratio Test

DF Chi-Square Pr > ChiSq

9 60.11 <.0001

Solution for Fixed Effects

StandardEffect Estimate Error DF t Value Pr > |t|

Intercept 17.4220 0.6930 10 25.14 <.0001age 0.4823 0.06144 10 7.85 <.0001

FIT WITH UNSTRUCTURED COVARIANCE FOR EACH GENDER 6

----------------------------------- gender=0 -----------------------------------

The Mixed Procedure

Type 3 Tests of Fixed Effects

Num DenEffect DF DF F Value Pr > F

age 1 10 61.62 <.0001

FIT WITH UNSTRUCTURED COVARIANCE FOR EACH GENDER 7

----------------------------------- gender=1 -----------------------------------

The Mixed Procedure

Model Information

Data Set WORK.DENT1Dependent Variable distanceCovariance Structure UnstructuredSubject Effect childEstimation Method MLResidual Variance Method NoneFixed Effects SE Method Model-BasedDegrees of Freedom Method Between-Within

Class Level Information

Class Levels Values

child 16 12 13 14 15 16 17 18 19 20 2122 23 24 25 26 27

Dimensions

Covariance Parameters 10Columns in X 2Columns in Z 0Subjects 16Max Obs Per Subject 4Observations Used 64Observations Not Used 0Total Observations 64

Iteration History

Iteration Evaluations -2 Log Like Criterion

0 1 287.188144671 2 264.37833982 0.000005652 1 264.37792193 0.00000000

Convergence criteria met.

PAGE 254

Page 264: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 8 ST 732, M. DAVIDIAN

Estimated R Matrix for child 12

Row Col1 Col2 Col3 Col4

1 5.7813 2.0152 3.3585 1.49872 2.0152 4.4035 2.0982 2.64723 3.3585 2.0982 6.6064 3.04214 1.4987 2.6472 3.0421 4.0783

FIT WITH UNSTRUCTURED COVARIANCE FOR EACH GENDER 8

----------------------------------- gender=1 -----------------------------------

The Mixed Procedure

Estimated R Correlation Matrix for child 12

Row Col1 Col2 Col3 Col4

1 1.0000 0.3994 0.5434 0.30862 0.3994 1.0000 0.3890 0.62473 0.5434 0.3890 1.0000 0.58614 0.3086 0.6247 0.5861 1.0000

Covariance Parameter Estimates

Cov Parm Subject Estimate

UN(1,1) child 5.7813UN(2,1) child 2.0152UN(2,2) child 4.4035UN(3,1) child 3.3585UN(3,2) child 2.0982UN(3,3) child 6.6064UN(4,1) child 1.4987UN(4,2) child 2.6472UN(4,3) child 3.0421UN(4,4) child 4.0783

Fit Statistics

-2 Log Likelihood 264.4AIC (smaller is better) 288.4AICC (smaller is better) 294.5BIC (smaller is better) 297.6

Null Model Likelihood Ratio Test

DF Chi-Square Pr > ChiSq

9 22.81 0.0066

Solution for Fixed Effects

StandardEffect Estimate Error DF t Value Pr > |t|

Intercept 15.8282 1.1179 15 14.16 <.0001age 0.8340 0.09274 15 8.99 <.0001

FIT WITH UNSTRUCTURED COVARIANCE FOR EACH GENDER 9

----------------------------------- gender=1 -----------------------------------

The Mixed Procedure

Type 3 Tests of Fixed Effects

Num DenEffect DF DF F Value Pr > F

age 1 15 80.86 <.0001

COMMON COMPOUND SYMMETRY STRUCTURE 10

The Mixed Procedure

Model Information

Data Set WORK.DENT1Dependent Variable distanceCovariance Structure Compound SymmetrySubject Effect child

PAGE 255

Page 265: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 8 ST 732, M. DAVIDIAN

Estimation Method MLResidual Variance Method ProfileFixed Effects SE Method Model-BasedDegrees of Freedom Method Between-Within

Class Level Information

Class Levels Values

gender 2 0 1child 27 1 2 3 4 5 6 7 8 9 10 11 12 13

14 15 16 17 18 19 20 21 22 2324 25 26 27

Dimensions

Covariance Parameters 2Columns in X 4Columns in Z 0Subjects 27Max Obs Per Subject 4Observations Used 108Observations Not Used 0Total Observations 108

Iteration History

Iteration Evaluations -2 Log Like Criterion

0 1 478.241759861 1 428.63905802 0.00000000

Convergence criteria met.

Estimated R Matrix for child 1

Row Col1 Col2 Col3 Col4

1 4.9052 3.0306 3.0306 3.03062 3.0306 4.9052 3.0306 3.03063 3.0306 3.0306 4.9052 3.03064 3.0306 3.0306 3.0306 4.9052

COMMON COMPOUND SYMMETRY STRUCTURE 11

The Mixed Procedure

Estimated R Correlation Matrix for child 1

Row Col1 Col2 Col3 Col4

1 1.0000 0.6178 0.6178 0.61782 0.6178 1.0000 0.6178 0.61783 0.6178 0.6178 1.0000 0.61784 0.6178 0.6178 0.6178 1.0000

Covariance Parameter Estimates

Cov Parm Subject Estimate

CS child 3.0306Residual 1.8746

Fit Statistics

-2 Log Likelihood 428.6AIC (smaller is better) 440.6AICC (smaller is better) 441.5BIC (smaller is better) 448.4

Null Model Likelihood Ratio Test

DF Chi-Square Pr > ChiSq

1 49.60 <.0001

Solution for Fixed Effects

StandardEffect gender Estimate Error DF t Value Pr > |t|

PAGE 256

Page 266: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 8 ST 732, M. DAVIDIAN

gender 0 17.3727 1.1615 25 14.96 <.0001gender 1 16.3406 0.9631 25 16.97 <.0001age*gender 0 0.4795 0.09231 79 5.20 <.0001age*gender 1 0.7844 0.07654 79 10.25 <.0001

Type 3 Tests of Fixed Effects

Num DenEffect DF DF F Value Pr > F

gender 2 25 255.79 <.0001age*gender 2 79 66.01 <.0001

COMMON COMPOUND SYMMETRY STRUCTURE 12

The Mixed Procedure

Model Information

Data Set WORK.DENT1Dependent Variable distanceCovariance Structure Compound SymmetrySubject Effect childEstimation Method MLResidual Variance Method ProfileFixed Effects SE Method Model-BasedDegrees of Freedom Method Between-Within

Class Level Information

Class Levels Values

gender 2 0 1child 27 1 2 3 4 5 6 7 8 9 10 11 12 13

14 15 16 17 18 19 20 21 22 2324 25 26 27

Dimensions

Covariance Parameters 2Columns in X 6Columns in Z 0Subjects 27Max Obs Per Subject 4Observations Used 108Observations Not Used 0Total Observations 108

Iteration History

Iteration Evaluations -2 Log Like Criterion

0 1 478.241759861 1 428.63905802 0.00000000

Convergence criteria met.

Estimated R Matrix for child 1

Row Col1 Col2 Col3 Col4

1 4.9052 3.0306 3.0306 3.03062 3.0306 4.9052 3.0306 3.03063 3.0306 3.0306 4.9052 3.03064 3.0306 3.0306 3.0306 4.9052

COMMON COMPOUND SYMMETRY STRUCTURE 13

The Mixed Procedure

Estimated R Correlation Matrix for child 1

Row Col1 Col2 Col3 Col4

1 1.0000 0.6178 0.6178 0.61782 0.6178 1.0000 0.6178 0.61783 0.6178 0.6178 1.0000 0.61784 0.6178 0.6178 0.6178 1.0000

Covariance Parameter Estimates

Cov Parm Subject Estimate

PAGE 257

Page 267: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 8 ST 732, M. DAVIDIAN

CS child 3.0306Residual 1.8746

Fit Statistics

-2 Log Likelihood 428.6AIC (smaller is better) 440.6AICC (smaller is better) 441.5BIC (smaller is better) 448.4

Null Model Likelihood Ratio Test

DF Chi-Square Pr > ChiSq

1 49.60 <.0001

Solution for Fixed Effects

StandardEffect gender Estimate Error DF t Value Pr > |t|

Intercept 16.3406 0.9631 25 16.97 <.0001gender 0 1.0321 1.5089 25 0.68 0.5003gender 1 0 . . . .age 0.7844 0.07654 79 10.25 <.0001age*gender 0 -0.3048 0.1199 79 -2.54 0.0130age*gender 1 0 . . . .

Type 3 Tests of Fixed Effects

Num DenEffect DF DF Chi-Square F Value Pr > ChiSq Pr > F

gender 1 25 0.47 0.47 0.4940 0.5003age 1 79 111.10 111.10 <.0001 <.0001age*gender 1 79 6.46 6.46 0.0110 0.0130

COMMON AR(1) STRUCTURE 14

The Mixed Procedure

Model Information

Data Set WORK.DENT1Dependent Variable distanceCovariance Structure AutoregressiveSubject Effect childEstimation Method MLResidual Variance Method ProfileFixed Effects SE Method Model-BasedDegrees of Freedom Method Between-Within

Class Level Information

Class Levels Values

gender 2 0 1child 27 1 2 3 4 5 6 7 8 9 10 11 12 13

14 15 16 17 18 19 20 21 22 2324 25 26 27

Dimensions

Covariance Parameters 2Columns in X 6Columns in Z 0Subjects 27Max Obs Per Subject 4Observations Used 108Observations Not Used 0Total Observations 108

Iteration History

Iteration Evaluations -2 Log Like Criterion

0 1 478.241759861 2 440.68100623 0.00000000

Convergence criteria met.

PAGE 258

Page 268: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 8 ST 732, M. DAVIDIAN

Estimated R Matrix for child 1

Row Col1 Col2 Col3 Col4

1 4.8910 2.9696 1.8030 1.09472 2.9696 4.8910 2.9696 1.80303 1.8030 2.9696 4.8910 2.96964 1.0947 1.8030 2.9696 4.8910

COMMON AR(1) STRUCTURE 15

The Mixed Procedure

Estimated R Correlation Matrix for child 1

Row Col1 Col2 Col3 Col4

1 1.0000 0.6071 0.3686 0.22382 0.6071 1.0000 0.6071 0.36863 0.3686 0.6071 1.0000 0.60714 0.2238 0.3686 0.6071 1.0000

Covariance Parameter Estimates

Cov Parm Subject Estimate

AR(1) child 0.6071Residual 4.8910

Fit Statistics

-2 Log Likelihood 440.7AIC (smaller is better) 452.7AICC (smaller is better) 453.5BIC (smaller is better) 460.5

Null Model Likelihood Ratio Test

DF Chi-Square Pr > ChiSq

1 37.56 <.0001

Solution for Fixed Effects

StandardEffect gender Estimate Error DF t Value Pr > |t|

Intercept 16.5920 1.3299 25 12.48 <.0001gender 0 0.7297 2.0836 25 0.35 0.7291gender 1 0 . . . .age 0.7696 0.1147 79 6.71 <.0001age*gender 0 -0.2858 0.1797 79 -1.59 0.1157age*gender 1 0 . . . .

Type 3 Tests of Fixed Effects

Num DenEffect DF DF Chi-Square F Value Pr > ChiSq Pr > F

gender 1 25 0.12 0.12 0.7262 0.7291age 1 79 48.63 48.63 <.0001 <.0001age*gender 1 79 2.53 2.53 0.1117 0.1157

COMMON ONE-DEPENDENT STRUCTURE 16

The Mixed Procedure

Model Information

Data Set WORK.DENT1Dependent Variable distanceCovariance Structure ToeplitzSubject Effect childEstimation Method MLResidual Variance Method ProfileFixed Effects SE Method Model-BasedDegrees of Freedom Method Between-Within

Class Level Information

Class Levels Values

gender 2 0 1child 27 1 2 3 4 5 6 7 8 9 10 11 12 13

PAGE 259

Page 269: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 8 ST 732, M. DAVIDIAN

14 15 16 17 18 19 20 21 22 2324 25 26 27

Dimensions

Covariance Parameters 2Columns in X 6Columns in Z 0Subjects 27Max Obs Per Subject 4Observations Used 108Observations Not Used 0Total Observations 108

Iteration History

Iteration Evaluations -2 Log Like Criterion

0 1 478.241759861 2 589.03603775 0.162830932 1 545.67380444 0.151385643 1 510.19059372 0.124673984 1 484.30189351 0.086458765 1 468.14463315 0.046496056 1 460.20520640 0.015924417 1 457.72394860 0.002149848 1 457.42200558 0.000041209 1 457.41660393 0.00000002

10 1 457.41660197 0.00000000

Convergence criteria met.

COMMON ONE-DEPENDENT STRUCTURE 17

The Mixed Procedure

Estimated R Matrix for child 1

Row Col1 Col2 Col3 Col4

1 4.5294 1.61202 1.6120 4.5294 1.61203 1.6120 4.5294 1.61204 1.6120 4.5294

Estimated R Correlation Matrix for child 1

Row Col1 Col2 Col3 Col4

1 1.0000 0.35592 0.3559 1.0000 0.35593 0.3559 1.0000 0.35594 0.3559 1.0000

Covariance Parameter Estimates

Cov Parm Subject Estimate

TOEP(2) child 1.6120Residual 4.5294

Fit Statistics

-2 Log Likelihood 457.4AIC (smaller is better) 469.4AICC (smaller is better) 470.2BIC (smaller is better) 477.2

Null Model Likelihood Ratio Test

DF Chi-Square Pr > ChiSq

1 20.83 <.0001

Solution for Fixed Effects

StandardEffect gender Estimate Error DF t Value Pr > |t|

Intercept 16.6208 1.4167 25 11.73 <.0001gender 0 0.6827 2.2195 25 0.31 0.7609gender 1 0 . . . .

PAGE 260

Page 270: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 8 ST 732, M. DAVIDIAN

age 0.7629 0.1253 79 6.09 <.0001age*gender 0 -0.2773 0.1964 79 -1.41 0.1619age*gender 1 0 . . . .

COMMON ONE-DEPENDENT STRUCTURE 18

The Mixed Procedure

Type 3 Tests of Fixed Effects

Num DenEffect DF DF Chi-Square F Value Pr > ChiSq Pr > F

gender 1 25 0.09 0.09 0.7584 0.7609age 1 79 40.42 40.42 <.0001 <.0001age*gender 1 79 1.99 1.99 0.1580 0.1619

SEPARATE COMPOUND SYMMETRY FOR EACH GENDER 19

The Mixed Procedure

Model Information

Data Set WORK.DENT1Dependent Variable distanceCovariance Structure Compound SymmetrySubject Effect childGroup Effect genderEstimation Method MLResidual Variance Method NoneFixed Effects SE Method Model-BasedDegrees of Freedom Method Between-Within

Class Level Information

Class Levels Values

gender 2 0 1child 27 1 2 3 4 5 6 7 8 9 10 11 12 13

14 15 16 17 18 19 20 21 22 2324 25 26 27

Dimensions

Covariance Parameters 4Columns in X 6Columns in Z 0Subjects 27Max Obs Per Subject 4Observations Used 108Observations Not Used 0Total Observations 108

Iteration History

Iteration Evaluations -2 Log Like Criterion

0 1 478.241759861 1 408.81297228 0.00000000

Convergence criteria met.

Estimated R Matrix for child 1

Row Col1 Col2 Col3 Col4

1 4.4704 3.8804 3.8804 3.88042 3.8804 4.4704 3.8804 3.88043 3.8804 3.8804 4.4704 3.88044 3.8804 3.8804 3.8804 4.4704

SEPARATE COMPOUND SYMMETRY FOR EACH GENDER 20

The Mixed Procedure

Estimated R Correlation Matrix for child 1

Row Col1 Col2 Col3 Col4

1 1.0000 0.8680 0.8680 0.86802 0.8680 1.0000 0.8680 0.86803 0.8680 0.8680 1.0000 0.86804 0.8680 0.8680 0.8680 1.0000

PAGE 261

Page 271: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 8 ST 732, M. DAVIDIAN

Covariance Parameter Estimates

Cov Parm Subject Group Estimate

Variance child gender 0 0.5900CS child gender 0 3.8804Variance child gender 1 2.7577CS child gender 1 2.4463

Fit Statistics

-2 Log Likelihood 408.8AIC (smaller is better) 424.8AICC (smaller is better) 426.3BIC (smaller is better) 435.2

Null Model Likelihood Ratio Test

DF Chi-Square Pr > ChiSq

3 69.43 <.0001

Solution for Fixed Effects

StandardEffect gender Estimate Error DF t Value Pr > |t|

Intercept 16.3406 1.1130 25 14.68 <.0001gender 0 1.0321 1.3890 25 0.74 0.4644gender 1 0 . . . .age 0.7844 0.09283 79 8.45 <.0001age*gender 0 -0.3048 0.1063 79 -2.87 0.0053age*gender 1 0 . . . .

Type 3 Tests of Fixed Effects

Num DenEffect DF DF Chi-Square F Value Pr > ChiSq Pr > F

gender 1 25 0.55 0.55 0.4575 0.4644age 1 79 141.37 141.37 <.0001 <.0001

SEPARATE COMPOUND SYMMETRY FOR EACH GENDER 21

The Mixed Procedure

Type 3 Tests of Fixed Effects

Num DenEffect DF DF Chi-Square F Value Pr > ChiSq Pr > F

age*gender 1 79 8.22 8.22 0.0041 0.0053

SEPARATE AR(1) FOR EACH GENDER 22

The Mixed Procedure

Model Information

Data Set WORK.DENT1Dependent Variable distanceCovariance Structure AutoregressiveSubject Effect childGroup Effect genderEstimation Method MLResidual Variance Method NoneFixed Effects SE Method Model-BasedDegrees of Freedom Method Between-Within

Class Level Information

Class Levels Values

gender 2 0 1child 27 1 2 3 4 5 6 7 8 9 10 11 12 13

14 15 16 17 18 19 20 21 22 2324 25 26 27

Dimensions

Covariance Parameters 4Columns in X 6Columns in Z 0Subjects 27

PAGE 262

Page 272: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 8 ST 732, M. DAVIDIAN

Max Obs Per Subject 4Observations Used 108Observations Not Used 0Total Observations 108

Iteration History

Iteration Evaluations -2 Log Like Criterion

0 1 478.241759861 2 475.71968065 0.200255732 1 440.38814030 0.089677563 1 426.69925492 0.041341234 1 420.38697948 0.027921145 1 416.67736557 0.009237336 1 415.50565786 0.000834287 1 415.41014131 0.000006718 1 415.40940946 0.00000000

Convergence criteria met.

SEPARATE AR(1) FOR EACH GENDER 23

The Mixed Procedure

Estimated R Matrix for child 1

Row Col1 Col2 Col3 Col4

1 4.6591 4.1730 3.7377 3.34772 4.1730 4.6591 4.1730 3.73773 3.7377 4.1730 4.6591 4.17304 3.3477 3.7377 4.1730 4.6591

Estimated R Correlation Matrix for child 1

Row Col1 Col2 Col3 Col4

1 1.0000 0.8957 0.8022 0.71852 0.8957 1.0000 0.8957 0.80223 0.8022 0.8957 1.0000 0.89574 0.7185 0.8022 0.8957 1.0000

Covariance Parameter Estimates

Cov Parm Subject Group Estimate

Variance child gender 0 4.6591AR(1) child gender 0 0.8957Variance child gender 1 5.1724AR(1) child gender 1 0.4430

Fit Statistics

-2 Log Likelihood 415.4AIC (smaller is better) 431.4AICC (smaller is better) 432.9BIC (smaller is better) 441.8

Null Model Likelihood Ratio Test

DF Chi-Square Pr > ChiSq

3 62.83 <.0001

Solution for Fixed Effects

StandardEffect gender Estimate Error DF t Value Pr > |t|

Intercept 16.5245 1.4558 25 11.35 <.0001gender 0 0.7817 1.8123 25 0.43 0.6699gender 1 0 . . . .age 0.7729 0.1276 79 6.06 <.0001age*gender 0 -0.2882 0.1513 79 -1.90 0.0605

SEPARATE AR(1) FOR EACH GENDER 24

The Mixed Procedure

Solution for Fixed Effects

Standard

PAGE 263

Page 273: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 8 ST 732, M. DAVIDIAN

Effect gender Estimate Error DF t Value Pr > |t|

age*gender 1 0 . . . .

Type 3 Tests of Fixed Effects

Num DenEffect DF DF Chi-Square F Value Pr > ChiSq Pr > F

gender 1 25 0.19 0.19 0.6662 0.6699age 1 79 69.07 69.07 <.0001 <.0001age*gender 1 79 3.63 3.63 0.0569 0.0605

SEPARATE ONE-DEPENDENT FOR EACH GENDER 25

The Mixed Procedure

Model Information

Data Set WORK.DENT1Dependent Variable distanceCovariance Structure ToeplitzSubject Effect childGroup Effect genderEstimation Method MLResidual Variance Method NoneFixed Effects SE Method Model-BasedDegrees of Freedom Method Between-Within

Class Level Information

Class Levels Values

gender 2 0 1child 27 1 2 3 4 5 6 7 8 9 10 11 12 13

14 15 16 17 18 19 20 21 22 2324 25 26 27

Dimensions

Covariance Parameters 4Columns in X 6Columns in Z 0Subjects 27Max Obs Per Subject 4Observations Used 108Observations Not Used 0Total Observations 108

Iteration History

Iteration Evaluations -2 Log Like Criterion

0 1 478.241759861 2 465.00494081 280.114180992 1 458.88438919 49.853855753 1 453.61695810 7.333351634 1 445.15025755 0.003479915 1 444.66243888 0.000281716 1 444.62522997 0.000004367 1 444.62468768 0.00000000

Convergence criteria met.

SEPARATE ONE-DEPENDENT FOR EACH GENDER 26

The Mixed Procedure

Estimated R Matrix for child 1

Row Col1 Col2 Col3 Col4

1 3.7093 2.04152 2.0415 3.7093 2.04153 2.0415 3.7093 2.04154 2.0415 3.7093

Estimated R Correlation Matrix for child 1

Row Col1 Col2 Col3 Col4

1 1.0000 0.55042 0.5504 1.0000 0.5504

PAGE 264

Page 274: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 8 ST 732, M. DAVIDIAN

3 0.5504 1.0000 0.55044 0.5504 1.0000

Covariance Parameter Estimates

Cov Parm Subject Group Estimate

Variance child gender 0 3.7093TOEP(2) child gender 0 2.0415Variance child gender 1 4.9891TOEP(2) child gender 1 1.3289

Fit Statistics

-2 Log Likelihood 444.6AIC (smaller is better) 460.6AICC (smaller is better) 462.1BIC (smaller is better) 471.0

Null Model Likelihood Ratio Test

DF Chi-Square Pr > ChiSq

3 33.62 <.0001

Solution for Fixed Effects

StandardEffect gender Estimate Error DF t Value Pr > |t|

Intercept 16.5091 1.4797 25 11.16 <.0001gender 0 0.5832 2.0126 25 0.29 0.7744gender 1 0 . . . .age 0.7719 0.1312 79 5.88 <.0001age*gender 0 -0.2673 0.1772 79 -1.51 0.1354

SEPARATE ONE-DEPENDENT FOR EACH GENDER 27

The Mixed Procedure

Solution for Fixed Effects

StandardEffect gender Estimate Error DF t Value Pr > |t|

age*gender 1 0 . . . .

Type 3 Tests of Fixed Effects

Num DenEffect DF DF Chi-Square F Value Pr > ChiSq Pr > F

gender 1 25 0.08 0.08 0.7720 0.7744age 1 79 51.92 51.92 <.0001 <.0001age*gender 1 79 2.28 2.28 0.1314 0.1354

FULL MODEL WITH COMPOUND SYMMETRY FOR EACH GENDER 28

The Mixed Procedure

Model Information

Data Set WORK.DENT1Dependent Variable distanceCovariance Structure Compound SymmetrySubject Effect childGroup Effect genderEstimation Method MLResidual Variance Method NoneFixed Effects SE Method Model-BasedDegrees of Freedom Method Between-Within

Class Level Information

Class Levels Values

gender 2 0 1child 27 1 2 3 4 5 6 7 8 9 10 11 12 13

14 15 16 17 18 19 20 21 22 2324 25 26 27

Dimensions

PAGE 265

Page 275: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 8 ST 732, M. DAVIDIAN

Covariance Parameters 4Columns in X 4Columns in Z 0Subjects 27Max Obs Per Subject 4Observations Used 108Observations Not Used 0Total Observations 108

Iteration History

Iteration Evaluations -2 Log Like Criterion

0 1 478.241759861 1 408.81297228 0.00000000

Convergence criteria met.

Estimated R Matrix for child 1

Row Col1 Col2 Col3 Col4

1 4.4704 3.8804 3.8804 3.88042 3.8804 4.4704 3.8804 3.88043 3.8804 3.8804 4.4704 3.88044 3.8804 3.8804 3.8804 4.4704

FULL MODEL WITH COMPOUND SYMMETRY FOR EACH GENDER 29

The Mixed Procedure

Estimated R Correlation Matrix for child 1

Row Col1 Col2 Col3 Col4

1 1.0000 0.8680 0.8680 0.86802 0.8680 1.0000 0.8680 0.86803 0.8680 0.8680 1.0000 0.86804 0.8680 0.8680 0.8680 1.0000

Covariance Parameter Estimates

Cov Parm Subject Group Estimate

Variance child gender 0 0.5900CS child gender 0 3.8804Variance child gender 1 2.7577CS child gender 1 2.4463

Fit Statistics

-2 Log Likelihood 408.8AIC (smaller is better) 424.8AICC (smaller is better) 426.3BIC (smaller is better) 435.2

Null Model Likelihood Ratio Test

DF Chi-Square Pr > ChiSq

3 69.43 <.0001

Solution for Fixed Effects

StandardEffect gender Estimate Error DF t Value Pr > |t|

gender 0 17.3727 0.8311 25 20.90 <.0001gender 1 16.3406 1.1130 25 14.68 <.0001age*gender 0 0.4795 0.05179 79 9.26 <.0001age*gender 1 0.7844 0.09283 79 8.45 <.0001

Covariance Matrix for Fixed Effects

Row Effect gender Col1 Col2 Col3 Col4

1 gender 0 0.6907 -0.029502 gender 1 1.2388 -0.094803 age*gender 0 -0.02950 0.0026824 age*gender 1 -0.09480 0.008618

FULL MODEL WITH COMPOUND SYMMETRY FOR EACH GENDER 30

PAGE 266

Page 276: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 8 ST 732, M. DAVIDIAN

The Mixed Procedure

Type 3 Tests of Fixed Effects

Num DenEffect DF DF F Value Pr > F

gender 2 25 326.26 <.0001age*gender 2 79 78.57 <.0001

REDUCED MODEL WITH COMPOUND SYMMETRY FOR EACH GENDER 31

The Mixed Procedure

Model Information

Data Set WORK.DENT1Dependent Variable distanceCovariance Structure Compound SymmetrySubject Effect childGroup Effect genderEstimation Method MLResidual Variance Method NoneFixed Effects SE Method Model-BasedDegrees of Freedom Method Between-Within

Class Level Information

Class Levels Values

gender 2 0 1child 27 1 2 3 4 5 6 7 8 9 10 11 12 13

14 15 16 17 18 19 20 21 22 2324 25 26 27

Dimensions

Covariance Parameters 4Columns in X 3Columns in Z 0Subjects 27Max Obs Per Subject 4Observations Used 108Observations Not Used 0Total Observations 108

Iteration History

Iteration Evaluations -2 Log Like Criterion

0 1 480.683621611 4 416.64891361 0.000456402 1 416.59716984 0.000002763 1 416.59686755 0.00000000

Convergence criteria met.

Estimated R Matrix for child 1

Row Col1 Col2 Col3 Col4

1 4.4937 3.8726 3.8726 3.87262 3.8726 4.4937 3.8726 3.87263 3.8726 3.8726 4.4937 3.8726

REDUCED MODEL WITH COMPOUND SYMMETRY FOR EACH GENDER 32

The Mixed Procedure

Estimated R Matrix for child 1

Row Col1 Col2 Col3 Col4

4 3.8726 3.8726 3.8726 4.4937

Estimated R Correlation Matrix for child 1

Row Col1 Col2 Col3 Col4

1 1.0000 0.8618 0.8618 0.86182 0.8618 1.0000 0.8618 0.86183 0.8618 0.8618 1.0000 0.86184 0.8618 0.8618 0.8618 1.0000

PAGE 267

Page 277: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 8 ST 732, M. DAVIDIAN

Covariance Parameter Estimates

Cov Parm Subject Group Estimate

Variance child gender 0 0.6211CS child gender 0 3.8726Variance child gender 1 3.1308CS child gender 1 2.3530

Fit Statistics

-2 Log Likelihood 416.6AIC (smaller is better) 430.6AICC (smaller is better) 431.7BIC (smaller is better) 439.7

Null Model Likelihood Ratio Test

DF Chi-Square Pr > ChiSq

3 64.09 <.0001

Solution for Fixed Effects

StandardEffect gender Estimate Error DF t Value Pr > |t|

gender 0 16.6218 0.7945 25 20.92 <.0001gender 1 18.9429 0.6790 25 27.90 <.0001age 0.5478 0.04681 80 11.70 <.0001

REDUCED MODEL WITH COMPOUND SYMMETRY FOR EACH GENDER 33

The Mixed Procedure

Covariance Matrix for Fixed Effects

Row Effect gender Col1 Col2 Col3

1 gender 0 0.6313 0.2651 -0.024102 gender 1 0.2651 0.4611 -0.024103 age -0.02410 -0.02410 0.002191

Type 3 Tests of Fixed Effects

Num DenEffect DF DF F Value Pr > F

gender 2 25 423.41 <.0001age 1 80 136.97 <.0001

FULL MODEL WITH COMPOUND SYMMETRY FOR EACH GENDER, REML 34

The Mixed Procedure

Model Information

Data Set WORK.DENT1Dependent Variable distanceCovariance Structure Compound SymmetrySubject Effect childGroup Effect genderEstimation Method REMLResidual Variance Method NoneFixed Effects SE Method Model-BasedDegrees of Freedom Method Between-Within

Class Level Information

Class Levels Values

gender 2 0 1child 27 1 2 3 4 5 6 7 8 9 10 11 12 13

14 15 16 17 18 19 20 21 22 2324 25 26 27

Dimensions

Covariance Parameters 4Columns in X 4

PAGE 268

Page 278: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 8 ST 732, M. DAVIDIAN

Columns in Z 0Subjects 27Max Obs Per Subject 4Observations Used 108Observations Not Used 0Total Observations 108

Iteration History

Iteration Evaluations -2 Res Log Like Criterion

0 1 483.559117461 1 414.66636550 0.00000000

Convergence criteria met.

Estimated R Matrix for child 1

Row Col1 Col2 Col3 Col4

1 4.8870 4.2786 4.2786 4.27862 4.2786 4.8870 4.2786 4.27863 4.2786 4.2786 4.8870 4.27864 4.2786 4.2786 4.2786 4.8870

FULL MODEL WITH COMPOUND SYMMETRY FOR EACH GENDER, REML 35

The Mixed Procedure

Estimated R Correlation Matrix for child 1

Row Col1 Col2 Col3 Col4

1 1.0000 0.8755 0.8755 0.87552 0.8755 1.0000 0.8755 0.87553 0.8755 0.8755 1.0000 0.87554 0.8755 0.8755 0.8755 1.0000

Covariance Parameter Estimates

Cov Parm Subject Group Estimate

Variance child gender 0 0.6085CS child gender 0 4.2786Variance child gender 1 2.8164CS child gender 1 2.6407

Fit Statistics

-2 Res Log Likelihood 414.7AIC (smaller is better) 422.7AICC (smaller is better) 423.1BIC (smaller is better) 427.8

Null Model Likelihood Ratio Test

DF Chi-Square Pr > ChiSq

3 68.89 <.0001

Solution for Fixed Effects

StandardEffect gender Estimate Error DF t Value Pr > |t|

gender 0 17.3727 0.8587 25 20.23 <.0001gender 1 16.3406 1.1287 25 14.48 <.0001age*gender 0 0.4795 0.05259 79 9.12 <.0001age*gender 1 0.7844 0.09382 79 8.36 <.0001

Covariance Matrix for Fixed Effects

Row Effect gender Col1 Col2 Col3 Col4

1 gender 0 0.7374 -0.030422 gender 1 1.2740 -0.096813 age*gender 0 -0.03042 0.0027664 age*gender 1 -0.09681 0.008801

FULL MODEL WITH COMPOUND SYMMETRY FOR EACH GENDER, REML 36

The Mixed Procedure

PAGE 269

Page 279: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 8 ST 732, M. DAVIDIAN

Type 3 Tests of Fixed Effects

Num DenEffect DF DF F Value Pr > F

gender 2 25 309.43 <.0001age*gender 2 79 76.53 <.0001

Estimates

StandardLabel Estimate Error DF t Value Pr > |t|

boy at 11 24.9688 0.4572 79 54.61 <.0001

FULL MODEL, DIFFERENCE PARAMETERIZATION 37

The Mixed Procedure

Model Information

Data Set WORK.DENT1Dependent Variable distanceCovariance Structure Compound SymmetrySubject Effect childGroup Effect genderEstimation Method MLResidual Variance Method NoneFixed Effects SE Method Model-BasedDegrees of Freedom Method Between-Within

Class Level Information

Class Levels Values

gender 2 0 1child 27 1 2 3 4 5 6 7 8 9 10 11 12 13

14 15 16 17 18 19 20 21 22 2324 25 26 27

Dimensions

Covariance Parameters 4Columns in X 6Columns in Z 0Subjects 27Max Obs Per Subject 4Observations Used 108Observations Not Used 0Total Observations 108

Iteration History

Iteration Evaluations -2 Log Like Criterion

0 1 478.241759861 1 408.81297228 0.00000000

Convergence criteria met.

Estimated R Matrix for child 1

Row Col1 Col2 Col3 Col4

1 4.4704 3.8804 3.8804 3.88042 3.8804 4.4704 3.8804 3.88043 3.8804 3.8804 4.4704 3.88044 3.8804 3.8804 3.8804 4.4704

FULL MODEL, DIFFERENCE PARAMETERIZATION 38

The Mixed Procedure

Estimated R Correlation Matrix for child 1

Row Col1 Col2 Col3 Col4

1 1.0000 0.8680 0.8680 0.86802 0.8680 1.0000 0.8680 0.86803 0.8680 0.8680 1.0000 0.86804 0.8680 0.8680 0.8680 1.0000

PAGE 270

Page 280: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 8 ST 732, M. DAVIDIAN

Covariance Parameter Estimates

Cov Parm Subject Group Estimate

Variance child gender 0 0.5900CS child gender 0 3.8804Variance child gender 1 2.7577CS child gender 1 2.4463

Fit Statistics

-2 Log Likelihood 408.8AIC (smaller is better) 424.8AICC (smaller is better) 426.3BIC (smaller is better) 435.2

Null Model Likelihood Ratio Test

DF Chi-Square Pr > ChiSq

3 69.43 <.0001

Solution for Fixed Effects

StandardEffect gender Estimate Error DF t Value Pr > |t|

Intercept 16.3406 1.1130 25 14.68 <.0001gender 0 1.0321 1.3890 25 0.74 0.4644gender 1 0 . . . .age 0.7844 0.09283 79 8.45 <.0001age*gender 0 -0.3048 0.1063 79 -2.87 0.0053age*gender 1 0 . . . .

Covariance Matrix for Fixed Effects

Row Effect gender Col1 Col2 Col3 Col4 Col5

1 Intercept 1.2388 -1.2388 -0.09480 0.094802 gender 0 -1.2388 1.9294 0.09480 -0.12433 gender 1

FULL MODEL, DIFFERENCE PARAMETERIZATION 39

The Mixed Procedure

Covariance Matrix for Fixed Effects

Row Effect gender Col1 Col2 Col3 Col4 Col5

4 age -0.09480 0.09480 0.008618 -0.008625 age*gender 0 0.09480 -0.1243 -0.00862 0.011306 age*gender 1

CovarianceMatrix for

Fixed Effects

Row Col6

123456

Type 3 Tests of Fixed Effects

Num DenEffect DF DF Chi-Square F Value Pr > ChiSq Pr > F

gender 1 25 0.55 0.55 0.4575 0.4644age 1 79 141.37 141.37 <.0001 <.0001age*gender 1 79 8.22 8.22 0.0041 0.0053

PAGE 271

Page 281: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 8 ST 732, M. DAVIDIAN

INTERPRETATION:

• Comparison with ordinary least squares (independence assumption). Pages 1–3 of the

output show the results of fitting the straight line model separately for each gender and then for

both genders together using ordinary least squares. Thus, these fits do not take correlation into

account, but rather assume that all observations across all children are independent. Because the

information on the straight line for each gender comes only from the data from that gender, the

estimates of intercept and slope for each are the same regardless of whether the model is fitted

separately or simultaneously. The ordinary least squares estimates are

β0,G,OLS = 17.3273, β1,G,OLS = 0.4795, β0,B,OLS = 16.3406, β1,B,OLS = 0.7844.

Pages 10–11 show the results of fitting the model with both genders simultaneously but assuming

the same compound symmetry structure for both genders. Note that the estimates of β are

identical to the ordinary least squares estimates. Pages 19-21 show the results of fitting the

same model, but in the second “difference” parameterization and assuming a separate compound

symmetry structure for each gender. Again, the estimates for β are identical to the ordinary

least squares estimates. Both of these fits were carried out using maximum likelihood estimation

(method=ml).

Inspection of fits with other covariance structures shows that these lead to estimates for β that

are different from ordinary least squares. This reflects a result we will see later, that when the

covariance structure is of a certain form (of which compound symmetry is a special case), estimates

of β are the same as ordinary least squares. However, the standard errors computed under

the independence assumption will differ from those computed under the compound symmetry, so

that tests about β could lead to different conclusions. See the output to verify that the standard

error estimates are indeed different.

• Choice of covariance structure. Pages 4–9 show the results of fitting the straight line model

separately for each gender assuming that the covariance matrix is unstructured. This allows the

analyst to examine the “raw” evidence for whether it seems reasonable to assume that the structure

is the same for each gender or different. Page 4 shows the estimate for girls, page 7 for boys (R

Matrix for CHILD 1 or 12). PROC MIXED prints out the estimate for the first child in each group;

these are balanced data, so the matrix is the same for all other children. The corresponding

correlation matrices R Correlation Matrix) are also printed. Comparison of these shows that

the estimated pattern of correlation appears quite different for the two genders; observations on

girls seem to be more highly correlated.

PAGE 272

Page 282: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 8 ST 732, M. DAVIDIAN

Pages 8–27 show the results of fits of several different covariance structures using maximum like-

lihood. In the following table, we summarize the results (see the output for each fit):

Model −2 loglike AIC BIC

Compound symmetry, same 428.6 440.6 448.4

AR(1), same 440.7 452.7 460.5

One-dependent, same 457.4 469.4 477.2

Compound symmetry, different 408.8 424.8 435.2

AR(1), different 415.4 431.4 441.8

One-dependent, different 444.6 460.6 471.0

Inspection of the AIC and BIC values reveals that those for models where the covariance structure

is allowed to differ across genders are mostly smaller than those for models where the structure

is assumed to be the same. Both criteria are smallest in a fairly convincing way for the choice

of separate compound symmetry structures for each gender. As both criteria agree, a sensible

approach would be to choose this model to represent the covariance structure.

• Hypothesis of common slopes. Having decided upon the covariance model, we now turn to

hypotheses of interest. Tests of these hypotheses will be based on the fit of this model. On pages

28–30, the fit of the full model using the first parameterization is shown. The covb option results

in printing of the estimates covariance matrix V β for this fit (Covariance Matrix for Fixed

Effects on page 29). The matrix is

V β =

0.6907 0.0000 −0.0295 0.0000

0.0000 1.2388 0.0000 −0.0948

−0.0295 0.0000 0.0027 0.0000

0.0000 −0.0948 0.0000 0.0086

.

It is straightforward to verify that the estimated standard errors printed in the table Solution

for Fixed Effects are the square roots of the diagonal elements of this matrix. Also from the

output, we find that −2 times the log-likelihood is equal to 408.8.

On pages 31–33, we fit the “reduced” model which assumes the slope is the same and equal to

β1 for both genders:

Yij = β0,B + β1tij + eij for boys

= β0,G + β1tij + eij for girls

The estimate of β1 is 0.5478. The log-likelihood multiplied by −2 is 416.6.

PAGE 273

Page 283: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 8 ST 732, M. DAVIDIAN

The likelihood ratio test statistic for testing the null hypothesis that the slopes are the same is

416.6 − 408.8 = 7.8. The difference in number of parameters between the “full” and “reduced”

models is r = 1. Thus, we compare the test statistic value to χ21,0.95 = 3.84. As the statistic is

much larger than the critical value, we have strong evidence to suggest that the slopes are indeed

different; we reject the null hypothesis at level α = 0.05.

We may also conduct this test using Wald methods. Define

L = (0, 0, 1,−1).

Then it may be verified (try it!) that, using V β above from the full model fit on p. 29,

TL = 8.22.

This test statistic also has a sampling distribution that is χ21; thus, we compare 8.22 to 3.84

and reject the null hypothesis on the basis of this procedure as well. For this parameterization,

the table Tests of Fixed Effects on page 39 in fact computes this test statistic (from the

chisq option); for a model with several straight lines and the “difference” parameterization, the

“interaction” test (AGE*GENDER here) is a test for equal slopes (the test for equal intercepts is the

“main effect” test for GENDER here). PROC MIXED by default produces an “adjusted” version of the

χ2 Wald statistic that is to be compared to an F distribution. This statistic is identical to the

Wald statistic when there are only 2 groups, as here. This table of Tests of Fixed Effects is

meaningless for this model in the first parameterization.

Alternatively, we see that PROC MIXED will computes this test for us in another place, too. On

pages 37–39, the results of fitting the full model using the second “difference” parameterization

are shown. In the table Solution for Fixed Effects, the estimate of β1,G−B = −0.3048 with

estimated standard error 0.1063. Note that when we parameterize the model this way, SAS displays

the results as if the model were overparameterized. One can reconstruct the estimates of intercept

and slope for girls from this table. The null hypothesis of common slope is H0 : β1,G−B = 0 in this

parameterization. We may construct a Wald test statistic as −0.3048/0.1063 = −2.87; actually,

SAS does this for us in the table.

PAGE 274

Page 284: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 8 ST 732, M. DAVIDIAN

• Estimation of mean for boys at age 11. In the analysis using REML on pages 34–36, we

use an estimate statement to ask PROC MIXED to compute an estimate of the mean distance for

a boy of 11 years of age. The estimate and its standard error are 24.9688 (0.4572). This may be

verified manually; from the output,

V β =

0.7374 0.0000 −0.0304 0.0000

0.0000 1.2740 0.0000 −0.09681

−0.0304 0.0000 0.00276 0.0000

0.0000 −0.0968 0.0000 0.0088

.

With

L = (0, 1, 0, 11),

Lβ = β0,B + β1,B(11), the desired quantity. It may be verified that the matrix multiplication

Lβ leads to the estimate above. Furthermore, the estimated standard error for Lβ is given by

(LV βL′)1/2, which may be verified to give the value above.

PAGE 275

Page 285: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 8 ST 732, M. DAVIDIAN

EXAMPLE 2 – DIALYZER DATA: In the following program, we consider the model that assumes that

the mean response is a straight line as a function of time for each center.

• As with the dental data, we may parameterize this model with either (1) a separate intercept

and slope for each center as in equation (8.10) or (2) with the “difference” parameterization with

each center’s intercept and slope represented with a parameter that is the difference between the

intercept or slope for that center measured against that for center 3.

• This mean model is fitted using ordinary least squares (so assuming the independence covariance

structure) and then by restricted maximum likelihood (the default method used by PROC MIXED)

assuming the compound symmetry and Markov covariance structures. Recall that these data are

unbalanced in the sense that the “times” (transmembrane pressures in this case) are different for

each dialyzer; thus, it is not possible to consider a completely unstructured covariance structure

nor some of the models for covariance that only make sense if the data are balanced.

• The preferred covariance structure according to inspection of the AIC and BIC values is fitted

using both parameterizations (1) and (2); from the output for the latter fit, the Wald test statistics

may be examined to investigate whether rate of change of ultrafiltration rate with pressure differs

across centers.

• The variable tmp representing transmembrane pressure is rescaled by dividing its value by 100.

This is carried out to allow sensible and stable fitting of the Markov covariance structure. Recall

that for this structure, the correlation parameter ρ is raised to a power equal to the difference

between adjacent “times” within each unit. Because the pressures here are on the order of 100s,

these differences may be quite large (=100 or more). Computationally, raising a small number to a

power this large is not feasible, and will cause numerical algorithms used to carry out maximization

of likelihoods or restricted likelihoods to fail. By rescaling the pressures, and hence the differences,

we alleviate this difficulty. This does not alter the problem or our ability to draw valid conclusions;

all it does is put slope parameters on a scale of 100 mmHg/unit pressure rather than mmHg/unit

pressure.

PAGE 276

Page 286: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 8 ST 732, M. DAVIDIAN

PROGRAM:

/*******************************************************************

CHAPTER 8, EXAMPLE 2

Analysis of the ultrafiltration data by fitting a general linearregression model in transmembrane pressure (mmHg)

- the repeated measurement factor is transmembrane pressure (tmp)

- there is one "treatment" factor, center

- the response is ultrafiltration rate (ufr, ml/hr)

For each center, the mean model is a straight line in time.

We use the REPEATED statement of PROC MIXED with theTYPE= options to fit the model assuming various covariance structures.

These data are unbalanced both in the sense that the pressuresunder which each dialyzer is observed are different.

*******************************************************************/

options ls=80 ps=59 nodate; run;

/******************************************************************

Read in the data set

*******************************************************************/

data ultra; infile ’ultra.dat’;input subject tmp ufr center;

* rescale the pressures;

tmp=tmp/100;

run;

/*******************************************************************

Fit the straight line model assuming that the covariancestructure of a data vector is diagonal with constant variance;i.e. using ordinary least squares.

We use PROC GLM with the SOLUTION and NOINT options to fitthe three separate intercepts/slopes parameterization.

*******************************************************************/

title "FIT USING ORDINARY LEAST SQUARES";proc glm data=ultra;class center;model ufr = center center*tmp / noint solution;

run;

/*******************************************************************

Now use PROC MIXED to fit the more general regression model withassumptions about the covariance matrix of a data vector. We showtwo, assuming the covariance is similar across centers.

The SOLUTION option in the MODEL statement requests that theestimates of the regression parameters be printed.

The R option in the REPEATED statement as used here requests thatthe covariance matrix estimate be printed in matrix form. We alsoprint the correlation matrix using the RCORR option.

*******************************************************************/

* compound symmetry;

title "FIT WITH COMPOUND SYMMETRY";proc mixed data=ultra method=ml;class subject center ;model ufr = center center*tmp / noint solution covb;repeated / type = cs subject=subject r rcorr;

run;

* Markov;

title "FIT WITH MARKOV STRUCTURE";proc mixed data=ultra method=ml;class subject center ;

PAGE 277

Page 287: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 8 ST 732, M. DAVIDIAN

model ufr = center center*tmp / noint solution covb;repeated / type = sp(pow)(tmp) subject=subject r rcorr;

run;

* using the alternative parameterization to get the chi-square tests;

title "FIT WITH MARKOV STRUCTURE AND DIFFERENCE PARAMETERIZATION";proc mixed data=ultra method=ml;class subject center ;model ufr = center tmp center*tmp / solution covb chisq;repeated / type = sp(pow)(tmp) subject=subject r rcorr;

run;

OUTPUT: First we display the output; following this is a brief interpretation.

FIT USING ORDINARY LEAST SQUARES 1

The GLM Procedure

Class Level Information

Class Levels Values

center 3 1 2 3

Number of observations 164

FIT USING ORDINARY LEAST SQUARES 2

The GLM Procedure

Dependent Variable: ufr

Sum ofSource DF Squares Mean Square F Value Pr > F

Model 6 243256296.5 40542716.1 14328.2 <.0001

Error 158 447071.5 2829.6

Uncorrected Total 164 243703368.0

R-Square Coeff Var Root MSE ufr Mean

0.987565 4.726174 53.19367 1125.512

Source DF Type I SS Mean Square F Value Pr > F

center 3 208388808.8 69462936.3 24549.0 <.0001tmp*center 3 34867487.8 11622495.9 4107.52 <.0001

Source DF Type III SS Mean Square F Value Pr > F

center 3 514475.40 171491.80 60.61 <.0001tmp*center 3 34867487.76 11622495.92 4107.52 <.0001

StandardParameter Estimate Error t Value Pr > |t|

center 1 -175.1259559 18.97989383 -9.23 <.0001center 2 -168.7697782 21.19872031 -7.96 <.0001center 3 -148.0350885 25.65223883 -5.77 <.0001tmp*center 1 441.1821984 5.73604724 76.91 <.0001tmp*center 2 411.5087473 6.66672020 61.73 <.0001tmp*center 3 405.5340253 7.95819811 50.96 <.0001

FIT WITH COMPOUND SYMMETRY 3

The Mixed Procedure

Model Information

Data Set WORK.ULTRADependent Variable ufrCovariance Structure Compound SymmetrySubject Effect subjectEstimation Method MLResidual Variance Method ProfileFixed Effects SE Method Model-BasedDegrees of Freedom Method Between-Within

PAGE 278

Page 288: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 8 ST 732, M. DAVIDIAN

Class Level Information

Class Levels Values

subject 41 1 2 3 4 5 6 7 8 9 10 11 12 1314 15 16 17 18 19 20 21 22 2324 25 26 27 28 29 30 31 32 3334 35 36 37 38 39 40 41

center 3 1 2 3

Dimensions

Covariance Parameters 2Columns in X 6Columns in Z 0Subjects 41Max Obs Per Subject 5Observations Used 164Observations Not Used 0Total Observations 164

Iteration History

Iteration Evaluations -2 Log Like Criterion

0 1 1762.751435251 2 1697.47817418 0.00000000

Convergence criteria met.

Estimated R Matrix for subject 1

Row Col1 Col2 Col3 Col4

1 2723.81 1576.70 1576.70 1576.702 1576.70 2723.81 1576.70 1576.703 1576.70 1576.70 2723.81 1576.704 1576.70 1576.70 1576.70 2723.81

FIT WITH COMPOUND SYMMETRY 4

The Mixed Procedure

Estimated R Correlation Matrix for subject 1

Row Col1 Col2 Col3 Col4

1 1.0000 0.5789 0.5789 0.57892 0.5789 1.0000 0.5789 0.57893 0.5789 0.5789 1.0000 0.57894 0.5789 0.5789 0.5789 1.0000

Covariance Parameter Estimates

Cov Parm Subject Estimate

CS subject 1576.70Residual 1147.12

Fit Statistics

-2 Log Likelihood 1697.5AIC (smaller is better) 1713.5AICC (smaller is better) 1714.4BIC (smaller is better) 1727.2

Null Model Likelihood Ratio Test

DF Chi-Square Pr > ChiSq

1 65.27 <.0001

Solution for Fixed Effects

StandardEffect center Estimate Error DF t Value Pr > |t|

center 1 -174.32 15.4542 38 -11.28 <.0001center 2 -171.51 17.4378 38 -9.84 <.0001center 3 -150.40 20.2761 38 -7.42 <.0001

PAGE 279

Page 289: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 8 ST 732, M. DAVIDIAN

tmp*center 1 440.92 3.6528 120 120.71 <.0001tmp*center 2 412.24 4.2494 120 97.01 <.0001tmp*center 3 406.31 5.0777 120 80.02 <.0001

Covariance Matrix for Fixed Effects

Row Effect center Col1 Col2 Col3 Col4 Col5

1 center 1 238.83 -41.52322 center 2 304.08 -53.84253 center 3 411.124 tmp*center 1 -41.5232 13.34335 tmp*center 2 -53.8425 18.0574

FIT WITH COMPOUND SYMMETRY 5

The Mixed Procedure

Covariance Matrix for Fixed Effects

Row Effect center Col1 Col2 Col3 Col4 Col5

6 tmp*center 3 -78.9443

CovarianceMatrix for

Fixed Effects

Row Col6

123 -78.9443456 25.7835

Type 3 Tests of Fixed Effects

Num DenEffect DF DF F Value Pr > F

center 3 38 93.00 <.0001tmp*center 3 120 10128.0 <.0001

FIT WITH MARKOV STRUCTURE 6

The Mixed Procedure

Model Information

Data Set WORK.ULTRADependent Variable ufrCovariance Structure Spatial PowerSubject Effect subjectEstimation Method MLResidual Variance Method ProfileFixed Effects SE Method Model-BasedDegrees of Freedom Method Between-Within

Class Level Information

Class Levels Values

subject 41 1 2 3 4 5 6 7 8 9 10 11 12 1314 15 16 17 18 19 20 21 22 2324 25 26 27 28 29 30 31 32 3334 35 36 37 38 39 40 41

center 3 1 2 3

Dimensions

Covariance Parameters 2Columns in X 6Columns in Z 0Subjects 41Max Obs Per Subject 5Observations Used 164Observations Not Used 0Total Observations 164

Iteration History

Iteration Evaluations -2 Log Like Criterion

PAGE 280

Page 290: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 8 ST 732, M. DAVIDIAN

0 1 1762.751435251 2 1689.99200625 0.000003202 1 1689.98977683 0.00000000

Convergence criteria met.

Estimated R Matrix for subject 1

Row Col1 Col2 Col3 Col4

1 2913.20 1954.28 1336.16 952.562 1954.28 2913.20 1991.78 1419.973 1336.16 1991.78 2913.20 2076.864 952.56 1419.97 2076.86 2913.20

FIT WITH MARKOV STRUCTURE 7

The Mixed Procedure

Estimated R Correlation Matrix for subject 1

Row Col1 Col2 Col3 Col4

1 1.0000 0.6708 0.4587 0.32702 0.6708 1.0000 0.6837 0.48743 0.4587 0.6837 1.0000 0.71294 0.3270 0.4874 0.7129 1.0000

Covariance Parameter Estimates

Cov Parm Subject Estimate

SP(POW) subject 0.6837Residual 2913.20

Fit Statistics

-2 Log Likelihood 1690.0AIC (smaller is better) 1706.0AICC (smaller is better) 1706.9BIC (smaller is better) 1719.7

Null Model Likelihood Ratio Test

DF Chi-Square Pr > ChiSq

1 72.76 <.0001

Solution for Fixed Effects

StandardEffect center Estimate Error DF t Value Pr > |t|

center 1 -171.68 18.9175 38 -9.08 <.0001center 2 -166.60 21.5922 38 -7.72 <.0001center 3 -144.92 25.5328 38 -5.68 <.0001tmp*center 1 441.34 5.0608 120 87.21 <.0001tmp*center 2 410.91 5.9007 120 69.64 <.0001tmp*center 3 403.23 6.9137 120 58.32 <.0001

Covariance Matrix for Fixed Effects

Row Effect center Col1 Col2 Col3 Col4 Col5

1 center 1 357.87 -79.78412 center 2 466.22 -105.843 center 3 651.934 tmp*center 1 -79.7841 25.61135 tmp*center 2 -105.84 34.8182

FIT WITH MARKOV STRUCTURE 8

The Mixed Procedure

Covariance Matrix for Fixed Effects

Row Effect center Col1 Col2 Col3 Col4 Col5

6 tmp*center 3 -150.66

CovarianceMatrix for

Fixed Effects

PAGE 281

Page 291: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 8 ST 732, M. DAVIDIAN

Row Col6

123 -150.66456 47.7993

Type 3 Tests of Fixed Effects

Num DenEffect DF DF F Value Pr > F

center 3 38 58.04 <.0001tmp*center 3 120 5285.40 <.0001

FIT WITH MARKOV STRUCTURE AND DIFFERENCE PARAMETERIZATION 9

The Mixed Procedure

Model Information

Data Set WORK.ULTRADependent Variable ufrCovariance Structure Spatial PowerSubject Effect subjectEstimation Method MLResidual Variance Method ProfileFixed Effects SE Method Model-BasedDegrees of Freedom Method Between-Within

Class Level Information

Class Levels Values

subject 41 1 2 3 4 5 6 7 8 9 10 11 12 1314 15 16 17 18 19 20 21 22 2324 25 26 27 28 29 30 31 32 3334 35 36 37 38 39 40 41

center 3 1 2 3

Dimensions

Covariance Parameters 2Columns in X 8Columns in Z 0Subjects 41Max Obs Per Subject 5Observations Used 164Observations Not Used 0Total Observations 164

Iteration History

Iteration Evaluations -2 Log Like Criterion

0 1 1762.751435251 2 1689.99200625 0.000003202 1 1689.98977683 0.00000000

Convergence criteria met.

Estimated R Matrix for subject 1

Row Col1 Col2 Col3 Col4

1 2913.20 1954.28 1336.16 952.562 1954.28 2913.20 1991.78 1419.973 1336.16 1991.78 2913.20 2076.864 952.56 1419.97 2076.86 2913.20

FIT WITH MARKOV STRUCTURE AND DIFFERENCE PARAMETERIZATION 10

The Mixed Procedure

Estimated R Correlation Matrix for subject 1

Row Col1 Col2 Col3 Col4

1 1.0000 0.6708 0.4587 0.32702 0.6708 1.0000 0.6837 0.48743 0.4587 0.6837 1.0000 0.7129

PAGE 282

Page 292: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 8 ST 732, M. DAVIDIAN

4 0.3270 0.4874 0.7129 1.0000

Covariance Parameter Estimates

Cov Parm Subject Estimate

SP(POW) subject 0.6837Residual 2913.20

Fit Statistics

-2 Log Likelihood 1690.0AIC (smaller is better) 1706.0AICC (smaller is better) 1706.9BIC (smaller is better) 1719.7

Null Model Likelihood Ratio Test

DF Chi-Square Pr > ChiSq

1 72.76 <.0001

Solution for Fixed Effects

StandardEffect center Estimate Error DF t Value Pr > |t|

Intercept -144.92 25.5328 38 -5.68 <.0001center 1 -26.7663 31.7773 38 -0.84 0.4049center 2 -21.6836 33.4387 38 -0.65 0.5206center 3 0 . . . .tmp 403.23 6.9137 120 58.32 <.0001tmp*center 1 38.1138 8.5680 120 4.45 <.0001tmp*center 2 7.6822 9.0894 120 0.85 0.3997tmp*center 3 0 . . . .

Covariance Matrix for Fixed Effects

Row Effect center Col1 Col2 Col3 Col4 Col5

1 Intercept 651.93 -651.93 -651.93 -150.662 center 1 -651.93 1009.80 651.93 150.663 center 2 -651.93 651.93 1118.15 150.66

FIT WITH MARKOV STRUCTURE AND DIFFERENCE PARAMETERIZATION 11

The Mixed Procedure

Covariance Matrix for Fixed Effects

Row Effect center Col1 Col2 Col3 Col4 Col5

4 center 35 tmp -150.66 150.66 150.66 47.79936 tmp*center 1 150.66 -230.44 -150.66 -47.79937 tmp*center 2 150.66 -150.66 -256.49 -47.79938 tmp*center 3

Covariance Matrix for Fixed Effects

Row Col6 Col7 Col8

1 150.66 150.662 -230.44 -150.663 -150.66 -256.4945 -47.7993 -47.79936 73.4106 47.79937 47.7993 82.61758

Type 3 Tests of Fixed Effects

Num DenEffect DF DF Chi-Square F Value Pr > ChiSq Pr > F

center 2 38 0.74 0.37 0.6917 0.6941tmp 1 120 14563.8 14563.8 <.0001 <.0001tmp*center 2 120 25.49 12.74 <.0001 <.0001

PAGE 283

Page 293: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 8 ST 732, M. DAVIDIAN

INTERPRETATION:

• Comparison with ordinary least squares: Note that, because these data are not balanced,

none of the estimates of the mean parameters β are exactly the same across methods. However,

note from pages 2, 4, and 7 of the output that the estimates are similar across methods, and the

ordering of the size of slopes and intercepts is in the same direction for each. Because these are

longitudinal data, however, the estimates that are based on a model that take into account the

likely correlation among observations within the same unit is more credible, and the tests and

standard errors derived from such a model are more reliable.

• Choice of covariance structure: Inspection of the AIC and BIC values for each of the

compound symmetry and Markov fits shows that both criteria are smaller when the Markov

structure is assumed. This gives a rationale for preferring this covariance model, given the choice

between the two. Note that in this case we have fitted the models using ML; the same mean

model is used in each case.

• Hypothesis tests. The final call to PROC MIXED fits the “difference” parameterization with the

Markov structure. As discussed in the interpretation of the dental study analysis, the result is that

the Tests of Fixed Effects given on page 11 of the output provide a test of the null hypothesis

that the slopes are the same for all centers (TMP*CENTER). Here, we have used the chisq option to

ask PROC MIXED to calculate the Wald statistic TL and the p-value obtained by comparing this to

the appropriate χ2 distribution. Here, the degrees of freedom is r = 2; under the null hypothesis,

there is only 1 common slope versus 3 separate slopes for the “full” model that has been fitted.

From the output TL = 25.49, with an associated p-value of 0.0001. Thus, there is strong evidence

to suggest that at least one of the slopes differs from the others. The test associated with CENTER

considers the same question with respect to intercepts; as seen from the output, TL for this test is

0.74, with a p-value of 0.69, suggesting that there is not enough evidence in these data to conclude

that the intercepts are different across centers.

From page 10, the Solution for Fixed Effects table shows that the estimate of difference in

slope between centers 3 and 1 is 38.114, with a estimated standard error of 8.57. The corresponding

Wald test statistic is 4.45, which compared to a standard normal (or t as in the output) distribution

yields a p-value of 0.0001. The comparison between slopes for centers 3 and 2 has an estimated

difference of 7.68 (9.09); the corresponding Wald test statistic is 0.85, with a large p-value.

PAGE 284

Page 294: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 8 ST 732, M. DAVIDIAN

These results seem to suggest that the rate of change in ultrafiltration rate with transmembrane

pressure is similar for centers 2 and 3, but is faster for center 1. One could also construct a test

of whether slope differs between centers 1 and 2 from the fit of parameterization (1) on page 7,

using the L matrix

L = (0, 0, 0, 1,−1, 0)

and the estimated covariance matrix for β given on that page; this could be done manually from

the output or by using the estimate statement

estimate ’slope 1 vs. 2’ center 0 0 0 center*tmp 1 -1 0;

(see the analysis of the dental data for an example).

EXAMPLE 3 – HIP REPLACEMENT DATA: In the following program, we consider the model in

(8.12),

Yij = β1 + β2tij + β3t2ij + β7ai + εij , males

Yij = β4 + β5tij + β6t2ij + β7ai + εij , females.

• The model is parameterized exactly as it is shown above. Each gender has its own intercept and

its own linear and quadratic coefficients, and there is a common effect of age regardless of gender.

We fit this model for illustrative purposes; one could entertain several other models and do “full”

versus “reduced” tests to zero in on an appropriate model.

• With this mean model, several covariance structures are considered: unstructured, compound

symmetry, AR(1), and one-dependence. Recall that these data are imbalanced in the sense that,

although all individuals were supposed to be seen at the same times (at 1, 2, 3, and 4 weeks), some

were missing at the least the week 3 measurement. To communicate this to PROC MIXED, the time

factor is incorporated as week in the mean model in the model statement and as a classification

factor time in the repeated statement (see the program below). Adding the class variable time

to the repeated statement has the effect of providing SAS with the information it needs about

the intended times of data collection so that it can set up each individual’s covariance matrix

appropriately. To see that this is indeed the case, the r and rcorr options of the repeated

statement are used to print out the covariance matrices for individuals 1, 10, and 15 (who have

different numbers of observations).

PAGE 285

Page 295: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 8 ST 732, M. DAVIDIAN

• We show use of the contrast and estimate statements in the one-dependent fit; here, we ask

PROC MIXED to estimate the difference in mean response between females and males at week 3 and

test whether it is different from 0; in the notation above, this is

β4 + β5(3) + β6(9)− β1 − β2(3)− β3(9).

The appropriate L matrix would be

L = (−1,−3,−9, 1, 3, 9, 0).

In the program, females and males are coded 0 and 1, respectively; one may examine the output

from the fits to determine how SAS has represented the model and thus how this contrast should

be represented in the contrast and estimate statements.

• For all fits, we use the default REML method. We compare the AIC and BIC values for this

same mean model using this method to determine a suitable covariance model.

PROGRAM:

/*******************************************************************

CHAPTER 8, EXAMPLE 3

Analysis of the hip replacement data using a generalregression model in time and age

- the repeated measurement factor is time (weeks)

- there is one "treatment" factor, gender (0=female, 1 = male)

- an additional covariate, age, is also available

- the response is haematocrit

We use the REPEATED statement of PROC MIXED with theTYPE= options to fit the model assuming different covariatestructures.

These data are unbalanced both in the sense that some patientswere not observed at all times.

*******************************************************************/

options ls=80 ps=59 nodate; run;

/******************************************************************

Read in the data set

*******************************************************************/

data hips; infile ’hips.dat’;input patient gender age week h;week2=week*week;time=week;

/*******************************************************************

Use PROC MIXED to fit the general quadratic regression model withassumptions about the covariance matrix of a data vector.

The SOLUTION option in the MODEL statement requests that theestimates of the regression parameters be printed.

The R option in the REPEATED statement as used here requests thatthe covariance matrix estimate be printed in matrix form. Here,because the data have unequal numbers of observations, we ask

PAGE 286

Page 296: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 8 ST 732, M. DAVIDIAN

to see the matrices for 2 individuals with different numbers.Similarly for the RCORR option, which prints the correspondingcorrelation matrix.

With the ar(1) and one-dependent structures, we have to becareful to communicate to PROC MIXED the fact that the dataare imbalanced in the sense that the times are all the samefor all patients, but some patients are not observed at someof the times. In our mean model, we want WEEK, the time factor,to be continuous; however, PROC MIXED needs also for the timefactor to be a classification factor so that it can properly figure outthe missingness pattern. We give it this information by definingTIME = WEEK and letting TIME be a classification factor in theREPEATED statement.

*******************************************************************/

* unstructured;

title "FIT WITH UNSTRUCTURED COMMON COVARIANCE";proc mixed data=hips;class patient time gender;model h = gender gender*week gender*week2 age / noint solution chisq;repeated time / type = un subject=patient r= 1,10,15 rcorr=1,10,15;

run;

* compound symmetry;

title "FIT WITH COMMON COMPOUND SYMMETRY";proc mixed data=hips;class patient time gender;model h = gender gender*week gender*week2 age / noint solution chisq;repeated time / type = cs subject=patient rcorr=1,10,15;

run;

* ar(1);

title "FIT WITH COMMON AR(1) STRUCTURE";proc mixed data=hips;class patient time gender;model h = gender gender*week gender*week2 age / noint solution chisq;repeated time / type = ar(1) subject=patient rcorr=1,10,15;

run;

* one-dependent;* and show use of CONTRAST statement;

title "FIT WITH COMMON ONE-DEPENDENT STRUCTURE";proc mixed data=hips;class patient time gender;model h = gender gender*week gender*week2 age / noint solution chisq covb;repeated time / type = toep(2) subject=patient rcorr=1,10,15;contrast ’f vs m, wk 3’ gender 1 -1

gender*week 3 -3 gender*week2 9 -9 /chisq;estimate ’f vs m, wk 3’ gender 1 -1

gender*week 3 -3 gender*week2 9 -9;run;

PAGE 287

Page 297: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 8 ST 732, M. DAVIDIAN

OUTPUT:

FIT WITH UNSTRUCTURED COMMON COVARIANCE 1

The Mixed Procedure

Model Information

Data Set WORK.HIPSDependent Variable hCovariance Structure UnstructuredSubject Effect patientEstimation Method REMLResidual Variance Method NoneFixed Effects SE Method Model-BasedDegrees of Freedom Method Between-Within

Class Level Information

Class Levels Values

patient 30 1 2 3 4 5 6 7 8 9 10 11 12 1314 15 16 17 18 19 20 21 22 2324 25 26 27 28 29 30

time 4 0 1 2 3gender 2 0 1

Dimensions

Covariance Parameters 10Columns in X 7Columns in Z 0Subjects 30Max Obs Per Subject 4Observations Used 99Observations Not Used 0Total Observations 99

Iteration History

Iteration Evaluations -2 Res Log Like Criterion

0 1 561.121550031 2 551.06018998 0.000593802 1 549.70264000 0.010939153 1 546.99589520 0.006220144 1 545.54535711 0.002910745 1 544.84740510 0.001137896 1 544.58650911 0.000270637 1 544.52750285 0.000025048 1 544.52249433 0.000000299 1 544.52243938 0.00000000

Convergence criteria met.

FIT WITH UNSTRUCTURED COMMON COVARIANCE 2

The Mixed Procedure

Estimated R Matrix for patient 1

Row Col1 Col2 Col3

1 18.0680 4.6364 5.09472 4.6364 16.5021 0.48703 5.0947 0.4870 19.2076

Estimated R CorrelationMatrix for patient 1

Row Col1 Col2 Col3

1 1.0000 0.2685 0.27352 0.2685 1.0000 0.027353 0.2735 0.02735 1.0000

Estimated R Matrix for patient 10

Row Col1 Col2 Col3 Col4

1 18.0680 4.6364 -13.9213 5.09472 4.6364 16.5021 2.8483 0.48703 -13.9213 2.8483 67.8805 25.1818

PAGE 288

Page 298: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 8 ST 732, M. DAVIDIAN

4 5.0947 0.4870 25.1818 19.2076

Estimated R Correlation Matrix for patient 10

Row Col1 Col2 Col3 Col4

1 1.0000 0.2685 -0.3975 0.27352 0.2685 1.0000 0.08510 0.027353 -0.3975 0.08510 1.0000 0.69744 0.2735 0.02735 0.6974 1.0000

Estimated R Matrixfor patient 15

Row Col1 Col2

1 16.5021 0.48702 0.4870 19.2076

Estimated R CorrelationMatrix for patient 15

Row Col1 Col2

1 1.0000 0.027352 0.02735 1.0000

FIT WITH UNSTRUCTURED COMMON COVARIANCE 3

The Mixed Procedure

Covariance Parameter Estimates

Cov Parm Subject Estimate

UN(1,1) patient 18.0680UN(2,1) patient 4.6364UN(2,2) patient 16.5021UN(3,1) patient -13.9213UN(3,2) patient 2.8483UN(3,3) patient 67.8805UN(4,1) patient 5.0947UN(4,2) patient 0.4870UN(4,3) patient 25.1818UN(4,4) patient 19.2076

Fit Statistics

-2 Res Log Likelihood 544.5AIC (smaller is better) 564.5AICC (smaller is better) 567.2BIC (smaller is better) 578.5

Null Model Likelihood Ratio Test

DF Chi-Square Pr > ChiSq

9 16.60 0.0554

Solution for Fixed Effects

StandardEffect gender Estimate Error DF t Value Pr > |t|

gender 0 42.2823 3.1835 28 13.28 <.0001gender 1 45.5650 3.1116 28 14.64 <.0001week*gender 0 -11.4526 1.8018 28 -6.36 <.0001week*gender 1 -15.8799 2.0222 28 -7.85 <.0001week2*gender 0 2.9269 0.5640 28 5.19 <.0001week2*gender 1 4.2369 0.6368 28 6.65 <.0001age -0.04330 0.04465 28 -0.97 0.3405

Type 3 Tests of Fixed Effects

Num DenEffect DF DF Chi-Square F Value Pr > ChiSq Pr > F

gender 2 28 214.58 107.29 <.0001 <.0001week*gender 2 28 102.07 51.03 <.0001 <.0001week2*gender 2 28 71.20 35.60 <.0001 <.0001age 1 28 0.94 0.94 0.3322 0.3405

PAGE 289

Page 299: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 8 ST 732, M. DAVIDIAN

FIT WITH COMMON COMPOUND SYMMETRY 4

The Mixed Procedure

Model Information

Data Set WORK.HIPSDependent Variable hCovariance Structure Compound SymmetrySubject Effect patientEstimation Method REMLResidual Variance Method ProfileFixed Effects SE Method Model-BasedDegrees of Freedom Method Between-Within

Class Level Information

Class Levels Values

patient 30 1 2 3 4 5 6 7 8 9 10 11 12 1314 15 16 17 18 19 20 21 22 2324 25 26 27 28 29 30

time 4 0 1 2 3gender 2 0 1

Dimensions

Covariance Parameters 2Columns in X 7Columns in Z 0Subjects 30Max Obs Per Subject 4Observations Used 99Observations Not Used 0Total Observations 99

Iteration History

Iteration Evaluations -2 Res Log Like Criterion

0 1 561.121550031 2 556.70472691 0.000002752 1 556.70418983 0.00000000

Convergence criteria met.

Estimated R CorrelationMatrix for patient 1

Row Col1 Col2 Col3

1 1.0000 0.2079 0.20792 0.2079 1.0000 0.20793 0.2079 0.2079 1.0000

FIT WITH COMMON COMPOUND SYMMETRY 5

The Mixed Procedure

Estimated R Correlation Matrix for patient 10

Row Col1 Col2 Col3 Col4

1 1.0000 0.2079 0.2079 0.20792 0.2079 1.0000 0.2079 0.20793 0.2079 0.2079 1.0000 0.20794 0.2079 0.2079 0.2079 1.0000

Estimated R CorrelationMatrix for patient 15

Row Col1 Col2

1 1.0000 0.20792 0.2079 1.0000

Covariance Parameter Estimates

Cov Parm Subject Estimate

CS patient 3.8016Residual 14.4824

PAGE 290

Page 300: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 8 ST 732, M. DAVIDIAN

Fit Statistics

-2 Res Log Likelihood 556.7AIC (smaller is better) 560.7AICC (smaller is better) 560.8BIC (smaller is better) 563.5

Null Model Likelihood Ratio Test

DF Chi-Square Pr > ChiSq

1 4.42 0.0356

Solution for Fixed Effects

StandardEffect gender Estimate Error DF t Value Pr > |t|

gender 0 35.7027 3.8826 28 9.20 <.0001gender 1 39.6756 3.8088 28 10.42 <.0001week*gender 0 -9.5954 1.6604 64 -5.78 <.0001week*gender 1 -14.2653 1.9229 64 -7.42 <.0001week2*gender 0 2.5899 0.5180 64 5.00 <.0001week2*gender 1 3.8392 0.6046 64 6.35 <.0001age 0.03853 0.05562 64 0.69 0.4910

FIT WITH COMMON COMPOUND SYMMETRY 6

The Mixed Procedure

Type 3 Tests of Fixed Effects

Num DenEffect DF DF Chi-Square F Value Pr > ChiSq Pr > F

gender 2 28 109.24 54.62 <.0001 <.0001week*gender 2 64 88.53 44.26 <.0001 <.0001week2*gender 2 64 65.36 32.68 <.0001 <.0001age 1 64 0.48 0.48 0.4884 0.4910

FIT WITH COMMON AR(1) STRUCTURE 7

The Mixed Procedure

Model Information

Data Set WORK.HIPSDependent Variable hCovariance Structure AutoregressiveSubject Effect patientEstimation Method REMLResidual Variance Method ProfileFixed Effects SE Method Model-BasedDegrees of Freedom Method Between-Within

Class Level Information

Class Levels Values

patient 30 1 2 3 4 5 6 7 8 9 10 11 12 1314 15 16 17 18 19 20 21 22 2324 25 26 27 28 29 30

time 4 0 1 2 3gender 2 0 1

Dimensions

Covariance Parameters 2Columns in X 7Columns in Z 0Subjects 30Max Obs Per Subject 4Observations Used 99Observations Not Used 0Total Observations 99

Iteration History

Iteration Evaluations -2 Res Log Like Criterion

0 1 561.121550031 2 556.48035628 0.000000152 1 556.48032672 0.00000000

PAGE 291

Page 301: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 8 ST 732, M. DAVIDIAN

Convergence criteria met.

Estimated R CorrelationMatrix for patient 1

Row Col1 Col2 Col3

1 1.0000 0.2910 0.024652 0.2910 1.0000 0.084693 0.02465 0.08469 1.0000

FIT WITH COMMON AR(1) STRUCTURE 8

The Mixed Procedure

Estimated R Correlation Matrix for patient 10

Row Col1 Col2 Col3 Col4

1 1.0000 0.2910 0.08469 0.024652 0.2910 1.0000 0.2910 0.084693 0.08469 0.2910 1.0000 0.29104 0.02465 0.08469 0.2910 1.0000

Estimated R CorrelationMatrix for patient 15

Row Col1 Col2

1 1.0000 0.084692 0.08469 1.0000

Covariance Parameter Estimates

Cov Parm Subject Estimate

AR(1) patient 0.2910Residual 18.3070

Fit Statistics

-2 Res Log Likelihood 556.5AIC (smaller is better) 560.5AICC (smaller is better) 560.6BIC (smaller is better) 563.3

Null Model Likelihood Ratio Test

DF Chi-Square Pr > ChiSq

1 4.64 0.0312

Solution for Fixed Effects

StandardEffect gender Estimate Error DF t Value Pr > |t|

gender 0 35.8838 3.7661 28 9.53 <.0001gender 1 39.8949 3.6947 28 10.80 <.0001week*gender 0 -9.8043 1.6356 64 -5.99 <.0001week*gender 1 -14.6020 1.8736 64 -7.79 <.0001week2*gender 0 2.6313 0.5094 64 5.17 <.0001week2*gender 1 3.9150 0.5904 64 6.63 <.0001age 0.03749 0.05369 64 0.70 0.4875

FIT WITH COMMON AR(1) STRUCTURE 9

The Mixed Procedure

Type 3 Tests of Fixed Effects

Num DenEffect DF DF Chi-Square F Value Pr > ChiSq Pr > F

gender 2 28 117.06 58.53 <.0001 <.0001week*gender 2 64 96.75 48.37 <.0001 <.0001week2*gender 2 64 70.68 35.34 <.0001 <.0001age 1 64 0.49 0.49 0.4850 0.4875

FIT WITH COMMON ONE-DEPENDENT STRUCTURE 10

The Mixed Procedure

PAGE 292

Page 302: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 8 ST 732, M. DAVIDIAN

Model Information

Data Set WORK.HIPSDependent Variable hCovariance Structure Banded ToeplitzSubject Effect patientEstimation Method REMLResidual Variance Method ProfileFixed Effects SE Method Model-BasedDegrees of Freedom Method Between-Within

Class Level Information

Class Levels Values

patient 30 1 2 3 4 5 6 7 8 9 10 11 12 1314 15 16 17 18 19 20 21 22 2324 25 26 27 28 29 30

time 4 0 1 2 3gender 2 0 1

Dimensions

Covariance Parameters 2Columns in X 7Columns in Z 0Subjects 30Max Obs Per Subject 4Observations Used 99Observations Not Used 0Total Observations 99

Iteration History

Iteration Evaluations -2 Res Log Like Criterion

0 1 561.121550031 2 556.12352167 0.000000022 1 556.12351849 0.00000000

Convergence criteria met.

Estimated R CorrelationMatrix for patient 1

Row Col1 Col2 Col3

1 1.0000 0.32472 0.3247 1.00003 1.0000

FIT WITH COMMON ONE-DEPENDENT STRUCTURE 11

The Mixed Procedure

Estimated R Correlation Matrix for patient 10

Row Col1 Col2 Col3 Col4

1 1.0000 0.32472 0.3247 1.0000 0.32473 0.3247 1.0000 0.32474 0.3247 1.0000

Estimated R CorrelationMatrix for patient 15

Row Col1 Col2

1 1.00002 1.0000

Covariance Parameter Estimates

Cov Parm Subject Estimate

TOEP(2) patient 6.0104Residual 18.5118

Fit Statistics

PAGE 293

Page 303: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 8 ST 732, M. DAVIDIAN

-2 Res Log Likelihood 556.1AIC (smaller is better) 560.1AICC (smaller is better) 560.3BIC (smaller is better) 562.9

Null Model Likelihood Ratio Test

DF Chi-Square Pr > ChiSq

1 5.00 0.0254

Solution for Fixed Effects

StandardEffect gender Estimate Error DF t Value Pr > |t|

gender 0 36.2941 3.7164 28 9.77 <.0001gender 1 40.2860 3.6474 28 11.05 <.0001week*gender 0 -9.9910 1.6592 64 -6.02 <.0001week*gender 1 -14.8308 1.8879 64 -7.86 <.0001week2*gender 0 2.6610 0.5222 64 5.10 <.0001week2*gender 1 3.9601 0.6025 64 6.57 <.0001age 0.03354 0.05284 64 0.63 0.5279

FIT WITH COMMON ONE-DEPENDENT STRUCTURE 12

The Mixed Procedure

Covariance Matrix for Fixed Effects

Row Effect gender Col1 Col2 Col3 Col4 Col5

1 gender 0 13.8117 12.2645 -1.4234 0.05482 0.30042 gender 1 12.2645 13.3033 -0.4160 -1.1484 0.093783 week*gender 0 -1.4234 -0.4160 2.7531 -0.00186 -0.82634 week*gender 1 0.05482 -1.1484 -0.00186 3.5640 0.0004195 week2*gender 0 0.3004 0.09378 -0.8263 0.000419 0.27276 week2*gender 1 -0.01425 0.2285 0.000483 -1.0835 -0.000117 age -0.1880 -0.1821 0.006377 -0.00081 -0.00144

Covariance Matrixfor Fixed Effects

Row Col6 Col7

1 -0.01425 -0.18802 0.2285 -0.18213 0.000483 0.0063774 -1.0835 -0.000815 -0.00011 -0.001446 0.3630 0.0002127 0.000212 0.002792

Type 3 Tests of Fixed Effects

Num DenEffect DF DF Chi-Square F Value Pr > ChiSq Pr > F

gender 2 28 122.28 61.14 <.0001 <.0001week*gender 2 64 98.03 49.01 <.0001 <.0001week2*gender 2 64 69.19 34.60 <.0001 <.0001age 1 64 0.40 0.40 0.5257 0.5279

Estimates

StandardLabel Estimate Error DF t Value Pr > |t|

f vs m, wk 3 -1.1649 1.6223 64 -0.72 0.4753

Contrasts

Num DenLabel DF DF Chi-Square F Value Pr > ChiSq Pr > F

f vs m, wk 3 1 64 0.52 0.52 0.4727 0.4753

PAGE 294

Page 304: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 8 ST 732, M. DAVIDIAN

INTERPRETATION:

• Choice of covariance structure: From the output, we have the following results on pages 2,,

3, 5, 7, and 9:

Model −2 res loglike AIC BIC

Unstructured 544.5 564.5 578.5

Compound symmetry 556.7 560.7 563.5

AR(1) 556.5 560.5 563.3

One-dependent 556.1 560.1 562.9

From the AIC and BIC values, it appears that assuming some kind of structure is better than

none (unstructured); however, the evidence is inconclusive about which structure, compound

symmetry, AR(1), or one-dependent provides a better characterization of covariance. Differences

in the criteria are small; because each fit requires a numerical method of finding the solution, the

values might end up slightly differently if a slightly different algorithm or machine had been used.

Thus, it is not sensible to make too much of these differences. We thus conclude that any of these

structures is probably capturing reasonably well the most important features of the covariance

structure; there is some correlation among observations, but the evidence is inconclusive about how

it “falls off” as they become farther apart in time. From the Solution for Fixed Effects for

each fit on pages 5, 8, and 11, the estimates of β differ very little across the different assumptions.

• Estimation of difference in mean response between males and females at week 3.

We illustrate use of the contrast and estimate statements for the one-dependent fit. On page

12, we have that the estimated mean difference is −1.165 with an estimated standard error of

1.622, so that the standard error exceeds the actual estimated difference in magnitude. The Wald

statistic of the form estimate divided by standard error is given in the result of the estimate

statement and is equal to -0.72. PROC MIXED compares this to a t distribution; alternatively, a

normal distribution could be used. The contrast statement with the chisq option produces the

identical test, but printing the statistic TL = 0.52 = (−0.72)2 instead. This is compared to a χ2

distribution with 1 degree of freedom (standard normal squared), as our contrast has one degree

of freedom. An alternative F test is also given by default, which involves an adjustment for finite

samples as discussed earlier.

PAGE 295

Page 305: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 8 ST 732, M. DAVIDIAN

From the results, there is not enough evidence to suggest that there is a difference in mean response

between the genders at the third week. Given the small estimate, which is very small compared

to a typical response value in the 30’s to almost 50, it appears that we would be safe to conclude

that there is no practical difference in mean response.

FURTHER INFORMATION ON PROC MIXED: See the SAS documentation and the book SAS System

for Mixed Models by Littell, Milliken, Stroup, and Wolfinger (1996) for much more on the capabilities

of PROC MIXED for fitting general regression models for longitudinal data. We will see that PROC MIXED

can do much more in the next few chapters.

8.9 Parameterizing models in SAS: Use of the noint option in SAS model state-

ments in PROC GLM and PROC MIXED

An important skill using “canned” software such as proc glm or proc mixed in SAS is understanding

how the software allows the user to specify models for mean response in the model statement. Here, we

give more detail on the principles behind specifying model statements in order to obtain desired mean

models in different parameterizations.

To fix ideas, consider the dental data and the analyses in EXAMPLE 1. In particular, consider the two

models for mean response on page 248.

Model in the “explicit” parameterization:

Yij = β0,B + β1,Btij + eij , boys

= β0,G + β1,Gtij + eij , girls (8.25)

Model in the “difference” parameterization:

Yij = β0,B + β1,Btij + eij , boys

= (β0,B + β0,G−B) + (β1,B + β1,G−B)tij + eij , girls (8.26)

In all of the following, we use expressions like β0, β1, etc. as just “placeholders” to denote generic terms

in models.

PAGE 296

Page 306: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 8 ST 732, M. DAVIDIAN

Consider the program. Recall that the variable gender takes on the numerical values 0 or 1 as a child

is a girl (0) or a boy (1). The variable age is a numerical value representing the time condition, and

the response is distance. The variable child is the unit indicator, and is ordinarily declared to be a

class variable (as SAS classifies observations as belonging to particular units on this basis).

It is demonstrated in the program and its output that the following statements lead to parameterization

of the model using the “difference” parameterization (8.26).

class gender child;

model distance = gender age gender*age / solution;

Here, notice that gender is also declared to be a class variable. Thus, SAS will treat gender as two

(in this case) categories corresponding to girls (gender 0) and boys (gender 1).

Representative output from such a call (in the Solution for Fixed Effects table) looks like:

Solution for Fixed Effects

Standard

Effect gender Estimate Error DF t Value Pr > |t|

Intercept 16.3406 0.9631 25 16.97 <.0001

gender 0 1.0321 1.5089 25 0.68 0.5003

gender 1 0 . . . .

age 0.7844 0.07654 79 10.25 <.0001

age*gender 0 -0.3048 0.1199 79 -2.54 0.0130

age*gender 1 0 . . . .

Let us consider more carefully what the model statement above is instructing SAS to do. In general, in

any model statement in proc glm or proc mixed, the presence of any effect (e.g. gender) causes SAS

to create a term or terms in the mean model. In this specific case, here is how this works.

As the noint option is not present, SAS automatically constructs an intercept term, call it β0 for now.

PAGE 297

Page 307: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 8 ST 732, M. DAVIDIAN

The presence of the gender effect causes SAS to create some terms as follows: because gender is

declared to be a class variable, SAS will create a term for each classification (or category)

determined by gender. Here, there are two, girls (gender 0) and boys (gender 1). So including

gender in the model statement with gender has the effect of creating terms in the model as follows:

β1 I(gender=0) + β2 I(gender=1),

where, here, the notation “I(gender=x)” means “this term is present if gender=x” for x=0,1.

Now age is not a class variable, but just a variable that takes on numerical values (8,10,12,14 in this

case). As it is not a class variable, SAS simply creates a term of the form β3t, where we are using t

to represent the numerical values of age. Note that with numerical variables, SAS creates only a single

such term; it does not create a separate term for each value that t takes on.

Because gender is a class variable, the gender*age effect causes SAS to do something similar to the

above. In particular, SAS will again created a term for each classification (or category) determined

by gender (times age now). That is, including gender*age has the effect of creating terms in the model

as follows:

β4t I(gender=0) + β5t I(gender=1) (age).

Putting this all together, we have that the mean model created looks like

β0 + β1 I(gender=0) + β2 I(gender=1) + β3t + β4t I(gender=0) + β5t I(gender=1).

Note then that for a girl, the model is

(β0 + β1) + (β3 + β4)t,

and for a boy, the model is

(β0 + β2) + (β3 + β5)t.

In the table of Solution for Fixed Effects, we have the following correspondences:

Intercept β0

gender 0 β1

gender 1 β2

age β3

age*gender 0 β4

age*gender 1 β5

PAGE 298

Page 308: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 8 ST 732, M. DAVIDIAN

Note that this is over-parameterized – there are only two intercepts and two slopes (four parameters)

that need to be described, but there are six parameters in the model! That is, it is not possible to

estimate all of β0, β1, . . . , β5 from data that only tell us about two intercepts and two slopes. We really

don’t need all of β0, β1, β2 to determine two intercepts, and likewise we don’t need all of β3, β4, β5 to

determine two slopes.

SAS recognizes this automatically and imposes some constraints to get the number of parameters

down to a number that can be estimated. Practically speaking, by default, the way it chooses to do this

is to disregard one of β0, β1, β2 for the intercepts and β3, β4, β5 for the slopes. From the Solution for

Fixed Effects table, the “0” followed by dots corresponding to gender 1 and age*gender 1 indicate

that it chooses to disregard what we have called β2 and β5, essentially setting these equal to 0.

The result is that the implied model is, for a girl,

(β0 + β1) + (β3 + β4)t,

and for a boy,

β0 + β3t.

That is, SAS defaults to the “difference” parameterization, which may be seen by identifying β0 with

β0,B, β1 with β0,G−B, β3 with β1,B, β4 with β1,G−B in (8.26).

Now consider the case of the “explicit” parameterization. It is demonstrated in the program and

its output that the following statements lead to parameterization of the model using the “explicit”

parameterization (8.25).

class gender child;

model distance = gender gender*age / noint solution;

Again, gender is declared to be a class variable, so SAS will treat gender as two (in this case) categories

corresponding to girls (gender 0) and boys (gender 1). Note the use now of the noint option. Note

also that we do not include an age effect here; we will see why momentarily.

PAGE 299

Page 309: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 8 ST 732, M. DAVIDIAN

Representative output from such a call (in the Solution for Fixed Effects table) looks like:

Solution for Fixed Effects

Standard

Effect gender Estimate Error DF t Value Pr > |t|

gender 0 17.3727 1.1615 25 14.96 <.0001

gender 1 16.3406 0.9631 25 16.97 <.0001

age*gender 0 0.4795 0.09231 79 5.20 <.0001

age*gender 1 0.7844 0.07654 79 10.25 <.0001

Let us consider more carefully what the model statement here is instructing SAS to do. As above,

in any model statement in proc glm or proc mixed, the presence of any effect (e.g. gender) causes

SAS to create a term in the mean model. As the noint option is present, SAS will not automatically

construct and intercept term. The presence of the gender effect causes SAS to create the same type

of terms as before; that is, because gender is declared to be a class variable, SAS will create a

term for each classification (or category) determined by gender, leading to terms of the form

β1 I(gender=0) + β2 I(gender=1).

As before, age is not a class variable, but just a variable that takes on numerical values (8,10,12,14 in

this case). As it is not a class variable, SAS simply creates a term of the form β3t.

Also as before, because gender is a class variable, the gender*age effect causes SAS to create a term

for each classification (or category) determined by gender (times age now); that is

β3t I(gender=0) + β4t I(gender=1).

Putting this all together, we have that the mean model created looks like

β1 I(gender=0) + β2 I(gender=1) + β3t I(gender=0) + β4t I(gender=1).

Note then that for a girl, the model is

β1 + β3t,

and for a boy, the model is

β2 + β4t.

PAGE 300

Page 310: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 8 ST 732, M. DAVIDIAN

That is, the model as specified contains four parameters, two intercepts and two slopes, exactly what

is needed! It is not overparameterized.

In the table of Solution for Fixed Effects, we have the following correspondences:

gender 0 β1

gender 1 β2

age*gender 0 β3

age*gender 1 β4

There are no “zeroed out” elements, because each corresponding term is something that can be esti-

mated.

Thus, with an understanding of how SAS creates terms from effects specified in a model statement, we

see that this results in the parameterization of the model in (8.25), identifying β1 with β0,G, β2 with

β0,B, β3 with β1,G, β4 with β1,B.

Note that including the effect age in the model statement would have resulted in an overparameterization

– we do not need a single term of the form βt, as we already have all the parameters we need to

characterize the model. Knowing the way SAS constructs effects, the user can anticipate this and leave

the age term out. (Fun exercise: try putting it in and see what happens!)

Thus, note that, in either model statement, the way in which SAS creates terms is identical – including

a term in a model statement always has the same effect – it is the choice of terms to include that

dictates the resulting model and parameterization.

In general, then, the following principles apply:

• If a variable is declared to be a class variable and the variable appears in effects in a model

statement, SAS creates a term for that effect corresponding to each level (value taken on by) the

variable. In this example, gender has two such levels (girl and boy), so there are two terms.

• If a variable is not declared to be a class variable and the variable appears in a model statement,

it is treated as numeric. In this case, SAS creates a single term as in the example with age.

The above principles extend to more than two groups. For example, the dialyzer (ultrafiltration) data

discussed in EXAMPLE 2 have three groups (centers 1,2,3).

PAGE 301

Page 311: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 8 ST 732, M. DAVIDIAN

Here, center is equal to 1, 2, or 3 depending on center, and tmp is the (numerical) “time” variable.

The two competing model statements are

class subject center;

model ufr = center tmp center*tmp / solution;

to obtain the “difference” parameterization and

class subject center;

model ufr = center center*tmp / noint solution;

to obtain the “explicit” parameterization. In either case, center will cause SAS to construct terms like

β1 I(center=1) + β2 I(center=2) + β3 I(center=3)

and, similarly, center*age will imply

β4t I(center=1) + β5t I(center=2) + β6t I(center=3)

You can go through the same reasoning as for the dental data to identify the parameterization each

model statement implies.

All of the above has to do with the declaration of the group variable as a class variable. In the case of

two groups, it is possible to obtain the same parameterizations fairly easily without such a declaration

as long as one makes sure the group variable is such that it takes on the values 0 and 1 (as for the

dental data).

To see this, consider the following model statement:

class child;

model distance = gender age gender*age / solution;

PAGE 302

Page 312: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 8 ST 732, M. DAVIDIAN

Note we have not used the noint option. Here, gender is not declared to be a class variable; thus,

SAS interprets it as taking on numerical values (0 and 1 in this case). By the general principles, SAS

will create a term corresponding to each of the effects gender, age, and gender*age. But, because

gender is not a class variable, it will simply treat it the same way as age and create a single term

rather than terms for each category as it would if it were a class variable. That is, letting g be the

numerical value of gender, this model statement will result in

β0 + β1g + β2t + β3gt,

where the β0 is the “automatic” intercept. Thus, we see that the implied model here is

β0 + β1 + (β2 + β3)t

for g = 0 (girl) and

β0 + β2t

for g = 1 (boy). This is, of course, exactly in the form of the “difference” parameterization in (8.26).

We can in fact also get the “explicit” parameterization without treating gender as a class variable by

being clever as follows. Create a new variable revgender = 1-gender. Thus, revgender takes on the

value 1 for girls and 0 for boys (the “reverse” of gender). Consider the following model statement (note

we use the noint option here.

class child;

model distance = gender revgender gender*age revgender*age / noint solution;

By the above principles, as gender and revgender are just treated as variables taking numerical values,

SAS creates the following terms:

β1g + β2(1− g) + β3tg + β4t(1− g).

PAGE 303

Page 313: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 8 ST 732, M. DAVIDIAN

Thus, we see that the implied model here is

β2 + β4t

for g = 0 (girl) and

β1 + β3t

for g = 1 (boy). This is, of course, in exactly the form of the “explicit” parameterization (8.25), making

the appropriate correspondences.

In the case of more than two groups, one may do the same thing, but it gets messier. One needs to

create “dummy” variables taking on values 0 or 1 for each group; thus, for the dialyzer data, we might

create variables as follows:

c1 = 1 if center=1

0 otherwise

c2 = 1 if center=2

0 otherwise

c3 = 1 if center=3

0 otherwise

To convince yourself of the following, just write out the implied models for each model statement:

You may verify that the “difference” parameterization may be obtained by the following code:

model ufr = c1 c2 tmp c1*tmp c2*tmp / solution;

Note that, here, we chose not to include c3 in the model statement. The effect of this is to make center

3 the “reference” center. We could have equally well have chosen another center as the “reference.”

We left out one of the center dummy variables (c3 here) because we knew in advance that to include

them all would lead to an overparameterization. You might want to try running the following code

to see what happens:

model ufr = c1 c2 c3 tmp c1*tmp c2*tmp c3 / solution;

You should be able to see that, using the same considerations as above, this leads to an overparameter-

ized model.

PAGE 304

Page 314: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 8 ST 732, M. DAVIDIAN

The “explicit” parameterization may be obtained by

model ufr = c1 c2 c3 c1*tmp c2*tmp c3*tmp / noint solution;

Note that, here, the model is not overparameterized.

It should be obvious that, as the number of groups grows, it becomes less and less convenient to define

all these variables. The class statement in SAS essentially does this for us.

8.10 Using SAS model, contrast, and estimate statements

This section gives more information how to use these statements with PROC MIXED in the context of

EXAMPLES 1–3. You may wish to add these statements to the example programs to see what output

they produce. We demonstrate the use of contrast and estimate statements more in the next chapter.

EXAMPLE 1 – DENTAL DATA. Consider the call to proc mixed for the fit of the “full model” with

the “explicit parameterization” using a separate compound symmetric covariance structure for each

gender on page 251.

From the Solution for Fixed Effects table in the output of this statement , β is defined as

β =

β0,G

β0,B

β1,G

β1,B

.

The null hypothesis of equal slopes may be written as H0 : Lβ = 0, where

L = (0, 0, 1,−1).

To obtain the Wald test (and default F approximation), use the following contrast statement, placed

after the repeated statement:

contrast ’slp diff’ gender 0 0 gender*age 1 -1 / chisq;

PAGE 305

Page 315: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 8 ST 732, M. DAVIDIAN

The null hypothesis of coincident lines (same intercepts and slopes in both groups) may be written as

H0 : Lβ = 0, where

L =

1 −1 0 0

0 0 1 −1

.

To obtain the Wald test (and default F approximation), use the following contrast statement, placed

after the repeated statement:

contrast ’both diff’ gender 1 -1 gender*age 0 0,

gender 0 0 gender*age 1 -1 / chisq;

The results of such contrast statements appears in the output in a section labeled “Contrasts.”

EXAMPLE 2 – DIALYZER DATA. The call to proc mixed for the fit using the “explicit parameteri-

zation” with the Markov covariance model is at the bottom of page 277.

From the Solution for Fixed Effects table in the output, β is defined as, in obvious notation,

β =

β0,1

β0,2

β0,3

β1,1

β1,2

β1,3

.

The null hypothesis of equal slopes across all three centers may be written as H0 : Lβ = 0, where

L =

0 0 0 1 −1 0

0 0 0 1 0 −1

.

To obtain the Wald test (and default F approximation), use the following contrast statement, placed

after the repeated statement:

contrast ’slp diff’ center 0 0 0 center*tmp 1 -1 0,

center 0 0 0 center*tmp 1 0 -1 / chisq;

PAGE 306

Page 316: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 8 ST 732, M. DAVIDIAN

EXAMPLE 3 – HIP REPLACEMENT DATA. The model statement syntax for fitting the model on

page 285 is given in the calls to proc mixed on page 287 – here, the “explicit parameterization” is used.

What if we wanted to fit a more complicated model? For example, consider the model

Yij = (β1 + β7ai) + (β2 + β8ai)tij + (β3 + β9ai)t2ij + eij for males

= (β4 + β10ai) + (β5 + β11ai)tij + (β6 + β12ai)t2ij + eij for females

This model says that the week-zero mean, the linear component, and the quadratic effect is different for

males and females, and, further, the way in which each of these depends on age is linear and different

for males and females. This is a rather complicated model.

The appropriate syntax may be found by multiplying out each expression; e.g., for males, the mean

expression is

β1 + β7ai + β2tij + β8aitij + β3t2ij + β9ait

2ij ,

and there is a corresponding expression for females, where each term has a different coefficient; i.e.

β4 + β10ai + β5tij + β11aitij + β6t2ij + β12ait

2ij ,

Multiplying things out makes the model syntax clear. We use the noint option, so that we can construct

the “intercept terms” β1 and β4 for males and females ourselves. The syntax is

model h = gender gender*age gender*week gender*age*week

gender*week2 gender*age*week2 /noint solution;

That is, there is a term corresponding to each term in the multiplied-out expression. The gender part

of each term ensures that the model includes different such terms for males and females.

PAGE 307

Page 317: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 9 ST 732, M. DAVIDIAN

9 Random coefficient models for multivariate normal data

9.1 Introduction

In the last chapter, we noted that an alternative perspective on explicit modeling of longitudinal response

is to think directly of the fact that each unit appears to have its own trajectory or inherent trend

with its own peculiar features. For example, in the dental study, if we focus on a particular child, the

trajectory looks to be approximately like a straight line (with some variation about it, of course). The

data are reproduced below for convenience in Figure 1. A similar statement could be made about the

dialyzer data in the last chapter.

Figure 1: Dental data revisited.

age (years)

dist

ance

(m

m)

8 9 10 11 12 13 14

2025

30

0 0 0

0

0

0

0

0

0

0

0

1

1

1

1

1

1

1

1

1

1

1

1

1

11

1

0

0

0 0

0

0

0 0

0

0

01

11

1

1

1

11

1

1

11

1

1

1

1 0

0 0 0

0

0

0 0

0

0

0

1

1

1

1

1

1

11

11

11

111

1 0

0 0 0

0

0

0

0

0

0

0

1

1

11

1

1

1

11

1

1

1

1

1

1

1

Dental Study Data

The general regression modeling approach takes the standard perspective in much of statistical modeling

of focusing directly on the mean responses and how they change over time. In this chapter, we consider

an alternative approach to building a model based on thinking first about individual trajectories.

• For trajectories that may be represented by linear functions of a design matrix and parameters,

this approach will lead us to the same type of mean models as the general regression approach.

PAGE 308

Page 318: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 9 ST 732, M. DAVIDIAN

• However, the modeling approach acknowledges explicitly the two separate sources of variation

we have discussed. As a result, it “automatically” leads to covariance models that also acknowledge

these sources.

• The resulting statistical model, called a random coefficient model for reasons that will be clear

shortly, will be seen to imply a a model like the general linear regression models of the last chapter

with a particular covariance structure for each data vector. Thus, the inferential methods of that

chapter, namely maximum and restricted maximum likelihood, will apply immediately.

• In addition, this modeling strategy will allow us to address questions of scientific interest about

trajectories for individual units, either ones in the study or future units. For example, in a

study of AIDS patients, it may be of interest to physicians attending the patients to have an

estimate of a patient’s individual apparent trajectory, so that they may make clinical decisions

about his or her future care. There is no apparent way of doing this in the general modeling

approach we have just considered.

9.2 Random coefficient model

SUBJECT-SPECIFIC TRAJECTORY: Recall the conceptual model discussed in Chapter 4. For def-

initeness, again consider the dental study data. We take the view that each child has his/her own

underlying straight line inherent trend. Focusing on the ith child, this says that s/he has his/her

own intercept and slope, β0i and β1i, say, respectively, that determine this trend. This intercept and

slope are unique to child i.

WITHIN-INDIVIDUAL VARIATION: Continuing with conceptual perspective, the actual responses

observed for a given child do not fall exactly on a straight line (the inherent trajectory) due to

• The fact that the response cannot be measured perfectly, but is instead subject to measurement

error due to the measuring device.

• Individual “fluctuations;” although the overall trend for a given child is a straight line, the actual

responses, if we could observe them continuously over time, tend to fluctuate about the trend.

AMONG-INDIVIDUAL VARIATION: The inherent trajectories are “high” or “low” with different

steepness across children, suggesting that the child-specific intercepts β0i and slopes β1i vary across

children.

PAGE 309

Page 319: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 9 ST 732, M. DAVIDIAN

To formalize this thinking, a model is developed in two stages.

“INDIVIDUAL (FIRST STAGE)” MODEL: The first stage involves describing what we believe at the

level the ith child; specifically, we write a model for the random variables Yi1, . . . , Yini for the ith child

taken at time points ti1, . . . , tini . Although the particular dental study example is balanced, we write

things more generally to allow the possibility of imbalance. The model for child i is, i = 1, . . . , m is

Yij = β0i + β1itij + eij , j = 1, . . . , ni. (9.1)

In model (9.1), the observations on the ith child follow a straight line with child-specific intercept and

slope β0i and β1i. That actual observations vary about this inherent line due to within-unit sources is

represented explicitly by the deviation eij with mean 0. We say more about these deviations shortly.

• Thus, model (9.1) has the form of a straight line regression model unique to the ith child. Each

child has such a model.

• Each child has a regression parameter vector βi =

β0i

β1i

.

• We may write the model (9.1) concisely. Define Y i and ei as usual, and let

Zi =

1 ti1

1 ti2...

1 tini

.

We may then write the model as

Y i = Ziβi + ei, i = 1, . . . , m. (9.2)

“POPULATION (SECOND STAGE)” MODEL: Model (9.1) only tells part of the story; it describes

what happens at the level of an individual child, and includes explicit mention (through eij) of within-

child variation. However, it does not by itself acknowledge among-child variation. We have recognized

that the inherent trends differ across children; for example, some children have a steeper slope for their

apparent trajectory than do others. For now, we downplay the fact that children are of two genders;

we will tackle this issue momentarily.

We may think of the children observed as arising from a population of all such children. Each child

has its own intercept and slope; thus, we may think abstractly of this population in terms of random

vectors βi, one for each child, as it is the unique intercept and slope for each child that distinguishes

his/her trajectory.

PAGE 310

Page 320: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 9 ST 732, M. DAVIDIAN

• It is natural to think of this population as being “centered” about a “typical” value of intercept

and slope, with variation about this center value – some children have shallower or steeper slopes,

for example.

• More formally, we may think of the mean value of intercept and slope of the population of all

such βi vectors. Individual intercept/slope vectors vary about this mean. Thus, we may think

of a joint probability distribution of all possible values that a random vector of regression

parameters βi could take on. More on this momentarily.

This way of thinking suggests a model for this population as follows. Let β0 and β1 represent the

mean values of intercept and slope, and define

β =

β0

β1

. (9.3)

Thus β is the mean vector of the population of all βi. Then write

βi = β + bi, bi =

b0i

b1i

, (9.4)

which is a shorthand way of saying

β0i = β0 + b0i, β1i = β1 + b1i.

• Here, bi is a vector of random effects describing how the intercept and slope for the ith child

deviates from the mean value.

• Thus, (9.4) has the flavor of a regression-type model for the child-specific regression parameters,

with a systematic component, the mean, and a random component summarizing how things

vary about it.

• More formally, the vectors bi are assumed to have mean 0 and some covariance matrix that

describes the nature of this variation – how intercepts and slopes vary among children and how

they covary (e.g. do large intercepts and slopes tend to occur together?) In fact, as we discuss

shortly, the bi are assumed to have a multivariate probability distribution with this mean

and covariance matrix.

PAGE 311

Page 321: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 9 ST 732, M. DAVIDIAN

• Thus, whereas the individual child model summarizes how things happen within a child, this

model characterizes variation among children, representing the population through intercepts

and slopes. Putting the models (9.1) and (9.4) together thus gives a complete description of

what we believe about each child and the population of children, acknowledging the two sources

of variation explicitly.

• Note that we may substitute the expressions for β0i and β1i in (9.1) to obtain

Yij = (β0 + b0i) + (β1 + b1i)tij + eij .

This shows clearly what we are assuming: each child has intercept and slope that varies about

the “typical,” or mean intercept and slope β0 and β1.

ACKNOWLEDGING GENDER: We can refine our model to allow for the fact that children are of

different genders as follows. We may think of children as coming from two populations, males and

females, each population with its own mean values of intercept and slope and possibly different pattern

of variation in these intercepts and slopes. Each child would still have his/her own individual regression

model as in (9.1), so this would not change. What would change to incorporate this refinement is the

population model. For example, if child i is a boy, then we might believe

β0i = β0,B + b0i. β1i = β1,B + b1i,

while if i is a girl,

β0i = β0,G + b0i. β1i = β1,G + b1i.

• Here, the fixed parameters β0,B, β1,B represent the mean intercept and slope for boys; similarly,

β0,G, β1,G represent the same for girls.

• bi = (b0i, b1i)′ represents the random effect for child i with mean 0 We may believe that the

populations of βi for boys and girls have different means but have similar variation. In this case,

we might say that the bi all have the same covariance matrix regardless of whether i is a boy

or girl. On the other hand, if we believe that the populations have different variation, we might

think of the bi of being of two types, with a different covariance matrix depending on the gender.

We will be more formal shortly.

• Let

β =

β0,G

β1,G

β0,B

β1,B

.

PAGE 312

Page 322: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 9 ST 732, M. DAVIDIAN

Define for each child a matrix Ai such that

Ai =

1 0 0 0

0 1 0 0

if child i is a girl

Ai =

0 0 1 0

0 0 0 1

if child i is a boy

Then it is straightforward to verify that we may write the model concisely for each child as

βi = Aiβ + bi. (9.5)

• Note that the simpler (“one-population”) model (9.4) could also be written in this way with β

defined as in (9.3) and Ai = I2 for all i (try it!)

Let us now be more specific about the nature of the two sources of variation being acknowledged

explicitly in this modeling approach.

WITHIN-UNIT VARIATION: In the “individual” model (9.2), the within-unit random vector ei has

mean zero and represents the deviations introduced solely by sources within an individual. This in-

cludes measurement error, biological “fluctuations,” or both. Thus, following the conceptual framework

in Chapter 4, we may think of ei as being decomposed as

ei = e1i + e2i,

where e1i represents the deviations due to within-subject fluctuations and e2i those due to measurement

error.

To characterize within-subject variation and correlation due to within-subject sources (fluctuations),

the approach is to specify a covariance structure model for var(ei). In general, write

Ri = var(ei),

where Ri is a (ni × ni) covariance matrix. We now discuss through review of some typical scenarios

considerations involved in identifying an appropriate Ri.

• Suppose we believe that, although there may be biological fluctuations over time, the observation

times are sufficiently far apart that correlation due to within-subject sources among the Yij may

be regarded as negligible.

PAGE 313

Page 323: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 9 ST 732, M. DAVIDIAN

In this case, it is reasonable to assume that var(e1i) is a diagonal matrix. If we furthermore

believe that the magnitude of fluctuations is similar across time and units, we may represent this

by the assumption that var(e1ij) = σ21, say, for all i and j, so that

var(e1i) = σ21Ini .

The assumption that this is similar across units may be viewed as reflecting the belief that the

e1ij are independent of βi and hence bi, which dictate how “large” the unit-specific trend is, so

that the magnitude of fluctuations is unrelated to any unit-specific response characteristics.

• As we have discussed previously, it may be reasonable to assume that errors in measurement are

uncorrelated over time; thus, taking var(e2i) to be a diagonal matrix would be appropriate.

Suppose we also believe that errors committed by the measuring device are of similar magnitude

regardless of the true size of the thing being measured, and are similar for all units (because the

same device is used). This suggests that var(e2ij) = σ22, say, for all j, so that

var(e2i) = σ22Ini .

Now the true size of the thing being measured at time tij is

β0i + β1itij + e1ij ;

i.e. the actual response uncontaminated by measurement error. Under this belief, it is reasonable

to assume that the e2ij are independent of βi and thus bi.

• Putting this together, we would take

Ri = var(ei) = var(e1i) + var(e2i) = σ21Ini + σ2

2Ini = σ2Ini ,

where σ2 is the aggregate variance reflecting variation due to both within-unit sources.

• The assumption that e1i and e2i are independent is standard, as is the assumption that e1i

and e2i (and hence ei) are independent of bi. We say more about these assumptions shortly.

• We may think of other situations. For example, suppose that the response is something like

height, which in all likelihood we can measure with very little if any error. Under this condition,

we may effectively eliminate e2i from the model and assume that ei = e1i; i.e. all within-unit

variation is due to things like “fluctuations.” In the model above, σ2 = σ21 would then represent

the variance due to this sole source.

PAGE 314

Page 324: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 9 ST 732, M. DAVIDIAN

• Similarly, we may have a rather “noisy” measuring device such that, relative to errors in mea-

surement, deviations due to within-unit subjects are virtually negligible. Under this condition, as

long as we believe the times are far enough apart to render within-unit correlation negligible as

well, we may as well take ei = e2i, in which case σ2 = σ22 in the above model represents solely

measurement error variance.

• Now suppose that the times of observation are sufficiently close that correlation due to within-unit

sources cannot be viewed as negligible. In this event, it would be unreasonable to take var(e1i)

to be diagonal. It would instead be more realistic to adopt a model for var(e1i) that represents

correlation that decays as observations become farther apart. For example, with equally-spaced

observations and variance assumed constant as above, the AR(1) structure may be a suitable

model; i.e.

var(e1i) = σ21

1 ρ ρ2 · · · ρn−1

......

......

...

ρn−1 ρn−2 · · · ρ 1

.

In general, maintaining the common variance assumption, we might entertain models var(e1i) =

σ21Γi, where Γi is a suitable (ni × ni) correlation matrix.

• In this case, with the same assumptions on measurement error and independence as above, we

would instead have

Ri = var(ei) = σ21Γi + σ2

2Ini . (9.6)

If measurement error were deemed negligible, this would be reduced to the assumption that

Ri = σ2Γi,

where σ2 = σ22 represents variance due solely to within-unit fluctuations.

• We could also modify the above models to incorporate the possibility that, for example, one

or both variances changes over time. In this situation, one could postulate a heterogeneous

covariance model, as described in Chapter 4. I.e., if we believed fluctuation variances are still

similar across subjects but change in magnitude over time, replace the assumption σ21Γi above by

the heterogeneous version of the correlation matrix.

PAGE 315

Page 325: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 9 ST 732, M. DAVIDIAN

If we believe that there is a different variance at every time, this would make the most sense when

all units are seen potentially at the same time points, as in the hip replacement study of the last

chapter, so that there would be a finite number of variances to estimate. In this case, supposing

there are n potential times at which units are seen, let var(e1ij) = σ21j for the jth such time,

j = 1, . . . , n. Then for a unit seen at all n times, define

T1/2i = diag(σ11, σ12, . . . , σ

21n), (n× n),

where “diag” means a diagonal matrix with these values on the diagonal. We can then express

the covariance matrix of the fluctuation deviation as

var(e1i) = T1/2i ΓiT

1/2i

using the notation defined on page 45 in Chapter 3. For a unit with some time points missing, the

considerations in the last chapter for specifying covariance matrices with unbalanced data would

be used to write down the model for var(e1i) for each subject.

• Alternatively, it is conceivable that if there are several populations, Ri could be different for each.

As an example, we could have

Ri = σ2GIni if i is a girl

and = Ri = σ2BIni if i is a boy, perhaps reflecting the belief that the magnitude of fluctuations is

different for each gender.

• It should be clear that, in specifying the matrix Ri, the analyst must consider carefully the features

of the situation at hand in regard to within-unit sources of variation and correlation. Ideally, s/he

would want to adopt a model that accurately characterizes the anticipated features.

• However, it turns out that, although not impossible, it may be difficult to fit a postulated model,

particularly if it is rather complicated.

For example, it is often problematic to fit models like (9.6) where both measurement error and

“fluctuation” are assumed nonnegligible. This is often because there is not sufficient information

to identify all the components of the model. A simplifying assumption that is thus often made

is that one of the two sources tends to dominate the other. Under this assumption, modeling of

Ri and fitting are simplified. The hope is that this may be a sufficiently good approximation to

provide reliable inferences.

PAGE 316

Page 326: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 9 ST 732, M. DAVIDIAN

This sort of assumption is often made unknowingly; the analyst will choose a model for Ri

that embodies certain assumptions and emphasizes one source or another by default without

having thought about considerations like those above. In fact, the most common assumption is

Ri = σ2Ini , where σ2 is the same for all units and groups, is usually made in this way (and is the

default in SAS PROC MIXED).

We discuss the consequences of a “wrong” model specification for Ri shortly.

• In general, Ri is a (ni × ni) matrix depending on a few variance and correlation parameters;

e.g. σ2 and ρ in the example above, chosen to at least approximate the anticipated features of

within-unit sources of variation and correlation.

• If we just focus on the response for individual i at any time point tij , if we believe a normal

distribution is a reasonable way to represent the population of responses we might see on this

individual at tij , then it would make sense to assume that each eij were normally distributed.

This of course implies that we assume

ei ∼ Nni(0, Ri).

AMONG-UNIT VARIATION: In the “population” model (9.5), the random effects bi have mean 0

and represent variation resulting from the fact that individual units differ; i.e. exhibit biological or

other variation. The model says that this variation among individuals manifests itself by causing

the individual unit trajectories to be different (have different intercepts and slopes). Thus, var(bi)

characterizes this variation.

• Intercepts and slopes may tend to be large or small together, so that children with steeper slopes

tend to “start out” larger at age 0. Alternatively, large intercepts may tend to happen with

small slopes and vice versa; perhaps children who “start out” smaller experience a steeper growth

pattern to “catch up.” In either case, this suggests that it would not necessarily be prudent to

think of var(bi) as a diagonal matrix. Rather, we expect there to be some correlation between

intercepts and slopes, the nature of this correlation depending on what is being studied.

• As noted above, we may believe that the populations of intercept/slopes for boys and girls have

possibly different means, but that the variation in each population about the mean is similar.

Formally, we can represent this by assuming that

var(bi) = D

for some covariance matrix D regardless of whether i is a boy or girl.

PAGE 317

Page 327: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 9 ST 732, M. DAVIDIAN

• Here, D is (2 × 2), and an unstructured model is really the only one that makes sense. In

particular, writing

D =

D11 D12

D12 D22

,

we have

var(β0i) = var(b0i) = D11, var(β1i) = var(b1i) = D22, cov(β0i, β1i) = cov(b0i, b1i) = D12.

It should be clear that we would not expect D12 = 0 in general; e.g., steep slopes may be associated

with “high” intercepts.

It should also be clear that D11 = D22 would be unrealistic. The intercept is on the same

scale of measurement as the response, while the slope is on the scale “response scale per unit

time.” Thus, these parameters are representing variances that would be expected to be different

because they correspond to phenomena that are on different scales.

• If we believed that these populations exhibit possibly different variation, we can represent this by

assuming that

var(bi) = DB if i is a boy, var(bi) = DG if i is a girl,

where DB and DG are two (unstructured) covariance matrices.

• In either case, the assumption on var(bi) reflects solely the nature of variation at the level of the

population(s) of units; that is, that caused solely by variation among units due to biology or

other features. This is formally represented through the bi.

• It is often reasonable to assume that populations of intercepts and slopes are approximately

normally distributed; e.g. this says that slopes vary symmetrically about the mean, some

steeper, some shallower. Thus, a standard assumption is that the bi have a multivariate normal

distribution; e.g. in the case where the covariance matrix is assumed the same and equal to D

regardless of gender, the assumption would be

bi ∼ Nk(0, D),

where k is the dimension of bi (k = 2 here).

PAGE 318

Page 328: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 9 ST 732, M. DAVIDIAN

REMARKS:

• As noted previously, it is usually assumed that ei and bi are independent. This says that the

magnitude of variation within a unit does not depend on the magnitude of βi for that unit.

As we have also discussed, if the device used to measure individual responses causes errors of similar

magnitude all the time, and fluctuations are of similar magnitude regardless of the characteristics

of the units, then this seems reasonable.

However, if measurement errors tend to get larger as the response being measured gets larger,

which is a characteristic of some measuring systems, then this may not be reasonable. In this

case, we would expect the deviations in e2i to be related to Ziβi which dictates how large the

responses on a particular unit are; we would also expect them to be related to the deviations in

e1i.

Similarly, if the magnitude of fluctuations is related to inherent unit characteristics (e.g., “high”

units tend to have larger fluctuations), the assumption would also be violated.

• We will assume for now that this assumption is reasonable, and take bi and ei to be independent,

as is customary. Later, we will discuss situations where this is definitely unreasonable in more

detail.

• We have also noted that specification of the within-units covariance matrix Ri to reflect reality is

desirable. However, computational issues and a tendency to not consider the issue carefully can

lead to choice of an unrealistic model.

• As we will see in a moment, the specifications on var(bi) and var(ei) combine to produce an

overall model for var(εi) that describes the aggregate effects of both sources of variation. The

hope is that this model is rich and flexible enough that it can still represent the true pattern of

overall variation even if one or both components are incorrectly modeled.

If interest focuses only on β, this may be adequate. However, if there is interest in how units

vary in the population, represented by var(bi), it seems clear that getting this model correct

is essential. We will say more later.

PAGE 319

Page 329: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 9 ST 732, M. DAVIDIAN

SUMMARY: We now summarize the model suggested by these considerations. The model may be

thought of as a two-stage hierarchy: For i = 1, . . . , m,

Stage 1 – individual

Y i = Ziβi + ei (ni × 1), ei ∼ Nni(0, Ri) (9.7)

This is like a “regression model” for the ith unit, with “design matrix” Zi and (k × 1) “regression

parameter” βi.

Stage 2 – population

βi = Aiβ + bi (k × 1), bi ∼ Nk(0, D). (9.8)

Here, we have taken var(bi) = D to be the same for all i, and we will continue to do so for definiteness

in our subsequent development. However, this could be relaxed as described above, and the features of

the model we point out shortly would still be valid. The matrix Ai summarizes information like group

membership, allowing the mean of βi to be different for different groups.

Variation in the model is explicitly acknowledged to come from two sources:

• Due to features within units, represented through the covariance matrix Ri.

• Due to biological variation among units, represented to the covariance matrix D.

• This is in marked contrast to the models of the previous chapter. These models required the

analyst to think of a single covariance matrix for a data vector, representing the aggregate effect

of both sources. The models that are typically used tend to focus on the time-ordered aspect.

IMPLICATION: We now see the contrast with the models of the last chapter more directly. Suppose

that we combine two parts of the model into a single representation by substituting the expression for

βi in (9.8) into (9.7); i.e.

Y i = Zi(Aiβ + bi) + ei = (ZiAi)β + Zibi + ei.

• Suppose first that there is only one group, so that Ai = Ik. Then we see that the model implied

is

Y i = Ziβ + Zibi + ei.

Note that we can write this in a more familiar form by letting Xi = Zi and εi = Zibi + ei. With

these identifications, we have

Y i = Xiβ + εi, i = 1, . . . , m.

PAGE 320

Page 330: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 9 ST 732, M. DAVIDIAN

This has exactly the form of the regression models of the previous chapter!

• The difference is that, here, the way we arrived at this model requires that the error vector εi

have the particular form above. Note that this implies that, using the independence of bi and

ei (and taking var(bi) = D for definiteness),

var(εi) = ZiDZ ′i + Ri = Σi. (9.9)

Thus, the model implied by thinking in two stages implies that the covariance matrix of a data

vector is the sum of two pieces representing the separate effects of among-and within-unit vari-

ation.

• If there is more than one group, the same interpretation holds. Suppose β is (p× 1); p = 4 in the

dental example. With βi (k × 1), then Ai a (k × p) matrix; k = 2 in the dental example. Then

we see that the model implied is

Y i = Xiβ + Zibi + ei = Xiβ + εi,

where Xi = ZiAi. As above, var(εi) is as in (9.9). In the dental example, note that for boys

Xi = ZiAi =

1 ti1

1 ti2...

1 tini

0 0 1 0

0 0 0 1

=

0 0 1 ti1...

......

...

0 0 1 tini

and similarly for girls,

Xi = ZiAi =

1 ti1 0 0...

......

...

1 tini 0 0

.

Compare these with (8.9); they are the same.

RESULT: By thinking about individual trajectories, we see that we ultimately arrive at a regression

model that is of the same form as those in the last chapter.

• The similarity is that the mean of a data vector is of the same linear form; i.e.

E(Y i) = Xiβ,

where the form of the matrices Xi is dictated by the thinking above (Xi = ZiAi).

PAGE 321

Page 331: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 9 ST 732, M. DAVIDIAN

The critical difference is that the covariance matrix of a data vector has the very specific form (9.9)

that explicitly acknowledges both sources of variation and allows them to be thought about separately.

Further features of note:

• The model does not allow the covariance matrix of a data vector to be the same for all units

in general. The only way that this matrix may be of the same form for all units is var(bi) and

var(ei) are the same for all units and the data are balanced (more on this shortly).

• The covariance matrix depends on the times of observation through the matrix Zi. Thus, if

different units are seen at different times, this information is automatically incorporated into

the model.

• Recall that we have noted that we expect observations on the same unit to be correlated even if

the repeated observations are taken very far apart in time; this is due to the simple fact that they

are from the same unit. Note that the implied form of the covariance matrix (9.9) accommodates

this naturally. Even if Ri = σ2I, say, which implies that we believe there is no correlation due

to within-unit sources, the entire matrix Σi is still not diagonal. Rather, it will be nondiagonal

because D is not diagonal in general. Thus, the model offers a natural way to represent correlation

among observations on the same unit that arises simply because they are on the same unit and

thus “more alike” than those compared across units.

• In this model, Σi depends on a finite set of parameters. For example, if Ri = σ2Ini , then Σi

depends on σ2 and the distinct elements of the matrix D. We say distinct because, as D is a

covariance matrix, it is symmetric, so contains the same off-diagonal elements more than once;

e.g. if

D =

D11 D12

D21 D22

,

then D depends on the three distinct values D11, D12, and D22, since D12 = D21 by symmetry.

We may in fact say even more. If we believe that both bi and ei are both well-represented by multivariate

normal distributions and are independent, then, using results in Chapter 4, we may conclude that

Y i ∼ Nni(Xiβ,Σi), i = 1, . . . , m (9.10)

Xi = ZiAi, Σi = ZiDZ ′i + Ri.

• As with the models of the previous chapter, if the units are completely unrelated, then it is

reasonable to assume that the Y i are independent random vectors, each multivariate normal

with the particular mean and covariance structure given above.

PAGE 322

Page 332: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 9 ST 732, M. DAVIDIAN

TERMINOLOGY: These models are known as random coefficient models because they rely on think-

ing of individual-specific regression parameters, or coefficients of time, as being random, each

representing a draw from a population.

• The above reasoning is extended easily to the case where units come from more than two groups; for

example, for the dialyzer data, where the relationship between transmembrane pressure (“time”)

and ultrafiltration rate (response) was observed on dialyzers from 3 centers. We would thus think

of each dialyzer having its own straight line relationship, with its own intercept and slope (k = 2).

The vector β would represent the mean intercept and slope for each center stacked together, so

would have p = 6 elements.

• The reasoning is extended easily to the case where the “regression model” for an individual unit is

something other than a straight line; e.g. suppose a quadratic function is a better model (recall

the hip replacement data)

Yij = β0i + β1itij + β2it2ij + eij .

In this case, βi has k = 3 elements.

• All of these models are a particular case of the more general class of linear mixed effects models

we will describe in the next chapter.

9.3 Inference on regression and covariance parameters

Because this way of thinking leads ultimately to the model given in (9.10), the methods of maximum

likelihood and restricted maximum likelihood may be used to estimate the parameters that char-

acterize “mean” and “variation,” namely β, the distinct elements of D, and the parameters that make

up Ri. That is, the methods described in sections 8.5 and 8.6 may be used exactly as described. The

same considerations apply:

• The generalized least squares estimator for β and its large sample approximate sampling

distribution will have the same form, with Xi and Σi defined as in (9.10).

• Questions of interest may be written in the identical fashion, and estimation of approximate

standard errors, Wald tests, likelihood ratio tests for nested models, and so on may be carried out

in the same way. We will discuss the formulation and interpretation of questions of interest

under this model momentarily.

PAGE 323

Page 333: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 9 ST 732, M. DAVIDIAN

• Information criteria may be used to compare non-nested models.

See these sections for descriptions, which go through unchanged for the model (9.10).

QUESTIONS OF INTEREST: Because of the way we motivated the random coefficient model, questions

of interest may be thought of in different ways. For definiteness, again consider the situation of the

dental study data. A vague statement of the main question of interest is: “Is the rate of change of

distance as children age different for boys and girls?”

Both here and in the previous chapter, we end up with a model that says that the mean of all possible

Yij values we might see at a particular age tij for girls is

E(Yij) = β0,G + β1,Gtij ,

and similarly for boys. How we arrive at the model involved different thinking, however.

• In the previous chapters, we always thought in terms of how the means at each time were related,

averaged across all units at each time point. In this way of thinking, we write down the model

above immediately, and β1,G and β1,B have the interpretation as the parameters that describe the

relationship of the mean responses over time; that is, the slope of the (assumed straight line)

relationship among means at different times tij .

• From the motivation for the random coefficient model, we think in terms of individual trajectories

and their “typical” features. In this way of thinking, β1,G and β1,B have the interpretation as the

means of the populations of child-specific slopes for all possible girls and boys, respectively.

Since the model we end up with is the same, either interpretation is valid. The result is that we may

think of the vague question of interest more formally in two ways, and both are correct. If we consider

testing

H0 : β1,G − β1,B = 0 vs. H1 : β1,G − β1,B 6= 0,

we may interpret this as saying either of the following:

1. Does the rate of change in mean response over time differ between girls and boys?

2. Is the “typical” value of the slope of the individual straight lines for girls different from the

“typical” value of the slope of the individual straight lines for boys?

PAGE 324

Page 334: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 9 ST 732, M. DAVIDIAN

THE “TYPICAL” PROFILE VS THE “TYPICAL” RATE OF CHANGE: This fuss over how to state

the vague question of interest and interpret this statement may seem to be overblown. However, it has

some important practical consequences.

• Depending on the subject matter, one interpretation may make more sense than another. The

process occurring over time may be something that is naturally thought of as happening within

a unit, such as growth. Under these circumstances, an investigator may find it easier to think

in terms of the random coefficient model, which says that each child has his/her own individual

trajectory with his/her own rate of change (slope). Then the question is naturally one about the

comparison of “typical” (mean) slopes.

• In other contexts, investigators may find it easier to think in terms of the “typical” response

profile; i.e. how the means across all units over time change. This might be true if the ultimate

goal is to make public policy recommendations. If the response is score on an achievement test

administered to each of m children each year for 5 years in two different curricula, the investigator

is interested in how the means over children in each group change over time; he would like to

claim that the average score for one curriculum got better faster than the other. His thinking will

tend to focus on how change happens over time to children as a group (means) rather than on

“typical” change over time for children.

The distinction in interpretation is quite a subtle one, and most people find it difficult to grasp at first.

As we have seen, either interpretation makes sense for our model.

• As we will see later, this is because the model both for mean response as a function of time and

the individual trajectories is linear in the parameters β and βi.

• When this model is not linear, we will see that the interpretation gets more difficult.

ALTERNATIVE FITTING METHOD: A natural inclination when thinking about random coefficient

models is to exploit the fact that the model says that each unit has its own trajectory and hence own

“regression model” with unit-specific “regression parameter” βi, where the βi come from a population

with mean (“typical value”) β. (We discuss one population here, but the following reasoning applies to

more than one.) This suggests that if we want to learn about β, a one way to do it would be to estimate

each βi from each unit separately, and then combine the results to estimate β; e.g. estimate β as

the sample mean of the individual unit estimates of βi.

PAGE 325

Page 335: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 9 ST 732, M. DAVIDIAN

• Such an approach represents an alternative to fitting the full model by ML or REML as discussed

above, and is often called a two-stage estimation method. This is because fitting happens in two

stages.

• (1) Estimate each βi separately from the data on unit i only; e.g. if we believe Ri = σ2Ini for

each i, then we might estimate βi by usual least squares applied to the data from unit i. Call

these estimates βi.

• (2) This distills the data Y i on each individual down to new “data” βi. This suggests using the

new “data” as the basis for inference. For example, a natural approach would be to average the

βi across all i to estimate β; e.g. if there is only one group, estimate β as

m−1m∑

i=1

βi.

If there are several groups, do this on a group by group basis, e.g. average the estimates from

boys and girls separately.

• To compare groups, compare these sample averages of estimates across groups by using standard

statistical methods, e.g. apply an analysis of variance to the slope estimates to compare the mean

slope.

This sounds appealing, but it isn’t quite right.

• The new “data,” the individual estimates βi, are not exactly the “data” we’d like. The ideal for

learning about β would be to average the true βi across units. Of course, we don’t know these

and the best we can do is estimate them by βi. But this introduces additional uncertainty that

the above procedure does not take into account.

• For example, if the ni are very different across units, with some units having lots of measurements

and others only a few, then for some i, βi will be a better estimate of the true βi than for others.

Treating them all on equal footing as “data” is thus obviously not appropriate.

• Thus, simply averaging the βi as if they were the true βi can be misleading.

It turns out that if one wants to use individual estimates as “data,” one must instead take a weighted

average of the βi in an appropriate way to take these issues into account. This kind of approach is

discussed in Davidian and Giltinan (1995).

PAGE 326

Page 336: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 9 ST 732, M. DAVIDIAN

Historically, the use of two-stage methods was suggested quite a long time ago, in part because it made

intuitive sense. A fundamental paper advocating two-stage methods is Rowell and Walters (1976).

Other references to two-stage methods include Gumpertz and Pantula (1989) and Davidian and Gilti-

nan (1995). Because the methods of ML and REML are straightforward to implement with available

software, we do not consider two-stage methods further here.

SPECIAL CASE – BALANCED DATA: Recall in the last chapter we noted an interesting curiosity for

the dental data, which are balanced. When we assumed that the covariance matrix of a data vector, Σi

(which is actually the same for all i with balanced data) had the compound symmetry structure, we

saw that the generalized least squares estimator for β reduced to the ordinary least squares estimator

βOLS treating all data as if they were independent. That is, the GLS estimator

β =

(m∑

i=1

X ′iΣ

−1Xi

)−1 m∑i=1

X ′iΣ

−1Y i (9.11)

with Σ having the compound symmetry structure had the same value as the OLS estimator

βOLS =

(m∑

i=1

X ′iXi

)−1 m∑i=1

X ′iY i.

It turns out that this is a special instance of a more general result. The general result says:

• For the random coefficient model, if (i) the data are balanced, with all units seen at the

same n times, so that the design matrix Zi of time points is the same for all units i, and (ii)

Ri = σ2In, then then the generalized least squares estimator is numerically equivalent to the OLS

estimator!

• To show this is a nasty but not impossible exercise in matrix algebra. Under conditions (i) and

(ii), Σi reduces to the same matrix for each i:

Σi = ZDZ ′ + σ2In.

Substitute this expression for Σ in (9.11) for each i (even if D and σ2 are replaced by estimates,

the form is the same). Fancy footwork with matrix inversion formulæ like those in Chapter 2 may

then be used to show the equivalence. Those with strong stomachs might want to try it!

PAGE 327

Page 337: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 9 ST 732, M. DAVIDIAN

The compound symmetry assumption for Σ directly in these circumstances is just a special case

of the particular covariance structure Σi = ZDZ ′ + σ2In for balanced data. To see this, consider a

simple model with one group, so that

Yij = (β0 + b0i) + (β1 + b1i)tj + eij ,

var(bi) = D =

D11 D12

D12 D22

, var(ei) = σ2In.

• It is straightforward to verify that (try it!)

var(Yij) = D11 + D22t2j + 2D12tj + σ2, cov(Yij , Yik) = D11 + D22tjtk + D12(tj + tk).

• Note that if D22 = 0 and D12 = 0, then these reduce to

var(Yij) = D11 + σ2, cov(Yij , Yik) = D11,

which is the compound symmetry model!

NEED FOR COVARIANCE STRUCTURE: As we have stressed before, just because the GLS estimator

is numerically identical to the OLS estimator under these circumstances is no reason to disregard the

need to characterize the covariance structure of a data vector correctly!

• The approximate covariance matrix of the GLS estimator, V β , depends on the form of Σi, even

if the estimator β doesn’t!

9.4 Inference on individuals

The random coefficient model is intuitively appealing – it comes from thinking first about individuals and

their own unique trajectories, and then about the population of individuals (in terms of the parameters

that characterize these trajectories). Thinking this way leads to a model for the mean and covariance of

a data vector that has a specific form; in particular, the covariance matrix of data vector is represented

explicitly as the sum of 2 terms, incorporating separately the impact of 2 sources of variation, within-

and among-units. This makes it easier for the data analyst:

• The sources of variation may be thought of separately. Thus, for example, a model Ri that best

captures the variation due to the nature of data collection on an individual unit may be entertained

separately from having to think about biological variation (D). In the modeling approach of the

last chapter, this had to be done all at once.

PAGE 328

Page 338: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 9 ST 732, M. DAVIDIAN

The model has still another advantage. It is sometimes the case that investigators may wish not only to

learn about the population(s) of units through things such as the “typical” (mean) slope values and

how they compare across populations. Particularly in medical and educational studies, the investigators

may wish to understand the change in the response over time for specific subjects.

• In a study of AIDS patients, with response “viral load,” measuring “amount” of virus in the

system, investigators may wish to characterize the trajectory of viral load for particular patients

in order to aid in decisions about their future care.

• In educational studies, where response is some measure of “achievement,” investigators may wish

to characterize the progress of individual children in order to place them in the most suitable

learning environment.

If we think in terms of the random coefficient model, then, interest focuses on the subject-specific

parameters βi describing the trajectories of individual subjects. In particular, for individual subjects,

the investigators are interested in “estimating” βi for specific subjects based on the data.

• One way to do this would be just to use estimates based on treating each subject as a separate

regression problem – one could get βi from each subject’s data separately.

• However, if the numbers of observations on each i is not too large, these estimates will probably

not be very good.

• Moreover, this does not take into account (nor does it take advantage of) the fact that we have

data from an entire sample of similar subjects from the same population(s). Intuition suggests

that we could stand to gain something from acknowledging that we believe this!

We will take up this issue in the next chapter, when we discuss the general linear mixed effects

model, of which the random coefficient model is a special case.

• Note immediately, however, that the models we have talked about in this course up to now

(Chapters 4–7) do not even explicitly acknowledge individual trajectories!

PAGE 329

Page 339: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 9 ST 732, M. DAVIDIAN

9.5 Discussion

“POPULATION-AVERAGED” VS. “SUBJECT-SPECIFIC”: We have seen that the random coefficient

model arises from thinking about the longitudinal data situation in an alternative way. Rather than

thinking in terms of the mean responses at each time point and how they are related, we think of

individual trajectories and then the means of individual-specific parameters that characterize these

trajectories (e.g. mean of the slopes in the population of subjects).

• The first approach, which was used in Chapter 7, is often called a population-averaged approach

for this reason – the focus of modeling is on the averages (means) across the population of

units at each time point, and how these averages are related over time.

• The current approach is often called a subject-specific approach – the focus of modeling is on

individual units.

• In the case where the models considered are linear, the two perspectives ultimately lead to the

same type of model for the mean, so that either interpretation is valid.

• The subject-specific, random coefficient approach has the additional feature that it “automati-

cally” leads to a particular assumption about the structure of the covariance matrix of a data

vector, which naturally acknowledges within- and among-unit variation separately. In contrast,

the population-averaged approach forces the data analyst to model this covariance, thinking about

the two sources of variation together. As a result, the subject-specific approach of the random

coefficient model, and, more generally, the linear mixed effects models we will consider in the

next chapter, has become incredibly popular.

ALTERNATIVE TERMINOLOGY: The random coefficient model, allowing for the possibility of dif-

ferent groups, is sometimes referred to as a growth curve model in the statistical and subject-matter

literature.

CHOICE OF COVARIANCE STRUCTURE: We have noted that the possibilities are quite broad for

modeling covariance structure within the random coefficient model framework.

• One may in principle take the covariance matrix Ri, corresponding to within-unit variation, to

be one of a variety of structures according to knowledge of the data collection process.

• If the main source of within-unit variation is measurement error, or if it is instead fluctuation but

observations are far apart in time taking Ri diagonal may be reasonable.

PAGE 330

Page 340: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 9 ST 732, M. DAVIDIAN

• One may in principle take the covariance matrix var(bi), characterizing variation among units

(through how the parameters in the individual trajectories vary) to be the same for all groups or

different, depending on the belief about the pattern of variation for each group.

• The most commonly-used form of the random coefficient model is that where

Ri = σ2Ini , var(bi) = D = same for all groups.

Often this structure is suitable; e.g. units tend to vary similarly for each group, although the

means may be different (same D is reasonable). This same kind of assumption (means differ,

variance the same) is standard in usual analysis of variance models and methods. This model is

considered extensively and almost exclusively in much of the literature. It is certainly possible to

relax these assumptions; for example, we discussed the possibility of taking D to be different for

each gender group in the dental data example.

• One pitfall of trying to get too fancy with modeling of Ri and var(bi) is that it is quite likely that

one will end up with a model that is too complicated to be sorted out given the data at hand.

This problem of identifiability is mentioned in the next section.

• Thus, many people are willing to risk the possibility that they may incorrectly specify Ri and/or

D by, for example, assuming that thevar(bi) = D is common to all groups when it may not be.

The form of the model

Σi = ZiDZ ′i + Ri

is sufficiently general that, even if the two components D and Ri are not exactly correctly chosen,

the resulting Σi matrix will differ very little from that one would obtain if they were. Thus, if

one’s main interest is in estimating β and tests about it, this may be okay.

• However, if interest is focused on var(bi) and Ri themselves, then obviously one would want to

investigate all possibilities. Thus, in the first example of section 9.7, we illustrate how both the

commonly-used specification and fancier ones may be implemented in SAS. However, be aware

that fitting very fancy models may lead to difficulties and “over-fitting.” To read more about the

possibilities, see SAS System for Mixed Models (1996, chapter 8) and Vonesh and Chinchilli (1997,

section 6.3).

PAGE 331

Page 341: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 9 ST 732, M. DAVIDIAN

9.6 Basic PROC MIXED sytnax

We are now in a position to explain fully exactly how PROC MIXED is set up. In the most general case

of a random coefficient model, we may write the model as

Y i = Xiβ + Zibi + ei.

In fact, just as we did in the previous chapter, we may present this mode in a streamlined form by

“stacking” the contributions from each unit. In particular, Define

Y =

Y 1

Y 2

...

Y m

, e =

e1

e2

...

em

, X =

X1

X2

...

Xm

, R =

R1 0 · · · 0

0 R2 · · · 0...

.... . .

...

0 0 · · · Rm

,

b =

b1

b2

...

bm

, Z =

Z1 0 · · · 0

0 Z2 · · · 0...

.... . .

...

0 0 · · · Zm

, D =

D 0 · · · 0

0 D · · · 0...

.... . .

...

0 0 · · · D

,

where D here has been displayed in the case where var(bi) = D for all units but could be modified if,

say, girls and boys had different matrices DG and DB. We may then write the model concisely as

Y = Xβ + Zb + e, var(Y ) = ZDZ ′ + R (9.12)

(verify). This type of concise expression is used in the documentation, except that SAS refers to D as

G.

We have already seen that the model statement is the mechanism by which the analyst may specify

the form the mean vector, denoted Xiβ for unit i or Xβ for all units, stacked. We have used the

repeated statement to specify the overall covariance matrix.

• In the context of a model of the above form, however, the repeated statement is used to specify

the within-unit covariance model Ri or, equivalently, R above.

• An additional statement, the random statement, is used to specify the assumption on var(bi) (D).

We will see specific examples in the next section.

PAGE 332

Page 342: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 9 ST 732, M. DAVIDIAN

For now, we offer a summary of the basic syntax for quick reference.

proc mixed data=dataset method= (ML,REML);

class classification variables;

model response = columns of X / solution;

random columns of Z / type= subject= group= ;

repeated / type= subject= group= ;

run;

proc mixed statement

• method=REML is the default; no method= required in this case

model statement

• columns of X are variables (class or continuous) corresponding to variables associated with

fixed effects β

• Intercept is assumed unless noint option after slash

• solution is an option

random statement

• Describes the matrix D = var(b) (i.e. the matrices var(bi) making up the blocks of D

• columns of Z are variables (class or continuous), i.e. variables associated with random effects

b

• subject= tells mixed what class variable denotes the grouping determining the units

• type= allows choice of matrix (e.g. un, unstructured)

• group= allows D to be different according to this class variable (e.g. dental study, boys, girls)

PAGE 333

Page 343: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 9 ST 732, M. DAVIDIAN

repeated statement

• Describes the matrix R = var(e) (i.e. the matrices Ri = var(ei)

• If var(ei) = σ2Ini same for all i repeated statement is NOT needed

• subject= tells mixed what class variable denotes the grouping determining the units

• type= allows choice other than diagonal (e.g. ar(1), cs, etc.

• group= allows Ri to be different depending on group membership (e.g. dental study, var(ei) = σ2G

girls, var(ei) = σ2B boys)

We may now observe that, in the previous chapter, to implement a general linear regression model

using proc mixed with the repeated statement, we simply made a correspondence between the model

of form (9.12) with no random effects b, which looks like

Y = Xβ + e,

and the model in that chapter of the form

Y = Xβ + εi.

From purely operational point of view (but not an interpretation point of view), the models have the

same structure – a mean plus a deviation with components of length ni, each of which has a covariance

matrix. Thus, purely to specify these covariance matrices for the second model, the repeated statement

can be used.

See the SAS documentation for PROC MIXED for much more detail on the use of these statements and

available options.

PAGE 334

Page 344: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 9 ST 732, M. DAVIDIAN

9.7 Implementation with SAS

We illustrate how to carry out analyses based on random coefficient models for two examples we have

already considered:

1. The dental study data

2. The ultrafiltration data

For each data set, we consider different random coefficient models and address questions of interest such

as whether the mean slope differs across groups (gender or center). As discussed in the last section,

we use SAS PROC MIXED with the random statement to impose the random coefficient model structure

– this statement allows the user to specify var(bi). If there is no repeated statement, it is assumed

that var(ei) = σ2Ini (see the last section). Otherwise, if a random and repeated statement appear

simultaneously, the repeated statement sets up some other model for var(ei) = Ri.

WARNING – LACK OF IDENTIFIABILITY: It is important to use PROC MIXED with version 6.12 or

higher of SAS; here, we use version 8.2. Even with this improved version, as well as with programs in

other software packages that are designed to fit these models, things may not always go as planned. It

is important to keep in mind that the models are being fit via numerical algorithms that are used to

maximize the likelihood or restricted likelihood. It is possible to specify a model with var(bi) and var(ei)

sufficiently complex that it is too complicated to be fitted given the information available in the data.

That is, one may choose these models in such a way that there are too many parameters, more than

are required to give an adequate characterization of the true covariance structure. Such a model is said

to be over-identified or unidentifiable. The result of specifying such models is that the numerical

algorithms will either fail to find a solution (converge) or will lead to a solution that is nonsensical).

Thus, one pitfall to be aware of when fitting these models and more generally those of the next chapter

is the possibility of getting “carried away” in choosing the structure for Ri, making it too complicated

and leading to an unidentifiable model. If PROC MIXED fails to converge for a particular model choice,

then the analyst may have to consider whether the implied model for Σi is “too rich” for the problem

and adopt simpler choices (at the risk of being “wrong”).

PAGE 335

Page 345: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 9 ST 732, M. DAVIDIAN

EXAMPLE 1 – DENTAL STUDY DATA:

• For illustration purposes only, we fit the random coefficient model assuming that the mean inter-

cept and slope differ for the two genders. Note that when fitting a random coefficient model, it is

natural to think in terms of the parameterization of the model that contains intercept and slope

explicitly rather than their difference:

Yij = β0i + β1itij + eij ,

βi = β + bi, β =

β0,G

β1,G

girls, β =

β0,B

β1,B

boys.

We consider this parameterization in our fitting.

• For fitting this model, we illustrate how to instruct PROC MIXED to fit models for a number of

different assumptions on the matrices Ri and var(bi). These are:

(i) Ri = σ2I, D same for both genders. This is the most common specification. Recall this

implies a belief that within-child sources of correlation are negligible (Ri diagonal) and

among-child variation is similar in each group. The parameter σ2 may be interpreted as the

aggregate variance due to within-child “fluctuations” in distance and measurement error.

(ii) Ri = σ2GI if i is a girl and Ri = σ2

BI if i is a boy, D same for both genders. This allows for

the possibility that within-child variation might be different for the different genders (due to

measurement error and fluctuation).

(iii) Ri is the AR(1) covariance matrix, same for both genders, and D is the same for both

genders. This choice of Ri allows for the possibility of nonnegligible within-child correlation.

(iv) Ri = σ2GI if i is a girl and Ri = σ2

BI if i is a boy, and var(bi) = DG if i is a girl and = DB

if a boy. This allows for the possibility that within-child variation might be different for

the different genders and the possibility that variability in intercepts and slopes is different.

This essentially amounts to fitting two separate models, one for each gender!

(v) Ri is the sum of two components: an AR(1) covariance matrix (corresponding to the fluctua-

tions, allowing within-child correlation) and σ22I, which now corresponds to the measurement

error component (assumed common). D is the same for both genders. Specifically, we have

Ri = σ21Γ + σ2

2I,

where Γ is the (4×4) AR(1) correlation matrix. To fit this model, we use of the local option

of the repeated statement, which adds the matrix σ22I to the requested AR(1) matrix.

PAGE 336

Page 346: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 9 ST 732, M. DAVIDIAN

PROGRAM:

/*******************************************************************

CHAPTER 9, EXAMPLE 1

Analysis of the dental study data by fitting a random coefficientmodel in time using PROC MIXED.

- the repeated measurement factor is age (time)

- there is one "treatment" factor, gender

The model for each child is assumed to be a straight line.The intercepts and slopes may have different means depending ongender, with the same covariance matrix D for each gender.

We use the RANDOM and REPEATED statements to fit models thatmake several different assumptions about the forms of the matricesRi and D.

*******************************************************************/

options ls=80 ps=59 nodate; run;

/******************************************************************

Read in the data set (See Example 1 of Chapter 4)

*******************************************************************/

data dent1; infile ’dental.dat’;input obsno child age distance gender;

run;

/*******************************************************************

Use PROC MIXED to fit the random coefficient model via theRANDOM statement. For all of the fits, we use usual normalML rather than REML (the default).

In all cases, we use the usual parameterization for the meanmodel.

The SOLUTION option in the MODEL statement requests that theestimates of the regression parameters be printed.

The G and GCORR options in the RANDOM statement asks that theD matrix and the corresponding correlation matrix it impliesbe printed. The V and VCORR options ask that the overallSigma matrix be printed (for the first subject or particularsubjects).

To fit a random coefficient model, we must specify that bothintercept and slope are random in the RANDOM statement.

If no REPEATED statement appears, then PROC MIXED assumes thatRi = sigma^2*I. Otherwise, we use a REPEATED statement to seta structure for Ri with the TYPE = option.

*******************************************************************/

* MODEL (i);* Ri = diagonal with constant variance sigma^2 same in both genders;* No REPEATED statement necessary to fit this Ri (default);* D = (2x2) unstructured matrix same for both genders;* Specified in the RANDOM statement;

title ’RANDOM COEFFICIENT MODEL WITH DIAGONAL WITHIN-CHILD’;title2 ’COVARIANCE MATRIX WITH CONSTANT VARIANCE SAME FOR EACH GENDER’;title3 ’SAME D MATRIX FOR BOTH GENDERS’;proc mixed method=ml data=dent1;class gender child;model distance = gender gender*age / noint solution;random intercept age / type=un subject=child g gcorr v vcorr;estimate ’diff in mean slope’ gender 0 0 gender*age 1 -1;contrast ’overall gender diff’ gender 1 -1, gender*age 1 -1 /chisq;

run;

* MODEL (ii);* Fit the same model but with a separate diagonal Ri matrix for;* each gender. Thus, there are 2 separate variances sigma^2_(G and B);* D still = (2x2) unstructured matrix same for both genders;* Specified in the RANDOM statement;

title ’RANDOM COEFFICIENT MODEL WITH DIAGONAL WITHIN-CHILD’;title2 ’COVARIANCE MATRIX WITH SEPARATE CONSTANT VARIANCE FOR EACH GENDER’;

PAGE 337

Page 347: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 9 ST 732, M. DAVIDIAN

title3 ’SAME D MATRIX FOR BOTH GENDERS’;proc mixed method=ml data=dent1;class child gender;model distance = gender gender*age / noint solution;repeated / group=gender subject=child;random intercept age / type=un subject=child g gcorr v vcorr;estimate ’diff in mean slope’ gender 0 0 gender*age 1 -1;contrast ’overall gender diff’ gender 1 -1, gender*age 1 -1 /chisq;

run;

* MODEL (iii);* Ri is AR(1) with the same variance and rho value for each gender;* Specified in the REPEATED statement;* D still = (2x2) unstructured matrix same for both genders;* Specified in the RANDOM statement;

title ’RANDOM COEFFICIENT MODEL WITH AR(1) WITHIN-CHILD’;title2 ’CORRELATION MATRIX WITH CONSTANT VARIANCE SAME FOR EACH GENDER’;title3 ’SAME D MATRIX FOR BOTH GENDERS’;proc mixed method=ml data=dent1;class gender child ;model distance = gender gender*age / noint solution ;random intercept age / type=un subject=child g gcorr v vcorr;repeated / type=ar(1) subject=child rcorr;estimate ’diff in mean slope’ gender 0 0 gender*age 1 -1;contrast ’overall gender diff’ gender 1 -1, gender*age 1 -1 /chisq;

run;

* MODEL (iv);* Fit the same model but with a separate diagonal Ri matrix for;* each gender. Thus, there are 2 separate variances sigma^2_(G and B);* D still = (2x2) unstructured matrix differs across genders;* Specified in the RANDOM statement by the GROUP=GENDER option;

title ’RANDOM COEFFICIENT MODEL WITH DIAGONAL WITHIN-CHILD’;title2 ’COVARIANCE MATRIX WITH SEPARATE CONSTANT VARIANCE FOR EACH GENDER’;title3 ’DIFFERENT D MATRIX FOR BOTH GENDERS’;proc mixed method=ml data=dent1;class child gender;model distance = gender gender*age / noint solution;repeated / group=gender subject=child;random intercept age / type=un group=gender subject=child g gcorr v vcorr;estimate ’diff in mean slope’ gender 0 0 gender*age 1 -1;contrast ’overall gender diff’ gender 1 -1, gender*age 1 -1 /chisq;

run;

* MODEL (v)* Ri is the sum of two components, an AR(1) component for fluctuations;* and a diagonal component with variance sigma^2 common to both genders;* The LOCAL option adds the diagonal component to the AR(1) structure;* specified in the REPEATED statement;* D still = (2x2) unstructured matrix same for both genders;* Specified in the RANDOM statement;

title ’RANDOM COEFFICIENT MODEL WITH AR(1) + COMMON MEAS ERROR WITHIN-CHILD’;title2 ’CORRELATION MATRIX WITH CONSTANT VARIANCE SAME FOR EACH GENDER’;title3 ’SAME D MATRIX FOR BOTH GENDERS’;proc mixed method=ml data=dent1;class gender child ;model distance = gender gender*age / noint solution ;random intercept age / type=un subject=child g gcorr v vcorr;repeated / type=ar(1) local subject=child rcorr;estimate ’diff in mean slope’ gender 0 0 gender*age 1 -1;contrast ’overall gender diff’ gender 1 -1, gender*age 1 -1 /chisq;

run;

PAGE 338

Page 348: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 9 ST 732, M. DAVIDIAN

OUTPUT: Following the output, we comment on a few aspects of the output.

RANDOM COEFFICIENT MODEL WITH DIAGONAL WITHIN-CHILD 1COVARIANCE MATRIX WITH CONSTANT VARIANCE SAME FOR EACH GENDER

SAME D MATRIX FOR BOTH GENDERS

The Mixed Procedure

Model Information

Data Set WORK.DENT1Dependent Variable distanceCovariance Structure UnstructuredSubject Effect childEstimation Method MLResidual Variance Method ProfileFixed Effects SE Method Model-BasedDegrees of Freedom Method Containment

Class Level Information

Class Levels Values

gender 2 0 1child 27 1 2 3 4 5 6 7 8 9 10 11 12 13

14 15 16 17 18 19 20 21 22 2324 25 26 27

Dimensions

Covariance Parameters 4Columns in X 4Columns in Z Per Subject 2Subjects 27Max Obs Per Subject 4Observations Used 108Observations Not Used 0Total Observations 108

Iteration History

Iteration Evaluations -2 Log Like Criterion

0 1 478.241759861 1 427.80595080 0.00000000

Convergence criteria met.

Estimated G Matrix

Row Effect child Col1 Col2

1 Intercept 1 4.5569 -0.19832 age 1 -0.1983 0.02376

RANDOM COEFFICIENT MODEL WITH DIAGONAL WITHIN-CHILD 2COVARIANCE MATRIX WITH CONSTANT VARIANCE SAME FOR EACH GENDER

SAME D MATRIX FOR BOTH GENDERS

The Mixed Procedure

Estimated G Correlation Matrix

Row Effect child Col1 Col2

1 Intercept 1 1.0000 -0.60252 age 1 -0.6025 1.0000

Estimated V Matrix for child 1

Row Col1 Col2 Col3 Col4

1 4.6216 2.8891 2.8727 2.85632 2.8891 4.6839 3.0464 3.12513 2.8727 3.0464 4.9363 3.39384 2.8563 3.1251 3.3938 5.3788

Estimated V Correlation Matrix for child 1

Row Col1 Col2 Col3 Col4

1 1.0000 0.6209 0.6014 0.5729

PAGE 339

Page 349: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 9 ST 732, M. DAVIDIAN

2 0.6209 1.0000 0.6335 0.62263 0.6014 0.6335 1.0000 0.65864 0.5729 0.6226 0.6586 1.0000

Covariance Parameter Estimates

Cov Parm Subject Estimate

UN(1,1) child 4.5569UN(2,1) child -0.1983UN(2,2) child 0.02376Residual 1.7162

Fit Statistics

-2 Log Likelihood 427.8AIC (smaller is better) 443.8AICC (smaller is better) 445.3BIC (smaller is better) 454.2

Null Model Likelihood Ratio Test

DF Chi-Square Pr > ChiSq

3 50.44 <.0001

RANDOM COEFFICIENT MODEL WITH DIAGONAL WITHIN-CHILD 3COVARIANCE MATRIX WITH CONSTANT VARIANCE SAME FOR EACH GENDER

SAME D MATRIX FOR BOTH GENDERS

The Mixed Procedure

Solution for Fixed Effects

StandardEffect gender Estimate Error DF t Value Pr > |t|

gender 0 17.3727 1.1820 54 14.70 <.0001gender 1 16.3406 0.9801 54 16.67 <.0001age*gender 0 0.4795 0.09980 54 4.80 <.0001age*gender 1 0.7844 0.08275 54 9.48 <.0001

Type 3 Tests of Fixed Effects

Num DenEffect DF DF F Value Pr > F

gender 2 54 247.00 <.0001age*gender 2 54 56.46 <.0001

Estimates

StandardLabel Estimate Error DF t Value Pr > |t|

diff in mean slope -0.3048 0.1296 54 -2.35 0.0224

Contrasts

Num DenLabel DF DF Chi-Square F Value Pr > ChiSq Pr > F

overall gender diff 2 54 14.19 7.10 0.0008 0.0018

RANDOM COEFFICIENT MODEL WITH DIAGONAL WITHIN-CHILD 4COVARIANCE MATRIX WITH SEPARATE CONSTANT VARIANCE FOR EACH GENDER

SAME D MATRIX FOR BOTH GENDERS

The Mixed Procedure

Model Information

Data Set WORK.DENT1Dependent Variable distanceCovariance Structures Unstructured, Variance

ComponentsSubject Effects child, childGroup Effect genderEstimation Method MLResidual Variance Method NoneFixed Effects SE Method Model-BasedDegrees of Freedom Method Containment

PAGE 340

Page 350: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 9 ST 732, M. DAVIDIAN

Class Level Information

Class Levels Values

child 27 1 2 3 4 5 6 7 8 9 10 11 12 1314 15 16 17 18 19 20 21 22 2324 25 26 27

gender 2 0 1

Dimensions

Covariance Parameters 5Columns in X 4Columns in Z Per Subject 2Subjects 27Max Obs Per Subject 4Observations Used 108Observations Not Used 0Total Observations 108

Iteration History

Iteration Evaluations -2 Log Like Criterion

0 1 478.241759861 2 418.92503842 1.166324992 1 416.18869903 1.233262093 1 407.89638533 0.019542684 2 406.88264563 0.006458005 1 406.10632159 0.000568666 1 406.04318997 0.000007647 1 406.04238894 0.00000000

Convergence criteria met.

RANDOM COEFFICIENT MODEL WITH DIAGONAL WITHIN-CHILD 5COVARIANCE MATRIX WITH SEPARATE CONSTANT VARIANCE FOR EACH GENDER

SAME D MATRIX FOR BOTH GENDERS

The Mixed Procedure

Estimated G Matrix

Row Effect child Col1 Col2

1 Intercept 1 3.1978 -0.11032 age 1 -0.1103 0.01976

Estimated G Correlation Matrix

Row Effect child Col1 Col2

1 Intercept 1 1.0000 -0.43882 age 1 -0.4388 1.0000

Estimated V Matrix for child 1

Row Col1 Col2 Col3 Col4

1 3.1426 2.7933 2.8889 2.98452 2.7933 3.4128 3.1426 3.31723 2.8889 3.1426 3.8411 3.64994 2.9845 3.3172 3.6499 4.4275

Estimated V Correlation Matrix for child 1

Row Col1 Col2 Col3 Col4

1 1.0000 0.8529 0.8315 0.80012 0.8529 1.0000 0.8680 0.85343 0.8315 0.8680 1.0000 0.88514 0.8001 0.8534 0.8851 1.0000

Covariance Parameter Estimates

Cov Parm Subject Group Estimate

UN(1,1) child 3.1978UN(2,1) child -0.1103UN(2,2) child 0.01976Residual child gender 0 0.4449Residual child gender 1 2.6294

PAGE 341

Page 351: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 9 ST 732, M. DAVIDIAN

Fit Statistics

-2 Log Likelihood 406.0AIC (smaller is better) 424.0AICC (smaller is better) 425.9BIC (smaller is better) 435.7

RANDOM COEFFICIENT MODEL WITH DIAGONAL WITHIN-CHILD 6COVARIANCE MATRIX WITH SEPARATE CONSTANT VARIANCE FOR EACH GENDER

SAME D MATRIX FOR BOTH GENDERS

The Mixed Procedure

Null Model Likelihood Ratio Test

DF Chi-Square Pr > ChiSq

4 72.20 <.0001

Solution for Fixed Effects

StandardEffect gender Estimate Error DF t Value Pr > |t|

gender 0 17.3727 0.7386 54 23.52 <.0001gender 1 16.3406 1.1114 54 14.70 <.0001age*gender 0 0.4795 0.06180 54 7.76 <.0001age*gender 1 0.7844 0.09722 54 8.07 <.0001

Type 3 Tests of Fixed Effects

Num DenEffect DF DF F Value Pr > F

gender 2 54 384.72 <.0001age*gender 2 54 62.66 <.0001

Estimates

StandardLabel Estimate Error DF t Value Pr > |t|

diff in mean slope -0.3048 0.1152 54 -2.65 0.0106

Contrasts

Num DenLabel DF DF Chi-Square F Value Pr > ChiSq Pr > F

overall gender diff 2 54 14.32 7.16 0.0008 0.0017

RANDOM COEFFICIENT MODEL WITH AR(1) WITHIN-CHILD 7CORRELATION MATRIX WITH CONSTANT VARIANCE SAME FOR EACH GENDER

SAME D MATRIX FOR BOTH GENDERS

The Mixed Procedure

Model Information

Data Set WORK.DENT1Dependent Variable distanceCovariance Structures Unstructured,

AutoregressiveSubject Effects child, childEstimation Method MLResidual Variance Method ProfileFixed Effects SE Method Model-BasedDegrees of Freedom Method Containment

Class Level Information

Class Levels Values

gender 2 0 1child 27 1 2 3 4 5 6 7 8 9 10 11 12 13

14 15 16 17 18 19 20 21 22 2324 25 26 27

Dimensions

Covariance Parameters 5Columns in X 4Columns in Z Per Subject 2

PAGE 342

Page 352: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 9 ST 732, M. DAVIDIAN

Subjects 27Max Obs Per Subject 4Observations Used 108Observations Not Used 0Total Observations 108

Iteration History

Iteration Evaluations -2 Log Like Criterion

0 1 478.241759861 2 424.08934703 0.000280012 1 424.05684775 0.000000963 1 424.05673965 0.00000000

Convergence criteria met.

RANDOM COEFFICIENT MODEL WITH AR(1) WITHIN-CHILD 8CORRELATION MATRIX WITH CONSTANT VARIANCE SAME FOR EACH GENDER

SAME D MATRIX FOR BOTH GENDERS

The Mixed Procedure

Estimated R Correlation Matrix for child 1

Row Col1 Col2 Col3 Col4

1 1.0000 -0.4680 0.2190 -0.10252 -0.4680 1.0000 -0.4680 0.21903 0.2190 -0.4680 1.0000 -0.46804 -0.1025 0.2190 -0.4680 1.0000

Estimated G Matrix

Row Effect child Col1 Col2

1 Intercept 1 10.1459 -0.71982 age 1 -0.7198 0.07508

Estimated G Correlation Matrix

Row Effect child Col1 Col2

1 Intercept 1 1.0000 -0.82482 age 1 -0.8248 1.0000

Estimated V Matrix for child 1

Row Col1 Col2 Col3 Col4

1 4.6275 2.6363 3.2182 2.59592 2.6363 4.4510 2.7601 3.64233 3.2182 2.7601 4.8751 3.48464 2.5959 3.6423 3.4846 5.8999

Estimated V Correlation Matrix for child 1

Row Col1 Col2 Col3 Col4

1 1.0000 0.5809 0.6776 0.49682 0.5809 1.0000 0.5925 0.71083 0.6776 0.5925 1.0000 0.64974 0.4968 0.7108 0.6497 1.0000

Covariance Parameter Estimates

Cov Parm Subject Estimate

UN(1,1) child 10.1459UN(2,1) child -0.7198UN(2,2) child 0.07508

RANDOM COEFFICIENT MODEL WITH AR(1) WITHIN-CHILD 9CORRELATION MATRIX WITH CONSTANT VARIANCE SAME FOR EACH GENDER

SAME D MATRIX FOR BOTH GENDERS

The Mixed Procedure

Covariance Parameter Estimates

Cov Parm Subject Estimate

PAGE 343

Page 353: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 9 ST 732, M. DAVIDIAN

AR(1) child -0.4680Residual 1.1940

Fit Statistics

-2 Log Likelihood 424.1AIC (smaller is better) 442.1AICC (smaller is better) 443.9BIC (smaller is better) 453.7

Null Model Likelihood Ratio Test

DF Chi-Square Pr > ChiSq

4 54.19 <.0001

Solution for Fixed Effects

StandardEffect gender Estimate Error DF t Value Pr > |t|

gender 0 17.4166 1.1586 54 15.03 <.0001gender 1 16.1544 0.9607 54 16.82 <.0001age*gender 0 0.4757 0.1010 54 4.71 <.0001age*gender 1 0.7978 0.08374 54 9.53 <.0001

Type 3 Tests of Fixed Effects

Num DenEffect DF DF F Value Pr > F

gender 2 54 254.37 <.0001age*gender 2 54 56.48 <.0001

Estimates

StandardLabel Estimate Error DF t Value Pr > |t|

diff in mean slope -0.3220 0.1312 54 -2.45 0.0174

RANDOM COEFFICIENT MODEL WITH AR(1) WITHIN-CHILD 10CORRELATION MATRIX WITH CONSTANT VARIANCE SAME FOR EACH GENDER

SAME D MATRIX FOR BOTH GENDERS

The Mixed Procedure

Contrasts

Num DenLabel DF DF Chi-Square F Value Pr > ChiSq Pr > F

overall gender diff 2 54 13.46 6.73 0.0012 0.0025

RANDOM COEFFICIENT MODEL WITH DIAGONAL WITHIN-CHILD 11COVARIANCE MATRIX WITH SEPARATE CONSTANT VARIANCE FOR EACH GENDER

DIFFERENT D MATRIX FOR BOTH GENDERS

The Mixed Procedure

Model Information

Data Set WORK.DENT1Dependent Variable distanceCovariance Structures Unstructured, Variance

ComponentsSubject Effects child, childGroup Effects gender, genderEstimation Method MLResidual Variance Method NoneFixed Effects SE Method Model-BasedDegrees of Freedom Method Containment

Class Level Information

Class Levels Values

child 27 1 2 3 4 5 6 7 8 9 10 11 12 1314 15 16 17 18 19 20 21 22 2324 25 26 27

gender 2 0 1

Dimensions

PAGE 344

Page 354: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 9 ST 732, M. DAVIDIAN

Covariance Parameters 8Columns in X 4Columns in Z Per Subject 4Subjects 27Max Obs Per Subject 4Observations Used 108Observations Not Used 0Total Observations 108

Iteration History

Iteration Evaluations -2 Log Like Criterion

0 1 478.241759861 1 405.11800674 0.00000000

Convergence criteria met.

Estimated G Matrix

Row Effect child gender Col1 Col2 Col3 Col4

1 Intercept 1 0 2.9716 -0.075392 age 1 0 -0.07539 0.02151

RANDOM COEFFICIENT MODEL WITH DIAGONAL WITHIN-CHILD 12COVARIANCE MATRIX WITH SEPARATE CONSTANT VARIANCE FOR EACH GENDER

DIFFERENT D MATRIX FOR BOTH GENDERS

The Mixed Procedure

Estimated G Matrix

Row Effect child gender Col1 Col2 Col3 Col4

3 Intercept 1 1 5.6468 -0.28274 age 1 1 -0.2827 0.02530

Estimated G Correlation Matrix

Row Effect child gender Col1 Col2 Col3 Col4

1 Intercept 1 0 1.0000 -0.29822 age 1 0 -0.2982 1.00003 Intercept 1 1 1.0000 -0.74804 age 1 1 -0.7480 1.0000

Estimated V Matrix for child 1

Row Col1 Col2 Col3 Col4

1 3.5889 3.3357 3.5292 3.72262 3.3357 4.0618 3.8947 4.17423 3.5292 3.8947 4.7069 4.62584 3.7226 4.1742 4.6258 5.5240

Estimated V Correlation Matrix for child 1

Row Col1 Col2 Col3 Col4

1 1.0000 0.8737 0.8587 0.83612 0.8737 1.0000 0.8907 0.88123 0.8587 0.8907 1.0000 0.90724 0.8361 0.8812 0.9072 1.0000

Covariance Parameter Estimates

Cov Parm Subject Group Estimate

UN(1,1) child gender 0 2.9716UN(2,1) child gender 0 -0.07539UN(2,2) child gender 0 0.02151UN(1,1) child gender 1 5.6468UN(2,1) child gender 1 -0.2827UN(2,2) child gender 1 0.02530Residual child gender 0 0.4466Residual child gender 1 2.5891

RANDOM COEFFICIENT MODEL WITH DIAGONAL WITHIN-CHILD 13COVARIANCE MATRIX WITH SEPARATE CONSTANT VARIANCE FOR EACH GENDER

DIFFERENT D MATRIX FOR BOTH GENDERS

PAGE 345

Page 355: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 9 ST 732, M. DAVIDIAN

The Mixed Procedure

Fit Statistics

-2 Log Likelihood 405.1AIC (smaller is better) 429.1AICC (smaller is better) 432.4BIC (smaller is better) 444.7

Null Model Likelihood Ratio Test

DF Chi-Square Pr > ChiSq

7 73.12 <.0001

Solution for Fixed Effects

StandardEffect gender Estimate Error DF t Value Pr > |t|

gender 0 17.3727 0.7252 25 23.96 <.0001gender 1 16.3406 1.1715 25 13.95 <.0001age*gender 0 0.4795 0.06313 25 7.60 <.0001age*gender 1 0.7844 0.09835 25 7.98 <.0001

Type 3 Tests of Fixed Effects

Num DenEffect DF DF F Value Pr > F

gender 2 25 384.22 <.0001age*gender 2 25 60.65 <.0001

Estimates

StandardLabel Estimate Error DF t Value Pr > |t|

diff in mean slope -0.3048 0.1169 25 -2.61 0.0151

Contrasts

Num DenLabel DF DF Chi-Square F Value Pr > ChiSq Pr > F

overall gender diff 2 25 14.12 7.06 0.0009 0.0037

RANDOM COEFFICIENT MODEL WITH AR(1) + COMMON MEAS ERROR WITHIN-CHILD 14CORRELATION MATRIX WITH CONSTANT VARIANCE SAME FOR EACH GENDER

SAME D MATRIX FOR BOTH GENDERS

The Mixed Procedure

Model Information

Data Set WORK.DENT1Dependent Variable distanceCovariance Structures Unstructured,

AutoregressiveSubject Effects child, childEstimation Method MLResidual Variance Method ProfileFixed Effects SE Method Model-BasedDegrees of Freedom Method Containment

Class Level Information

Class Levels Values

gender 2 0 1child 27 1 2 3 4 5 6 7 8 9 10 11 12 13

14 15 16 17 18 19 20 21 22 2324 25 26 27

Dimensions

Covariance Parameters 6Columns in X 4Columns in Z Per Subject 2Subjects 27Max Obs Per Subject 4Observations Used 108

PAGE 346

Page 356: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 9 ST 732, M. DAVIDIAN

Observations Not Used 0Total Observations 108

Iteration History

Iteration Evaluations -2 Log Like Criterion

0 1 478.241759861 2 428.22548286 24.550880172 2 427.26075815 1.094776783 2 426.51452533 1.169191294 2 425.99015592 0.085432135 2 424.91951841 0.014580026 2 424.32018203 0.003230177 3 424.01683319 .8 1 423.99457950 0.000077639 1 423.99420143 0.00000054

10 2 423.99415208 0.0000000711 2 423.99414400 0.00000000

RANDOM COEFFICIENT MODEL WITH AR(1) + COMMON MEAS ERROR WITHIN-CHILD 15CORRELATION MATRIX WITH CONSTANT VARIANCE SAME FOR EACH GENDER

SAME D MATRIX FOR BOTH GENDERS

The Mixed Procedure

Convergence criteria met.

Estimated R Correlation Matrix for child 1

Row Col1 Col2 Col3 Col4

1 1.0000 -0.2256 0.2241 -0.22272 -0.2256 1.0000 -0.2256 0.22413 0.2241 -0.2256 1.0000 -0.22564 -0.2227 0.2241 -0.2256 1.0000

Estimated G Matrix

Row Effect child Col1 Col2

1 Intercept 1 6.9045 -0.43332 age 1 -0.4333 0.04828

Estimated G Correlation Matrix

Row Effect child Col1 Col2

1 Intercept 1 1.0000 -0.75052 age 1 -0.7505 1.0000

Estimated V Matrix for child 1

Row Col1 Col2 Col3 Col4

1 4.5375 2.6344 3.2041 2.45042 2.6344 4.5423 2.8323 3.59513 3.2041 2.8323 4.9333 3.41654 2.4504 3.5951 3.4165 5.7106

Estimated V Correlation Matrix for child 1

Row Col1 Col2 Col3 Col4

1 1.0000 0.5803 0.6772 0.48142 0.5803 1.0000 0.5983 0.70593 0.6772 0.5983 1.0000 0.64374 0.4814 0.7059 0.6437 1.0000

RANDOM COEFFICIENT MODEL WITH AR(1) + COMMON MEAS ERROR WITHIN-CHILD 16CORRELATION MATRIX WITH CONSTANT VARIANCE SAME FOR EACH GENDER

SAME D MATRIX FOR BOTH GENDERS

The Mixed Procedure

Covariance Parameter Estimates

Cov Parm Subject Estimate

UN(1,1) child 6.9045UN(2,1) child -0.4333UN(2,2) child 0.04828Variance child 0.3351

PAGE 347

Page 357: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 9 ST 732, M. DAVIDIAN

AR(1) child -0.9935Residual 1.1408

Fit Statistics

-2 Log Likelihood 424.0AIC (smaller is better) 444.0AICC (smaller is better) 446.3BIC (smaller is better) 457.0

Null Model Likelihood Ratio Test

DF Chi-Square Pr > ChiSq

5 54.25 <.0001

Solution for Fixed Effects

StandardEffect gender Estimate Error DF t Value Pr > |t|

gender 0 17.4148 1.1651 54 14.95 <.0001gender 1 16.1917 0.9661 54 16.76 <.0001age*gender 0 0.4757 0.1010 54 4.71 <.0001age*gender 1 0.7979 0.08376 54 9.53 <.0001

Type 3 Tests of Fixed Effects

Num DenEffect DF DF F Value Pr > F

gender 2 54 252.17 <.0001age*gender 2 54 56.46 <.0001

RANDOM COEFFICIENT MODEL WITH AR(1) + COMMON MEAS ERROR WITHIN-CHILD 17CORRELATION MATRIX WITH CONSTANT VARIANCE SAME FOR EACH GENDER

SAME D MATRIX FOR BOTH GENDERS

The Mixed Procedure

Estimates

StandardLabel Estimate Error DF t Value Pr > |t|

diff in mean slope -0.3222 0.1312 54 -2.45 0.0173

Contrasts

Num DenLabel DF DF Chi-Square F Value Pr > ChiSq Pr > F

overall gender diff 2 54 13.97 6.99 0.0009 0.0020

PAGE 348

Page 358: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 9 ST 732, M. DAVIDIAN

INTERPRETATION:

• For each assumed model, the output shows the estimates of D (or different such matrices where

appropriate), the estimates of parameters making up Ri, and, as usual, the estimates of β. For

the fit of model (i), the estimate of the assumed common D is (Estimated G Matrix) and the

implied correlation matrix (Estimated G Correlation Matrix) are 4.5569 −0.1983

−0.1983 0.02376

,

1.0000 −0.6025

−0.6025 1.0000

,

respectively. The estimate of σ2 in the assumed model Ri = σ2I is in the Covariance Parameter

Estimates table (along with the distinct elements of D repeated) and is equal to 1.716 (Residual).

Recall that these are balanced data; thus, under this assumption, the matrix Σi is the same for

all children. The estimate of Σi implied by the above estimates and the associated correlation ma-

trix are given in the tables Estimated V Matrix for CHILD 1 and Estimated V Correlation

Matrix for CHILD 1 (see the output, page 1 and 2).

For the other models (ii) – (v), the estimates of the components of the overall covariance structure

are given in a similar fashion. For model (ii), the estimates of D and its implied correlation

matrix appear on page 4 of the output. Here, we assume that the within-child variance is different

depending on gender; from the table Covariance Parameter Estimates, the estimates are given

as σ2G = 0.445 and σ2

B = 2.629. These estimates are quite different. The implied matrix Σi is

now different for different i; in particular, it will be the same for all boys and the same for all

girls. The v and vcorr options cause PROC MIXED to print the estimate of Σi for the first child,

so the estimates of Estimated V Matrix for CHILD 1 and Estimated V Correlation Matrix

for CHILD 1 correspond to the estimate for girls.

For the fit of model (iii), where a common AR(1) structure is assumed for both boys and girls, the

estimates of ρ and σ2 may be found on page 9 of the output in the table Covariance Parameter

Estimates as -0.468 and 1.194, respectively.

For model (iv), where a different D matrix and Ri matrix as in model (ii) are assumed for each

gender, SAS prints the estimates of the two matrices DG and DB in the Estimated G Matrix

together on pages 11–12; that for girls is 2.9716 −0.0754

−0.0754 0.0215

.

PAGE 349

Page 359: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 9 ST 732, M. DAVIDIAN

The corresponding correlation matrices are printed in Estimated G Correlation Matrix. Again,

the implied Σi matrices will differ for boys and girls; those for the first girl are printed on page

12.

For model (v), which included two components for Ri, results begin on page 14 of the output.

In the Covariance Parameter Estimates table, Variance is generated by the local option and

refers to the estimate of σ22. Residual refers to the common variance σ2

1 that appears as part of

the structure requested in type=. AR(1) refers to the estimate of ρ. Note that the estimated value

is −0.99, which is virtually 1! The estimate has wandered off toward the “boundary” of what its

possible values are. Note that the overall covariance model is very “rich.” This is typical behavior

under these conditions and probably reflects that this model is too fancy to be well-identified.

• Note in cases (i), (ii), and (iv) that the estimates of β found in the Solution for Fixed Effects

are identical and are equal to the ordinary least squares estimator. This reflects the argument

given in section 9.3. Of course, the estimated standard errors are different for the different fits,

reflecting the different assumptions about Σi that go into forming V β . For (iii) and (v), where

the AR(1) matrix is involved so that Ri does not have a form like sigma2I for all units, this does

not hold.

• For all analyses, the Wald test of different slopes carried out by the estimate statement gives

a significant result at level α = 0.05. Also obtained is a Wald test for the “overall difference”

between genders – the L matrix for this contrast is

L =

1 −1 0 0

0 0 1 −1

;

thus, we are testing whether the mean intercepts and slopes are the same for each gender simul-

taneously. Regardless of the assumption on Σi, the evidence supporting rejection of this null

hypothesis seems very strong.

PAGE 350

Page 360: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 9 ST 732, M. DAVIDIAN

• Inspection of the AIC and BIC values for these fits on pages 2, 5, 9, and 13 of the output shows

that model (ii), where a different within-child variance is assumed for each gender and D the same

seem preferable among the four models considered. The AIC and BIC values for this model are

424.0 and 435.7, respectively. Comparing the values to those for the general regression models

considered in the analysis of these data in section 8.8 reveals that these AIC and BIC values seem

comparable to those for the preferred model in that section, where Σi was modeled as following a

different compound symmetry structure for boys and girls. Thus, among all models considered for

these data so far, either of these seems plausible. Model (ii) here may be more pleasing to many

analysts, because it considers the two sources of variation explicitly. The key element seems to

be allowing the within-child variance to be different for the two genders; allowing D to differ as

well in model (iv) offered no improvement in fit. Inspection of the original data plot reveals the

potential source of this result. Note that 2 of the boys, and one especially, have trajectories that

seem to “bounce around” much more than those of the other children. From above, the estimate

of variance for boys, σ2B, was much larger than that for girls, σ2

G. Otherwise, the trajectories

seem similarly spread out across girls and boys, supporting the choice of common D. Being able

to model the covariance structure in terms of the two sources of variation explicitly makes this

clear, allowing a pleasing interpretation of how the overall covariance structure differs. Such an

interpretation is more difficult with the model of section 8.8.

PAGE 351

Page 361: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 9 ST 732, M. DAVIDIAN

EXAMPLE 2 – DIALYZER DATA: In the following program, we consider the issue of whether the

mean slope of a trajectory differs across the centers.

• The “full” model is that assuming that each dialyzer has its own straight line trajectory with its

own intercept and slope. Then, each center has its own mean intercept and slope. We assume

a common var(bi) = D and a common diagonal within-unit covariance matrix Ri = σ2I for all

centers. Other specifications could be investigated to see if they provide a better fit.

• The model is

Yij = β0i + βi1tij + eij ,

βi = Aiβ + bi, β =

β01

β11

β02

β12

β03

β13

, bi ∼ N2(0, D).

where β0`, β1` are the mean intercept and slope for the `th center, ` = 1, 2, 3. Ai is the appropriate

matrix of 0’s and 1’s that “picks off” the correct elements of β for the i dialyzer; e.g. if i is from

center 1, then

Ai =

1 0 0 0 0 0

0 1 0 0 0 0

.

We fit this model by ML and REML.

• We also consider the reduced model where the slopes are the same for each center (with different

intercepts). Thus, for this model

β =

β01

β02

β03

β1

,

where β1 is the common slope. Thus, Ai would be the (2 × 4) matrix to “pick off” the right

intercept and β1 for the ith center; e.g. for i from center 1,

Ai =

1 0 0 0

0 0 0 1

.

We fit this model by ML so that we can construct the likelihood ratio test of this model against

the full model.

PAGE 352

Page 362: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 9 ST 732, M. DAVIDIAN

• For the full model fits, we use the estimate and contrast statements of PROC MIXED to construct

the Wald test statistics for different mean slopes, different intercepts, and pairwise comparison of

mean slopes for each pair of centers.

PROGRAM:

/*******************************************************************

CHAPTER 9, EXAMPLE 2

Analysis of the ultrafiltration data by fitting a randomcoefficient model in transmembrane pressure (mmHg)

- the repeated measurement factor is transmembrane pressure (tmp)

- there is one "treatment" factor, center

- the response is ultrafiltration rate (ufr, ml/hr)

The model for each dialyzer is a straight line. The interceptsand slopes have different means for each center. The covariancematrix D is the same for each center. The matrix Ri is takento be diagonal with variance sigma^2 for all units.

We use the RANDOM statement to fit the random coefficient model.

These data are unbalanced both in the sense that the pressuresunder which each dialyzer is observed are different.

*******************************************************************/

options ls=80 ps=59 nodate; run;

/******************************************************************

Read in the data set

*******************************************************************/

data ultra; infile ’ultra.dat’;input subject tmp ufr center;

* rescale the pressures -- see Chapter 8;

tmp=tmp/1000;

run;

/*******************************************************************

Use PROC MIXED to fit the random coefficient model via theRANDOM statement. For all of the fits, we use REML.

The SOLUTION option in the MODEL statement requests that theestimates of the regression parameters be printed.

In all cases, we take the (2 x 2) matrix D to be unstructured(TYPE=UN) in the RANDOM statement.

The G and GCORR options in the RANDOM statement asks thatthe D matrix and its corresponding correlation matrixbe printed. The V and VCORR options ask that the overallSigma matrix be printed (for the first subject or particularsubjects).

To fit a random coefficient model, we must specify that bothintercept and slope are random in the RANDOM statement.

No REPEATED statement is used because we assume Ri = sigma^2 I,which is the default.

*******************************************************************/

* "Full" model with different intercept, slope for each center;

title ’FULL MODEL, FIT BY REML’;proc mixed data=ultra;class center subject;model ufr = center center*tmp / noint solution ;random intercept tmp / type=un subject=subject g gcorr v vcorr;contrast ’diff in slope’ center 0 0 0 center*tmp 1 -1 0,

PAGE 353

Page 363: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 9 ST 732, M. DAVIDIAN

center 0 0 0 center*tmp 1 0 -1 / chisq;contrast ’diff in int’ center 1 -1 0 center*tmp 0 0 0 ,

center 1 0 -1 center*tmp 0 0 0 / chisq;estimate ’slope 1 vs 2’ center 0 0 0 center*tmp 1 -1 0 ;estimate ’slope 1 vs 3’ center 0 0 0 center*tmp 1 0 -1 ;estimate ’slope 2 vs 3’ center 0 0 0 center*tmp 0 1 -1 ;

run;

title ’FULL MODEL, FIT BY ML’;proc mixed method=ml data=ultra;class center subject;model ufr = center center*tmp / noint solution ;random intercept tmp / type=un subject=subject g gcorr v vcorr;contrast ’diff in slope’ center 0 0 0 center*tmp 1 -1 0,

center 0 0 0 center*tmp 1 0 -1 / chisq;contrast ’diff in int’ center 1 -1 0 center*tmp 0 0 0 ,

center 1 0 -1 center*tmp 0 0 0 / chisq;estimate ’slope 1 vs 2’ center 0 0 0 center*tmp 1 -1 0 ;estimate ’slope 1 vs 3’ center 0 0 0 center*tmp 1 0 -1 ;estimate ’slope 2 vs 3’ center 0 0 0 center*tmp 0 1 -1 ;

run;

* "Reduced" model with different intercepts but same slope for all;* centers;

title ’REDUCED MODEL WITH DIFF INTERCEPTS, COMMON SLOPE, FIT BY ML’;proc mixed method=ml data=ultra;class center subject;model ufr = center tmp / noint solution ;random intercept tmp / type=un subject=subject g gcorr v vcorr;

run;

OUTPUT: Following the output, we consider the issue of common slopes in several ways.

FULL MODEL, FIT BY REML 1

The Mixed Procedure

Model Information

Data Set WORK.ULTRADependent Variable ufrCovariance Structure UnstructuredSubject Effect subjectEstimation Method REMLResidual Variance Method ProfileFixed Effects SE Method Model-BasedDegrees of Freedom Method Containment

Class Level Information

Class Levels Values

center 3 1 2 3subject 41 1 2 3 4 5 6 7 8 9 10 11 12 13

14 15 16 17 18 19 20 21 22 2324 25 26 27 28 29 30 31 32 3334 35 36 37 38 39 40 41

Dimensions

Covariance Parameters 4Columns in X 6Columns in Z Per Subject 2Subjects 41Max Obs Per Subject 5Observations Used 164Observations Not Used 0Total Observations 164

Iteration History

Iteration Evaluations -2 Res Log Like Criterion

0 1 1714.696274111 2 1621.10582541 0.000005802 1 1621.10190144 0.00000000

Convergence criteria met.

PAGE 354

Page 364: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 9 ST 732, M. DAVIDIAN

Estimated G Matrix

Row Effect subject Col1 Col2

1 Intercept 1 2327.18 -5715.332 tmp 1 -5715.33 32378

FULL MODEL, FIT BY REML 2

The Mixed Procedure

Estimated G Correlation Matrix

Row Effect subject Col1 Col2

1 Intercept 1 1.0000 -0.65842 tmp 1 -0.6584 1.0000

Estimated V Matrix for subject 1

Row Col1 Col2 Col3 Col4

1 2010.79 1271.01 1217.53 1169.942 1271.01 2255.46 1858.33 2113.313 1217.53 1858.33 3152.24 3011.764 1169.94 2113.31 3011.76 4495.01

Estimated V Correlation Matrix for subject 1

Row Col1 Col2 Col3 Col4

1 1.0000 0.5968 0.4836 0.38912 0.5968 1.0000 0.6969 0.66373 0.4836 0.6969 1.0000 0.80014 0.3891 0.6637 0.8001 1.0000

Covariance Parameter Estimates

Cov Parm Subject Estimate

UN(1,1) subject 2327.18UN(2,1) subject -5715.33UN(2,2) subject 32378Residual 683.63

Fit Statistics

-2 Res Log Likelihood 1621.1AIC (smaller is better) 1629.1AICC (smaller is better) 1629.4BIC (smaller is better) 1636.0

Null Model Likelihood Ratio Test

DF Chi-Square Pr > ChiSq

3 93.59 <.0001

FULL MODEL, FIT BY REML 3

The Mixed Procedure

Solution for Fixed Effects

StandardEffect center Estimate Error DF t Value Pr > |t|

center 1 -174.43 14.9676 82 -11.65 <.0001center 2 -172.20 16.9846 82 -10.14 <.0001center 3 -151.72 19.2842 82 -7.87 <.0001tmp*center 1 4409.53 51.9683 82 84.85 <.0001tmp*center 2 4126.00 59.7776 82 69.02 <.0001tmp*center 3 4067.73 66.9954 82 60.72 <.0001

Type 3 Tests of Fixed Effects

Num DenEffect DF DF F Value Pr > F

center 3 82 100.17 <.0001tmp*center 3 82 5216.74 <.0001

PAGE 355

Page 365: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 9 ST 732, M. DAVIDIAN

Estimates

StandardLabel Estimate Error DF t Value Pr > |t|

slope 1 vs 2 283.53 79.2090 82 3.58 0.0006slope 1 vs 3 341.80 84.7885 82 4.03 0.0001slope 2 vs 3 58.2698 89.7872 82 0.65 0.5182

Contrasts

Num DenLabel DF DF Chi-Square F Value Pr > ChiSq Pr > F

diff in slope 2 82 20.83 10.41 <.0001 <.0001diff in int 2 82 0.96 0.48 0.6194 0.6211

FULL MODEL, FIT BY ML 4

The Mixed Procedure

Model Information

Data Set WORK.ULTRADependent Variable ufrCovariance Structure UnstructuredSubject Effect subjectEstimation Method MLResidual Variance Method ProfileFixed Effects SE Method Model-BasedDegrees of Freedom Method Containment

Class Level Information

Class Levels Values

center 3 1 2 3subject 41 1 2 3 4 5 6 7 8 9 10 11 12 13

14 15 16 17 18 19 20 21 22 2324 25 26 27 28 29 30 31 32 3334 35 36 37 38 39 40 41

Dimensions

Covariance Parameters 4Columns in X 6Columns in Z Per Subject 2Subjects 41Max Obs Per Subject 5Observations Used 164Observations Not Used 0Total Observations 164

Iteration History

Iteration Evaluations -2 Log Like Criterion

0 1 1762.751435251 2 1670.84436023 0.000007242 1 1670.83930877 0.00000001

Convergence criteria met.

Estimated G Matrix

Row Effect subject Col1 Col2

1 Intercept 1 2055.33 -5005.312 tmp 1 -5005.31 29044

FULL MODEL, FIT BY ML 5

The Mixed Procedure

Estimated G Correlation Matrix

Row Effect subject Col1 Col2

1 Intercept 1 1.0000 -0.64782 tmp 1 -0.6478 1.0000

Estimated V Matrix for subject 1

PAGE 356

Page 366: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 9 ST 732, M. DAVIDIAN

Row Col1 Col2 Col3 Col4

1 1880.09 1159.53 1123.70 1091.812 1159.53 2125.05 1711.25 1950.783 1123.70 1711.25 2953.75 2768.834 1091.81 1950.78 2768.83 4179.84

Estimated V Correlation Matrix for subject 1

Row Col1 Col2 Col3 Col4

1 1.0000 0.5801 0.4768 0.38952 0.5801 1.0000 0.6830 0.65453 0.4768 0.6830 1.0000 0.78804 0.3895 0.6545 0.7880 1.0000

Covariance Parameter Estimates

Cov Parm Subject Estimate

UN(1,1) subject 2055.33UN(2,1) subject -5005.31UN(2,2) subject 29044Residual 682.93

Fit Statistics

-2 Log Likelihood 1670.8AIC (smaller is better) 1690.8AICC (smaller is better) 1692.3BIC (smaller is better) 1708.0

Null Model Likelihood Ratio Test

DF Chi-Square Pr > ChiSq

3 91.91 <.0001

FULL MODEL, FIT BY ML 6

The Mixed Procedure

Solution for Fixed Effects

StandardEffect center Estimate Error DF t Value Pr > |t|

center 1 -174.44 14.4204 82 -12.10 <.0001center 2 -172.19 16.3531 82 -10.53 <.0001center 3 -151.74 18.6268 82 -8.15 <.0001tmp*center 1 4409.54 50.0369 82 88.13 <.0001tmp*center 2 4125.92 57.5800 82 71.66 <.0001tmp*center 3 4067.81 64.6780 82 62.89 <.0001

Type 3 Tests of Fixed Effects

Num DenEffect DF DF F Value Pr > F

center 3 82 107.85 <.0001tmp*center 3 82 5618.74 <.0001

Estimates

StandardLabel Estimate Error DF t Value Pr > |t|

slope 1 vs 2 283.62 76.2833 82 3.72 0.0004slope 1 vs 3 341.74 81.7737 82 4.18 <.0001slope 2 vs 3 58.1182 86.5950 82 0.67 0.5040

Contrasts

Num DenLabel DF DF Chi-Square F Value Pr > ChiSq Pr > F

diff in slope 2 82 22.43 11.21 <.0001 <.0001diff in int 2 82 1.03 0.51 0.5986 0.6005

REDUCED MODEL WITH DIFF INTERCEPTS, COMMON SLOPE, FIT BY ML 7

The Mixed Procedure

PAGE 357

Page 367: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 9 ST 732, M. DAVIDIAN

Model Information

Data Set WORK.ULTRADependent Variable ufrCovariance Structure UnstructuredSubject Effect subjectEstimation Method MLResidual Variance Method ProfileFixed Effects SE Method Model-BasedDegrees of Freedom Method Containment

Class Level Information

Class Levels Values

center 3 1 2 3subject 41 1 2 3 4 5 6 7 8 9 10 11 12 13

14 15 16 17 18 19 20 21 22 2324 25 26 27 28 29 30 31 32 3334 35 36 37 38 39 40 41

Dimensions

Covariance Parameters 4Columns in X 4Columns in Z Per Subject 2Subjects 41Max Obs Per Subject 5Observations Used 164Observations Not Used 0Total Observations 164

Iteration History

Iteration Evaluations -2 Log Like Criterion

0 1 1780.287367841 3 1689.51609987 0.000869662 1 1688.81130525 0.000089043 1 1688.74503369 0.000001284 1 1688.74413473 0.00000000

Convergence criteria met.

Estimated G Matrix

Row Effect subject Col1 Col2

1 Intercept 1 3102.51 -9985.702 tmp 1 -9985.70 52598

REDUCED MODEL WITH DIFF INTERCEPTS, COMMON SLOPE, FIT BY ML 8

The Mixed Procedure

Estimated G Correlation Matrix

Row Effect subject Col1 Col2

1 Intercept 1 1.0000 -0.78172 tmp 1 -0.7817 1.0000

Estimated V Matrix for subject 1

Row Col1 Col2 Col3 Col4

1 1938.92 1088.75 931.75 792.022 1088.75 2189.12 1899.08 2250.883 931.75 1899.08 3505.66 3640.264 792.02 2250.88 3640.26 5562.15

Estimated V Correlation Matrix for subject 1

Row Col1 Col2 Col3 Col4

1 1.0000 0.5285 0.3574 0.24122 0.5285 1.0000 0.6855 0.64513 0.3574 0.6855 1.0000 0.82444 0.2412 0.6451 0.8244 1.0000

Covariance Parameter Estimates

PAGE 358

Page 368: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 9 ST 732, M. DAVIDIAN

Cov Parm Subject Estimate

UN(1,1) subject 3102.51UN(2,1) subject -9985.70UN(2,2) subject 52598Residual 685.33

Fit Statistics

-2 Log Likelihood 1688.7AIC (smaller is better) 1704.7AICC (smaller is better) 1705.7BIC (smaller is better) 1718.5

Null Model Likelihood Ratio Test

DF Chi-Square Pr > ChiSq

3 91.54 <.0001

REDUCED MODEL WITH DIFF INTERCEPTS, COMMON SLOPE, FIT BY ML 9

The Mixed Procedure

Solution for Fixed Effects

StandardEffect center Estimate Error DF t Value Pr > |t|

center 1 -136.02 12.8851 82 -10.56 <.0001center 2 -194.43 13.7986 82 -14.09 <.0001center 3 -187.31 14.8087 82 -12.65 <.0001tmp 4230.63 40.4983 40 104.46 <.0001

Type 3 Tests of Fixed Effects

Num DenEffect DF DF F Value Pr > F

center 3 82 90.15 <.0001tmp 1 40 10912.8 <.0001

PAGE 359

Page 369: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 9 ST 732, M. DAVIDIAN

INTERPRETATION:

• Comparing to the analysis of these data by ordinary least squares in section 8.8, we see that none

of the estimates for β in the full model agree with the OLS estimates for the full model. This is

not surprising, as these data are not balanced.

• In fact, note that the estimates of β and their standard errors in the full model in the Solution

for Fixed Effects table differ slightly for the ML and REML fits. This is to be expected – the

“weighting” by the estimated covariance matrices Σi is slightly different in each case, because the

estimates of (the distinct) elements of D and σ2 are slightly different. This can be seen by in-

specting the estimates of D in Estimated G Matrix and Estimated G Correlation Matrix for

each of the ML and REML fits on pages 1 (REML) and page 3 (ML). Similarly, from Covariance

Parameter Estimates for REML and ML on pages 2 and 5, the estimate of σ2 may be found

(Residual). The estimates differ slightly – σ2 = 683.63 for REML and σ2 = 682.93 for ML.

Note that the estimates of Σi for the dialyzer i = 1 in Estimated V Matrix for SUBJECT 1 and

Estimated V Correlation Matrix for Subject 1) are similar for the two fits.

• The results of the estimate and contrast statements for each fit lead to the same qualitative

conclusions. From pages 3 and 6, there is strong evidence according to the Wald (chisq) test for

difference in slope with 2 degrees of freedom obtained from the contrast statement that there is

a difference in mean slope for the 3 centers. Here, the L matrix has 2 rows:

L =

0 0 0 1 −1 0

0 0 0 1 0 −1

.

A contrast statement for difference in intercepts, with corresponding L matrix

L =

1 −1 0 0 0 0

1 0 −1 0 0 0

,

yields in each case a Wald test statistic TL = 0.96 (REML) and 1.03 (ML). Comparing these to a

χ22 distribution, it is clear that there is not enough evidence to suggest that the intercepts differ

among centers.

PAGE 360

Page 370: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 9 ST 732, M. DAVIDIAN

The pairwise comparisons of slopes among centers are obtained from the results of the estimate

statements for each analysis, on pages 3 and 5. Inspection of the results supports the contention

that the mean slope for center 1 is different from that for the other two centers. The estimate of

this mean slope is 4409.5 (mmHg/100 ml/hr) for each analysis, while those for the other centers

are considerably smaller. Thus, it appears that the “typical” rate of change of ultrafiltration rate

with transmembrane pressure is faster for dialyzers used at center 1. A possible explanation for

this result would be up to the investigators. Perhaps the subject population is different at the

first center, or personnel at the first center have different skills operating the devices.

• We may also conduct the test of equal mean slopes via a likelihood ratio test. Here, we use the

“full” and “reduced” model results for the fits based on ML. From pages 6 and 8, −2 log-likelihood

for the “full” and “reduced” models is 1670.8 and 1688.7, respectively, so that the likelihood ratio

test statistic is 1688.7− 1670.8 = 17.9. This is to be compared to the χ2 distribution with r = 2

degrees of freedom. As χ22,0.95 = 5.99, we have strong evidence on the basis of this test to suggest

that there is a difference among the mean slopes, which is in agreement with the inference based

on the Wald test above.

• For the fit of the “full” model by ML, from page 5, we have AIC = 1690.8 and BIC = 1708.0. Re-

call that in section 8.8, we fit the same mean model (although arriving at it from the “population-

averaged” perspective) with several different choices of model for Σi. We may compare those fits

to that here, which implies yet another assumption for Σi, on the basis of AIC and BIC values.

The (AIC, BIC) values assuming Σi has a compound symmetry and Markov structure, respec-

tively (from pages 4 and 7 of the output in section 8.8), are (1713.5,1727.2) and (1706.0,1719.7),

giving support for the “subject-specific” random coefficient modeling approach over the direct,

“population-averaged” regression approach in terms of modeling the covariance structure.

PAGE 361

Page 371: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 10 ST 732, M. DAVIDIAN

10 Linear mixed effects models for multivariate normal data

10.1 Introduction

Random coefficient models, where we develop an overall statistical model by thinking first about indi-

vidual trajectories in a “subject-specific” fashion, are a special case of a more general model framework

based on the same perspective. This model framework, known popularly as the linear mixed effects

model, is still based on thinking about individual behavior first, of course. However, the possibilities

for how this is represented, and how the variation in the population is represented, are broadened. The

result is a very flexible and rich set of models for characterizing repeated measurement data.

The broader possibilities that are encompassed are best illustrated by examples. In the next section,

we consider several examples that highlight some of these possibilities. We then note that all of the

examples, as well as the random coefficient model as described in the last chapter, may be written in a

unified way. Moreover, the same inferential techniques of maximum likelihood and restricted maximum

likelihood are also applicable.

As mentioned in our discussion of random coefficient models, one advantage is that the model naturally

represents individual trajectories in a formal way, so that questions of interest about individual

behavior may be considered. In this chapter, we will show in the context of the general linear mixed

effects model framework how “estimation” of individual trajectories may carried out.

10.2 Examples

RANDOM COEFFICIENT MODEL: To set the stage, recall the random coefficient model where each

unit is assumed to have its own inherent straight line trajectory, with its own intercept and slope β0i

and β1i, i.e.

Yij = β0i + β1itij + eij , βi =

β0i

β1i

.

If furthermore units are from, say, q = 2 groups, then the population model would be

βi = Aiβ + bi, bi ∼ N (0, D),

PAGE 362

Page 372: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 10 ST 732, M. DAVIDIAN

β =

β01

β11

β02

β12

, bi =

b0i

b1i

and Ai is the appropriate matrix of 0’s and 1’s that “picks off” the intercept and slope for the group

to which i belongs. If there is only q = 1 group, then Ai = I2 for all i and β = (β0, β1)′.

• Implicit in the statement of this model is that both intercepts and slopes exhibit nonnegligible

variation among units in the population(s) of interest. This belief is represented by the (2 × 1)

random effect bi – the intercept and slope for different units vary about the mean intercept and

slope according to bi.

MAGNITUDES OF AMONG-UNIT VARIATION: For simplicity, consider first a situation with a sin-

gle group, so that all β0i and β1i in the random coefficient model are assumed to vary about a common

mean intercept and slope. Consider Figure 1, which depicts longitudinal data for 10 hypothetical units.

Figure 1: Longitudinal data where variation in slope may be negligible

days

resp

onse

0 5 10 15 20 25 30

2040

6080

100

120

140

••

• •

••

••

••

• •

••

••

••

••

••

• ••

• •

••

• •

PSfrag replacements

µ

σ21

σ22

ρ12 = 0.0

ρ12 = 0.8

y1

y2

PAGE 363

Page 373: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 10 ST 732, M. DAVIDIAN

Note that, although the profiles clearly begin at different responses at time 0, the rate of change (slope)

of each profile over time seems very similar across units (keeping in mind that there is variation within

units making the profiles not look perfectly like straight lines). The upshot is that the intercepts of

the individual “true” straight lines definitely appear to vary across units; however, the slopes do not

seem to vary much at all.

• One possibility is that (though impossible to tell from just a graph) that the “true” underlying

slopes are identical for all units in the population. When the units are biological entities,

and the response something like growth, this seems practically implausible. However, in some

applications, like engineering, where the units may have been manufactured to change over time

in an identical fashion, this may not be so farfetched.

• A more reasonable explanation may be that, relative to how the intercepts vary across units, the

variation among the slopes is much less, making them appear to vary hardly at all. It may be

that the rate of change over time for this population is quite similar, but not exactly identical, for

all units.

If we had reason to believe the first possibility, we might want to consider a model that reflects the fact

that slopes are virtually identical across units explicitly. The following “second-stage” model would

accomplish this:

β0i = β0 + b0i

β1i = β1. (10.1)

In (10.1), note that the individual-specific slope β1i has no random effect associated with it. This

reflects formally the belief that the β1i do not vary in the population of units.

• Thus, under this population model, while the intercepts are random, with an associated random

effect and thus varying in the population, the slopes are all equal to the fixed value β1 and do

not vary at all across units.

• Thus, there is only a single, scalar random effect, b0i. Consideration of a covariance matrix

for the population, D, reduces to consideration of just a single variance, that of b0i.

PAGE 364

Page 374: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 10 ST 732, M. DAVIDIAN

If we believed that the second possibility were likely, we might still want to consider model (10.1). If

we considered the usual random coefficient model with

β0i = β0 + b0i

β1i = β1 + b1i,

then for the matrix D, the D11, represents the variance of b0i (among intercepts) and D22 that of b1i

(among slopes). If D11 is nonnegligible relative to the mean intercept, then this suggests that intercepts

vary perceptibly. If on the other hand D22 is virtually negligible relative to the size of the mean slope,

then this suggests that variation in slopes is almost undetectable.

• It is a fact of life that, when this is the case, the numerical algorithms used to implement fitting

of the model (e.g. by ML or REML) may experience serious difficulties. The algorithm simply

cannot pin down D22, and this makes it also have a hard time pinning down the covariance D12.

• Thus, in situations where this is true, it may be a reasonable approximation to the truth to

say that, for all practical purposes, the variation among β1i slopes is negligible. Although we

don’t necessarily believe that the slopes don’t vary at all, saying their variance is negligible is

an approximation that is probably reasonably close enough to the truth to accept for practical

purposes. This assumption will allow implementation of the model to be feasible.

In either case, we are faced with a situation that does not quite fit into the random coefficient framework.

The individual-specific parameters βi no longer have all elements varying! How may we represent this?

This is most easily seen by “brute force.” We have

Yij = β0i + β1itij + eij ,

β0i = β0 + b0i, β1i = β1. (10.2)

Plugging the representations for β0i and β1i into the first stage model, we obtain

Yij = β0 + β1tij + b0i + eij . (10.3)

PAGE 365

Page 375: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 10 ST 732, M. DAVIDIAN

If we think of the implication of (10.3) for the entire vector Y i, it is straightforward to see that we may

write this succinctly as

Y i = X iβ + 1b0i + ei,

where as usual 1 is a (ni × 1) vector of 1’s and X i is the design matrix for individual i

Xi =

1 ti1...

...

1 tini

.

Note that if we let Zi = 1 and bi = b0i (1 × 1), we may write this in the form

Y i = X iβ + Zibi + ei (10.4)

as before – this looks identical to the general representation we used in the last chapter, except that

the definitions of X i and Zi we used in the single group case are now different. Other than this, the

model has exactly the same form, once we’ve defined X i and Zi appropriately.

Alternatively, we can do the same calculation with more fancy footwork. We will illustrate this in a

way that allows immediate extension to the case of more than one group; to this end, it is convenient

to use a different symbol to represent the design matrix for individual i (we called it X i above). Thus,

write

Ci =

1 ti1...

...

1 tini

.

Furthermore, note that we may write (10.2) as follows (verify)

βi = Aiβ + Bibi, bi = b0i (1 × 1), (10.5)

where Ai is an identity matrix and

Bi =

1

0

, (2 × 1).

With these representations, if we think of the model that says each child has his/her own straight line

regression model with child-specific regression parameter βi, i.e.

Y i = Ciβi + ei,

plugging (10.5) into this expression gives

Y i = CiAiβ + CiBibi + ei. (10.6)

PAGE 366

Page 376: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 10 ST 732, M. DAVIDIAN

It is straightforward to verify (try it) that

CiBi = 1.

With a single group, Ai is an identity matrix, so, furthermore, C iAi = Ci in this case. If we rename

CiAi = Ci = Xi, then, writing Zi = 1,, we have the model (10.4) above with these definitions of X i

and Zi.

This argument extends immediately to the case of more than one group. In this situation, the Ai

for each individual i are appropriate (k × p) matrices of 0’s and 1’s rather than identity matrices

and β must be defined appropriately as well. For the dental data, k = 2 and p = 4, and we define

β = (β0,G, β1,G, β0,B, β1,B)′. However, the same manipulations apply; the only difference is that in this

case X i = CiAi is now the appropriate (ni ×p) matrix for the group to which individual i belongs; e.g.

in the dental study, for boys, we have

Xi = CiAi =

1 ti1...

...

1 tini

0 0 1 0

0 0 0 1

=

0 0 1 ti1...

......

...

0 0 1 tini

and similarly for girls. It is straightforward to verify that, with these definitions, the model implied for

an observation Yij is

Yij = β0,G + β1,Gtij + b0i + eij for girls

= β0,B + β1,Btij + b0i + eij for boys.

Thus, by the above, we are able to write down a model that says that all boys have slope β1,B and girls

β1,G, with intercepts that vary about the respective mean intercepts β0,B and β0,G.

RESULT: This is, of course, the same representation we considered in the last chapter. The difference

between the models here and the random coefficient model is that the matrix Z i, which dictates how

the random effects enter the model, and the bi themselves, are allowed to be defined differently to

accommodate the belief that the slopes β1i do not vary across individuals.

We thus see that it is possible to consider a more general form of the random coefficient model and

write it in the same form as we did previously, i.e. in terms of matrices X i and Zi. The definition of

these matrices depends on the features we wish to represent. That is, the random coefficient model of

Chapter 9 is a special case of a more general model, where the X i and Zi matrices may be defined in

other ways.

PAGE 367

Page 377: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 10 ST 732, M. DAVIDIAN

To gain a further understanding of this, consider another possibility.

OTHER COVARIATES: In some instances, the question of interest may in fact involve the possible

association between the values of measured covariates and rate of change of a response over time.

We now see that it is possible to write models appropriate for this situation in the form (10.4) for

suitable choices of X i and Zi.

An example arises in understanding the progression of disease in HIV-infected patients assigned to

follow a certain therapeutic regimen. HIV attacks the immune system, so HIV-infected subjects often

have compromised immune system characteristics. A standard measure of immune status is CD4 count,

where lower counts indicate poorer status. Now a standard measure of how well a patient is doing is

viral load, roughly the “amount” of virus present in the body, and it is routine to follow viral load

over time to monitor a patient’s well-being. HIV scientists may be interested in whether the nature of

viral load progression is different depending on a subject’s immune system at the time of initiation of

therapy. To develop a formal model to address this issue, suppose initially there is only one group.

• Let Yij be the viral load measurement taken on subject i at time tij (usually measured in units of

“log copy number”) following start of therapy at time 0, and suppose that for any given subject, the

trajectory of viral load measurements over time appears to be a straight line, with subject-specific

intercept and slope; i.e.

Yij = β0i + β1itij + eij , βi = (β0i, β1i)′

• In addition, suppose that at time 0 (“baseline”) for all subjects, a CD4 count measurement is

available; denote this measurement as ai for the ith subject.

• In terms of the individual model, then, the question of interest is whether the magnitude and

direction of individual rates of change, i.e. slopes β1i, are associated with the value of ai. We

may state such an association formally as

β1i = β2 + β3ai + b1i.

• For illustration, suppose that we do not believe that the intercepts, which represent viral load

at time 0, are associated with CD4 count (this is actually unlikely, but we assume it here for

purposes of developing a simple model). We may state this as

β0i = β1 + b0i.

PAGE 368

Page 378: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 10 ST 732, M. DAVIDIAN

We may write this succinctly as

βi = Aiβ + bi, β =

β1

β2

β3

, bi =

b0i

b1i

, Ai =

1 0 0

0 1 ai

• Note that this model allows the possibility that both intercepts and slopes vary in the population

of subjects. However, it states that the fact that slopes vary across individuals may in part be

associated with their baseline CD4 counts.

• The question of interest in the context of this model is about the value of β3; if β3 = 0, then this

says that there is no association between baseline CD4 and subsequent rate of change of viral load

while on this therapy.

• The model for βi itself has the flavor of a “regression model.” Here, ai is a covariate in this

model.

It is straightforward to see that this model may be put into the form of (10.4). Plugging in the form of

βi into the individual model, we see that

Yij = β1 + β2tij + β3aitij + b0i + b1itij + eij , j = 1, . . . , ni.

It may be verified that this may be written succinctly as

Y i = Xiβ + Zibi + ei,

where

Xi =

1 ti1 aiti1...

......

1 tiniaitini

, Zi =

1 ti1...

...

1 tini

= Ci, say.

PAGE 369

Page 379: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 10 ST 732, M. DAVIDIAN

Alternatively, using a matrix argument, note that we may write

βi = Aiβ + Bibi, Bi = I2

and Ai as above. Writing the first-stage individual model as

Y i = Ciβi + ei

and plugging in for βi, we obtain

Y i = (CiAi)β + (CiBi)bi + ei = X iβ + Zibi + ei, (10.7)

where

Xi = CiAi =

1 ti1...

...

1 tini

1 0 0

0 1 ai

=

1 ti1 ait1i

......

...

1 tiniaitini

and CiBi = CiI = Ci = Zi.

It is straightforward to see that this model could be extended to allow

• More than one group, by suitable redefinition of β and Ai; e.g. with two treatment groups we

could write

β0i = β1 + b0i for treatment 1,

= β4 + b0i for treatment 2,

β1i = β2 + β3ai + b1i for treatment 1,

= β5 + β6ai + b1i for treatment 2,

and define β = (β1, β2, β3, β4, β5, β6)′ and bi = (b0i, b1i)

′. The matrices Ai would be (3 × 6); for

example, for subject i in treatment 1,

Ai =

1 0 0 0 0 0

0 1 ai 0 0 0

.

Then βi = Aiβ + Bibi with Ai and β as above and Bi = I2.

PAGE 370

Page 380: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 10 ST 732, M. DAVIDIAN

• Some parameters not to vary in the population, as above. As a hypothetical example, suppose we

wanted a model that expresses the belief that variation among slopes is entirely attributable

to CD4 count and that none of the variation in slopes is random, while variation in intercepts

is random. (This sounds biologically questionable, but we consider it for illustration.) With 2

groups, this could be expressed as

β0i = β1 + b0i for treatment 1,

= β4 + b0i for treatment 2,

β1i = β2 + β3ai for treatment 1,

= β5 + β6ai for treatment 2,

We could again write this as βi = Aiβ + Bibi with Ai and β as above but with bi = b0i and

Bi = (1, 0)′.

By plugging these representations into the first stage model as in (10.7), we arrive at a model of the

form

Y i = Xiβ + Zibi + ei, (10.8)

where the matrices X i and Zi are determined by the particular definitions of Ai, Bi, and Ci.

RESULT: It should be clear that it is possible to represent even fancier specifications in this way. E.g.,

we could also incorporate association of the intercepts with ai, and we may have more than one

covariate in the second-stage population model. We consider an example at the end of this chapter.

Once we write down the model in the form βi = Aiβ + Bibi for appropriately defined matrices Ai and

Bi reflecting the features of interest, we may write a model of the form (10.8), where the definitions of

Xi and Zi are dictated by the form of the first- and second-stage models.

THE SIMPLEST MODEL: It is in fact the case that the general model

Y i = X iβ + Zibi + ei

includes as special cases may simple models for repeated measurements.

PAGE 371

Page 381: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 10 ST 732, M. DAVIDIAN

A particularly simple model is as follows. Suppose there is only one group, and, for each unit, we have

repeated measurements Yij . However, suppose that these measurements are not necessarily over

time; e.g. the m units are mother rats, and for the ith mother, Yij represent birthweights of her ni

pups. In the absence of further information, a very simple model for this situation is

Yij = µ + bi + eij , j = 1, . . . , ni. (10.9)

The model says that the population of all possible pup weights is centered about µ, and allows for the

possibility of 2 sources of variation, among mother rats, through bi (some mothers have larger pups

than others) and within mother rats, through eij (pups born to a given mother are not all identical,

and weights may be measured with error).

If we define X i = 1, Zi = 1, and bi = bi, then it is straightforward to see that we may write (10.9) in

the form of (10.8).

It is straightforward to extend this simple model to allow different treatment groups with mean µ` =

µ + τ` for the `th group by redefining β and X i (try it!).

In fact, the univariate ANOVA model of Chapter 5 can also be written in this form. Recall that in

Chapter 5 (see page 119) we wrote this model in the form

Y i = Xiβ + 1bi + ei

Thus, we see this is again a special case of the general model as above (Z i = 1, bi = bi) with the

particular forms of X i and β on page 119.

SUMMARY: It should be clear from these examples that it is possible to consider a wide variety of

subject-specific models of the form

Y i = X iβ + Zibi + ei

by suitably defining X i, β, Zi, and bi. This model in its general form is known as the linear mixed

effects model.

PAGE 372

Page 382: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 10 ST 732, M. DAVIDIAN

10.3 General linear mixed effects model

For convenience, we summarize the form of the linear mixed effects here.

THE MODEL: With Y i a (ni × 1) vector of responses for the ith unit, i = 1, . . . , m,

Y i = X iβ + Zibi + ei (10.10)

where

• X i is a (ni × p) “design matrix” that characterizes the systematic part of the response, e.g.

depending on covariates and time.

• β is a (p × 1) vector of parameters usually referred to as fixed effects, that complete the char-

acterization of the systematic part of the response.

• Zi is a (ni × k) “design matrix” that characterizes random variation in the response attributable

to among-unit sources.

• bi is a (k × 1) vector of random effects that completes the characterization of among-unit

variation. Note that k and p need not be equal.

• ei is a (ni × 1) vector of within-unit deviations characterizing variation due to sources like

within-unit fluctuations and measurement error.

ASSUMPTIONS ON RANDOM VARIATION: The model components bi (k × 1) and ei (ni × 1) char-

acterize the two sources of variation, among- and within-units. The usual assumptions are

• ei ∼ Nni(0, Ri). Here, Ri is a (ni ×ni) covariance matrix that characterizes variance and correla-

tion due to within-unit sources (see the discussion in the last chapter). The most common choice

is the model that says variance is the same at all time points for all units and that measurements

are sufficiently far apart in time that correlation, if any, is negligible, i.e.

Ri = σ2Ini.

As discussed in the previous chapter, other models for Ri are also possible.

PAGE 373

Page 383: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 10 ST 732, M. DAVIDIAN

• bi ∼ Nk(0, D). Here, D is a (k×k) covariance matrix that characterizes variation due to among-

unit sources, assumed the same for all units. The dimension of D corresponds to the number of

among-unit random effects in the model.

It is possible to allow D to have a particular form or to be unstructured. It is also possible to

have different D matrices for different groups, as we discussed in the last chapter. In our discussion

here, we will present things under the assumption of a common D for all units, regardless of group

or anything else. This may often be a reasonable assumption unless there is strong evidence that

different conditions have a nonnegligible effect on variation as well as mean. Much of what we

discuss in the sequel can be extended to more complex models, e.g., with different D matrices

and fancier Ri matrices.

• With these assumptions, we have

E(Y i) = X iβ, var(Y i) = ZiDZ ′

i + Ri = Σi

Y i ∼ Nni(Xiβ,Σi). (10.11)

That is, the model with the above assumptions on ei and bi implies that the Y i are multivariate

normal random vectors of dimension ni with a particular form of covariance matrix. The form of

Σi implied by the model has two distinct components, the first having to do with variation solely

from among-unit sources and the second having to do with variation solely from within-unit

sources.

“SUBJECT-SPECIFIC” MODEL: Although the forms of X i, β, Zi, and bi are allowed more possibil-

ities here than in the random coefficient model, the spirit of the model is the same. If we think about

the general form of the model, it is clear that the model is a subject-specific one. In particular, if we

examine the form of the model

Y i = Xiβ + Zibi + ei,

• If we “zero in” on unit i, and consider this unit alone and in its own right, regardless of other

units, the model has the form of a “regression model” for the data Y i. The “mean” part of this

regression model is

Xiβ + Zibi =

(Xi Zi

)

β

bi

.

PAGE 374

Page 384: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 10 ST 732, M. DAVIDIAN

The vector ei characterizes random variation associated with within-unit sources. This way of

writing this part of the model highlights the fact that individual unit behavior is being charac-

terized by some combination of β, which describes the mean for the population, and bi, which

describes how this particular unit deviates from the population mean.

• Thus, the model may be thought of as subject-specific; as it incorporates the behavior of the

individual unit.

• We will focus on individual behavior shortly; in particular, we will be more formal about the

notion of the unit’s “own mean.”

10.4 Inference on regression and covariance parameters

As in the previous chapter, once we note that the model implies (10.11), the methods of maximum

likelihood and restricted maximum likelihood may be used to estimate the parameters that char-

acterize the “mean” or systematic part of the model, β, and those that characterize the “variation” or

random part of the model, the distinct parameters that make up Ri and D. Thus, the methods and

considerations discussed in the previous two chapters apply exactly as described:

• The generalized least squares estimator for β and its large sample approximate sampling

distribution will have the same form, with X i and Σi as defined in the model.

• Computation of estimated standard errors, Wald and likelihood ratio tests is as before.

• The “subject-specific” versus “population-averaged” interpretations of the model both apply.

• When the data are balanced in the sense that the times of observation are all the same and the

matrices Zi are the same for all units, then when σ2In, the GLS and OLS estimators yield the

same numerical value. As before, however, the estimated approximate covariance matrices of the

estimators will be different; that based on the OLS analysis will be incorrect, because it will

not take proper account of the nature of variation for the data vectors Y i. (Recall that the OLS

estimator just assumes that all the Yij are independent, so that Σi = I for all i.) The estimated

covariance matrix V β for β, which does take variation into account, requires estimates of the

components of Ri and D.

Because we have already discussed these issues in detail in earlier chapters, we do not need to do so

again here. See section 9.3 and chapter 8 for more.

PAGE 375

Page 385: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 10 ST 732, M. DAVIDIAN

10.5 Best linear unbiased prediction

In chapter 9, we mentioned that an objective of analysis is sometimes to characterize individual

behavior. As we mentioned above, the linear mixed effects model (which contains the random coefficient

model as a special case) is a subject-specific model in the sense that an individual’s “regression model”

is characterized as having “mean” X iβ + Zibi.

• Thus, if we want to characterize individual behavior in this model, we’d like to “estimate” both

β and bi. We could then form “estimates” of things like βi where applicable and “estimates” of

the “mean” of a single response at certain times and covariate settings for a particular individual.

• We already know how to estimate β. However, how do we “estimate” bi? We have been putting

the word “estimate” in quotes because, technically, bi is not a fixed constant like β; rather,

it is a random effect – it varies across units. Thus, when we seek to “estimate” bi, we seek

to characterize a random, not a fixed, quantity – the units were randomly chosen from the

population.

• In situations where interest focuses on characterizing a random quantity, it is customary to use

different terminology in order to preserve the notion that we are interested in something that

varies. Thus, “estimation” of a random quantity is often called prediction to emphasize the

fact we are trying to get our hands on something that is not fixed and immutable, but something

whose value arises in a random fashion (through, for example, the fact that units are randomly

selected from the population).

Thus, in order to characterize individual unit behavior, we wish to develop a method for prediction of

the bi.

NOT THE MEAN: In ordinary regression analysis, a prediction problem arises when one wishes

to get a sense of future values of the response that might be observed; that is, it is desired to predict

future Y values that might be observed at certain covariate settings on the basis of the data at hand.

• In this case, the “best guess” for the value of Y at a certain covariate value x0 is the mean of Y

values that might be seen at x0, x′

0β, say.

• As the mean is not known (because β is not known), the approach is to use as the prediction

the estimated mean, x′

0β, where β is the estimate of β.

PAGE 376

Page 386: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 10 ST 732, M. DAVIDIAN

By analogy, one’s first thought for prediction of bi would be to use the mean of the population of bi.

However,

• An assumption of the model is that bi ∼ Nk(0, D), so that E(bi) = 0 for all i.

• Thus, following this logic, we would use 0 as the prediction for bi for any unit. This would lead

to the same “estimate” for individual-specific quantities like βi in a random coefficient model for

all units.

• But the whole point is that individuals are different; thus, this tactic does not seem sensible, as

it gives the same result regardless of individual!

Thus, simply using the mean of the population of random effects bi will not provide a useful result.

Something that preserves the “individuality” of the bi is needed instead.

Another thing to note is that this approach does not at all take advantage of the fact that we have

some additional information available – the data! Under the model, we have Y i = Xiβ + Zibi + ei;

that is, the data Y i and the underlying random effects bi are related. This suggests that there must

be information about bi in Y i that we could exploit. In particular, is there some sensible function of

the data Y i that could be used as a predictor for bi? Of course, this function would also be random,

as it is a function of the random data Y i.

CONDITIONAL EXPECTATION: To make the discussion a little easier, we will assume for the moment

that bi is a scalar; i.e. k = 1. The same reasoning goes through for k > 1. Call this scalar random

effect bi.

For our predictor, we’d like something that is “close to” bi. If we let c(Y i) be the function of the

data we will use as the predictor, then one possibility would be to say we’d like to choose c(Y i) so that

distance between c(Y i) and bi, which we can measure as

{bi − c(Y i)}2,

is “small.” This makes sense – we’d like to use as a predictor something that resembles bi in some sense.

PAGE 377

Page 387: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 10 ST 732, M. DAVIDIAN

As both Y i and bi are random, and hence vary in the population, we’d like the distance to be “small”

considered over all possible values they might take on. Thus, it seems reasonable to consider the

expectation of this distance, averaging it over all possible values; i.e.

E{bi − c(Y i)}2 (10.12)

How “small” is “small?” A natural way to think is that we’d like the function c(Y i) we use to be the

function that makes (10.12) as small as possible; that is, the function c(Y i) we’d like to choose is the

one that minimizes E{bi − c(Y i)}2 across all possible functions we might choose.

The particular function c(Y i) that minimizes this expected distance is called the conditional

expectation of bi given Y i. The usual notation is to write the conditional expectation as

E(bi|Y i). (10.13)

• The conditional expectation is itself a random quantity; it is a function of the random vector

Y i. Thus, do not be confused into thinking it is a fixed quantity because of the notation – the

“E” is being used in a different way.

• This definition may be extended to the case where bi is a vector.

CONDITIONAL EXPECTATION AND MULTIVARIATE NORMALITY: It turns out that when Y i

and bi are both normally distributed, it is possible to find an explicit expression for the conditional

expectation. We first discuss this in detail in a special case: the simplest form of the linear mixed model

given in equation (10.9), where bi is a scalar bi:

Yij = µ + bi + eij

with Y i = (Yi1, . . . , Yini)′, ei = (ei1, . . . , eini

)′, bi ∼ N (0, D), and ei ∼ Nni(0, σ2I). It of course follows

that Yij ∼ N (µ, D + σ2) (verify).

It may be shown that, under this model,

E(bi|Y i) =niD

niD + σ2(Y i − µ), (10.14)

where Y i is the mean of the ni Yij values in Y i.

PAGE 378

Page 388: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 10 ST 732, M. DAVIDIAN

• Note that we might equally well write E(bi|Y i); all the information about bi is summarized in the

individual unit mean Y i. This says that to find the function of the data Y i that is “closest” to bi

in the sense of minimizing (10.12), all we need to know is the sample mean of the data on unit

i; this is sufficient. This make sense – if bi is “large” (positive), then we’d expect this to lead

to a Y i that is “large” (larger than the mean µ), and similarly, if bi is “small” (negative), we’d

expect this to lead to a Y i that is “small” (smaller than the mean µ).

• Note further that (10.14) is a linear function of the elements of Y i (through Y i)

• In addition, note that the expression (10.14) we’d like to use as our predictor depends on µ, D,

and σ2, which are all unknown (but which we can estimate).

• Finally, note that if we were to know µ, D, and σ2, and we take the expectation of the predictor

(that is, averaging the value of the predictor across all possible values of the elements of Y i, Yij),

we get

E{E(bi|Y i) } =niD

niD + σ2E(Y i − µ) = 0

because E(Y i) = µ. That is, the average of the predictor across all possible values of the data is

0, which is exactly equal to the expectation of bi, the thing we are trying to predict! This seems

like a good property; if we were trying to estimate a fixed quantity, we would call this property

unbiasedness.

BEST LINEAR UNBIASED PREDICTOR: All of these observations are reflected in the name that

is often given to the predictor for bi that results from thinking about (10.14). Here is the way the

thinking goes. In practice, to actually calculate the value of the conditional expectation for bi, we would

need to know µ, D, and σ2, but these are unknown. It is thus natural to think of substituting estimates

for them.

• As we have considered before, first think of the “ideal” situation in which we were lucky enough

to know the elements of ω, which in this case is made up of D and σ2. Our model may be written

as

Y i = 1niµ + 1ni

bi + ei,

so that X i = Zi = 1ni, with µ thus playing the role of β and Σi = 1ni

D1′

ni+σ2Ini

= DJni+σ2Ini

(compound symmetry) for all i (because 1ni1′

ni= Jn1

; verify).

PAGE 379

Page 389: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 10 ST 732, M. DAVIDIAN

• If ω is known, then Σi is known, and in this case the maximum likelihood estimator for µ is the

weighted least squares estimator [see equation (8.17)], which in our case (X i = 1ni) is

µ =

(m∑

i=1

1′

niΣ−1

i 1ni

)−1 m∑

i=1

1′

niΣ−1

i Y i,

which may be shown to lead to the result that

µ =

∑mi=1(niD + σ2)−1Y i∑m

i=1(niD + σ2)−1. (10.15)

(Try it – you will need to use the matrix fact that

Σ−1i =

1

σ2

(Ini

− D

σ2 + niDJni

)

in your calculation.) Note that µ is a linear function of the data Yij (through Y i).

• Thus, under these “ideal” conditions, to calculate the predictor for practical use, we would sub-

stitute µ for µ in the conditional expectation to arrive at

niD

niD + σ2(Y i − µ). (10.16)

Note that (10.16) is still a linear function of the data through Y i.

• It may be shown that, if we calculate the variance of (10.16), it is smaller than the variance of

any other linear function of Y i we might use to predict bi. That is, the “estimated” predictor

(10.16) is the least variable among all predictors we might have chosen that are linear functions

of the data. Thus, it is “best” in the sense that it exhibits the least variability, so is most reliable

as a predictor.

• The predictor (10.16) under these “ideal” conditions is also unbiased in the same sense described

above – if we find its expectation, it is still equal to 0 even with µ substituted for µ (try it!).

• As a result, the predictor (10.16) is referred to as the Best Linear Unbiased Predictor for bi.

The popular acronym is BLUP.

PAGE 380

Page 390: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 10 ST 732, M. DAVIDIAN

• Now, of course, in real life, the elements of ω are not known; rather, they are estimated. Thus,

instead of the “ideal” WLS estimator (10.15), we must use the generalized least squares

estimator for µ which has the same form as the WLS estimator but depends on Σi, which is Σi

with the ML or REML estimates D and σ2 plugged in. Moreover, these estimates must be plugged

into the rest of the form of the predictor. Thus, in practice, one uses as the predictor

bi =niD

niD + σ2(Y i − µ), (10.17)

where µ is the GLS estimator

µ =

∑mi=1(niD + σ2)−1Y i∑m

i=1(niD + σ2)−1.

The symbol bi is used to denote this predictor.

• Because we have plugged in these estimates, the properties of unbiasedness and smallest vari-

ance no longer hold exactly. However, it is hoped that they hold at least approximately. Thus,

the predictor (10.17) used in practice is usually also referred to as BLUP, although this is not

precisely true anymore. Another common term is empirical Bayes estimator for bi, which

comes from another interpretation of the BLUP we will not discuss here.

“ESTIMATION” OF INDIVIDUAL “MEAN”: Recall our earlier observation for the general model that,

if we “zero in” on a particular individual, we may think of them as having their own “regression model”

with individual-specific “mean” X iβ + Zibi. In our simple model here, this “mean” is 1niµ + 1ni

bi,

which implies that the “mean” for the jth observation is

µi = µ + bi

for all j = 1, . . . , ni. An important goal of predicting bi is to allow us to characterize the individual-

specific “mean” for each unit.

• We may in fact formalize this. We have been saying that µi = µ + bi is the “mean” for individual

i. Technically, µi is the conditional expectation of Y i, the data for unit i, given bi. That is,

µi is the function of bi that is “closest” to Y i. For the jth observation, this is written

µi = E(Yij |bi).

Heuristically, we may thus think of µi as the “mean” of Yij were we lucky enough to know bi.

PAGE 381

Page 391: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 10 ST 732, M. DAVIDIAN

We’d like to predict not just bi, but µi.

• It turns out that the conditional expectation of µi given the data Y i is simply µi evaluated at

the conditional expectation of bi given Y i; that is, we define

E(µi|Y i) = µ + E(bi|Y i)

• Thus, it follows that the best linear unbiased predictor of µi in the “ideal” case where ω is

known is given by

µ +niD

niD + σ2(Y i − µ). (10.18)

Here, we have replaced µ by the WLS estimate.

• For practical use, we would replace µ by the GLS estimates and D and σ2 by the ML or REML

estimates in (10.18). This predictor of µi is also commonly referred to as the BLUP or empirical

Bayes estimator for µi.

BLUP AS A “WEIGHTED AVERAGE”: Consider again the “ideal” situation where ω is known for

simplicity. It is possible by some simple algebra to write the BLUP for µi (10.18) in the alternative

form (D

D + σ2/ni

)Y i +

(σ2/ni

D + σ2/ni

)µ, (10.19)

where µ is the WLS estimator.

• Inspection of (10.19) reveals that the BLUP has an interesting interpretation as a weighted

average between Y i and µ.

• In particular, note that Y i may be regarded as the “best guess” for µi based on the data for unit

i only. In contrast, µ is the “best guess” for the overall mean of observations averaged across

all units in the population.

• Recall that D measures variation among units, while σ2 measures variation within units. Fur-

thermore, ni describes the amount of information available about a particular unit. Thus, σ2/ni

measures the “quality” of our knowledge about unit i, taking into account both variation due to

within-unit sources and how many measurements we have.

• If D is large, then units vary quite a bit, so that, even if we know a lot about the population of

units, this doesn’t help us too much for knowing about a particular unit. If D is small, then units

are pretty similar, so knowing a lot about the population of units helps us quite a bit for knowing

about a particular unit.

PAGE 382

Page 392: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 10 ST 732, M. DAVIDIAN

• Thus, if D is large relative to σ2/ni, the information we have about unit i from unit i’s data is

more reliable than that from the population. In this case, note from (10.19) that D/(D + σ2/ni)

will be close to 1, while (σ2/ni)/(D + σ2/ni) will be close to 0. Thus, BLUP (µi) ≈ Y i. This

makes sense – the information we have about µi in Y i is better than that we have about the unit

through the (estimated) population mean µ.

• On the other hand, if D is small relative to σ2/ni, the information we have about unit i from the

population is better than that from unit i’s data. If ni were very small, so we have limited data on

i to begin with, this may very well be the case. Here, the situation is reversed – BLUP (µi) ≈ µ.

This also makes sense – the information we have about µi in Y i is not very good, so we rely on

the information about the population more heavily.

These results show that the BLUP for µi is a compromise between information from individual i alone

and information about the whole population (through all m units’ data). This compromise weights

these 2 sources of information in proportion to their quality. When neither term D or σ2/ni dominates,

the BLUP is a combination of both sources. Thus, by using BLUP to characterize individual unit

“means” or other features, it is popular to say that one “borrows strength across units,” supplementing

the information from unit i alone by information about the whole population from which i is assumed

to arise.

IN GENERAL: The implications of the above discussion carry over to the case of the general linear

mixed effects model

Y i = Xiβ + Zibi + ei,

where ω is composed of the distinct elements of D and Ri. Specifically:

• It may be shown that the conditional expectation of bi given the data Y i is

E(bi|Y i) = DZ ′

iΣ−1i (Y i − X iβ).

• In the “ideal” case where ω is known and β is the WLS estimator,

DZ ′

iΣ−1i (Y i − Xiβ). (10.20)

is the best linear unbiased predictor (BLUP) for bi.

PAGE 383

Page 393: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 10 ST 732, M. DAVIDIAN

• In the realistic case where ω is not known, one forms the “approximate” BLUP for bi as

bi = DZ ′

iΣ−1i (Y i − Xiβ), (10.21)

where Σi is as usual Σi with the estimator for ω substituted. This predictor is also often referred

to as the BLUP for bi or the empirical Bayes estimator for bi.

• The “mean” for individual i is the conditional expectation E(Y i|bi) = X iβ + Zibi. The BLUP

for X iβ + Zibi is found by substituting (10.20) into this expression; i.e.

Xiβ + ZiDZ ′

iΣ−1i (Y i − Xiβ), (10.22)

where β is the WLS estimator.

• As in the simple model, the predictor (10.22) has the interpretation that it may be rewritten in

the form of a weighted average combining information from individual i only and information

from the population. Thus, the same implications given above apply in the general model – the

BLUP for X iβ + Zibi may be viewed as “borrowing strength” across individuals to get the best

prediction for individual i.

• In practice, the “approximate” BLUP for X iβ + Zibi is found by substituting bi; i.e.

Xiβ + Zibi = X iβ + ZiDZ ′

iΣ−1i (Y i − X iβ) = σ2Ini

Σ−1i Xiβ + ZiDZ ′

iΣ−1i Y i, (10.23)

where now β is the GLS estimator. This predictor is also referred to as the BLUP or empirical

Bayes estimator of the individual-specific “mean” X iβ + Zibi.

IN PRACTICE: If one is interested in characterizing individual trajectories, it is standard to use the

BLUPs for this purpose.

• One specific case is that of a random coefficient model where

Y i = Ciβi + ei, βi = Aiβ + bi.

For example, if the stage one model is a straight line, so that βi = (β0i, β1i)′ are the unit-specific

intercepts and slopes, then it is often of interest to characterize β0i and β1i.

• This may be done by finding the BLUP bi with X i = CiAi and Zi = Ci and then obtaining

βi = Aiβ + bi,

where β is the GLS estimator. The elements of βi are thus “estimates” of unit i’s specific intercept

and slope.

PAGE 384

Page 394: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 10 ST 732, M. DAVIDIAN

• These “estimates” are often preferred over just carrying out individual regression fits to each

unit’s data separately, because they “borrow strength” across individuals by taking advantage of

the belief that the linear mixed effects model holds.

10.6 Testing whether a component is random

We have noted that one manifestation of the linear mixed effects model is to think of the usual random

coefficient model in which every unit has its own intercept, slope, etc., but then to consider the possibility

that the slopes, for example, do not vary across units. That is, we would think of slopes as being fixed

rather than random.

For definiteness, consider a situation with one group. Suppose that we consider a straight line model

for each subject. The “full” random coefficient model with random intercept and slope is

Yij = β0i + β1itij + eij , β0i = β0 + b0i, β1i = β1 + b1i

bi = var

b0i

b1i

, var(bi) = D =

D11 D12

D12 D22

.

If slopes do not vary across units, then we have the “reduced” model with slopes not random given by

Yij = β0i + β1i + eij , β0i = β0 + b0i, β1i = β1

bi = b0i, var(bi) = D11.

For definiteness, assume in each model that var(ei) = Ri = σ2Ini.

These two models lead to the same specification for the mean of a data vector, E(Y i) = X iβ, with

E(Yij) = β0 + β1tij . However, they involve different overall covariance models Σi = ZiDZ ′

i + σ2Ini.

In particular, the “full” model, Σi has the usual form with

Zi =

1 ti1...

...

1 tini

,

which we do not multiply out here.

PAGE 385

Page 395: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 10 ST 732, M. DAVIDIAN

In contrast, under the “reduced” model, D = D11 and Zi = 1niso that ZiDZ ′

i = D11Jni, so that

Σi =

D11 + σ2 D11 · · · D11

D11 D11 + σ2 · · · D11

......

. . ....

D11 · · · D11 D11 + σ2

,

which is a simple compound symmetric assumption.

Thus, to address the issue of which model is more suitable, one might use techniques such as information

criteria to informally choose between these models.

Alternatively, noting that we have nested models, it is natural to consider conducting a formal hy-

pothesis test using the likelihood ratio test. However, there is a difficulty with this that makes the

usual approach of comparing the likelihood ratio test statistic to the χ2 distribution inappropriate, a

fact that is not often not appreciated by practitioners. The reasons are rather technical; here, we give

an intuitive description of what the issue is.

• Here, var(bi) is a (2 × 2) matrix for the “full” model, involving two variances and a covariance.

var(bi) is a scalar variance for the “reduced” model. Thus, although the models are indeed nested,

going from the “full” to “reduced” model requires that the variance D22 = 0. Moreover, there is

no longer the need to worry about the covariance D12 between intercepts and slopes, because all

slopes are the same.

• Thus, the difference in models is rather complicated, so that the null hypothesis corresponding

to the “reduced” model is complicated. So it is clear that his problem seems “non-standard”

relative to the other uses of the likelihood ratio test we have seen.

• A major source of the difficulty is that this null hypothesis involves asking whether D22 in the full

model is equal to 0. D22 is a variance, so it cannot take on any value; specifically, a variance

must be ≥ 0 by definition! Indeed, the value “0” is on the “edge,” or boundary, of possible

values for D22.

Asking whether D22 = 0 corresponds to whether D22 takes its value on the boundary of the

parameter space (i.e., the set of possible values) for D22. Contrast this to other situations

where we have considered nested models; e.g. if the issue is whether the kth component of β is

equal to 0, say, as βk values can be anything, the parameter space is unrestricted and thus

βk = 0 is not on a “boundary.”

PAGE 386

Page 396: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 10 ST 732, M. DAVIDIAN

The theory that underlies the use of the likelihood ratio test breaks down when the null hypoth-

esis involves a boundary in this way. That is, as m → ∞, the likelihood ratio test does not

have a χ2 distribution anymore!

Thus, if one computes the likelihood ratio statistic and compares to the critical value from the χ22

sampling distribution (D22 = 0 and “D12 = 0”), it turns out that the test will tend to not reject

the null as often as it should, leading the analyst to end up using models that are too simple.

• It is possible to show that, instead, the correct sampling distribution is something called a mixture

of a χ21 distribution and a χ2

2 distribution. A random variable with this distribution takes its value

like a χ21 random variable 50% of the time and like a χ2

2 distribution 50% of the time.

A table of critical values for such χ2 mixtures is given, for instance, in Appendix C of Fitzmaurice,

Laird, and Ware (2004). For a test at level α = 0.05, χ22,0.95 = 5.99 while the corresponding critical

value for the mixture is 5.14. This shows that comparing to the χ22 sampling distribution will not

reject the null hypothesis as often as it should.

• It is important to realize that SAS PROC MIXED does not have an automatic way to carry out such

tests! So the analyst cannot simply expect the software to “know” that this is an issue.

This same issue arises more generally. For example, if we are entertaining a quadratic model

Yij = β0i + β1itij + β2it2ij + eij , βi = β + bi (3 × 3)

with bi = (b0i, b1i, b2i)′, and wonder whether we can do away with the quadratic term altogether,

the same problem occurs. Here, the relevant mixture can be very complicated. In such complicated

situations, Fitzmaurice, Laird and Ware (2004) recommend as an approximate ad hoc way to conduct

the test at level α = 0.05 to calculate the likelihood ratio test statistic and compare it to the usual χ2

critical value one would use if one did not know this was a problem but for α = 0.1 instead.

For more on this topic, see Verbeke and Molenberghs (2000, section 6.3.4) and Fitzmaurice, Laird, and

Ware (2004, sections 7.5 and 8.5).

10.7 Time-dependent covariates

In our development so far, we have restricted attention to covariates that do not change over time;

for example, treatment group, gender, age, CD4 count at baseline, and so on. Our interest has been

focused on features like whether the way things change over time is different for different groups or is

associated with baseline age, CD4, etc.

PAGE 387

Page 397: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 10 ST 732, M. DAVIDIAN

In some settings, information may be collected that changes over time, and questions of interest may

focus on the relationship between the response and this information. As we now discuss, this can lead

to some important conceptual issues.

To fix ideas, consider a longitudinal study to investigate the relationship between a measure of respira-

tory health and smoking behavior. Suppose that at time tij following subject i’s entry into the study,

Yij , a measure of respiratory health status, is recorded along with Zij , a measure of i’s current smoking

behavior. Note that of necessity such a study must be observational; it would be unethical to assign

subjects to different patterns of smoking!

• Note that we use upper-case Zij to refer to smoking at time tij . This is to emphasize the fact

that smoking behavior is a characteristic that may vary within and among subjects both at any

time and over time in a way that we may only observe. That is, Zij should be viewed as a

random variable. In this situation, Zij is something that we may not view as “under control”

over time, in contrast to things like treatment group and gender.

• Contrast this with a study in which the goal is to investigate the relationship between respiratory

health status and exercise. Suppose that each subject is assigned to follow a pre-determined

exercise plan such that, at time tij , subject i engages in exercise intensity zij . Here, although

exercise intensity changes over time, its values are fixed in advance in this study in a way that

has nothing to do with how the subjects’ respiratory health status turns out. Thus, we use lower-

case zij to emphasize that the exercise intensities are not something we can only observe, but are

under control of the investigators.

• Returning to the first study, it is clear that there may be complicated interrelationships between

respiratory status and smoking behavior. For example, a subject may decide at some time point to

modify his future smoking behavior as a result of his respiratory status; e.g. a subject experiencing

poor respiratory health at time j may decide to cut back on smoking at time j + 1. In contrast,

a subject whose respiratory health is not compromised may continue to smoke in the same way.

Here, current smoking behavior and respiratory status impacts future smoking behavior, and, of

course, smoking behavior impacts future respiratory health.

This suggests that even stating the question of interest can be difficult. What do we mean by “the

relationship between smoking behavior and respiratory health?” Precise description of what is meant

by this is often side-stepped by investigators. Instead, they may plow ahead and write down a statistical

model. As we now discuss, this can lead to difficult or erroneous interpretations!

PAGE 388

Page 398: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 10 ST 732, M. DAVIDIAN

• In particular, a common approach is to specify a model relating Yij and Zij . For example, one

might adopt a population-averaged model; assuming a straight-line relationship,

Yij = β0 + β1Zij + εij ,

with some assumptions on the εij . Alternatively, a random coefficient model

Yij = β0i + β1iZij + eij

might be specified, with second stage model

β0i = β1 + b0i, β1i = β2 + b1i.

It should be clear that this second model can be written in the form Y i = Xiβ + Zibi + ei.

• The type of model is not the issue; both models imply that the mean of Yij is of the form

β0 + β1Zij . In fact, we must be careful how we interpret this. Because the Zij are random

variables that change with Yij , we can really only talk about this mean in the context of the Zij .

As we have discussed, Yij may be related to past, present, and future smoking behaviors; however,

this model seems to specify that respiratory health at time j is related only to smoking behavior

at time j.

• To be fancier about this, as discussed in Section 10.5, what we are really writing is a model that

describes the conditional expectation of Yij given knowledge of Zi1, . . . , Zini. In the models

above, we are implicitly assuming that only Zij is associated with Yij in that knowing Zik, k 6= j,

does not give us any more information about respiratory status at time tij . In symbols,

E(Yij |Zi1, . . . , Zini) = E(Yij |Zij). (10.24)

If (10.24) does not hold, then it should be clear that we could end up drawing conclusions about

the relationship that may be misleading.

In fact, yet another issue arises. In many controlled studies, where units may be randomized to

different treatments, the goal is to claim that the use of a certain treatment relative to another causes

a more favorable mean response or more favorable rate of change of mean response over time.

PAGE 389

Page 399: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 10 ST 732, M. DAVIDIAN

• It is widely accepted that such causal interpretation is possible under these circumstances,

because the assignment of the treatment was in no way related to how the response might turn

out (assigned at random). Here, the association between treatment and response may be given

a causal interpretation.

• On the other hand, suppose we measure smoking behavior and respiratory status at just a single

time point. Here, if there is an association between treatment and response, we cannot claim

that the smoking caused the respiratory status; there may be other factors, e.g. heredity, past

smoking behavior, environmental factors, etc., that are related both to how a person might be

smoking when we see him and how his respiratory health might turn out. These are referred to

as confounding factors.

• To take this into account, it is common to consider a statistical model that includes confounding

factors. If all such relevant factors are available, it may be possible to “adjust” for them in a

regression model so that causal interpretations can be made.

However, in the longitudinal context, the problems are compounded. The study may be carried out

the study because the investigators would like to claim that, say, higher levels of smoking cause poorer

respiratory health over time somehow.

• Even if we write out a model that accurately describes the relationship or association between

Yij and Zi1, . . . , Zini, or even if (10.24) is true, we still cannot draw such a conclusion in general.

All the model does is describe the association, but that smoking actually causes health status

does not necessarily follow because of potential confounding.

• We would therefore need to adjust for confounding factors. However, the complicated interrela-

tionships between the Yij and Zij over time make this extremely difficult if not impossible! We

do not pursue this issue further, as it is quite complex, but it should be clear that simply testing

hypotheses about components of β in a simple model like those above will not address causal

questions in general.

This discussion is meant to convince the reader that models for longitudinal data that involve time-

dependent variables as covariates can be very difficult to specify and interpret. The analyst should be

aware of this and approach such situations with caution.

Some references related to this discussion are Pepe and Anderson (1994), Fitzmaurice, Laird, and Ware

(2004, Section 15.3), and Robins, Greenland, and Hu (1999).

PAGE 390

Page 400: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 10 ST 732, M. DAVIDIAN

10.8 Discussion

The general linear mixed effects model, with its broad possibilities for modeling longitudinal data, has

become immensely popular as a framework for the analysis of these data. Although the basic model

has been considered in the statistical literature since the 1970s, it was not until a paper by Laird and

Ware (1982) appeared in Biometrics describing the model that it commanded widespread attention; this

article explained the model with more of an eye toward practical application than technical detail. As a

result, although the authors did not “invent” the model, it is sometimes referred to as the “Laird-Ware”

model in the statistical and subject matter literature.

MAIN FEATURES:

• The model allows the analyst to incorporate additional covariate information, allows the possibility

that some effects do not vary in the population, and includes as special cases many simpler, popular

models, such as the random coefficient model.

• The model explicitly acknowledges both among- and within-unit variation separately, allowing

the analyst to think about and characterize each source separately.

• Because the model is subject-specific in this sense, it allows the analyst to characterize individual

behavior through the use of best linear unbiased prediction.

10.9 Implementation with SAS

We consider two examples:

1. The dental study data – here, we use these data to illustrate how to fit a model with slopes fixed

rather than random and show how to obtain the BLUPs of the bi and βi.

2. Data from a strength-training study. We use these data to show how to fit and interpret general

linear mixed effects models with additional covariates.

PAGE 391

Page 401: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 10 ST 732, M. DAVIDIAN

EXAMPLE 1 – DENTAL STUDY DATA:

• We fit two versions of the random coefficient model assuming a straight line relationship for each

child:

(i) The model with both intercepts and slopes random; i.e.

Yij = β0i + β1itij + eij ,

βi = β + bi, β =

β0,G

β1,G

girls, β =

β0,B

β1,B

boys.

This is the same model fitted in section 9.7. Here, also assume that var(bi) = D for both

genders and that

Ri = σ2GI girls, Ri = σ2

BI boys.

(ii) The model with intercepts random but slopes considered as fixed in the populations of boys

and girls; i.e.

Yij = β0i + β1itij + eij ,

βi = β +

b0i

0

, β =

β0,G

β1,G

girls, β =

β0,B

β1,B

boys.

We also assume as in (i) that var(bi) = D for both genders and that

Ri = σ2GI girls, Ri = σ2

BI boys.

• Thus, model (i) is the usual random coefficient model with random intercepts and slopes, while

(ii) is the modification with slopes all taken to be the same for all boys and for all girls. Note that

we may also write these models using the representation

βi = Aiβ + Bibi, β = (β0,G, β1,G, β0,B, β1,B)′,

where

(i) For model (i), Ai is the usual matrix of 0’s and 1’s that “picks off” the correct elements of

β depending on whether i is a boy or girl, Bi = I2, and bi = (b0i, b1i)′.

(ii) For model (ii), Ai is the usual matrix of 0’s and 1’s that “picks off” the correct elements of

β depending on whether i is a boy or girl, but now Bi = 12, and bi = b0i.

Of course, each model may be written in the general form

Y i = X iβ + Zibi + ei.

PAGE 392

Page 402: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 10 ST 732, M. DAVIDIAN

• For each model, we show how to get PROC MIXED to produce and print out various “subject-

specific” quantities. In particular, we show how to use the outpred option of the model statement

to obtain the BLUPs at each time of observation for each child; i.e. the values of X iβ +Zibi. We

also show how to obtain the values of the BLUPS of the bi, bi, by using the solution option of

the random statement. Finally, we exhibit how to obtain output data sets containing the estimates

of β and BLUPs of bi and how to manipulate these to obtain the BLUPs of the intercepts and

slopes, βi, for each individual.

PAGE 393

Page 403: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 10 ST 732, M. DAVIDIAN

PROGRAM:

/*******************************************************************

CHAPTER 10, EXAMPLE 1

Illustration of

- fitting both a full random coefficient model asin Chapter 9 and a and modified random coefficient modelwith intercepts random and slopes fixed for the dental datausing PROC MIXED.

- obtaining BLUPs of random effects and random intercepts(and slopes where applicable) for both models.

The model for each child is assumed to be a straight line.The intercepts and slopes may have different means depending ongender. However, for the modified model, slopes are takento be the SAME for all children within each gender. This assumptionis probably not true, but is made for illustrative purposes toshow how such a model may be specified in PROC MIXED.

For both models, we take D to be common to both genders and takeRi = sigma^2_G I for girls and Ri = sigma^2_B for boys using theREPEATED statement.

We use the RANDOM statement to specify how random effects enter themodel AND to ask for the BLUPs of the bi to be printed in each case.We also use an option in the MODEL statement to ask for theBLUPs of the individual means at each time point for each child.

*******************************************************************/

options ls=80 ps=59 nodate; run;

/******************************************************************

Read in the data set (See Example 1 of Chapter 4)

*******************************************************************/

data dent1; infile ’dental.dat’;input obsno child age distance gender;

run;

/*******************************************************************

Use PROC MIXED to fit the two linear mixed effects models.For all of the fits, we use usual normal ML rather than REML(the default). We call PROC MIXED twice to fit each model, forreasons described below.

In all cases, we use the usual parameterization for the meanmodel.

Here, we use the syntax for versions 7 and higher of SAS foroutputting calculations to data sets from PROC MIXED.

In the first call to PROC MIXED:

We use the OUTPRED=dataset option in the MODEL statement. Thisrequests that the (approximate) Best Linear Unbiased Predictorsfor the individual means at each time point in the data set foreach child be put in dataset (along with the original data for comparison).These may be printed with a print statement, as shown.

The SOLUTION option in the RANDOM statement requests that the(approximate) Best Linear Unbiased Predictors for the random effectsbi be printed for each child.

In the second call to PROC MIXED, we use the ODS statement toproduce data sets containing the fixed effects estimates andthe BLUPs for the random effects. We use the Output Delivery Systemin SAS, or ODS. The first ODS call with "listing exclude" suppressesprinting of the fixed and random effects.

To fit the full random coefficient model, we must specify that bothintercept and slope are random in the RANDOM statement. To fitthe modified model where slopes are taken to be constant across allchildren within a gender, we specify only that intercept is randomin the RANDOM statement.

*******************************************************************/

* MODEL (i) -- full random coefficient model;* Call to PROC MIXED to get the printed results;

title ’FULL RANDOM COEFFICIENT MODEL WITH BOTH’;

PAGE 394

Page 404: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 10 ST 732, M. DAVIDIAN

title2 ’INTERCEPTS AND SLOPES RANDOM FOR EACH GENDER’;proc mixed method=ml data=dent1;class gender child;model distance = gender gender*age / noint solution outpred=pdata;random intercept age / type=un subject=child solution;repeated / group=gender subject=child;

run;

proc print data=pdata;run;

/*******************************************************************

The output data sets FIXED1 and RANDOM1 we ask PROC MIXEDto create in the ODS statements contain the estimated fixedeffects (betahats) and random effects (the BLUPs of bis),respectively. We now combine these into a single data setin order to compute the BLUPs of the individual betais.This is accomplished by manipulating the output data sets andthen merging them.

*******************************************************************/

* Call to PROC MIXED to produce the output data sets;

proc mixed method=ml data=dent1;class gender child;model distance = gender gender*age / noint solution;random intercept age / type=un subject=child solution ;repeated / group=gender subject=child;ods listing exclude SolutionF;ods output SolutionF=fixed1;ods listing exclude SolutionR;ods output SolutionR=rand1;

run;

data fixed1; set fixed1;keep gender effect estimate;

run;

title3 ’FIXED EFFECTS OUTPUT DATA SET’;proc print data=fixed1; run;

proc sort data=fixed1; by gender; run;

data fixed12; set fixed1; by gender;retain fixint fixslope;if effect=’gender’ then fixint=estimate;if effect=’age*gender’ then fixslope=estimate;if last.gender then do;

output; fixint=.; fixslope=.;end;drop effect estimate;

run;

title3 ’RECONFIGURED FIXED EFFECTS DATA SET’;proc print data=fixed12; run;

data rand1; set rand1;gender=1; if child<12 then gender=0;keep child gender effect estimate;

run;

title3 ’RANDOM EFFECTS OUTPUT DATA SET’;proc print data=rand1; run;

proc sort data=rand1; by child; run;

data rand12; set rand1; by child;retain ranint ranslope;if effect=’Intercept’ then ranint=estimate;if effect=’age’ then ranslope=estimate;if last.child then do;

output; ranint=.; ranslope=.;end;drop effect estimate;

run;

proc sort data=rand12; by gender child; run;title3 ’RECONFIGURED RANDOM EFFECTS DATA SET’;proc print data=rand12; run;

data both1; merge fixed12 rand12; by gender;beta0i=fixint+ranint;beta1i=fixslope+ranslope;

run;

title3 ’RANDOM INTERCEPTS AND SLOPES’;proc print data=both1; run;

PAGE 395

Page 405: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 10 ST 732, M. DAVIDIAN

* MODEL (ii) -- common slope within each gender;* Call to PROC MIXED to get the printed results;* To save space, we do not print the predicted values;

title ’MODIFIED RANDOM COEFFICIENT MODEL WITH’;title2 ’INTERCEPTS RANDOM, SLOPES FIXED’;proc mixed method=ml data=dent1;class gender child;model distance = gender gender*age / noint solution ;random intercept / type=un subject=child solution;repeated / group=gender subject=child;

run;

* Call to PROC MIXED to get the output data sets;

proc mixed method=ml data=dent1;class gender child;model distance = gender gender*age / noint solution;random intercept / type=un subject=child solution;repeated / group=gender subject=child;ods listing exclude SolutionF;ods output SolutionF=fixed2;ods listing exclude SolutionR;ods output SolutionR=rand2;

run;

data fixed2; set fixed2;keep gender effect estimate;

run;

title3 ’FIXED EFFECTS OUTPUT DATA SET’;proc print data=fixed2; run;

proc sort data=fixed2; by gender; run;

data fixed22; set fixed2; by gender;retain fixint fixslope;if effect=’gender’ then fixint=estimate;if effect=’age*gender’ then fixslope=estimate;if last.gender then do;

output; fixint=.; fixslope=.;end;drop effect estimate;

run;

title3 ’RECONFIGURED FIXED EFFECTS DATA SET’;proc print data=fixed22; run;

data rand2; set rand2;gender=1; if child<12 then gender=0;keep child gender effect estimate;

run;

title3 ’RANDOM EFFECTS OUTPUT DATA SET’;proc print data=rand2; run;

proc sort data=rand2; by child; run;

data rand22; set rand2; by child;retain ranint ranslope;if effect=’Intercept’ then ranint=estimate;if last.child then do;

output; ranint=.;end;drop effect estimate;

run;

proc sort data=rand22; by gender child; run;title3 ’RECONFIGURED RANDOM EFFECTS DATA SET’;proc print data=rand22; run;

data both2; merge fixed22 rand22; by gender;beta0i=fixint+ranint;beta1i=fixslope;

run;

title3 ’RANDOM INTERCEPTS AND FIXED SLOPES’;proc print data=both2; run;

PAGE 396

Page 406: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 10 ST 732, M. DAVIDIAN

OUTPUT: Following the output, we comment on a few aspects of the output.

FULL RANDOM COEFFICIENT MODEL WITH BOTH 1INTERCEPTS AND SLOPES RANDOM FOR EACH GENDER

The Mixed Procedure

Model Information

Data Set WORK.DENT1Dependent Variable distanceCovariance Structures Unstructured, Variance

ComponentsSubject Effects child, childGroup Effect genderEstimation Method MLResidual Variance Method NoneFixed Effects SE Method Model-BasedDegrees of Freedom Method Containment

Class Level Information

Class Levels Values

gender 2 0 1child 27 1 2 3 4 5 6 7 8 9 10 11 12 13

14 15 16 17 18 19 20 21 22 2324 25 26 27

Dimensions

Covariance Parameters 5Columns in X 4Columns in Z Per Subject 2Subjects 27Max Obs Per Subject 4Observations Used 108Observations Not Used 0Total Observations 108

Iteration History

Iteration Evaluations -2 Log Like Criterion

0 1 478.241759861 2 418.92503842 1.166324992 1 416.18869903 1.233262093 1 407.89638533 0.019542684 2 406.88264563 0.006458005 1 406.10632159 0.000568666 1 406.04318997 0.000007647 1 406.04238894 0.00000000

Convergence criteria met.

FULL RANDOM COEFFICIENT MODEL WITH BOTH 2INTERCEPTS AND SLOPES RANDOM FOR EACH GENDER

The Mixed Procedure

Covariance Parameter Estimates

Cov Parm Subject Group Estimate

UN(1,1) child 3.1978UN(2,1) child -0.1103UN(2,2) child 0.01976Residual child gender 0 0.4449Residual child gender 1 2.6294

Fit Statistics

-2 Log Likelihood 406.0AIC (smaller is better) 424.0AICC (smaller is better) 425.9BIC (smaller is better) 435.7

Null Model Likelihood Ratio Test

DF Chi-Square Pr > ChiSq

4 72.20 <.0001

PAGE 397

Page 407: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 10 ST 732, M. DAVIDIAN

Solution for Fixed Effects

StandardEffect gender Estimate Error DF t Value Pr > |t|

gender 0 17.3727 0.7386 54 23.52 <.0001gender 1 16.3406 1.1114 54 14.70 <.0001age*gender 0 0.4795 0.06180 54 7.76 <.0001age*gender 1 0.7844 0.09722 54 8.07 <.0001

Solution for Random Effects

Std ErrEffect child Estimate Pred DF t Value Pr > |t|

Intercept 1 -0.4853 1.1744 54 -0.41 0.6811age 1 -0.06820 0.1017 54 -0.67 0.5052Intercept 2 -1.1922 1.1744 54 -1.02 0.3146age 2 0.1420 0.1017 54 1.40 0.1683Intercept 3 -0.8535 1.1744 54 -0.73 0.4705age 3 0.1773 0.1017 54 1.74 0.0869Intercept 4 1.7024 1.1744 54 1.45 0.1530age 4 0.04017 0.1017 54 0.40 0.6943Intercept 5 0.9136 1.1744 54 0.78 0.4400age 5 -0.08680 0.1017 54 -0.85 0.3970Intercept 6 -0.6740 1.1744 54 -0.57 0.5684age 6 -0.07292 0.1017 54 -0.72 0.4763

FULL RANDOM COEFFICIENT MODEL WITH BOTH 3INTERCEPTS AND SLOPES RANDOM FOR EACH GENDER

The Mixed Procedure

Solution for Random Effects

Std ErrEffect child Estimate Pred DF t Value Pr > |t|

Intercept 7 -0.05461 1.1744 54 -0.05 0.9631age 7 0.03641 0.1017 54 0.36 0.7217Intercept 8 1.9350 1.1744 54 1.65 0.1052age 8 -0.1149 0.1017 54 -1.13 0.2636Intercept 9 -0.2190 1.1744 54 -0.19 0.8528age 9 -0.1151 0.1017 54 -1.13 0.2624Intercept 10 -2.9974 1.1744 54 -2.55 0.0136age 10 -0.09085 0.1017 54 -0.89 0.3755Intercept 11 1.9249 1.1744 54 1.64 0.1070age 11 0.1530 0.1017 54 1.50 0.1382Intercept 12 1.3469 1.4342 54 0.94 0.3519age 12 0.08788 0.1232 54 0.71 0.4786Intercept 13 -0.8676 1.4342 54 -0.60 0.5478age 13 -0.04068 0.1232 54 -0.33 0.7424Intercept 14 -0.3575 1.4342 54 -0.25 0.8041age 14 -0.02176 0.1232 54 -0.18 0.8605Intercept 15 1.5946 1.4342 54 1.11 0.2711age 15 -0.02772 0.1232 54 -0.23 0.8228Intercept 16 -1.1581 1.4342 54 -0.81 0.4229age 16 -0.04153 0.1232 54 -0.34 0.7373Intercept 17 0.8972 1.4342 54 0.63 0.5342age 17 0.02260 0.1232 54 0.18 0.8551Intercept 18 -0.6889 1.4342 54 -0.48 0.6329age 18 -0.02853 0.1232 54 -0.23 0.8177Intercept 19 -0.1443 1.4342 54 -0.10 0.9202age 19 -0.07348 0.1232 54 -0.60 0.5533Intercept 20 -0.1273 1.4342 54 -0.09 0.9296age 20 0.02544 0.1232 54 0.21 0.8372Intercept 21 2.5349 1.4342 54 1.77 0.0828age 21 0.1088 0.1232 54 0.88 0.3811Intercept 22 -0.2261 1.4342 54 -0.16 0.8753age 22 -0.08535 0.1232 54 -0.69 0.4913Intercept 23 -0.6374 1.4342 54 -0.44 0.6585age 23 0.006510 0.1232 54 0.05 0.9580Intercept 24 -1.7008 1.4342 54 -1.19 0.2409age 24 0.1139 0.1232 54 0.92 0.3591Intercept 25 0.2387 1.4342 54 0.17 0.8684age 25 -0.03166 0.1232 54 -0.26 0.7981Intercept 26 0.1180 1.4342 54 0.08 0.9347age 26 0.06104 0.1232 54 0.50 0.6222Intercept 27 -0.8223 1.4342 54 -0.57 0.5688age 27 -0.07545 0.1232 54 -0.61 0.5427

FULL RANDOM COEFFICIENT MODEL WITH BOTH 4INTERCEPTS AND SLOPES RANDOM FOR EACH GENDER

The Mixed Procedure

Type 3 Tests of Fixed Effects

PAGE 398

Page 408: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 10 ST 732, M. DAVIDIAN

Num DenEffect DF DF F Value Pr > F

gender 2 54 384.72 <.0001age*gender 2 54 62.66 <.0001

FULL RANDOM COEFFICIENT MODEL WITH BOTH 5INTERCEPTS AND SLOPES RANDOM FOR EACH GENDER

St

d di Es g r

o c t e r A L U Rb h a n P P l o p e

O s i a n d r r p w p sb n l g c e e e D h e e is o d e e r d d F a r r d

1 1 1 8 21.0 0 20.1783 0.43711 54 0.05 19.3019 21.0546 0.821752 2 1 10 20.0 0 21.0009 0.33796 54 0.05 20.3234 21.6785 -1.000953 3 1 12 21.5 0 21.8236 0.34908 54 0.05 21.1238 22.5235 -0.323654 4 1 14 23.0 0 22.6463 0.46259 54 0.05 21.7189 23.5738 0.353665 5 2 8 21.0 0 21.1527 0.43711 54 0.05 20.2763 22.0290 -0.152666 6 2 10 21.5 0 22.3957 0.33796 54 0.05 21.7181 23.0733 -0.895707 7 2 12 24.0 0 23.6387 0.34908 54 0.05 22.9389 24.3386 0.361268 8 2 14 25.5 0 24.8818 0.46259 54 0.05 23.9543 25.8092 0.618229 9 3 8 20.5 0 21.7737 0.43711 54 0.05 20.8974 22.6501 -1.2737210 10 3 10 24.0 0 23.0873 0.33796 54 0.05 22.4098 23.7649 0.9126611 11 3 12 24.5 0 24.4010 0.34908 54 0.05 23.7011 25.1008 0.0990512 12 3 14 26.0 0 25.7146 0.46259 54 0.05 24.7871 26.6420 0.2854313 13 4 8 23.5 0 23.2329 0.43711 54 0.05 22.3565 24.1092 0.2671314 14 4 10 24.5 0 24.2723 0.33796 54 0.05 23.5947 24.9499 0.2277015 15 4 12 25.0 0 25.3117 0.34908 54 0.05 24.6119 26.0116 -0.3117316 16 4 14 26.5 0 26.3512 0.46259 54 0.05 25.4237 27.2786 0.1488417 17 5 8 21.5 0 21.4283 0.43711 54 0.05 20.5519 22.3046 0.0717118 18 5 10 23.0 0 22.2138 0.33796 54 0.05 21.5362 22.8913 0.7862319 19 5 12 22.5 0 22.9993 0.34908 54 0.05 22.2994 23.6991 -0.4992620 20 5 14 23.5 0 23.7847 0.46259 54 0.05 22.8573 24.7122 -0.2847421 21 6 8 20.0 0 19.9517 0.43711 54 0.05 19.0753 20.8280 0.0483122 22 6 10 21.0 0 20.7649 0.33796 54 0.05 20.0874 21.4425 0.2350623 23 6 12 21.0 0 21.5782 0.34908 54 0.05 20.8783 22.2781 -0.5781924 24 6 14 22.5 0 22.3914 0.46259 54 0.05 21.4640 23.3189 0.1085625 25 7 8 21.5 0 21.4457 0.43711 54 0.05 20.5694 22.3221 0.0542626 26 7 10 22.5 0 22.4776 0.33796 54 0.05 21.8001 23.1552 0.0223527 27 7 12 23.0 0 23.5096 0.34908 54 0.05 22.8097 24.2094 -0.5095528 28 7 14 25.0 0 24.5415 0.46259 54 0.05 23.6140 25.4689 0.4585429 29 8 8 23.0 0 22.2252 0.43711 54 0.05 21.3489 23.1016 0.7747930 30 8 10 23.0 0 22.9546 0.33796 54 0.05 22.2770 23.6321 0.0454231 31 8 12 23.5 0 23.6840 0.34908 54 0.05 22.9841 24.3838 -0.1839632 32 8 14 24.0 0 24.4133 0.46259 54 0.05 23.4859 25.3408 -0.4133333 33 9 8 20.0 0 20.0689 0.43711 54 0.05 19.1926 20.9453 -0.0689234 34 9 10 21.0 0 20.7977 0.33796 54 0.05 20.1202 21.4753 0.2022835 35 9 12 22.0 0 21.5265 0.34908 54 0.05 20.8266 22.2264 0.4734936 36 9 14 21.5 0 22.2553 0.46259 54 0.05 21.3279 23.1827 -0.7553137 37 10 8 16.5 0 17.4849 0.43711 54 0.05 16.6085 18.3612 -0.9848838 38 10 10 19.0 0 18.2623 0.33796 54 0.05 17.5847 18.9398 0.7377439 39 10 12 19.0 0 19.0396 0.34908 54 0.05 18.3398 19.7395 -0.0396440 40 10 14 19.5 0 19.8170 0.46259 54 0.05 18.8896 20.7445 -0.3170241 41 11 8 24.5 0 24.3578 0.43711 54 0.05 23.4814 25.2341 0.1422342 42 11 10 25.0 0 25.6228 0.33796 54 0.05 24.9452 26.3004 -0.6228043 43 11 12 28.0 0 26.8878 0.34908 54 0.05 26.1880 27.5877 1.1121844 44 11 14 28.0 0 28.1529 0.46259 54 0.05 27.2254 29.0803 -0.1528545 45 12 8 26.0 1 24.6655 0.81030 54 0.05 23.0410 26.2901 1.33449

FULL RANDOM COEFFICIENT MODEL WITH BOTH 6INTERCEPTS AND SLOPES RANDOM FOR EACH GENDER

St

d di Es g r

o c t e r A L U Rb h a n P P l o p e

O s i a n d r r p w p sb n l g c e e e D h e e is o d e e r d d F a r r d

46 46 12 10 25.0 1 26.4100 0.73529 54 0.05 24.9358 27.8842 -1.4100147 47 12 12 29.0 1 28.1545 0.77585 54 0.05 26.5990 29.7100 0.8454948 48 12 14 31.0 1 29.8990 0.91676 54 0.05 28.0610 31.7370 1.1009949 49 13 8 21.5 1 21.4226 0.81030 54 0.05 19.7980 23.0471 0.0774150 50 13 10 22.5 1 22.9100 0.73529 54 0.05 21.4358 24.3841 -0.4099751 51 13 12 23.0 1 24.3974 0.77585 54 0.05 22.8419 25.9528 -1.3973552 52 13 14 26.5 1 25.8847 0.91676 54 0.05 24.0467 27.7227 0.6152653 53 14 8 23.0 1 22.0841 0.81030 54 0.05 20.4595 23.7086 0.9159354 54 14 10 22.5 1 23.6093 0.73529 54 0.05 22.1351 25.0835 -1.10931

PAGE 399

Page 409: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 10 ST 732, M. DAVIDIAN

55 55 14 12 24.0 1 25.1345 0.77585 54 0.05 23.5791 26.6900 -1.1345456 56 14 14 27.5 1 26.6598 0.91676 54 0.05 24.8218 28.4978 0.8402257 57 15 8 25.5 1 23.9885 0.81030 54 0.05 22.3639 25.6130 1.5115258 58 15 10 27.5 1 25.5018 0.73529 54 0.05 24.0276 26.9760 1.9982159 59 15 12 26.5 1 27.0151 0.77585 54 0.05 25.4596 28.5706 -0.5151060 60 15 14 27.0 1 28.5284 0.91676 54 0.05 26.6904 30.3664 -1.5284161 61 16 8 20.0 1 21.1253 0.81030 54 0.05 19.5007 22.7498 -1.1252962 62 16 10 23.5 1 22.6110 0.73529 54 0.05 21.1368 24.0852 0.8890263 63 16 12 22.5 1 24.0967 0.77585 54 0.05 22.5412 25.6522 -1.5966864 64 16 14 26.0 1 25.5824 0.91676 54 0.05 23.7444 27.4204 0.4176365 65 17 8 24.5 1 23.6936 0.81030 54 0.05 22.0690 25.3181 0.8064266 66 17 10 25.5 1 25.3075 0.73529 54 0.05 23.8334 26.7817 0.1924867 67 17 12 27.0 1 26.9215 0.77585 54 0.05 25.3660 28.4769 0.0785368 68 17 14 28.5 1 28.5354 0.91676 54 0.05 26.6974 30.3734 -0.0354169 69 18 8 22.0 1 21.6984 0.81030 54 0.05 20.0739 23.3230 0.3015970 70 18 10 22.0 1 23.2101 0.73529 54 0.05 21.7359 24.6843 -1.2100971 71 18 12 24.5 1 24.7218 0.77585 54 0.05 23.1663 26.2773 -0.2217772 72 18 14 26.5 1 26.2335 0.91676 54 0.05 24.3955 28.0714 0.2665573 73 19 8 24.0 1 21.8835 0.81030 54 0.05 20.2589 23.5080 2.1165474 74 19 10 21.5 1 23.3053 0.73529 54 0.05 21.8311 24.7794 -1.8052575 75 19 12 24.5 1 24.7270 0.77585 54 0.05 23.1716 26.2825 -0.2270576 76 19 14 25.5 1 26.1488 0.91676 54 0.05 24.3108 27.9868 -0.6488477 77 20 8 23.0 1 22.6918 0.81030 54 0.05 21.0673 24.3164 0.3081878 78 20 10 20.5 1 24.3114 0.73529 54 0.05 22.8373 25.7856 -3.8114579 79 20 12 31.0 1 25.9311 0.77585 54 0.05 24.3756 27.4866 5.0689280 80 20 14 26.0 1 27.5507 0.91676 54 0.05 25.7127 29.3887 -1.5507081 81 21 8 27.5 1 26.0207 0.81030 54 0.05 24.3961 27.6452 1.4793182 82 21 10 28.0 1 27.8070 0.73529 54 0.05 26.3328 29.2812 0.1930183 83 21 12 31.0 1 29.5933 0.77585 54 0.05 28.0378 31.1488 1.4067284 84 21 14 31.5 1 31.3796 0.91676 54 0.05 29.5416 33.2176 0.1204385 85 22 8 23.0 1 21.7067 0.81030 54 0.05 20.0822 23.3313 1.2932586 86 22 10 23.0 1 23.1048 0.73529 54 0.05 21.6306 24.5790 -0.1048087 87 22 12 23.5 1 24.5029 0.77585 54 0.05 22.9474 26.0583 -1.0028688 88 22 14 25.0 1 25.9009 0.91676 54 0.05 24.0629 27.7389 -0.9009189 89 23 8 21.5 1 22.0303 0.81030 54 0.05 20.4058 23.6549 -0.5303590 90 23 10 23.5 1 23.6121 0.73529 54 0.05 22.1379 25.0863 -0.11212

FULL RANDOM COEFFICIENT MODEL WITH BOTH 7INTERCEPTS AND SLOPES RANDOM FOR EACH GENDER

St

d di Es g r

o c t e r A L U Rb h a n P P l o p e

O s i a n d r r p w p sb n l g c e e e D h e e is o d e e r d d F a r r d

91 91 23 12 24.0 1 25.1939 0.77585 54 0.05 23.6384 26.7494 -1.1938992 92 23 14 28.0 1 26.7757 0.91676 54 0.05 24.9377 28.6136 1.2243493 93 24 8 17.0 1 21.8262 0.81030 54 0.05 20.2017 23.4508 -4.8262194 94 24 10 24.5 1 23.6228 0.73529 54 0.05 22.1486 25.0970 0.8772095 95 24 12 26.0 1 25.4194 0.77585 54 0.05 23.8639 26.9749 0.5806096 96 24 14 29.5 1 27.2160 0.91676 54 0.05 25.3780 29.0540 2.2840197 97 25 8 22.5 1 22.6011 0.81030 54 0.05 20.9765 24.2256 -0.1010698 98 25 10 25.5 1 24.1065 0.73529 54 0.05 22.6323 25.5807 1.3935099 99 25 12 25.5 1 25.6119 0.77585 54 0.05 24.0565 27.1674 -0.11193

100 100 25 14 26.0 1 27.1174 0.91676 54 0.05 25.2794 28.9554 -1.11737101 101 26 8 23.0 1 23.2220 0.81030 54 0.05 21.5974 24.8465 -0.22197102 102 26 10 24.5 1 24.9128 0.73529 54 0.05 23.4386 26.3870 -0.41281103 103 26 12 26.0 1 26.6036 0.77585 54 0.05 25.0482 28.1591 -0.60364104 104 26 14 30.0 1 28.2945 0.91676 54 0.05 26.4565 30.1325 1.70552105 105 27 8 22.0 1 21.1898 0.81030 54 0.05 19.5652 22.8143 0.81025106 106 27 10 21.5 1 22.6076 0.73529 54 0.05 21.1334 24.0818 -1.10761107 107 27 12 23.5 1 24.0255 0.77585 54 0.05 22.4700 25.5809 -0.52546108 108 27 14 25.0 1 25.4433 0.91676 54 0.05 23.6053 27.2813 -0.44332

FULL RANDOM COEFFICIENT MODEL WITH BOTH 8INTERCEPTS AND SLOPES RANDOM FOR EACH GENDER

The Mixed Procedure

Model Information

Data Set WORK.DENT1Dependent Variable distanceCovariance Structures Unstructured, Variance

ComponentsSubject Effects child, childGroup Effect genderEstimation Method MLResidual Variance Method NoneFixed Effects SE Method Model-BasedDegrees of Freedom Method Containment

Class Level Information

PAGE 400

Page 410: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 10 ST 732, M. DAVIDIAN

Class Levels Values

gender 2 0 1child 27 1 2 3 4 5 6 7 8 9 10 11 12 13

14 15 16 17 18 19 20 21 22 2324 25 26 27

Dimensions

Covariance Parameters 5Columns in X 4Columns in Z Per Subject 2Subjects 27Max Obs Per Subject 4Observations Used 108Observations Not Used 0Total Observations 108

Iteration History

Iteration Evaluations -2 Log Like Criterion

0 1 478.241759861 2 418.92503842 1.166324992 1 416.18869903 1.233262093 1 407.89638533 0.019542684 2 406.88264563 0.006458005 1 406.10632159 0.000568666 1 406.04318997 0.000007647 1 406.04238894 0.00000000

Convergence criteria met.

FULL RANDOM COEFFICIENT MODEL WITH BOTH 9INTERCEPTS AND SLOPES RANDOM FOR EACH GENDER

The Mixed Procedure

Covariance Parameter Estimates

Cov Parm Subject Group Estimate

UN(1,1) child 3.1978UN(2,1) child -0.1103UN(2,2) child 0.01976Residual child gender 0 0.4449Residual child gender 1 2.6294

Fit Statistics

-2 Log Likelihood 406.0AIC (smaller is better) 424.0AICC (smaller is better) 425.9BIC (smaller is better) 435.7

Null Model Likelihood Ratio Test

DF Chi-Square Pr > ChiSq

4 72.20 <.0001

Type 3 Tests of Fixed Effects

Num DenEffect DF DF F Value Pr > F

gender 2 54 384.72 <.0001age*gender 2 54 62.66 <.0001

FULL RANDOM COEFFICIENT MODEL WITH BOTH 10INTERCEPTS AND SLOPES RANDOM FOR EACH GENDER

FIXED EFFECTS OUTPUT DATA SET

Obs Effect gender Estimate

1 gender 0 17.37272 gender 1 16.34063 age*gender 0 0.47954 age*gender 1 0.7844

FULL RANDOM COEFFICIENT MODEL WITH BOTH 11INTERCEPTS AND SLOPES RANDOM FOR EACH GENDER

RECONFIGURED FIXED EFFECTS DATA SET

PAGE 401

Page 411: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 10 ST 732, M. DAVIDIAN

Obs gender fixint fixslope

1 0 17.3727 0.479552 1 16.3406 0.78438

FULL RANDOM COEFFICIENT MODEL WITH BOTH 12INTERCEPTS AND SLOPES RANDOM FOR EACH GENDER

RANDOM EFFECTS OUTPUT DATA SET

Obs Effect child Estimate gender

1 Intercept 1 -0.4853 02 age 1 -0.06820 03 Intercept 2 -1.1922 04 age 2 0.1420 05 Intercept 3 -0.8535 06 age 3 0.1773 07 Intercept 4 1.7024 08 age 4 0.04017 09 Intercept 5 0.9136 010 age 5 -0.08680 011 Intercept 6 -0.6740 012 age 6 -0.07292 013 Intercept 7 -0.05461 014 age 7 0.03641 015 Intercept 8 1.9350 016 age 8 -0.1149 017 Intercept 9 -0.2190 018 age 9 -0.1151 019 Intercept 10 -2.9974 020 age 10 -0.09085 021 Intercept 11 1.9249 022 age 11 0.1530 023 Intercept 12 1.3469 124 age 12 0.08788 125 Intercept 13 -0.8676 126 age 13 -0.04068 127 Intercept 14 -0.3575 128 age 14 -0.02176 129 Intercept 15 1.5946 130 age 15 -0.02772 131 Intercept 16 -1.1581 132 age 16 -0.04153 133 Intercept 17 0.8972 134 age 17 0.02260 135 Intercept 18 -0.6889 136 age 18 -0.02853 137 Intercept 19 -0.1443 138 age 19 -0.07348 139 Intercept 20 -0.1273 140 age 20 0.02544 141 Intercept 21 2.5349 142 age 21 0.1088 143 Intercept 22 -0.2261 144 age 22 -0.08535 145 Intercept 23 -0.6374 146 age 23 0.006510 147 Intercept 24 -1.7008 148 age 24 0.1139 149 Intercept 25 0.2387 150 age 25 -0.03166 151 Intercept 26 0.1180 152 age 26 0.06104 153 Intercept 27 -0.8223 1

FULL RANDOM COEFFICIENT MODEL WITH BOTH 13INTERCEPTS AND SLOPES RANDOM FOR EACH GENDER

RANDOM EFFECTS OUTPUT DATA SET

Obs Effect child Estimate gender

54 age 27 -0.07545 1

FULL RANDOM COEFFICIENT MODEL WITH BOTH 14INTERCEPTS AND SLOPES RANDOM FOR EACH GENDER

RECONFIGURED RANDOM EFFECTS DATA SET

Obs child gender ranint ranslope

1 1 0 -0.48526 -0.068202 2 0 -1.19224 0.141983 3 0 -0.85346 0.177264 4 0 1.70243 0.040175 5 0 0.91363 -0.086806 6 0 -0.67403 -0.072927 7 0 -0.05461 0.036418 8 0 1.93498 -0.114869 9 0 -0.21898 -0.1151510 10 0 -2.99738 -0.09085

PAGE 402

Page 412: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 10 ST 732, M. DAVIDIAN

11 11 0 1.92494 0.1529712 12 1 1.34688 0.0878813 13 1 -0.86755 -0.0406814 14 1 -0.35750 -0.0217615 15 1 1.59462 -0.0277216 16 1 -1.15811 -0.0415317 17 1 0.89718 0.0226018 18 1 -0.68894 -0.0285319 19 1 -0.14433 -0.0734820 20 1 -0.12730 0.0254421 21 1 2.53489 0.1087722 22 1 -0.22609 -0.0853523 23 1 -0.63735 0.0065124 24 1 -1.70079 0.1139225 25 1 0.23870 -0.0316626 26 1 0.11799 0.0610427 27 1 -0.82229 -0.07545

FULL RANDOM COEFFICIENT MODEL WITH BOTH 15INTERCEPTS AND SLOPES RANDOM FOR EACH GENDER

RANDOM INTERCEPTS AND SLOPES

Obs gender fixint fixslope child ranint ranslope beta0i beta1i

1 0 17.3727 0.47955 1 -0.48526 -0.06820 16.8875 0.411352 0 17.3727 0.47955 2 -1.19224 0.14198 16.1805 0.621523 0 17.3727 0.47955 3 -0.85346 0.17726 16.5193 0.656814 0 17.3727 0.47955 4 1.70243 0.04017 19.0752 0.519715 0 17.3727 0.47955 5 0.91363 -0.08680 18.2864 0.392746 0 17.3727 0.47955 6 -0.67403 -0.07292 16.6987 0.406627 0 17.3727 0.47955 7 -0.05461 0.03641 17.3181 0.515958 0 17.3727 0.47955 8 1.93498 -0.11486 19.3077 0.364699 0 17.3727 0.47955 9 -0.21898 -0.11515 17.1537 0.3644010 0 17.3727 0.47955 10 -2.99738 -0.09085 14.3753 0.3886911 0 17.3727 0.47955 11 1.92494 0.15297 19.2977 0.6325112 1 16.3406 0.78438 12 1.34688 0.08788 17.6875 0.8722513 1 16.3406 0.78438 13 -0.86755 -0.04068 15.4731 0.7436914 1 16.3406 0.78438 14 -0.35750 -0.02176 15.9831 0.7626215 1 16.3406 0.78438 15 1.59462 -0.02772 17.9352 0.7566516 1 16.3406 0.78438 16 -1.15811 -0.04153 15.1825 0.7428517 1 16.3406 0.78438 17 0.89718 0.02260 17.2378 0.8069718 1 16.3406 0.78438 18 -0.68894 -0.02853 15.6517 0.7558419 1 16.3406 0.78438 19 -0.14433 -0.07348 16.1963 0.7109020 1 16.3406 0.78438 20 -0.12730 0.02544 16.2133 0.8098121 1 16.3406 0.78438 21 2.53489 0.10877 18.8755 0.8931522 1 16.3406 0.78438 22 -0.22609 -0.08535 16.1145 0.6990323 1 16.3406 0.78438 23 -0.63735 0.00651 15.7033 0.7908824 1 16.3406 0.78438 24 -1.70079 0.11392 14.6398 0.8983025 1 16.3406 0.78438 25 0.23870 -0.03166 16.5793 0.7527226 1 16.3406 0.78438 26 0.11799 0.06104 16.4586 0.8454227 1 16.3406 0.78438 27 -0.82229 -0.07545 15.5183 0.70893

MODIFIED RANDOM COEFFICIENT MODEL WITH 16INTERCEPTS RANDOM, SLOPES FIXED

The Mixed Procedure

Model Information

Data Set WORK.DENT1Dependent Variable distanceCovariance Structures Unstructured, Variance

ComponentsSubject Effects child, childGroup Effect genderEstimation Method MLResidual Variance Method NoneFixed Effects SE Method Model-BasedDegrees of Freedom Method Containment

Class Level Information

Class Levels Values

gender 2 0 1child 27 1 2 3 4 5 6 7 8 9 10 11 12 13

14 15 16 17 18 19 20 21 22 2324 25 26 27

Dimensions

Covariance Parameters 3Columns in X 4Columns in Z Per Subject 1Subjects 27Max Obs Per Subject 4Observations Used 108Observations Not Used 0

PAGE 403

Page 413: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 10 ST 732, M. DAVIDIAN

Total Observations 108

Iteration History

Iteration Evaluations -2 Log Like Criterion

0 1 478.241759861 2 411.27740673 0.017322642 1 409.74920841 0.003287033 1 409.36512908 0.000117524 1 409.35237809 0.000000265 1 409.35235096 0.00000000

Convergence criteria met.

MODIFIED RANDOM COEFFICIENT MODEL WITH 17INTERCEPTS RANDOM, SLOPES FIXED

The Mixed Procedure

Covariance Parameter Estimates

Cov Parm Subject Group Estimate

UN(1,1) child 3.1405Residual child gender 0 0.5920Residual child gender 1 2.7286

Fit Statistics

-2 Log Likelihood 409.4AIC (smaller is better) 423.4AICC (smaller is better) 424.5BIC (smaller is better) 432.4

Null Model Likelihood Ratio Test

DF Chi-Square Pr > ChiSq

2 68.89 <.0001

Solution for Fixed Effects

StandardEffect gender Estimate Error DF t Value Pr > |t|

gender 0 17.3727 0.7903 79 21.98 <.0001gender 1 16.3406 1.1272 79 14.50 <.0001age*gender 0 0.4795 0.05187 79 9.24 <.0001age*gender 1 0.7844 0.09234 79 8.49 <.0001

Solution for Random Effects

Std ErrEffect child Estimate Pred DF t Value Pr > |t|

Intercept 1 -1.2154 0.6434 79 -1.89 0.0626Intercept 2 0.3364 0.6434 79 0.52 0.6025Intercept 3 1.0527 0.6434 79 1.64 0.1058Intercept 4 2.1270 0.6434 79 3.31 0.0014Intercept 5 -0.02170 0.6434 79 -0.03 0.9732Intercept 6 -1.4542 0.6434 79 -2.26 0.0266Intercept 7 0.3364 0.6434 79 0.52 0.6025Intercept 8 0.6945 0.6434 79 1.08 0.2837Intercept 9 -1.4542 0.6434 79 -2.26 0.0266Intercept 10 -3.9611 0.6434 79 -6.16 <.0001Intercept 11 3.5595 0.6434 79 5.53 <.0001Intercept 12 2.2849 0.8495 79 2.69 0.0087Intercept 13 -1.3093 0.8495 79 -1.54 0.1272Intercept 14 -0.5905 0.8495 79 -0.70 0.4890

MODIFIED RANDOM COEFFICIENT MODEL WITH 18INTERCEPTS RANDOM, SLOPES FIXED

The Mixed Procedure

Solution for Random Effects

Std ErrEffect child Estimate Pred DF t Value Pr > |t|

Intercept 15 1.3607 0.8495 79 1.60 0.1132Intercept 16 -1.6174 0.8495 79 -1.90 0.0606

PAGE 404

Page 414: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 10 ST 732, M. DAVIDIAN

Intercept 17 1.1553 0.8495 79 1.36 0.1777Intercept 18 -1.0013 0.8495 79 -1.18 0.2421Intercept 19 -0.8986 0.8495 79 -1.06 0.2934Intercept 20 0.1284 0.8495 79 0.15 0.8803Intercept 21 3.7227 0.8495 79 4.38 <.0001Intercept 22 -1.1040 0.8495 79 -1.30 0.1975Intercept 23 -0.5905 0.8495 79 -0.70 0.4890Intercept 24 -0.5905 0.8495 79 -0.70 0.4890Intercept 25 -0.07702 0.8495 79 -0.09 0.9280Intercept 26 0.7445 0.8495 79 0.88 0.3835Intercept 27 -1.6174 0.8495 79 -1.90 0.0606

Type 3 Tests of Fixed Effects

Num DenEffect DF DF F Value Pr > F

gender 2 79 346.69 <.0001age*gender 2 79 78.81 <.0001

MODIFIED RANDOM COEFFICIENT MODEL WITH 19INTERCEPTS RANDOM, SLOPES FIXED

The Mixed Procedure

Model Information

Data Set WORK.DENT1Dependent Variable distanceCovariance Structures Unstructured, Variance

ComponentsSubject Effects child, childGroup Effect genderEstimation Method MLResidual Variance Method NoneFixed Effects SE Method Model-BasedDegrees of Freedom Method Containment

Class Level Information

Class Levels Values

gender 2 0 1child 27 1 2 3 4 5 6 7 8 9 10 11 12 13

14 15 16 17 18 19 20 21 22 2324 25 26 27

Dimensions

Covariance Parameters 3Columns in X 4Columns in Z Per Subject 1Subjects 27Max Obs Per Subject 4Observations Used 108Observations Not Used 0Total Observations 108

Iteration History

Iteration Evaluations -2 Log Like Criterion

0 1 478.241759861 2 411.27740673 0.017322642 1 409.74920841 0.003287033 1 409.36512908 0.000117524 1 409.35237809 0.000000265 1 409.35235096 0.00000000

Convergence criteria met.

MODIFIED RANDOM COEFFICIENT MODEL WITH 20INTERCEPTS RANDOM, SLOPES FIXED

The Mixed Procedure

Covariance Parameter Estimates

Cov Parm Subject Group Estimate

UN(1,1) child 3.1405Residual child gender 0 0.5920Residual child gender 1 2.7286

PAGE 405

Page 415: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 10 ST 732, M. DAVIDIAN

Fit Statistics

-2 Log Likelihood 409.4AIC (smaller is better) 423.4AICC (smaller is better) 424.5BIC (smaller is better) 432.4

Null Model Likelihood Ratio Test

DF Chi-Square Pr > ChiSq

2 68.89 <.0001

Type 3 Tests of Fixed Effects

Num DenEffect DF DF F Value Pr > F

gender 2 79 346.69 <.0001age*gender 2 79 78.81 <.0001

MODIFIED RANDOM COEFFICIENT MODEL WITH 21INTERCEPTS RANDOM, SLOPES FIXEDFIXED EFFECTS OUTPUT DATA SET

Obs Effect gender Estimate

1 gender 0 17.37272 gender 1 16.34063 age*gender 0 0.47954 age*gender 1 0.7844

MODIFIED RANDOM COEFFICIENT MODEL WITH 22INTERCEPTS RANDOM, SLOPES FIXED

RECONFIGURED FIXED EFFECTS DATA SET

Obs gender fixint fixslope

1 0 17.3727 0.479552 1 16.3406 0.78437

MODIFIED RANDOM COEFFICIENT MODEL WITH 23INTERCEPTS RANDOM, SLOPES FIXEDRANDOM EFFECTS OUTPUT DATA SET

Obs Effect child Estimate gender

1 Intercept 1 -1.2154 02 Intercept 2 0.3364 03 Intercept 3 1.0527 04 Intercept 4 2.1270 05 Intercept 5 -0.02170 06 Intercept 6 -1.4542 07 Intercept 7 0.3364 08 Intercept 8 0.6945 09 Intercept 9 -1.4542 0

10 Intercept 10 -3.9611 011 Intercept 11 3.5595 012 Intercept 12 2.2849 113 Intercept 13 -1.3093 114 Intercept 14 -0.5905 115 Intercept 15 1.3607 116 Intercept 16 -1.6174 117 Intercept 17 1.1553 118 Intercept 18 -1.0013 119 Intercept 19 -0.8986 120 Intercept 20 0.1284 121 Intercept 21 3.7227 122 Intercept 22 -1.1040 123 Intercept 23 -0.5905 124 Intercept 24 -0.5905 125 Intercept 25 -0.07702 126 Intercept 26 0.7445 127 Intercept 27 -1.6174 1

MODIFIED RANDOM COEFFICIENT MODEL WITH 24INTERCEPTS RANDOM, SLOPES FIXED

RECONFIGURED RANDOM EFFECTS DATA SET

Obs child gender ranint

1 1 0 -1.215452 2 0 0.336423 3 0 1.052664 4 0 2.127035 5 0 -0.021706 6 0 -1.45420

PAGE 406

Page 416: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 10 ST 732, M. DAVIDIAN

7 7 0 0.336428 8 0 0.694549 9 0 -1.4542010 10 0 -3.9610511 11 0 3.5595212 12 1 2.2849413 13 1 -1.3093514 14 1 -0.5904915 15 1 1.3606916 16 1 -1.6174317 17 1 1.1553118 18 1 -1.0012719 19 1 -0.8985720 20 1 0.1283721 21 1 3.7226522 22 1 -1.1039623 23 1 -0.5904924 24 1 -0.5904925 25 1 -0.0770226 26 1 0.7445327 27 1 -1.61743

MODIFIED RANDOM COEFFICIENT MODEL WITH 25INTERCEPTS RANDOM, SLOPES FIXEDRANDOM INTERCEPTS AND FIXED SLOPES

Obs gender fixint fixslope child ranint beta0i beta1i

1 0 17.3727 0.47955 1 -1.21545 16.1573 0.479552 0 17.3727 0.47955 2 0.33642 17.7091 0.479553 0 17.3727 0.47955 3 1.05266 18.4254 0.479554 0 17.3727 0.47955 4 2.12703 19.4998 0.479555 0 17.3727 0.47955 5 -0.02170 17.3510 0.479556 0 17.3727 0.47955 6 -1.45420 15.9185 0.479557 0 17.3727 0.47955 7 0.33642 17.7091 0.479558 0 17.3727 0.47955 8 0.69454 18.0673 0.479559 0 17.3727 0.47955 9 -1.45420 15.9185 0.4795510 0 17.3727 0.47955 10 -3.96105 13.4117 0.4795511 0 17.3727 0.47955 11 3.55952 20.9322 0.4795512 1 16.3406 0.78437 12 2.28494 18.6256 0.7843713 1 16.3406 0.78437 13 -1.30935 15.0313 0.7843714 1 16.3406 0.78437 14 -0.59049 15.7501 0.7843715 1 16.3406 0.78437 15 1.36069 17.7013 0.7843716 1 16.3406 0.78437 16 -1.61743 14.7232 0.7843717 1 16.3406 0.78437 17 1.15531 17.4959 0.7843718 1 16.3406 0.78437 18 -1.00127 15.3394 0.7843719 1 16.3406 0.78437 19 -0.89857 15.4421 0.7843720 1 16.3406 0.78437 20 0.12837 16.4690 0.7843721 1 16.3406 0.78437 21 3.72265 20.0633 0.7843722 1 16.3406 0.78437 22 -1.10396 15.2367 0.7843723 1 16.3406 0.78437 23 -0.59049 15.7501 0.7843724 1 16.3406 0.78437 24 -0.59049 15.7501 0.7843725 1 16.3406 0.78437 25 -0.07702 16.2636 0.7843726 1 16.3406 0.78437 26 0.74453 17.0852 0.7843727 1 16.3406 0.78437 27 -1.61743 14.7232 0.78437

INTERPRETATION:

• The fit of Model (i) is identical to that in section 9.7 using the same assumption on the forms

of D and Ri. The results appear on pages 1–4 of the output. Also on pages 2–3, the BLUPs of

the elements of bi are printed for each child as requested in the solution option of the random

statement.

PAGE 407

Page 417: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 10 ST 732, M. DAVIDIAN

• On pages 5–7 of the output, the data set created by outpred is printed. This data set contains

the values of

Xiβ + Zibi

for each observation in the data set in the order of appearance in the column Pred. Also

printed are the contents of the original data set. Thus, we see that for child 1 with observa-

tions (21.0, 20.0, 21.5, 23.0) at ages (8, 10, 12, 14), the BLUP of this child’s trajectory at these

times are (20.178, 21.001, 21.824, 22.646).

• Pages 8–9 are a repeat of the results arising from the second call to proc mixed. Note that

the solutions for fixed and random effects are not printed, resulting from the first and third

ods statement. Page 10 results from printing out the data set containing the estimates of β

created by the ods output SolutionF=fixed1 statement. SolutionF is a key word recognized

by PROC MIXED as identifying this data set; the PROC MIXED documentation describes many more

possibilities of results that may be output to SAS data sets. The statements following the proc

print to print these results reconfigure the data set so that it appears in the form on page 11.

This is necessary in order to merge the estimates of β with the BLUPs for the bi in subsequent

data steps.

• On pages 12–13, the results of printing the data set containing the BLUPs of the bi for each child

created by the ods output SolutionR=rand1 statement. SolutionR is the key word identifying

this data set. Note that for each child, there is a separate row in the file for the intercept BLUP

and the slope BLUP (b0i and b1i). In the code, the data step following the printing of this data

set results in a reconfigured data set suitable for mergeing with that containing the estimates of

β. This data set is given on page 14. The two variables ranint and ranslope contain the BLUPs

for b01i and b1i, respectively.

• Finally, page 15 shows the result of printing out the data set obtained by mergeing the two

data sets above. The variables beta0i and beta1i are the BLUPs for the intercept and slope

components of βi for each child.

• Pages 16–18 shows the output of the fit of Model (ii), in which slopes are taken not to vary. For

brevity, the predicted values using outpred are not requested. The results printed on pages 19–20

arise from the second call to proc mixed; those on pages 21–25 are the consequence of the same

manipulations of output data sets obtained from ods statements within PROC MIXED as for Model

(i), described above. Note that on page 25, the BLUPs of β0i, the child-specific intercepts, vary,

while those of β1i, the child-specific slopes, do not – slope is the same for all girls and all boys.

PAGE 408

Page 418: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 10 ST 732, M. DAVIDIAN

This, of course, is a result of the model assumption.

• Finally, note that, regardless of the assumption about how random effects enter the model, the

estimates of β are identical for Models (i) and (ii). This is a consequence of the fact that these

data are balanced, as previously noted.

EXAMPLE 2 – WEIGHT-LIFTING STUDY IN YOUNG MEN: Physical fitness researchers were in-

terested in whether following a new program including both a regimen of exercise and special diet would

lead to young men with an interest in weight-lifting to be able to bench press greater amounts of weight

and to do it more quickly than if they were to follow only the exercise part of the program alone. Thus,

they had a particular interest in the effects of the diet portion of the program.

To investigate, the researchers recruited 100 young men in high school, college, and beyond with either

existing interest and experience with weight-lifting or interest in becoming involved in weight-lifting. It is

well-known that the amount of weight a man can bench press may be associated with their body weight,

previous weight-lifting experience, and age. Thus, the researchers recorded these baseline characteristics

for each man:

Age mean (sd)=22.0 (2.7), min=16, max=32

Weight mean (sd)= 180.4 (24.8), min=119.7, man=227.6

Previous weight-lifting 27%

experience

Bench press (lbs) mean (sd)=163.7 (13.2)

The mean were randomized at the beginning of the study to 2 groups, 50 men per group:

• Follow the exercise part of the program only

• Follow both the exercise and diet parts of the program

The amount of weight each man was capable of bench pressing at entry into the study was recorded

for all men (day 0). Subsequently, the men were allowed to come to the gym at which the study was

conducted according to their own schedules, as would be the case in practice; most came at least 4

times per week. Periodically, members of the research staff would record the amount (lbs) each man

was able to bench press (the response). Because each man’s schedule was different due to their class or

work obligations, the times at which this was recorded for each man varied across men. Most men were

followed for about 9-10 months.

PAGE 409

Page 419: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 10 ST 732, M. DAVIDIAN

A spaghetti plot of the data is given in Figure 2. Here, time is measured in days since entry into the

study. Note that in each group, the weight trajectories appear to be roughly like straight lines, with

variation about the line within each man.

Figure 2: Weights bench pressed (lbs) over time for (a) men in the no diet group and (b) men in the

diet group.

0 50 100 150 200 250 300

100

150

200

250

300

350

400

time (days)

wei

ght (

lbs)

(a) No diet

0 50 100 150 200 250 300

100

150

200

250

300

350

400

time (days)

wei

ght (

lbs)

(b) Diet

PSfrag

replacem

entsµ

σ21

σ22

ρ12

=0.0

ρ12

=0.8y

1

y2

On the basis of these data, the researchers would like to investigate the following specific issues:

1. Is there evidence that the “typical” rate of change in amount such men are able to bench press is

different depending on whether they followed the diet or not?

2. In fact, does it matter whether they had previous experience with weight-lifting in regard to the

rate of change?

To investigate, we consider the following statistical models. The most general model (i) is as follows.

For the ith man, the individual trajectory follows a straight line; i.e. the jth weight bench pressed for

man i, Yij , measured at day tij after his entry into the study, j = 1, . . . , ni, is given by

Yij = β0i + β1itij + eij .

PAGE 410

Page 420: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 10 ST 732, M. DAVIDIAN

Clearly, the amount a man can bench press cannot increase without bound forever – eventually, a man

would reach his maximum possible strength, and the amount he could bench press would likely “level

off.” Over the period of this study, it seems, however, that most if not all men have not shown such

“leveling-off.” Thus, a straight line may be a reasonable representation of the trajectories in this time

frame; however, at later times, this model may not be appropriate at all.

Let wi be man i’s body weight (lb) at baseline, let ai be his baseline age, and let pi = 1 if the man had

prior weight-lifting experience before the start of the study and pi = 0 if not. Let di be an indicator

of whether man i was randomized to follow the program with (di = 1) or without (di = 0) the diet

component.

The simplest population model that could be considered would simply follow the study design exactly.

Because the men were randomized to receive the diet or not, we would expect the mean weight bench

pressed at time 0 to be the same regardless of whether a man was assigned to the diet or no diet group.

That is, the mean of intercepts β0i would not be expected to be different for the two groups. The mean

of the slopes β1i, which characterize rate of change (as constant over the period of the study) may well

be different. Under these conditions, the population model is

β0i = β0 + b0i, β1i = β1 + β11di + b1i,

where here we have used the “difference parameterization” for the slopes, so that β1 represents the

“typical” rate of change for men who do not follow the diet and β11 represents the amount by which

the rate of change differs from this with the diet. The first, overall question of whether the mean rate

of change is different depending on whether the diet is followed may be addressed by asking whether

β11 = 0.

In the following program, this is Model (i).

More detailed and exploratory analyses may be carried out. Given that it is suspected that men’s

baseline characteristics may help to explain some of the variation in the men at time 0. We may modify

Model (i) to take this into account by allowing the mean intercept to be different depending on baseline

weight, age, and experience:

β0i = β0 + β01wi + β02ai + β03pi + b0i.

The hope in fitting this model, which adjusts for baseline characteristics, is that if some of the variation

in the data (at baseline) can be explained by systematic features, it may lead to more precise estimation

and testing for the rate of change.

PAGE 411

Page 421: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 10 ST 732, M. DAVIDIAN

Model (i) with this modification is given in the program as Model (ii).

The model might be further modified to allow an exploratory analysis of whether previous experience

plays a role in how men’s ability to bench press changes over the time period in the study. The following

model takes into account baseline characteristics as in Model (ii), but also allows in the model for man-

specific slopes not only the possibility that the mean rate of change in weight bench-pressed may be

different because of whether a man followed the diet or not but also that this is differential depending

on whether the man has previous weight-lifting experience:

β0i = β0 + β01wi + β02ai + β03pi + b0i, β1i = β1 + β11di + β12pi + β13dipi + b1i.

In the program, this is Model (iii).

A final model is considered in the program, Model (iv), which does not allow mean rate of change to

depend on either diet or previous experience:

β1i = β1 + b1i;

this model may be used with Model (ii) to get a likelihood ratio test of whether mean rate of change is

different depending on whether the diet is followed, taking into account the baseline covariates.

The following SAS program uses PROC MIXED to fit these models to the data. It is assumed that

• With bi = (b0i, b1i)′, var(bi) = D, the same for both groups (diet or not).

• With ei = (ei1, . . . , eini)′, var(ei) = σ2Ini

, σ2 the same for both groups.

Ideally, these assumptions should be evaluated for relevance and modified if necessary; we do not do

this here but encourage the reader to do this with the data (on the class web site).

PAGE 412

Page 422: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 10 ST 732, M. DAVIDIAN

PROGRAM:

/*******************************************************************

CHAPTER 9, EXAMPLE 2

Illustration of fitting a linear mixed effects model derivedfrom a random coefficient model, where the mean slope in eachgroup depends on a continuous covariate.

The model for each man is assumed to be a straight line.The intercepts are taken to depend on baseline covariates.The slopes are taken to depend on baseline covariates, differentiallyby group (diet or not).

We take D to be common for both groups and take Ri to becommon to both groups of the form Ri = sigma^2 I.

*******************************************************************/

options ls=80 ps=59 nodate; run;

/******************************************************************

Read in the data set

*******************************************************************/

data pdat; infile ’press.dat’;input id time press weight age prev diet;

run;

/*******************************************************************

Use PROC MIXED to fit linear mixed effects model (i); we usenormal ML rather than REML to get likelihood ratio tests

*******************************************************************/

title ’MODEL (i)’;proc mixed method=ml data=pdat;class id;model press = time time*diet / solution;random intercept time / type=un subject=id;estimate "slp w/diet" time 1 time*diet 1;

run;

/*******************************************************************

Model (ii) that includes "adjustments" fornormal ML rather than REML to get likelihood ratio tests

*******************************************************************/

title ’MODEL (ii)’;proc mixed method=ml data=pdat;class id;model press = weight prev age time time*diet / solution;random intercept time / type=un subject=id;estimate "slp w/diet" time 1 time*diet 1;

run;

/*******************************************************************

Model (iii) includes this adjustment plus the possibility thatrate of change depends on both diet and previous experience.We include estimate statements to estimate each slope andcontrast statements to make some comparisons.

*******************************************************************/

title ’MODEL (iii)’;proc mixed method=ml data=pdat;class id;model press = weight prev age

time time*diet time*prev time*diet*prev / solution;random intercept time / type=un subject=id;estimate "slp, diet, no prev" time 1 time*diet 1;estimate "slp, no diet, prev" time 1 time*prev 1;estimate "slp, diet, prev" time 1 time*prev 1 time*diet 1 time*diet*prev 1;contrast "overall slp diff" time*diet 1,

time*prev 1,time*diet*prev 1 / chisq;

contrast "prev effect" time*prev 1, time*diet*prev 1 / chisq;contrast "diet effect" time*diet 1, time*diet*prev 1 /chisq;

run;

PAGE 413

Page 423: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 10 ST 732, M. DAVIDIAN

/*******************************************************************

Model (iv) -- "reduced" model with no diet or previous weightliftingeffect

*******************************************************************/

title ’MODEL (iv)’;proc mixed method=ml data=pdat;class id;model press = weight prev age time / solution;random intercept time / type=un subject=id;

run;

PAGE 414

Page 424: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 10 ST 732, M. DAVIDIAN

OUTPUT: Following the output, we comment on a few aspects of the output.

MODEL (i) 1

The Mixed Procedure

Model Information

Data Set WORK.PDATDependent Variable pressCovariance Structure UnstructuredSubject Effect idEstimation Method MLResidual Variance Method ProfileFixed Effects SE Method Model-BasedDegrees of Freedom Method Containment

Class Level Information

Class Levels Values

id 100 1 2 3 4 5 6 7 8 9 10 11 12 1314 15 16 17 18 19 20 21 22 2324 25 26 27 28 29 30 31 32 3334 35 36 37 38 39 40 41 42 4344 45 46 47 48 49 50 51 52 5354 55 56 57 58 59 60 61 62 6364 65 66 67 68 69 70 71 72 7374 75 76 77 78 79 80 81 82 8384 85 86 87 88 89 90 91 92 9394 95 96 97 98 99 100

Dimensions

Covariance Parameters 4Columns in X 3Columns in Z Per Subject 2Subjects 100Max Obs Per Subject 12Observations Used 839Observations Not Used 0Total Observations 839

Iteration History

Iteration Evaluations -2 Log Like Criterion

0 1 7787.644610221 2 5564.11759892 0.030576892 1 5483.82830125 0.016022753 1 5443.30531416 0.006798974 1 5426.68613900 0.002125555 1 5421.70939610 0.000367906 1 5420.90966177 0.000016617 1 5420.87642307 0.000000048 1 5420.87634256 0.00000000

MODEL (i) 2

The Mixed Procedure

Convergence criteria met.

Covariance Parameter Estimates

Cov Parm Subject Estimate

UN(1,1) id 164.79UN(2,1) id 0.6063UN(2,2) id 0.01228Residual 13.7306

Fit Statistics

-2 Log Likelihood 5420.9AIC (smaller is better) 5434.9AICC (smaller is better) 5435.0BIC (smaller is better) 5453.1

Null Model Likelihood Ratio Test

DF Chi-Square Pr > ChiSq

PAGE 415

Page 425: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 10 ST 732, M. DAVIDIAN

3 2366.77 <.0001

Solution for Fixed Effects

StandardEffect Estimate Error DF t Value Pr > |t|

Intercept 163.89 1.3056 99 125.53 <.0001time 0.2020 0.01523 98 13.27 <.0001time*diet 0.1665 0.02060 639 8.08 <.0001

Type 3 Tests of Fixed Effects

Num DenEffect DF DF F Value Pr > F

time 1 98 175.97 <.0001time*diet 1 639 65.35 <.0001

Estimates

StandardLabel Estimate Error DF t Value Pr > |t|

slp w/diet 0.3685 0.01520 639 24.24 <.0001

MODEL (ii) 3

The Mixed Procedure

Model Information

Data Set WORK.PDATDependent Variable pressCovariance Structure UnstructuredSubject Effect idEstimation Method MLResidual Variance Method ProfileFixed Effects SE Method Model-BasedDegrees of Freedom Method Containment

Class Level Information

Class Levels Values

id 100 1 2 3 4 5 6 7 8 9 10 11 12 1314 15 16 17 18 19 20 21 22 2324 25 26 27 28 29 30 31 32 3334 35 36 37 38 39 40 41 42 4344 45 46 47 48 49 50 51 52 5354 55 56 57 58 59 60 61 62 6364 65 66 67 68 69 70 71 72 7374 75 76 77 78 79 80 81 82 8384 85 86 87 88 89 90 91 92 9394 95 96 97 98 99 100

Dimensions

Covariance Parameters 4Columns in X 6Columns in Z Per Subject 2Subjects 100Max Obs Per Subject 12Observations Used 839Observations Not Used 0Total Observations 839

Iteration History

Iteration Evaluations -2 Log Like Criterion

0 1 7377.928805971 2 5414.72631658 0.007004912 1 5397.79499881 0.002077353 1 5392.99291567 0.000337644 1 5392.26713310 0.000014075 1 5392.23925291 0.000000036 1 5392.23919542 0.00000000

MODEL (ii) 4

The Mixed Procedure

Convergence criteria met.

PAGE 416

Page 426: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 10 ST 732, M. DAVIDIAN

Covariance Parameter Estimates

Cov Parm Subject Estimate

UN(1,1) id 104.54UN(2,1) id 0.1806UN(2,2) id 0.01227Residual 13.7285

Fit Statistics

-2 Log Likelihood 5392.2AIC (smaller is better) 5412.2AICC (smaller is better) 5412.5BIC (smaller is better) 5438.3

Null Model Likelihood Ratio Test

DF Chi-Square Pr > ChiSq

3 1985.69 <.0001

Solution for Fixed Effects

StandardEffect Estimate Error DF t Value Pr > |t|

Intercept 130.86 12.3075 96 10.63 <.0001weight 0.06093 0.04260 639 1.43 0.1531prev 15.0642 2.3490 639 6.41 <.0001age 0.8181 0.3876 639 2.11 0.0352time 0.2014 0.01578 98 12.76 <.0001time*diet 0.1674 0.02221 639 7.54 <.0001

Type 3 Tests of Fixed Effects

Num DenEffect DF DF F Value Pr > F

weight 1 639 2.05 0.1531prev 1 639 41.13 <.0001age 1 639 4.45 0.0352time 1 98 162.94 <.0001time*diet 1 639 56.79 <.0001

MODEL (ii) 5

The Mixed Procedure

Estimates

StandardLabel Estimate Error DF t Value Pr > |t|

slp w/diet 0.3688 0.01576 639 23.40 <.0001

MODEL (iii) 6

The Mixed Procedure

Model Information

Data Set WORK.PDATDependent Variable pressCovariance Structure UnstructuredSubject Effect idEstimation Method MLResidual Variance Method ProfileFixed Effects SE Method Model-BasedDegrees of Freedom Method Containment

Class Level Information

Class Levels Values

id 100 1 2 3 4 5 6 7 8 9 10 11 12 1314 15 16 17 18 19 20 21 22 2324 25 26 27 28 29 30 31 32 3334 35 36 37 38 39 40 41 42 4344 45 46 47 48 49 50 51 52 5354 55 56 57 58 59 60 61 62 6364 65 66 67 68 69 70 71 72 7374 75 76 77 78 79 80 81 82 83

PAGE 417

Page 427: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 10 ST 732, M. DAVIDIAN

84 85 86 87 88 89 90 91 92 9394 95 96 97 98 99 100

Dimensions

Covariance Parameters 4Columns in X 8Columns in Z Per Subject 2Subjects 100Max Obs Per Subject 12Observations Used 839Observations Not Used 0Total Observations 839

Iteration History

Iteration Evaluations -2 Log Like Criterion

0 1 7270.055736441 2 5342.30391536 0.000132132 1 5342.03719070 0.000001403 1 5342.03451402 0.00000000

Convergence criteria met.

MODEL (iii) 7

The Mixed Procedure

Covariance Parameter Estimates

Cov Parm Subject Estimate

UN(1,1) id 103.90UN(2,1) id 0.1075UN(2,2) id 0.007303Residual 13.7266

Fit Statistics

-2 Log Likelihood 5342.0AIC (smaller is better) 5366.0AICC (smaller is better) 5366.4BIC (smaller is better) 5397.3

Null Model Likelihood Ratio Test

DF Chi-Square Pr > ChiSq

3 1928.02 <.0001

Solution for Fixed Effects

StandardEffect Estimate Error DF t Value Pr > |t|

Intercept 130.83 12.3290 96 10.61 <.0001weight 0.06032 0.04267 639 1.41 0.1580prev 16.8923 2.3608 639 7.16 <.0001age 0.8011 0.3883 639 2.06 0.0395time 0.1715 0.01428 96 12.00 <.0001time*diet 0.1444 0.02027 639 7.12 <.0001prev*time 0.1154 0.02805 639 4.11 <.0001prev*time*diet 0.07575 0.03915 639 1.93 0.0534

Type 3 Tests of Fixed Effects

Num DenEffect DF DF F Value Pr > F

weight 1 639 2.00 0.1580prev 1 639 51.20 <.0001age 1 639 4.26 0.0395time 1 96 144.11 <.0001time*diet 1 639 50.76 <.0001prev*time 1 639 16.92 <.0001prev*time*diet 1 639 3.74 0.0534

MODEL (iii) 8

The Mixed Procedure

Estimates

PAGE 418

Page 428: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 10 ST 732, M. DAVIDIAN

StandardLabel Estimate Error DF t Value Pr > |t|

slp, diet, no prev 0.3158 0.01443 639 21.89 <.0001slp, no diet, prev 0.2869 0.02415 639 11.88 <.0001slp, diet, prev 0.5070 0.02329 639 21.77 <.0001

Contrasts

Num DenLabel DF DF Chi-Square F Value Pr > ChiSq Pr > F

overall slp diff 3 639 158.73 52.91 <.0001 <.0001prev effect 2 639 65.40 32.70 <.0001 <.0001diet effect 2 639 93.96 46.98 <.0001 <.0001

MODEL (iv) 9

The Mixed Procedure

Model Information

Data Set WORK.PDATDependent Variable pressCovariance Structure UnstructuredSubject Effect idEstimation Method MLResidual Variance Method ProfileFixed Effects SE Method Model-BasedDegrees of Freedom Method Containment

Class Level Information

Class Levels Values

id 100 1 2 3 4 5 6 7 8 9 10 11 12 1314 15 16 17 18 19 20 21 22 2324 25 26 27 28 29 30 31 32 3334 35 36 37 38 39 40 41 42 4344 45 46 47 48 49 50 51 52 5354 55 56 57 58 59 60 61 62 6364 65 66 67 68 69 70 71 72 7374 75 76 77 78 79 80 81 82 8384 85 86 87 88 89 90 91 92 9394 95 96 97 98 99 100

Dimensions

Covariance Parameters 4Columns in X 5Columns in Z Per Subject 2Subjects 100Max Obs Per Subject 12Observations Used 839Observations Not Used 0Total Observations 839

Iteration History

Iteration Evaluations -2 Log Like Criterion

0 1 7681.552583041 2 5479.69566892 0.010955232 1 5451.98795580 0.004644863 1 5440.63977067 0.001340994 1 5437.54085223 0.000173765 1 5437.17181826 0.000004046 1 5437.16382593 0.00000000

MODEL (iv) 10

The Mixed Procedure

Convergence criteria met.

Covariance Parameter Estimates

Cov Parm Subject Estimate

UN(1,1) id 104.01UN(2,1) id 0.1711UN(2,2) id 0.01930Residual 13.7321

PAGE 419

Page 429: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 10 ST 732, M. DAVIDIAN

Fit Statistics

-2 Log Likelihood 5437.2AIC (smaller is better) 5455.2AICC (smaller is better) 5455.4BIC (smaller is better) 5478.6

Null Model Likelihood Ratio Test

DF Chi-Square Pr > ChiSq

3 2244.39 <.0001

Solution for Fixed Effects

StandardEffect Estimate Error DF t Value Pr > |t|

Intercept 130.96 12.3232 96 10.63 <.0001weight 0.06097 0.04265 639 1.43 0.1533prev 15.7659 2.3516 639 6.70 <.0001age 0.8044 0.3881 639 2.07 0.0386time 0.2851 0.01399 99 20.39 <.0001

Type 3 Tests of Fixed Effects

Num DenEffect DF DF F Value Pr > F

weight 1 639 2.04 0.1533prev 1 639 44.95 <.0001age 1 639 4.29 0.0386time 1 99 415.58 <.0001

INTERPRETATION:

• From the output for the fits of Models (i) and (ii) on pages 2 and 4, difference in rate of change

for using the diet versus not is estimated as about β11 = 0.17 lbs/day (standard error 0.02); the

estimate is almost identical whether “adjustment” for baseline characteristics is included or not.

The p-value of 0.0001 for the Wald test indicates that the evidence is very strong that the diet

does have a positive effect on the rate of change. From the estimate statement in each case, we

have that the estimated slopes are β1 = 0.20 (0.15) lbs/day with no diet and β1 + β11 = 0.37

(0.16) lbs/day.

We can obtain the likelihood ratio statistic in the case of baseline adjustment from the output

of models (ii) and (iv). The observed statistic is 5437.2 − 5392.2 = 45.0. The statistic has a χ21

distribution, for which the critical value for a 0.05 level test is χ21,0.95 = 3.84. Thus, it is clear that

the evidence is very strong that the diet makes a different.

• Turning to the exploratory analyses, consider the output for Model (iii) on pages 6–8. Here, there

is a separate slope for each combination of diet or not and experience or not, given by

PAGE 420

Page 430: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 10 ST 732, M. DAVIDIAN

β1 rate of change with no diet and no previous experience

β1 + β11 rate of change with diet but no experience

β1 + β12 rate of change with no diet but experience

β1 + β11 + β12 + β13 rate of change with diet and previous experience.

The estimates and their standard errors may be seen in the main table of Solution for Fixed

Effects (β1) and in the output of the estimate statement (others). To test whether there is an

overall slope difference at all, we consider the null hypothesis H0 : β11 = β12 = β13 = 0. The first

contrast statement provides the result of this test (3 degrees of freedom) and shows that there

is very strong evidence of a difference.

The second two contrast statements attempt to gain further insight. In the first, we test H0 :

β12 = β13 = 0, which says there is no effect of previous experience, allowing the possibility of a

difference due to diet. There is strong evidence of a departure from this null hypothesis (prev

effect contrast). The third contrast is similar.

A more focused question is whether the difference in mean rate of change between using the diet

or not is different depending on whether a man has had previous weight-lifting experience. This is

simply the “diet-by-previous experience” interaction. The term β13 allows this possibility; thus, at

test of H0 : β13 = 0 addresses this question. From the Solution for Fixed Effects table, the

test corresponding to prev*time*diet yields a p-value of 0.05, so that the evidence is inconclusive

in this regard. It seems that whether men have prior experience is important in how the progress

in their bench pressing, as above, but the evidence is not clear on whether the way in which this

happens is similar regardless of whether they follow the diet or not.

PAGE 421

Page 431: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 11 ST 732, M. DAVIDIAN

11 Generalized linear models for nonnormal response

11.1 Introduction

So far, in our study of “regression-type” models for longitudinal data, we have focused on situations

where

• The response is continuous and reasonably assumed to be normally distributed.

• The model relating mean response to time and possibly other covariates is linear in parameters

that characterize the relationship. For example, regardless of how we modeled covariance (by

direct modeling or by introducing random effects), we had models for the mean response of a data

vector of the form

E(Y i) = Xiβ;

i.e. for the observation at time tij on unit i,

E(Yij) = β0 + β1tij .

Under these conditions, we were led to methods that were based on the assumption that

Y i ∼ N (Xiβ,Σi);

the form of the matrix Σi is dictated by what one assumes about the nature of variation. To fit the

model, we used the methods of maximum likelihood and restricted maximum likelihood under

the assumption that the data vectors are distributed as multivariate normal. Thus, the fitting

method was based on the normality assumption.

As we noted at the beginning of the course, the assumption of normality is not always relevant for some

data. This issue is not confined to longitudinal data analysis – it is an issue even in ordinary regression

modeling. If the response is in the form of small counts, or is in fact binary (yes/no), it is clear that

the assumption of normality would be quite unreasonable. Thus, the modeling and methods we have

discussed so far, including the classical techniques, would be inappropriate for these situations.

PAGE 422

Page 432: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 11 ST 732, M. DAVIDIAN

One possibility is to analyze the data on a transformed scale on which they appear to be more nearly

normal; e.g. count data may be transformed via a square-root or other transformation, and then

represented by linear models on this scale. This is somewhat unsatisfactory, however, as the model

no longer pertains directly to the original scale of measurement, which is usually of greatest interest.

Moreover, it tries to “force” a model framework and distributional assumption that may not be best

for the data.

In the late 1970’/early 1980’s, in the context of ordinary regression modeling, a new perspective emerged

in the statistical literature that generated much interest and evolved into a new standard for analysis

in these situations. For data like counts and binary outcomes, as well as for continuous data for which

the normal distribution is not a good probability model, there are alternative probability models

that might be better representations of the way in which the response takes on values. The idea was

to use these more appropriate probability models as the basis for developing new regression models

and methods, rather than to try and make things fit into the usual (and inappropriate) normal-based

methods. Then, in the mid-1980’s, these techniques were extended to allow application to longitudinal

data; this topic still is a focus of current statistical research.

In this chapter, we will gain the necessary background for understanding longitudinal data methods for

nonnormal response. To do this, we will step away from the longitudinal data problem in this chapter,

and consider just the ordinary regression situation where responses are scalar and independent.

Armed with an appreciation of regression methods for nonnormal response, we will then be able to

see how these might be extended to the harder problem of longitudinal data. As we will see, this

extension turns out to not be quite as straightforward as it was in the normal case.

Thus, in this chapter, we will consider the following problem as a prelude to our treatment of nonnormal

longitudinal data:

• As in multiple regression, suppose we have responses Y1, . . . , Yn each taken at a setting of k

covariates xj1, . . . , xjk, j = 1, . . . , n.

• The Yj values are mutually independent.

• The goal is to develop a statistical model that represents the response as a function of the

covariates, as in usual linear regression.

• However, the nature of the response is such that the normal probability model is not appropriate.

PAGE 423

Page 433: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 11 ST 732, M. DAVIDIAN

We might think of the data as arising either as

• n observations on a single unit in a longitudinal data situation, where we focus on this individual

unit only, so that the only relevant variation is within the unit. If observations are taken far

enough apart in time, they might be viewed as independent.

• n scalar observations, each taken on a different unit (thus, the independence assumption is

natural). Here, j indexes observations and units (recall the oxygen intake example in section 3.4).

• Either way of thinking is valid – the important point is that we wish to fit a regression model to

data that do not seem to be normally distributed. As we will see, the data type might impose

additional considerations about the form of the regression model.

• We use the subscript j in this chapter to index the observations; we could have equally well used

the subscript i.

The class of regression models we will consider for this situation is known in the literature as generalized

linear models (not to be confused with the name of the SAS procedure GLM standing for General Linear

Model). Our treatment here is not comprehensive; for everything you ever wanted to know and more

about generalized linear models, see the book by McCullagh and Nelder (1989).

11.2 Probability models for nonnormal data

Before we discuss regression modeling of nonnormal data, we review a few probability models that are

ideally suited to representation of these data. We will focus on three models in particular; a more

extensive catalogue of models may be found in McCullagh and Nelder (1989):

• The Poisson probability distribution as a model for count data (discrete)

• The Bernoulli probability distribution as a model for binary data (discrete) (this may be ex-

tended to model data in the form of proportions

• The gamma probability distribution as a model for continuous but nonnormal data with con-

stant coefficient of variation.

PAGE 424

Page 434: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 11 ST 732, M. DAVIDIAN

We will see that all of these probability models are members of a special class of probability models.

This class also includes the normal distribution with constant variance (the basis for classical linear

regression methods for normal data); thus, generalized linear models will be seen to be an extension

of ordinary linear regression models.

COUNT DATA – THE POISSON DISTRIBUTION: Suppose we have a response Y that is in the form

of a count – Y records the number of times an event of interest is observed. Recall the epileptic seizure

data discussed at the beginning of the course; here, Y was the number of seizures suffered by a particular

patient in a two-week period.

When the response is a count, it should be clear that the possible values of the response must be non-

negative integers; more precisely, Y may take on the values 0, 1, 2, 3, . . .. In principle, any nonnegative

integer value is possible; there is no upper bound on how large a count may be. Realistically, if the

thing being counted happens infrequently, large counts may be so unlikely as to almost never be seen.

The Poisson probability distribution describes probabilities that a random variable Y that describes

counts takes on values in the range 0, 1, 2, 3, . . .. More precisely, the probability density function de-

scribes the probability that Y takes on the value y:

f(y) = P (Y = y) =µye−µ

y!, y = 0, 1, 2, . . . , µ > 0. (11.1)

• It may be shown that the mean (expectation) of Y is µ; i.e. E(Y ) = µ. Note that µ is positive,

which makes sense – the average across all possible values of counts should be positive.

• Furthermore, it may be shown that the variance of Y is also equal to µ; i.e. var(Y ) = µ. Thus,

the variance of Y is nonconstant. Thus, if Y1 and Y2 are both Poisson random variables, the

only way that they can have the same variance is if they have the same mean.

• This has implications for regression – if Y1 and Y2 correspond to counts taken at different settings

of the covariates, so thus at possibly different mean values, it is inappropriate to assume that they

have the same variance. Recall that a standard assumption of ordinary regression under normality

is that of constant variance regardless of mean value; this assumption is clearly not sensible for

count data.

Figure 1 shows the probability histogram for the case of a Poisson distribution with µ = 4. Because

the random variable in question is discrete, the histogram is not smooth; rather, the blocks represent

the probabilities of each value on the horizontal axis by area.

PAGE 425

Page 435: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 11 ST 732, M. DAVIDIAN

Figure 1: Poisson probabilities with mean = 4.

0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

0.0

0.05

0.10

0.15

0.20

count

Some features:

• Probabilities of seeing counts larger than 12 are virtually negligible, although, in principle, counts

may take on any nonnegative value.

• Clearly, if µ were larger, the values for which probabilities would become negligible would get

larger and larger.

• For “smallish” counts, where the mean is small (e.g. µ = 4), the shape of the probability histogram

is asymmetric. Thus, discreteness aside, the normal distribution would be a lousy approximation

to this shape. For larger and larger µ, it may be seen that the shape gets more and more symmetric.

Thus, when counts are very large, it is common to approximate the Poisson probability distribution

by a normal distribution.

PAGE 426

Page 436: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 11 ST 732, M. DAVIDIAN

EXAMPLE – HORSE-KICK DATA: As an example of a situation where the response is a (small) count,

we consider a world-famous data set. These data may be found on page 227 of Hand et al. (1994). Data

were collected and maintained over the 20 years 1875 – 1894, inclusive, on the numbers of Prussian

militiamen killed by being kicked by a horse in each of 10 separate corps of militiamen. For example,

the data for the first 6 years are as follows:

Year Corps

1 2 3 4 5 6 7 8 9 10

1875 0 0 0 0 1 1 0 0 1 0

1876 0 0 1 0 0 0 0 0 1 1

1877 0 0 0 0 1 0 0 1 2 0

1878 2 1 1 0 0 0 0 1 1 0

1879 0 1 1 2 0 1 0 0 1 0

1880 2 1 1 1 0 0 2 1 3 0

Thus, for example, in 1877, 2 militiamen were killed by kicks from a horse in the 9th corps. Note that,

technically, counts may not be any number – there is an “upper bound” (the total number of men in

the corps). But this number is so huge relative to the size of the counts that, for all practical purposes

it is “infinite.” Clearly, the numbers of men killed (counts) in each year/corps combination are small;

thus, the normal distribution is a bad approximation to the true, Poisson distribution.

It was of interest to determine from these data whether differences in the numbers of men kicked could

be attributed to systematic effects of year or corps. That is, were members of certain corps more

susceptible to horse-kick deaths than others? Were certain years particularly bad for horse-kick deaths?

• If the data were normal, a natural approach to this question would be to postulate a regression

model that allows mean response to depend on the particular corps and year.

• Specifically, if we were to define 19 dummy variables for year and 9 for corps, we might write a

linear model for the mean of the jth observation in the data set (n = 200 total) as

β0 + β1xj1 + · · ·+ β19xj,19 + β20zj1 + · · ·+ β28zj9, (11.2)

xjk = 1 if observation j is from year k = 1875, . . . , 1893

= 0 otherwise

zjk = 1 if observation j is from corps k = 1, . . . , 9

= 0 otherwise

PAGE 427

Page 437: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 11 ST 732, M. DAVIDIAN

With these definitions, note that β0 corresponds to what happens for year 1894 with corps 10.

The remaining parameters describe the change from this due to changing year or corps.

• Note that, aside from the normality issue, letting (11.2) represent the mean of observation Yj ,

E(Yj) has a problem. Recall that counts must be nonnegative by definition. However with this

model, it is possible to end up with an estimated value for E(Yj) that is negative – this restriction

is not enforced. This seems quite possible – many of the observations are 0, so that it would not

be surprising to end up estimating some means as negative. More on this later.

BINARY DATA – THE BERNOULLI DISTRIBUTION: Suppose we have a response y that takes

on either the value 0 or 1 depending on whether an event of interest occurs or not. Recall the child

respiratory data at the beginning of the course; here, y was 0 or 1 according to whether a child did not

or did “wheeze.”

Here, the response can take on only two possible values. Clearly, the normal distribution should not

even be considered as a model.

The Bernoulli probability distribution describes probabilities that a random variable Y that charac-

terizes whether an event occurs or not takes on its two possible values (0, 1). The probability density

function is given by

f(1) = P (Y = 1) = µ, f(0) = P (Y = 0) = 1− µ

for 0 ≤ µ ≤ 1. The extremes µ = 0, 1 are not particularly interesting, so we will consider 0 < µ < 1.

This may be summarized succinctly as

f(y) = P (Y = y) = µy(1− µ)(1−y), 0 < µ < 1, y = 0, 1. (11.3)

• It may be shown that the mean of Y is µ. Also, note that µ is also the probability of seeing the

event of interest (y = 1). As a probability, it must be between 0 and 1, so that the mean of Y

must be between 0 and 1 as well.

• Furthermore, it may be shown that the variance of Y is equal to µ(1−µ); i.e. var(Y ) = µ(1−µ).

As with the Poisson distribution, the variance of Y is nonconstant. Thus, if Y1 and Y2 are both

Bernoulli random variables, the only way that they can have the same variance is if they have

the same mean.

PAGE 428

Page 438: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 11 ST 732, M. DAVIDIAN

• This has implications for regression – if Y1 and Y2 correspond to binary responses taken at dif-

ferent settings of the covariates, so thus at possibly different mean values, it is inappropriate to

assume that they have the same variance. Thus, again, the usual assumption of constant variance

is clearly not sensible when modeling binary data.

EXAMPLE – MYOCARDIAL INFARCTION DATA: The response is often binary in medical studies.

Here, we consider an example in which 200 women participated in a study to investigate risk factors

associated with myocardial infarction (heart attack). On each woman, the following information was

observed:

• Whether the woman used oral contraceptives in the past year (1 if yes, 0 if no)

• Age in years

• Whether the woman currently smokes more than 1 pack of cigarettes per day (1 if yes, 0 if no)

• Whether the woman has suffered a myocardial infarction – the response (y = 0 if no, y = 1 if yes).

The data for the first 10 women are given below:

Woman Contracep. Age Smoke MI

1 1 33 1 0

2 0 32 0 0

3 1 37 0 1

4 0 36 0 0

5 1 50 1 1

6 1 40 0 0

7 0 35 0 0

8 1 33 0 0

9 1 33 0 0

10 0 31 0 0

The objective of this study was to determine whether any of the covariates, or potential risk factors

(oral contraceptive use, age, smoking), were associated with the chance of having a heart attack. For

example, was there evidence to suggest that smoking more than one pack of cigarettes a day raises the

probability of having a heart attack?

PAGE 429

Page 439: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 11 ST 732, M. DAVIDIAN

• If the data were normal, a natural approach to this question would be to postulate a regression

model that allows mean response (which is equal to probability of having a heart attack as this

is a binary response) to depend on age, smoking status, and contraceptive use.

• Define for the jth woman

xj1 = 1 if oral contraceptive use

= 0 otherwise

xj2 = age in years

xj3 = 1 if smoke more then one pack/day

= 0 otherwise

Then we would be tempted to model the mean (probability of heart attack) as a linear model,

writing the mean for the j observation

β0 + β1xj1 + β2xj2 + β3xj3.

• Using a linear function of the covariates like this to represent the mean (probability of heart

attack) has an immediate problem. Because the mean is a probability, it must be between 0 and

1. There is nothing to guarantee that the estimates of means we would end up with after fitting

this model in the usual way would honor this restriction. Thus, we could end up with negative

estimates of probabilities, or estimated probabilities that were greater than one! More on this

later.

CONTINUOUS DATA WITH CONSTANT COEFFICIENT OF VARIATION – THE GAMMA DIS-

TRIBUTION: As we have already remarked, just because the response is continuous does not mean

that the normal distribution is a sensible probability model.

• For example, most biological responses take on only positive values. The normal distribution in

principle assigns positive probability to all values on the real line, negative and positive.

PAGE 430

Page 440: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 11 ST 732, M. DAVIDIAN

• Furthermore, the normal distribution says that values to the left and right of its mean are equally

likely to be seen, by virtue of the symmetry inherent in the form of the probability density.

This may not be realistic for biological and other kinds of data. A common phenomenon is to

see “unusually large” values of the response with more frequency than “unusually small” values.

For example, if the response is annual income, the distribution of incomes is mostly in a limited

range; however, every so often, a “chairman of the board,” athlete, or entertainer may command

an enormous income. For this situation, a distribution that says small and large values of the

response are equally likely is not suitable.

Other probability models are available for continuous response that better represent these features.

Several such models are possible; we consider one of these.

The gamma probability distribution describes the probabilities with which a random variable Y takes

on values, where Y can only be positive. More precisely, the probability density function for value y

is given by

f(y) =1

yΓ(1/σ2)

(y

σ2µ

)1/σ2

exp(− y

σ2µ

), µ, σ2 > 0, y > 0. (11.4)

• In (11.4), Γ(·) is the so-called “Gamma function.” This function of a positive argument may only

be evaluated on a computer. If the argument is a positive integer k, however, then it turns out

that Γ(k) = (k − 1)! = (k − 1)(k − 2) · · · (2)(1).

• It may be shown that the mean of Y is µ; i.e. E(Y ) = µ. Note that µ must be positive, which

makes sense.

• It may also be shown that the variance of Y is var(Y ) = σ2µ2. That is, the variance of Y is

nonconstant; it depends on the value of µ. Thus, if Y1 and Y2 are both gamma random variables,

then the only way that they can have the same variance is if they have the same mean µ and the

same value of the parameter σ2.

• Thus, for regression, if Y1 and Y2 correspond to responses taken at different covariate settings, it is

inappropriate to take them to have the same variance. Thus, as above, the assumption of constant

variance is not appropriate for a response that is well-represented by the gamma probability model.

PAGE 431

Page 441: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 11 ST 732, M. DAVIDIAN

• In fact, note here that the symbol σ2 is being used here in a different way from how we have

used it in the past, to represent a variance. Here, it turns out that σ (not squared) has the

interpretation as the coefficient of variation (CV), defined for any random variable Y as

CV ={var(Y )}1/2

E(Y );

that is, CV is the ratio of standard deviation of the response to mean, or “noise to signal.”

This ratio may be expressed as a proportion or a percentage; in either case, CV characterizes

the “quality” of the data by quantifying how large the “noise” is relative to the size of the thing

being measured.

• “Small” CV (“high quality”) is usually considered to be CV ≤ 0.30. “Large” CV (“low quality”)

is larger.

• Note that for the gamma distribution,

CV =(σ2µ2)1/2

µ= σ,

so that, regardless of the value of µ, the ratio of “noise” to “signal” is the same. Thus, rather than

having constant variance, the gamma distribution imposes constant coefficient of variation.

This is often a realistic model for biological, income, and other data taking on positive values.

Figure 2 shows gamma probability density functions for µ = 1 and progressively smaller choices of σ2,

corresponding to progressively smaller CV.

• As σ2 becomes smaller, the shape of the curve begins to look more symmetric. Thus, if CV

is “small” (“high quality” data), gamma probability distribution looks very much like a normal

distribution.

• On the other hand, when σ2 is relatively large, so that CV is “large” (“low quality” data), the

shape is skewed. For example, with σ2 = 0.5, corresponding to CV = 0.707, so “noise” that is

70% the magnitude of the “signal” (upper left panel of Figure 2), the shape of the gamma density

does not resemble that of the normal at all.

PAGE 432

Page 442: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 11 ST 732, M. DAVIDIAN

Figure 2: Gamma probability density functions.

y

0 1 2 3 4

0.0

0.2

0.4

0.6

0.8

1.0

y

0 1 2 3 4

0.0

0.2

0.4

0.6

0.8

1.0

y

0 1 2 3 4

0.0

0.5

1.0

1.5

2.0

y

0 1 2 3 4

0.0

0.5

1.0

1.5

2.0

µ = 1, σ2 = 0.5 µ = 1, σ2 = 0.2

µ = 1, σ2 = 0.1 µ = 1, σ2 = 0.05

EXAMPLE – CLOTTING TIME DATA: In the development of clotting agents, it is common to perform

in vitro studies of time to clotting. The following data are reported in McCullagh and Nelder (1989,

section 8.4.2), and are taken from such a study. Here, samples of normal human plasma were diluted to

one of 9 different percentage concentrations with prothrombin-free plasma; the higher the dilution, the

more the interference with the blood’s ability to clot, because the blood’s natural clotting capability

has been weakened. For each sample, clotting was induced by introducing thromboplastin, a clotting

agent, and the time until clotting occurred was recorded (in seconds). 5 samples were measured at each

of the 9 percentage concentrations, and the mean clotting times were averaged; thus, the response is

mean clotting time over the 5 samples. The response is plotted against percentage concentration (on

the log scale) in the upper left panel of Figure 3. We will discuss the other panels of the figure shortly.

It is well-recognized that this type of response, which is by its nature always positive, does not exhibit

the same variability at all levels. Rather, large responses tend to be more variable than small ones, and

a constant coefficient of variation model is often a suitable model for this nonconstant variation.

PAGE 433

Page 443: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 11 ST 732, M. DAVIDIAN

Figure 3: Clotting times (seconds) for normal plasma diluted to 9 different concentrations with

prothrombin-free plasma. In the lower right panel, the solid line is the loglinear fit, the dashed line

is the reciprocal (inverse) fit.

••

• • • • •

log (percentage conc of plasma)

mea

n cl

ottin

g tim

e

5 10 50 100

2040

6080

100

120

Original scale

••

••

••

log (percentage conc of plasma)

1/m

ean

clot

ting

time

5 10 50 100

0.01

0.02

0.03

0.04

0.05

0.06

Reciprocal scale

••

• •• • •

log (percentage conc of plasma)

log

(mea

n cl

ottin

g tim

e)

5 10 50 100

2.5

3.0

3.5

4.0

4.5

Log scale

••

• • • • •

log (percentage conc of plasma)

mea

n cl

ottin

g tim

e

5 10 50 100

2040

6080

100

120

Original scale with fits

From the plot, it is clear that a straight-line model for mean response as a function of log(percentage

concentration) would be inappropriate. A quadratic model seems better, but, because such models

eventually curve “back up,” this might not be a good model, either. In the upper right and lower left

panels, the reciprocals (1/y) and logarithms (log y) of the response, respectively, are plotted against

log(percentage concentration). These appear to be roughly like straight lines, the former more-so than

the latter. We will return to the implications of these two plots for choosing a model for mean response

shortly. Note, of course, that a sensible model for mean response would be one that honors the positivity

restriction for the response.

Also noticeable from the plot is that the data are of “high quality” – the pattern of change in the

response with log(percentage concentration) is very clear and smooth, with very little “noise.” This

would suggest that if the data really are well-represented by the gamma probability distribution, then

the coefficient of variation is “small.” From the plot, it is very difficult to see any evidence of that the

variance really is nonconstant as the response changes – this is due to the fact that variation is just so

small, so it is hard to pick up by eye.

We will return to these data shortly.

PAGE 434

Page 444: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 11 ST 732, M. DAVIDIAN

SUMMARY: The Poisson, Bernoulli, and gamma distributions are three different probability distribu-

tions that are well-suited to modeling data in the form of counts, binary response, and positive contin-

uous response where constant coefficient of variation is more likely than constant variance, respectively.

As mentioned above, still other probability distributions for other situations are available; discussion

of these is beyond our scope here, but the implications are similar to the cases we have covered. We

now turn to regression modeling in the context of problems where these probability distributions are

appropriate.

11.3 Generalized linear models

THE CLASSICAL LINEAR REGRESSION MODEL: The classical linear regression model for scalar

response Yj and k covariates xj1, . . . , xjk is usually written as

Yj = β0 + β1xj1 + · · ·+ βkxjk + εj

or, defining xj = (1, xj1, . . . , xjk)′, where xj is (p× 1), p = k + 1,

Yj = x′jβ + εj , β = (β0, . . . , βk)′. (11.5)

The Yj are assumed to be independent across j. When the response is continuous, it is often assumed

that the εj are independent N (0, σ2), so that

Yj ∼ N (x′jβ, σ2).

That is, the classical, normal-based regression model may be summarized as:

(i) Mean: E(Yj) = x′jβ.

(ii) Probability distribution: Yj follow a normal distribution for all j and are independent.

(iii) Variance: var(Yj) = σ2 (constant regardless of the setting of xj).

As we have discussed through our examples, this approach has several deficiencies as a model for count,

binary, or some positive continuous data:

• The normal distribution may not be a good probability model.

• Variance may not be constant across the range of the response.

PAGE 435

Page 445: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 11 ST 732, M. DAVIDIAN

• Because the response (and its mean) are restricted to be positive, a model that does not build

this in may be inappropriate – in (11.5), there is nothing that says that estimates of the mean

response must be positive everywhere – it could very well be that the estimated value of β could

produce negative mean estimates for some covariate settings, even if ideally this is not possible

for the problem at hand.

Models appropriate for the situations we have been discussing would have to address these issues.

GENERALIZATION: For responses that are not well represented by a normal distribution, it is not

customary to write models in the form of (11.5) above, with an additive deviation.. This is because, for

distributions like the Poisson, Bernoulli, or gamma, there is no analogue to the fact that if ε is normally

distributed with mean 0, variance σ2, then Y = µ + ε is also normal with mean µ, variance σ2.

It is thus standard to express regression models as we did in (i), (ii), and (iii) above – in terms of (i) an

assumed model for the mean, (ii) an assumption about probability distribution, and (iii) an assumption

about variance. As we have noted, for the Poisson, Bernoulli, and gamma distributions, the form of the

distribution dictates the assumption about variance.

We now show how this modeling is done for the three situations on which we have focused. We will then

highlight the common features. Because these models are more complex that usual linear regression

models, special fitting techniques are required, and will be discussed in section 11.4.

COUNT DATA: For data in the form of counts, we have noted that a sensible probability model is the

Poisson distribution. This model dictates that variance is equal to the mean; moreover, any sensible

representation of the mean ought to be such that the mean is forced to be positive.

(i) Mean: For regression modeling, we wish to represent the mean for Yj as a function of the

covariates xj . However, this representation should ensure the mean can only be positive. A

model that would accomplish this is

E(Yj) = exp(β0 + β1xj1 + · · ·+ βkxjk) = exp(x′jβ). (11.6)

In (11.6), the positivity requirement is enforced by writing the mean as the exponential of the

linear function of β x′jβ. Note that the model implies

log{E(Yj)} = β0 + β1xj1 + · · ·+ βkxjk = x′jβ;

i.e. the logarithm of the mean response is being modeled as a linear function of covariates and

regression parameters. As a result, a model like (11.6) is often called a loglinear model.

PAGE 436

Page 446: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 11 ST 732, M. DAVIDIAN

Loglinear modeling is a standard technique for data in the form of counts, especially when the

counts are small. When the counts are small, it is quite possible that using a linear model

instead, E(Yj) = x′jβ, would lead to an estimated value for β that would allow estimates of the

mean to be negative for some covariate settings. This is less of a worry when the counts are very

large. Consequently, loglinear modeling is most often employed for small count data.

It is important to note that a loglinear model for the mean response is not the only possibility

for count data. However, it is the most common.

(ii) Probability distribution: The Yj are assumed to arise at each setting xj from a Poisson

distribution with mean as in (11.6) and are assumed to be independent.

(iii) Variance: Under the Poisson assumption and the mean model (11.6), we have that the variance

of Yj is given by

var(Yj) = E(Yj) = exp(x′jβ) (11.7)

BINARY DATA: For binary data, the relevant probability model is the Bernoulli distribution. Here, the

mean is also equal to the probability of seeing the event of interest; thus, the mean should be restricted

to lie between 0 and 1. In addition, the model dictates that the variance of a response is a particular

function of the mean.

(i) Mean: For regression modeling, we wish to represent the mean for Yj as a function of the

covariates xj with the important restriction that this function always be between 0 and 1. A

model that accomplishes this is

E(Yj) =exp(x′

jβ)1 + exp(x′

jβ). (11.8)

Note that, regardless of the value of the linear combination x′jβ, this function must always

be less than 1. Similarly, the function must always be greater than 0. (Convince yourself).

It is an algebraic exercise to show that (try it!)

log

(E(Yj)

1− E(Yj)

)= x′

jβ. (11.9)

The function of E(Yj) on the left hand side of (11.9) is called the logit function. Recall that here

E(Yj) is equal to the probability of seeing the event of interest. Thus, the function(E(Yj)

1− E(Yj)

)

is the ratio of the probability of seeing the event of interest to the probability of not seeing it!

PAGE 437

Page 447: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 11 ST 732, M. DAVIDIAN

This ratio is often called the odds for this reason. Thus, the model (11.8) may be thought of as

modeling the log odds as a linear combination of the covariates and regression parameters.

Model (11.8) is not the only model appropriate for representing the mean of a Bernoulli random

variable; any function taking values only between 0 and 1 would do. Other such models are

the probit and complementary log-log functions (see McCullagh and Nelder 1989, page 31).

However, (11.8) is by far the most popular, and the model is usually referred to as the logistic

regression model (for binary data).

(ii) Probability distribution: The Yj are assumed to arise at each setting xj from a Bernoulli

distribution with mean as in (11.8) and are assumed to be independent.

(iii) Variance: For binary data, if the mean is represented by (11.8), then we must have that the

variance of Yj is given by

var(Yj) = E(Yj){1− E(Yj)} =exp(x′

jβ)1 + exp(x′

jβ)

(1− exp(x′

jβ)1 + exp(x′

jβ)

)(11.10)

CONTINUOUS, POSITIVE DATA WITH CONSTANT COEFFICIENT OF VARIATION: For these

data, there are a number of relevant probability models; we have discussed the gamma distribution.

Here, the mean must be positive, and the variance must have the constant CV form.

(i) Mean: For regression modeling, we wish to represent the mean for Yj as a function of the

covariates xj If the size of the responses is not too large, then using a linear model, E(Yj) = x′jβ

could be dangerous; thus, it is preferred to use a model that enforces positivity. One common

model is the loglinear model (11.6), which is also commonly used for count data. Both types of

data share the requirement of positivity, so this is not surprising.

When the size of the response is larger, it is often the case that the positivity requirement is not

a big concern – even if a linear model is used to represent the data, because the responses are

all so big, estimated means will still all be positive for covariate settings like those of the original

data. This opens up the possibility for other models for the mean.

With a single covariate (k = 1), linear models are seldom used – here, the linear model would be

a straight line. This is because it is fairly typical that, for phenomena where constant coefficient

of variation occurs, the relationship between response and covariate seldom looks like a straight

line; rather it tends to look more like that in the upper left panel of Figure 3.

PAGE 438

Page 448: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 11 ST 732, M. DAVIDIAN

Note that in the lower left panel of Figure 3, once the response is placed on the log scale, the

relationship looks much more like a straight line. This suggests that a model like

log{E(Yj)} = β0 + β1xj ,

where xj = log percent concentration, might be reasonable; that is, log of response is a straight

line in xj . This is exactly the loglinear model (11.6) in the special case k = 1, of course.

However, note that in the upper right panel, once the response is inverted by taking the recip-

rocal (so plotting 1/Yj on the vertical axis), the relationship looks even more like a straight line.

This observation indicates that a model like

1E(Yj)

= β0 + β1xj

might be appropriate.

More generally, for k covariates, this suggests the model

E(Yj) =1

x′jβ

. (11.11)

This model does not preserve the positivity requirement; however, for situations where this is

not really a concern, the inverse or reciprocal model (11.11) often gives a better representation

than does a plain linear model for E(Yj), as was the case for the clotting time data.

(ii) Probability distribution: The Yj are assumed to arise at each setting xj from a gamma distri-

bution with mean as in (11.6), (11.11), or some other model deemed appropriate. The Yj are also

assumed to be independent.

(iii) Variance: Under the gamma assumption, the variance of Yj is proportional to the square of the

mean response; i.e. constant coefficient of variation. Thus, if the mean is represented by (11.6),

then we must have that the variance of Yj is given by

var(Yj) = σ2E(Yj)2 = σ2{exp(x′jβ)}2. (11.12)

If the mean is represented by (11.11), then we must have that

var(Yj) = σ2E(Yj)2 = σ2

(1

x′jβ

)2

. (11.13)

PAGE 439

Page 449: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 11 ST 732, M. DAVIDIAN

IN GENERAL: All of the regression models we have discussed share the features that

• Appropriate models for mean response are of the form

E(Yj) = f(x′jβ), (11.14)

where f(x′jβ) is a suitable function of a linear combination of the covariates xj and regression

parameter β.

• The variance of Yj may be represented as a function of the form

var(Yj) = φV {E(Yj) } = φV { f(x′jβ) }, (11.15)

where V is a function of the mean response and φ is a constant usually assumed to be the same

for all j. For the Poisson and Bernoulli cases, φ = 1; for the gamma case, φ = σ2.

SCALED EXPONENTIAL FAMILY: It turns out that these regression models share even more. It was

long ago recognized that certain probability distributions all fall into a general class. For distributions

in this class, if the mean is equal to µ, then the variance must be a specific function φV (µ) of µ.

Distributions in this class include:

• The normal distribution with mean µ, variance σ2 (not related to µ in any way, so a function of

µ that is the same for all µ).

• The Poisson distribution with mean µ, variance µ.

• The gamma distribution with mean µ, variance σ2µ2.

• The Bernoulli distribution with mean µ, variance µ(1− µ).

The class includes other distributions we have not discussed as well. This class of distributions is known

as the scaled exponential family. As we will discuss in section 11.4, because these distributions share

so much, fitting regression models under them may be accomplished by the same method.

PAGE 440

Page 450: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 11 ST 732, M. DAVIDIAN

GENERALIZED LINEAR MODELS: We are now in a position to state all of this more formally. A

generalized linear model is a regression model for response Yj with the following features:

• The mean of Yj is assumed to be of the form (11.14)

E(Yj) = f(x′jβ).

It is customary to express this a bit differently, however. The function f is almost always chosen

to be monotone; that is, it is a strictly increasing or decreasing function of x′jβ. This

means that there is a unique function g, say, called the inverse function of f , such that we may

re-express (11.14) model in the form

g{E(Yj)} = x′jβ.

For example, for binary data, we considered the logistic function (11.8); i.e.

E(Yj) = f(x′jβ) =

exp(x′jβ)

1 + exp(x′jβ)

.

This may be rewritten in the form (11.9),

log

(E(Yj)

1− E(Yj)

)= g{E(Yj)} = x′

jβ.

The function g is called the link function, because it “links” the mean and the covariates. The

linear combination of covariates and regression parameters x′jβ is called the linear predictor.

Certain choices of f , and hence of link function g, are popular for different kinds of data, as we

have noted.

• The probability distribution governing Yj is assumed to be one of those from the scaled expo-

nential family class.

• The variance of Yj is thus assumed to be of the form dictated by the distribution:

var(Yj) = φV {E(Yj) },

where the function V depends on the distribution and φ might be equal to a known constant.

The function V is referred to as the variance function for obvious reasons. The parameter φ is

often called the dispersion parameter because it has to do with variance. It may be known,

as for the Poisson or Bernoulli distributions, or unknown and estimated, which is the case for the

gamma.

The models we have discussed for count, binary, and positive continuous data are thus all generalized

linear models. In fact, the classical linear regression model assuming normality with constant variance

is also a generalized linear model!

PAGE 441

Page 451: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 11 ST 732, M. DAVIDIAN

11.4 Maximum likelihood and iteratively reweighted least squares

The class of generalized linear models may be thought of as extending the usual classical linear model

to handle special features of different kinds of data. The extension introduces some complications,

however. In particular:

• The model for mean response need no longer be a linear model.

• The variance is allowed to depend on the mean; thus, the variance depends on the regression

parameter β.

The result of these more complex features is that it is no longer quite so straightforward to estimate

β (and φ, if required). To appreciate this, we first review the method of least squares for the normal,

linear, constant variance model.

LINEAR MODEL AND MAXIMUM LIKELIHOOD: For the linear model with constant variance σ2

and normality, the usual method of least squares involves minimizing in β the distance criterion

n∑j=1

(yj − x′jβ)2, (11.16)

where y1, . . . , yn are observed data. This approach has another motivation – the estimator of β obtained

in this way is the maximum likelihood estimator. In particular, write the observed data as y =

(y1, . . . , yn)′. Because the Yj are assumed independent, the joint density of all the data (that is, the

joint density of Y ), is just the product of the n individual normal densities:

f(y) =n∏

j=1

(2π)−1/2σ−1 exp{−(yj − x′jβ)2/(2σ2)}.

It is easy to see that the only place that β appears is in the exponent; thus, if we wish to maximize

the likelihood f(y), we must maximize the exponent. Note that the smaller (Yj − x′jβ)2 gets, the

larger the exponent gets (because of the negative sign). Thus, to maximize the likelihood, we wish

to minimize (11.16), which corresponds exactly to the method of least squares!

• Thus, obtaining the least squares estimator in a linear regression model under the normality and

constant variance assumptions is the same as finding the maximum likelihood estimator.

• In this case, minimizing (11.16) may be done analytically; that is, we can write down an explicit

expression for the estimator (as a function of the random vector Y ):

β = (X ′X)−1X ′Y ,

PAGE 442

Page 452: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 11 ST 732, M. DAVIDIAN

where X is the usual design matrix.

• This follows from calculus – the minimizing value of (11.16) is found by setting the first derivative

of the equation to 0 and solving for β. That is, the least squares (ML) estimator solves the set of

p equationsn∑

j=1

(Yj − x′jβ)xj = 0. (11.17)

• Note that the the estimator and the equation it solves are linear functions of the data Yj .

GENERALIZED LINEAR MODELS AND MAXIMUM LIKELIHOOD: A natural approach to esti-

mating β in all generalized linear models is thus to appeal to the principle of maximum likelihood. It is

beyond the scope of our discussion to give a detailed treatment of this. We simply remark that it turns

out that, fortuitously, the form of the joint density of random variables Y1, . . . , Yn that arise from any

of the distributions in the scaled exponential family class has the same general form. Thus, it turns out

that the ML estimator for β in any generalized linear model solves a set of p equations of the same

general form:n∑

j=1

1V {f(x′

jβ)}{Yj − f(x′jβ)}f ′(x′

jβ)xj = 0, (11.18)

where f ′(u) =d

duf(u), the derivative of f with respect to its argument.

The equation (11.18) and the equation for the linear, normal, constant variance model (11.17) share

the feature that they are both linear functions of the data Yj and are equations we would like to solve

in order to obtain the maximum likelihood estimator for β. Thus, they are very similar in spirit.

However, they differ in several ways:

• Each deviation {Yj − f(x′jβ)} in (11.18) is weighted in accordance with its variance (the

scale parameter φ is a constant). Of course, so is each deviation in (11.17); however, in that

case, the variance is constant for all j. Recall that weighting in accordance with variance is a

sensible principle, so it is satisfying to see that, despite the difference in probability distributions,

this principle is still followed. Here, the variance function depends on β, so now the weighting

depends on β! Thus, β appears in this equation in a very complicated way.

• Moreover, β also appears in the function f , which can be quite complicated – the function f is

certainly not a linear function of β!

The result of these differences is that, while it is possible to solve (11.17) explicitly, it is not possible

to do the same for (11.18). Rather, the solution to (11.18) must be found using a numerical algorithm.

PAGE 443

Page 453: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 11 ST 732, M. DAVIDIAN

The numerical algorithm is straightforward and works well in practice, so this is not an enormous

drawback.

ITERATIVELY REWEIGHTED LEAST SQUARES: It turns out that there is a standard algorithm

that is applicable for solving equations of the form (11.18); discussion of the details is beyond our scope.

The basic idea is (operating on the observed data)

• Given a starting value, or guess, for β, β(0), say, evaluate the weights at β(0): 1/V {f(xj , β(0))}.

• Pretending the weights are fixed constants not depending on β, solve equation (11.18). This still

requires a numerical technique, but may be accomplished by something that is approximately

like solving (11.17). This gives a new guess for β, β(1), say.

• Evaluate the weights at β(1). and repeat. Continue updating until two successive β values are the

same.

The repeatedly updating of the weights along with the approximation to solve an equation like (11.17)

gives this procedure its name: iteratively reweighted least squares, often abbreviated as IRWLS

or IWLS.

Luckily, there are standard ways to find the starting value based on the data and knowledge of the

assumed probability distribution. Thus, the user need not be concerned with this (usually); software

typically generates this value automatically.

SAMPLING DISTRIBUTION: It should come as no surprise that the sampling distribution of the

estimator β solving (11.18) cannot be derived in closed form. Rather, it is necessary to resort to

large sample theory approximation. Here, “large sample” refers to the sample size, n (number of

independent observations). This is sensible – each Yj is typically from a different unit.

We now state the large sample result. For n “large,” the IRWLS/ML estimator satisfies

β·∼ N{β, φ(∆′V −1∆)−1}. (11.19)

Here,

• ∆ is a (n× p) matrix whose (j, s) element (j = 1, . . . , n, s = 1, . . . , p) is the derivative of f(x′jβ)

with respect to the sth element of β.

• V is the (n× n) diagonal matrix with diagonal elements V {f(x′jβ)}.

PAGE 444

Page 454: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 11 ST 732, M. DAVIDIAN

A little thought about the form of ∆ and V reveals that both depend on β. However, β is unknown

and has been estimated. In addition, if φ is not dictated to be equal to a specific constant (e.g. φ = 1

if Yj are Poisson or Bernoulli but is unknown if Yj is gamma), then it, too, must be estimated. In this

situation, the standard estimator for φ is

φ = (n− p)−1n∑

j=1

{Yj − f(x′jβ)}2

V {f(x′jβ)} .

In the context of fitting generalized linear models, this is often referred to as the Pearson chi-square

(divided by its degrees of freedom). Other methods are also available; we use this method for illustration

in the examples of section 11.6.

Thus, it is customary to approximate (11.19) by replacing β and φ by estimates wherever they appear.

Standard errors for the elements of β are then found as the square roots of the diagonal elements of

the matrix

V β = φ(∆′V

−1∆)−1,

where the “hats” mean that β and φ are replaced by estimates. We use the same notation, V β, as in

previous chapters to denote the estimated covariance matrix; the definition of V β should be clear from

the context.

HYPOTHESIS TESTS: It is common to use Wald testing procedures to test hypotheses about β.

Specifically, for null hypotheses of the form

H0 : Lβ = h,

we may approximate the sampling distribution of the estimate Lβ by

Lβ·∼ N (Lβ, LV βL′).

Construction of test statistics and confidence intervals is then carried out in a fashion identical to that

discussed in previous chapters. For example, if L is a row vector, then one may form the “z-statistic”

z =Lβ − h

SE(Lβ).

More generally, the Wald χ2 test statistic would be

(Lβ − h)′(LV βL′)−1(Lβ − h)

(of course = z2 in the case L has a single row).

PAGE 445

Page 455: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 11 ST 732, M. DAVIDIAN

REMARK: Note that all of this looks very similar to what is done in classical, linear regression under

the assumption of constant variance and normality. The obvious difference is that the results are now

just large sample approximations rather than exact, but the form and spirit are the same.

11.5 Discussion

Generalized linear models may be regarded as an extension of classical linear regression when the usual

assumptions of normality and constant variance do not apply. Because of the additional considerations

imposed by the nature of the data, sensible models for mean response may no longer be linear functions

of covariates and regression parameters directly. Rather, the mean response is modeled as a function

(nonlinear) of a linear combination of covariates and regression parameters (the linear predictor).

Although the models and fitting methods become more complicated as a result, the spirit is the same.

11.6 Implementation with SAS

We illustrate how to carry out fitting of generalized linear models for the three examples discussed in

this section:

1. The horsekick data

2. The myocardial infarction data

3. The clotting times data

As our main objective is to gain some familiarity with these models in order to appreciate their extension

to the case of longitudinal data from m units, we do not perform detailed, comprehensive analyses

involving many questions of scientific interest. Rather, we focus mainly on how to specify models using

SAS PROC GENMOD and how to interpret the output. In the next chapter, we will use PROC GENMOD with

the REPEATED statement to fit longitudinal data.

PAGE 446

Page 456: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 11 ST 732, M. DAVIDIAN

EXAMPLE 1 – HORSEKICK DATA: Recall that it was reasonable to model these data using the

Poisson distribution assumption. Define Yj to be the jth observations of number of horsekick deaths

suffered corresponding to a particular corps and year denoted by dummy variables

xjk = 1 if observation j is from year k = 1875, . . . , 1893

= 0 otherwise

zjk = 1 if observation j is from corps k = 1, . . . , 9

= 0 otherwise

We thus consider the loglinear model

E(Yj) = exp(β0 + β1xj1 + · · ·+ β19xj,19 + β20zj1 + · · ·+ β28zj9) (11.20)

for the mean response. This model represents the mean number of horse kicks as an exponential function;

for example, for j corresponding to 1894 and corps 10,

E(Yj) = exp(β0);

for j corresponding to 1875 and corps 1,

E(Yj) = exp(β0 + β1 + β20).

An obvious question of interest would be to determine whether some of the regression parameters are

different from 0, indicating that the particular year or corps to which they correspond does not differ

from the final year and corps (1894, corps 10). This may be addressed by inspecting the Wald test

statistics corresponding to each element of β. To address the issue of how specific years compared,

averaged across corps, one would be interested in whether the appropriate differences in elements of

β were equal to zero. For example, if we were interested in whether 1875 and 1880 were different, we

would be interested in the difference β1 − β6.

PAGE 447

Page 457: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 11 ST 732, M. DAVIDIAN

PROGRAM:

/******************************************************************

CHAPTER 11, EXAMPLE 1

Fit a loglinear regression model to the horse-kick data.(Poisson assumption)

******************************************************************/

options ls=80 ps=59 nodate; run;

/******************************************************************

The data look like (first 6 records)

1875 0 0 0 0 1 1 0 0 1 01876 0 0 1 0 0 0 0 0 1 11877 0 0 0 0 1 0 0 1 2 01878 2 1 1 0 0 0 0 1 1 01879 0 1 1 2 0 1 0 0 1 01880 2 1 1 1 0 0 2 1 3 0

.

.

.

column 1 yearcolumns 2-11 number of fatal horsekicks suffered by corps 1-10.

******************************************************************/

data kicks; infile ’kicks.dat’;input year c1-c10;

run;

/******************************************************************

Reconfigure the data so that the a single number of kicksfor a particular year/corps combination appears on a separateline.

******************************************************************/

data kicks2; set kicks;array c{10} c1-c10;do corps=1 to 10;kicks = c{corps};output;

end;drop c1-c10;

run;

proc print data=kicks2 ; run;

/*****************************************************************

Fit the loglinear regression model using PROC GENMOD. Here,the dispersion parameter phi=1, so is not estimated. We let SASform the dummy variables through use of the CLASS statement.This results in the model for mean response being parameterizedas in equation (11.20).

The DIST=POISSON option in the model statement specifiesthat the Poisson probability distribution assumption, with itsrequirement that mean = variance, be used. The LINK=LOG optionasks for the loglinear model. Other LINK= choices are available.

We also use a CONTRAST statement to investigate whether there isevidence to suggest that 1875 differed from 1880 in terms of numbersof horsekick deaths. The WALD option asks that the usual large samplechi-square test statistic be used as the basis for the test.

*****************************************************************/

proc genmod data=kicks2;class year corps;model kicks = year corps / dist = poisson link = log;contrast ’1875-1880’ year 1 0 0 0 0 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 / wald;

run;

PAGE 448

Page 458: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 11 ST 732, M. DAVIDIAN

OUTPUT: Following the output, we comment on a few aspects of the output.

The SAS System 1

Obs year corps kicks

1 1875 1 02 1875 2 03 1875 3 04 1875 4 05 1875 5 16 1875 6 17 1875 7 08 1875 8 09 1875 9 1

10 1875 10 011 1876 1 012 1876 2 013 1876 3 114 1876 4 015 1876 5 016 1876 6 017 1876 7 018 1876 8 019 1876 9 120 1876 10 121 1877 1 022 1877 2 023 1877 3 024 1877 4 025 1877 5 126 1877 6 027 1877 7 028 1877 8 129 1877 9 230 1877 10 031 1878 1 232 1878 2 133 1878 3 134 1878 4 035 1878 5 036 1878 6 037 1878 7 038 1878 8 139 1878 9 140 1878 10 041 1879 1 042 1879 2 143 1879 3 144 1879 4 245 1879 5 046 1879 6 147 1879 7 048 1879 8 049 1879 9 150 1879 10 051 1880 1 252 1880 2 153 1880 3 154 1880 4 155 1880 5 0

The SAS System 2

Obs year corps kicks

56 1880 6 057 1880 7 258 1880 8 159 1880 9 360 1880 10 061 1881 1 062 1881 2 263 1881 3 164 1881 4 065 1881 5 166 1881 6 067 1881 7 168 1881 8 069 1881 9 070 1881 10 071 1882 1 072 1882 2 073 1882 3 074 1882 4 075 1882 5 076 1882 6 177 1882 7 178 1882 8 2

PAGE 449

Page 459: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 11 ST 732, M. DAVIDIAN

79 1882 9 480 1882 10 181 1883 1 182 1883 2 283 1883 3 084 1883 4 185 1883 5 186 1883 6 087 1883 7 188 1883 8 089 1883 9 090 1883 10 091 1884 1 192 1884 2 093 1884 3 094 1884 4 095 1884 5 196 1884 6 097 1884 7 098 1884 8 299 1884 9 1

100 1884 10 1101 1885 1 0102 1885 2 0103 1885 3 0104 1885 4 0105 1885 5 0106 1885 6 0107 1885 7 2108 1885 8 0109 1885 9 0110 1885 10 1

The SAS System 3

Obs year corps kicks

111 1886 1 0112 1886 2 0113 1886 3 1114 1886 4 1115 1886 5 0116 1886 6 0117 1886 7 1118 1886 8 0119 1886 9 3120 1886 10 0121 1887 1 2122 1887 2 1123 1887 3 0124 1887 4 0125 1887 5 2126 1887 6 1127 1887 7 1128 1887 8 0129 1887 9 2130 1887 10 0131 1888 1 1132 1888 2 0133 1888 3 0134 1888 4 1135 1888 5 0136 1888 6 0137 1888 7 0138 1888 8 0139 1888 9 1140 1888 10 0141 1889 1 1142 1889 2 1143 1889 3 0144 1889 4 1145 1889 5 0146 1889 6 0147 1889 7 1148 1889 8 2149 1889 9 0150 1889 10 2151 1890 1 0152 1890 2 2153 1890 3 0154 1890 4 1155 1890 5 2156 1890 6 0157 1890 7 2158 1890 8 1159 1890 9 2160 1890 10 2161 1891 1 0162 1891 2 1163 1891 3 1

PAGE 450

Page 460: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 11 ST 732, M. DAVIDIAN

164 1891 4 1165 1891 5 1

The SAS System 4

Obs year corps kicks

166 1891 6 1167 1891 7 0168 1891 8 3169 1891 9 1170 1891 10 0171 1892 1 2172 1892 2 0173 1892 3 1174 1892 4 1175 1892 5 0176 1892 6 1177 1892 7 1178 1892 8 0179 1892 9 1180 1892 10 0181 1893 1 0182 1893 2 0183 1893 3 0184 1893 4 1185 1893 5 2186 1893 6 0187 1893 7 0188 1893 8 1189 1893 9 0190 1893 10 0191 1894 1 0192 1894 2 0193 1894 3 0194 1894 4 0195 1894 5 0196 1894 6 1197 1894 7 0198 1894 8 1199 1894 9 0200 1894 10 0

The SAS System 5

The GENMOD Procedure

Model Information

Data Set WORK.KICKS2Distribution PoissonLink Function LogDependent Variable kicksObservations Used 200

Class Level Information

Class Levels Values

year 20 1875 1876 1877 1878 1879 1880 1881 1882 1883 18841885 1886 1887 1888 1889 1890 1891 1892 1893 1894

corps 10 1 2 3 4 5 6 7 8 9 10

Parameter Information

Parameter Effect year corps

Prm1 InterceptPrm2 year 1875Prm3 year 1876Prm4 year 1877Prm5 year 1878Prm6 year 1879Prm7 year 1880Prm8 year 1881Prm9 year 1882Prm10 year 1883Prm11 year 1884Prm12 year 1885Prm13 year 1886Prm14 year 1887Prm15 year 1888Prm16 year 1889Prm17 year 1890Prm18 year 1891Prm19 year 1892Prm20 year 1893Prm21 year 1894

PAGE 451

Page 461: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 11 ST 732, M. DAVIDIAN

Prm22 corps 1Prm23 corps 2Prm24 corps 3Prm25 corps 4Prm26 corps 5Prm27 corps 6Prm28 corps 7Prm29 corps 8Prm30 corps 9Prm31 corps 10

The SAS System 6

The GENMOD Procedure

Criteria For Assessing Goodness Of Fit

Criterion DF Value Value/DF

Deviance 171 171.6395 1.0037Scaled Deviance 171 171.6395 1.0037Pearson Chi-Square 171 160.6792 0.9396Scaled Pearson X2 171 160.6792 0.9396Log Likelihood -161.8886

Algorithm converged.

Analysis Of Parameter Estimates

Standard Wald 95% Chi-Parameter DF Estimate Error Confidence Limits Square Pr > ChiSq

Intercept 1 -2.0314 0.7854 -3.5707 -0.4921 6.69 0.0097year 1875 1 0.4055 0.9129 -1.3837 2.1947 0.20 0.6569year 1876 1 0.4055 0.9129 -1.3837 2.1947 0.20 0.6569year 1877 1 0.6931 0.8660 -1.0042 2.3905 0.64 0.4235year 1878 1 1.0986 0.8165 -0.5017 2.6989 1.81 0.1785year 1879 1 1.0986 0.8165 -0.5017 2.6989 1.81 0.1785year 1880 1 1.7047 0.7687 0.1981 3.2114 4.92 0.0266year 1881 1 0.9163 0.8367 -0.7235 2.5561 1.20 0.2734year 1882 1 1.5041 0.7817 -0.0281 3.0363 3.70 0.0544year 1883 1 1.0986 0.8165 -0.5017 2.6989 1.81 0.1785year 1884 1 1.0986 0.8165 -0.5017 2.6989 1.81 0.1785year 1885 1 0.4055 0.9129 -1.3837 2.1947 0.20 0.6569year 1886 1 1.0986 0.8165 -0.5017 2.6989 1.81 0.1785year 1887 1 1.5041 0.7817 -0.0281 3.0363 3.70 0.0544year 1888 1 0.4055 0.9129 -1.3837 2.1947 0.20 0.6569year 1889 1 1.3863 0.7906 -0.1632 2.9358 3.07 0.0795year 1890 1 1.7918 0.7638 0.2948 3.2887 5.50 0.0190year 1891 1 1.5041 0.7817 -0.0281 3.0363 3.70 0.0544year 1892 1 1.2528 0.8018 -0.3187 2.8242 2.44 0.1182year 1893 1 0.6931 0.8660 -1.0042 2.3905 0.64 0.4235year 1894 0 0.0000 0.0000 0.0000 0.0000 . .corps 1 1 0.4055 0.4564 -0.4891 1.3001 0.79 0.3744corps 2 1 0.4055 0.4564 -0.4891 1.3001 0.79 0.3744corps 3 1 -0.0000 0.5000 -0.9800 0.9800 0.00 1.0000corps 4 1 0.3185 0.4647 -0.5923 1.2292 0.47 0.4931corps 5 1 0.4055 0.4564 -0.4891 1.3001 0.79 0.3744corps 6 1 -0.1335 0.5175 -1.1479 0.8808 0.07 0.7964corps 7 1 0.4855 0.4494 -0.3952 1.3662 1.17 0.2799corps 8 1 0.6286 0.4378 -0.2295 1.4867 2.06 0.1510corps 9 1 1.0986 0.4082 0.2985 1.8988 7.24 0.0071corps 10 0 0.0000 0.0000 0.0000 0.0000 . .Scale 0 1.0000 0.0000 1.0000 1.0000

NOTE: The scale parameter was held fixed.

The SAS System 7

The GENMOD Procedure

Contrast Results

Chi-Contrast DF Square Pr > ChiSq Type

1875-1880 1 3.98 0.0461 Wald

INTERPRETATION:

• Pages 1–4 of the output show the reconfigured data set.

PAGE 452

Page 462: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 11 ST 732, M. DAVIDIAN

• The results of running PROC GENMOD appear on pages 5–7 of the output. On page 6, the results

of the fit by IRWLS/ML are displayed. The table Analysis of Parameter Estimates contains

the estimates of the parameters β0 – β28, along with their estimated standard errors (square roots

of the elements of V β). The column Chi-Square gives the value of the Wald test statistic for

testing whether the parameter in that row is equal to zero.

• The row SCALE corresponds to φ; here, for the Poisson distribution, φ = 1, so nothing is estimated.

This is noted at the bottom of page 6 (The scale parameter was held fixed.).

• Page 7 shows the result of the contrast statement to address the null hypothesis that there was

no difference in mean horsekick deaths in 1875 and 1880 (see the program). The Wald test statistic

is 3.98 with an asociated p-value of 0.046, suggesting that there is some evidence to support a

difference. Note that if β1 and β6 are different, then the mean responses for 1875 and 1880 must

be different for any corps. However, note that the difference β1 − β6 does not correspond to the

actual difference in mean response. Inspection of the estimates of β1 and β6 on page 6 shows

β1 = 0.4055 and β6 = 1.7047. This suggests that the mean response for 1880, which depends on

exp(β6), is larger than that for 1875, which depends on exp(β1).

EXAMPLE 2 – MYOCARDIAL INFARCTION DATA: Here, the response (whether or not a woman

has suffered a myocardial infarction) is binary, so we wish to fit a generalized linear model assuming

the Bernoulli distribution. The mean function must honor the restriction of being between 0 and 1;

here, we fit the logistic regression model, using the logit link.

Recall that we defined

xj1 = 1 if oral contraceptive use

= 0 otherwise

xj2 = age in years

xj3 = 1 if smoke more then one pack/day

= 0 otherwise

Thus, we model the mean response, equivalently, the probability of suffering a heart attack, as

E(Yj) =exp(β0 + β1xj1 + β2xj2 + β3xj3)

1 + exp(β0 + β1xj1 + β2xj2 + β3xj3). (11.21)

Interest focuses on whether or not β1, β2, and β3. corresponding to the association of oral contraceptive

use, age, and smoking, respectively, with probability of myocardial infarction, are different from zero.

PAGE 453

Page 463: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 11 ST 732, M. DAVIDIAN

If β1 is different from zero, for example, the interpretation is that oral contraceptive use does change

the probability of suffering a heart attack. We say more about this shortly.

PROGRAM:

/******************************************************************

CHAPTER 11, EXAMPLE 2

Fit a logistic regression model to the myocardial infarctiondata.

******************************************************************/

options ls=80 ps=59 nodate; run;

/******************************************************************

The data look like (first 10 records)

1 1 33 1 02 0 32 0 03 1 37 0 14 0 36 0 05 1 50 1 16 1 40 0 07 0 35 0 08 1 33 0 09 1 33 0 010 0 31 0 0

.

.

.

column 1 subject idcolumn 2 oral contraceptive indicator (0=no,1=yes)column 3 age (years)column 4 smoking indicator (0=no,1=yes)column 5 binary response -- whether MI has been suffered

(0=no,1=yes)

******************************************************************/

data mi; infile ’infarc.dat’;input id oral age smoke mi;

run;

/*****************************************************************

Fit the logistic regression model using PROC GENMOD.We do not use a CLASS statement here, as the covariates areeither continuous (AGE) or already in "dummy" form (ORAL, SMOKE).The model statement with the LINK=LOGIT option results in thelogistic regression model in equation (10.21). The DIST=BINOMIALspecifies the Bernoulli distribution, which is the simplest caseof a binomial distribution.

In versions 7 and higher of SAS, PROC GENMOD will model bydefault the probability that the response y=0 rather thanthe conventional y=1! To make PROC GENMOD model probabilityy=1, as is standard, one must include the DESCENDING option inthe PROC GENMOD statement. In earlier versions of SAS, theprobability y=1 is modeled by default, as would be expected.

If the user is unsure which probability is being modeled, onecan check the .log file. In later versions of SAS, an explicitstatement about what is being modeled will appear. PROC GENMODoutput should also contain a statement about what is beingmodeled.

******************************************************************/

proc genmod data=mi descending;model mi = oral age smoke / dist = binomial link = logit;

run;

PAGE 454

Page 464: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 11 ST 732, M. DAVIDIAN

OUTPUT: Following the output, we comment on a few aspects of the output.

The SAS System 1

The GENMOD Procedure

Model Information

Data Set WORK.MIDistribution BinomialLink Function LogitDependent Variable miObservations Used 200

Response Profile

Ordered TotalValue mi Frequency

1 1 432 0 157

PROC GENMOD is modeling the probability that mi=’1’.

Criteria For Assessing Goodness Of Fit

Criterion DF Value Value/DF

Deviance 196 150.3748 0.7672Scaled Deviance 196 150.3748 0.7672Pearson Chi-Square 196 177.5430 0.9058Scaled Pearson X2 196 177.5430 0.9058Log Likelihood -75.1874

Algorithm converged.

Analysis Of Parameter Estimates

Standard Wald 95% Chi-Parameter DF Estimate Error Confidence Limits Square Pr > ChiSq

Intercept 1 -9.1140 1.7571 -12.5579 -5.6702 26.90 <.0001oral 1 1.9799 0.4697 1.0593 2.9005 17.77 <.0001age 1 0.1626 0.0445 0.0753 0.2498 13.32 0.0003smoke 1 1.8122 0.4294 0.9706 2.6538 17.81 <.0001Scale 0 1.0000 0.0000 1.0000 1.0000

NOTE: The scale parameter was held fixed.

INTERPRETATION:

• From the output, the Wald test statistics in the Chi-Square column of the table Analysis Of

Parameter Estimates of whether β1 = 0, β2 = 0, and β3 = 0 are all large, with very small p-

values. This suggests that there is strong evidence that oral contraceptive use, age, and smoking

affects the probability of having a heart attack.

PAGE 455

Page 465: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 11 ST 732, M. DAVIDIAN

• In each case, note that the estimate is positive. The logistic function

exp(u)1 + exp(u)

is an increasing function of u. Note that because the estimated values of β1, β2, and β3 are

positive, if xj1 changes from 0 (no contraceptives) to 1 (contraceptives), the linear predictor

β0 + β1xj1 + β2xj2 + β3xj3

evaluated at the estimates increases, and the same is true if age xj2 increases or if xj3 changes

from 0 (no smoking) to 1 (smoking). Thus, the fit indicates that the probability of having a heart

attack increases if one uses oral contraceptives or smokes, and increases as women age.

• In fact, we can say more. According to this model, the odds of having a heart attack, given

a woman has particular settings of contraceptive use, age, and smoking (xj1, , xj2, xj3) is, from

(11.9), which is the ratio of the probability of having a heart attack to not having one, is

exp(β0 + β1xj1 + β2xj2 + β3xj3).

A common quantity of interest is the so-called odds ratio. For example, we may be interested

in comparing the odds of having a heart attack if a randomly chosen woman smokes (xj3 = 1) to

those if she does not (xj3 = 0). The ratio of the odds under smoking to those under not smoking,

for any settings of age or contraceptive use, is thus

exp(β0 + β1xj1 + β2xj2 + β3)exp(β0 + β1xj1 + β2xj2)

= exp(β3).

Thus, expβ3 is a multiplicative factor that measures by how much the odds of having a heart

attack change if we move from not smoking to smoking. If β3 > 0, this multiplicative factor is

> 1, meaning that the odds go up; if β3 is negative, the factor is < 1, and the odds go down. β3

itself is referred to as the log odds ratio for obvious reasons.

Here, we estimate the log odds ratio for smoking as 1.81 and the odds ratios as exp(β3) =

exp(1.81) = 6.12; the odds increase by 6-fold if a woman smokes! Note that, ideally, we would

like a standard error to attach to this estimated odd ratios.

PAGE 456

Page 466: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 11 ST 732, M. DAVIDIAN

One can actually get PROC GENMOD to print out a log odds ratio and odds ratio and associated

standard errors in an estimate statement with the exp option by choosing L appropriately. Here,

to get the log odds ratio, which is just β3, we take L = (0, 0, 0, 1). The estimate tatement would

be

estimate "smk log odds ratio" int 0 oral 0 age 0 smoke 1 / exp;

try adding this to the program and see what happens (see the program on the class web site for

the results).

• An interesting aside: Logistic regression is a standard technique in public health studies. Chances

are, when you read in the newspaper that a certain behavior increases the risk of developing a

disease, the analysis that was performed to arrive at that conclusion was like this one.

EXAMPLE 3 – CLOTTING TIME DATA: These data are positive and continuous with possible con-

stant coefficient of variation. Thus, we consider the gamma probability model. Letting Yj be the clotting

time at percentage concentration xj , we consider two models for the mean response:

• Loglinear: E(Yj) = exp(β0 + β1xj)

• Reciprocal (inverse): E(Yj) = 1/(β0 + β1xj).

Note that although in both models β1 has to do with how the changing percentage concentration affects

the mean response, this happens in different ways in each model, so the parameters have different

interpretations, so it is not interesting to compare their values for the different models.

Here, because of the gamma assumption, the dispersion parameter φ is not equal to a fixed, known

constant. It is thus estimated from the data. Note that PROC GENMOD does not print out the estimate

of φ; rather, it prints out 1/φ.

We also show how to obtain results of the fit in a table that may be output to a SAS data set using

the ods statement, which is relevant in versions 7 and higher of SAS. Earlier versions use the make

statement.

PAGE 457

Page 467: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 11 ST 732, M. DAVIDIAN

PROGRAM:

/******************************************************************

CHAPTER 11, EXAMPLE 3

Fitting loglinear and reciprocal models to the clotting data.(Gamma assumption)

******************************************************************/

options ls=80 ps=59 nodate; run;

/******************************************************************

The data look like

5 11810 5815 4220 3530 2740 2560 2180 19100 18

column 1 percentage concentration plasmacolumn 2 clotting time (seconds)

******************************************************************/

data clots; infile ’clot.dat’;input u y;x=log(u);

run;

/*****************************************************************

Fit the loglinear regression model using PROC GENMOD. TheDIST=GAMMA option specifies the gamma distribution assumption.We then fit two models: the loglinear model in the firstcall to PROC GENMOD, obtained with the LINK=LOG option,and the reciprocal (inverse) model, obtained with theLINK=POWER(-1) option -- this option asks that the linearpredictor be raised to the power in parentheses as the modelfor the mean response.

Here, the dispersion parameter phi is unknown so must be estimated.This may be done a number of ways -- here, we use the PSCALEoption in MODEL statement to ask that phi be estimatedby the Pearson chi-square divided by its degrees of freedom.Actually, for the gamma distribution, what is printed underSCALE parameter is the reciprocal of this quantity, so we mustremember to invert the result from the output to obtain the estimateof phi.

Also, use the OBSTATS option in the MODEL statement to output atable of statistics such as predicted values (estimates of the meanresponse) and residuals (response-estimated mean). We showhow to output these to a data set using the ODS statement forfor the loglinear fit (although we don’t do anything with them).The ODS statement works with version 7 and higher of SAS.Note that the obstats option causes the output of GENMOD to containthese statistics; printing the output data set simply repeatsthese values.

******************************************************************/

proc genmod data=clots;model y = x / dist = gamma link = log obstats pscale;ods output obstats=outlog;

run;

proc print data=outlog; run;

/*****************************************************************

Fit the inverse reciprocal regression model using PROC GENMOD.Phi is again calculated by the Pearson chi-square/dof.

******************************************************************/

proc genmod data=clots;model y = x / dist = gamma link = power(-1) obstats pscale;

run;

PAGE 458

Page 468: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 11 ST 732, M. DAVIDIAN

OUTPUT: Following the output, we comment on a few aspects of the output.

The SAS System 1

The GENMOD Procedure

Model Information

Data Set WORK.CLOTSDistribution GammaLink Function LogDependent Variable yObservations Used 9

Criteria For Assessing Goodness Of Fit

Criterion DF Value Value/DF

Deviance 7 0.1626 0.0232Scaled Deviance 7 6.6768 0.9538Pearson Chi-Square 7 0.1705 0.0244Scaled Pearson X2 7 7.0000 1.0000Log Likelihood -26.4276

Algorithm converged.

Analysis Of Parameter Estimates

Standard Wald 95% Chi-Parameter DF Estimate Error Confidence Limits Square Pr > ChiSq

Intercept 1 5.5032 0.1799 5.1506 5.8559 935.63 <.0001x 1 -0.6019 0.0520 -0.7039 -0.4999 133.80 <.0001Scale 0 41.0604 0.0000 41.0604 41.0604

NOTE: The Gamma scale parameter was estimated by DOF/Pearson’s Chi-Square

Lagrange Multiplier Statistics

Parameter Chi-Square Pr > ChiSq

Scale 0.3069 0.5796

Observation Statistics

Observation y x Pred Xbeta Std HessWgtLower Upper Resraw Reschi Resdev

StResdev StReschi Reslik

1 118 1.6094379 93.175154 4.5344811 0.1026374 52.00016576.196496 113.93712 24.824846 0.266432 0.24588012.1728608 2.3544798 2.2608074

2 58 2.3025851 61.39102 4.1172636 0.0738424 38.79234153.119026 70.951174 -3.39102 -0.055236 -0.056288-0.413325 -0.405606 -0.411497

The SAS System 2

The GENMOD Procedure

Observation Statistics

Observation y x Pred Xbeta Std HessWgtLower Upper Resraw Reschi Resdev

StResdev StReschi Reslik

3 42 2.7080502 48.096382 3.873207 0.0607149 35.85582542.700382 54.174268 -6.096382 -0.126753 -0.132544-0.9248 -0.8844 -0.918591

4 35 2.9957323 40.449166 3.700046 0.0545252 35.52886336.349431 45.011297 -5.449166 -0.134716 -0.141291-0.967048 -0.92205 -0.961605

5 27 3.4011974 31.689627 3.4559894 0.052237 34.98428.605721 35.106001 -4.689627 -0.147986 -0.155989-1.060815 -1.006389 -1.054851

6 25 3.6888795 26.651048 3.2828285 0.0556359 38.51665323.897747 29.721562 -1.651048 -0.061951 -0.063278-0.434509 -0.425393 -0.433342

7 21 4.0943446 20.879585 3.0387719 0.0661298 41.29716818.341382 23.769042 0.1204152 0.0057671 0.00575610.0409427 0.0410213 0.0409576

PAGE 459

Page 469: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 11 ST 732, M. DAVIDIAN

8 19 4.3820266 17.559778 2.865611 0.0762872 44.42806615.121094 20.391766 1.4402218 0.0820182 0.07987740.5932165 0.6091154 0.5973195

9 18 4.6051702 15.352785 2.7312969 0.0851497 48.14023112.992945 18.141231 2.6472147 0.1724257 0.16340651.2715487 1.3417313 1.2945556

The SAS System 3

Obs Observation y x Pred Xbeta

1 1 118 1.6094379 93.175154 4.53448112 2 58 2.3025851 61.39102 4.11726363 3 42 2.7080502 48.096382 3.8732074 4 35 2.9957323 40.449166 3.7000465 5 27 3.4011974 31.689627 3.45598946 6 25 3.6888795 26.651048 3.28282857 7 21 4.0943446 20.879585 3.03877198 8 19 4.3820266 17.559778 2.8656119 9 18 4.6051702 15.352785 2.7312969

Obs Std Hesswgt Lower Upper Resraw

1 0.1026374 52.000165 76.196496 113.93712 24.8248462 0.0738424 38.792341 53.119026 70.951174 -3.391023 0.0607149 35.855825 42.700382 54.174268 -6.0963824 0.0545252 35.528863 36.349431 45.011297 -5.4491665 0.052237 34.984 28.605721 35.106001 -4.6896276 0.0556359 38.516653 23.897747 29.721562 -1.6510487 0.0661298 41.297168 18.341382 23.769042 0.12041528 0.0762872 44.428066 15.121094 20.391766 1.44022189 0.0851497 48.140231 12.992945 18.141231 2.6472147

Obs Reschi Resdev Stresdev Streschi Reslik

1 0.266432 0.2458801 2.1728608 2.3544798 2.26080742 -0.055236 -0.056288 -0.413325 -0.405606 -0.4114973 -0.126753 -0.132544 -0.9248 -0.8844 -0.9185914 -0.134716 -0.141291 -0.967048 -0.92205 -0.9616055 -0.147986 -0.155989 -1.060815 -1.006389 -1.0548516 -0.061951 -0.063278 -0.434509 -0.425393 -0.4333427 0.0057671 0.0057561 0.0409427 0.0410213 0.04095768 0.0820182 0.0798774 0.5932165 0.6091154 0.59731959 0.1724257 0.1634065 1.2715487 1.3417313 1.2945556

The SAS System 4

The GENMOD Procedure

Model Information

Data Set WORK.CLOTSDistribution GammaLink Function Power(-1)Dependent Variable yObservations Used 9

Criteria For Assessing Goodness Of Fit

Criterion DF Value Value/DF

Deviance 7 0.0167 0.0024Scaled Deviance 7 6.8395 0.9771Pearson Chi-Square 7 0.0171 0.0024Scaled Pearson X2 7 7.0000 1.0000Log Likelihood -16.1504

Algorithm converged.

Analysis Of Parameter Estimates

Standard Wald 95% Chi-Parameter DF Estimate Error Confidence Limits Square Pr > ChiSq

Intercept 1 -0.0166 0.0009 -0.0184 -0.0147 318.53 <.0001x 1 0.0153 0.0004 0.0145 0.0162 1367.15 <.0001Scale 0 408.8247 0.0000 408.8247 408.8247

NOTE: The Gamma scale parameter was estimated by DOF/Pearson’s Chi-Square

Lagrange Multiplier Statistics

Parameter Chi-Square Pr > ChiSq

Scale 0.2600 0.6101

PAGE 460

Page 470: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 11 ST 732, M. DAVIDIAN

Observation Statistics

Observation y x Pred Xbeta Std HessWgtLower Upper Resraw Reschi Resdev

StResdev StReschi Reslik

1 118 1.6094379 122.85904 0.0081394 0.0003814 6170940.5112.52367 135.28505 -4.859041 -0.03955 -0.040083-2.535827 -2.502059 -2.50553

2 58 2.3025851 53.263889 0.0187744 0.0003353 1159852.751.462321 55.196169 4.7361113 0.0889179 0.08641121.8736358 1.9279877 1.8808138

The SAS System 5

The GENMOD Procedure

Observation Statistics

Observation y x Pred Xbeta Std HessWgtLower Upper Resraw Reschi Resdev

StResdev StReschi Reslik

3 42 2.7080502 40.007131 0.0249955 0.0004121 654352.7638.754832 41.343065 1.9928686 0.0498128 0.0490091.0510498 1.0682898 1.0529795

4 35 2.9957323 34.002638 0.0294095 0.0004948 472674.6832.917102 35.162214 0.9973619 0.0293319 0.02904990.6246313 0.6306943 0.625336

5 27 3.4011974 28.065779 0.0356306 0.0006317 322026.2827.12331 29.076102 -1.065779 -0.037974 -0.038466

-0.833125 -0.822477 -0.8317656 25 3.6888795 24.972206 0.0400445 0.0007367 254947.6

24.103101 25.906332 0.0277938 0.001113 0.00111260.0242347 0.0242437 0.024236

7 21 4.0943446 21.614323 0.0462656 0.0008909 190994.2920.828244 22.462064 -0.614323 -0.028422 -0.028696-0.629919 -0.623908 -0.629011

8 19 4.3820266 19.731822 0.0506796 0.001003 159173.7718.99499 20.528126 -0.731822 -0.037088 -0.037557

-0.828624 -0.818283 -0.8269779 18 4.6051702 18.48317 0.0541033 0.0010911 139665.78

17.780391 19.243791 -0.48317 -0.026141 -0.026372-0.583988 -0.578865 -0.583139

INTERPRETATION:

• Pages 1–2 of the output show the results of fitting the loglinear model. The estimates of β0 and β1

and their estimated standard errors are given in the table Analysis of Parameter Estimates.

The SCALE parameter estimate corresponds to an estimate of 1/φ; thus, the estimate of φ itself

is 1/41.0604 = 0.02435. Recall that the coefficient of variation σ is defined as σ2 = φ; thus, the

estimated coefficient of variation under the loglinear fit is 0.15606.

• The table Observation Statistics on pages 1 and 2 lists a number of results based on the

fit. Of particular interest is the column PRED, which gives the estimates of the mean response at

each xj value (the column Y contains the actual data values for comparison). These numbers are

repeated on page 3, which shows the result of the call to proc print to print the data set created

by the ods statement. This illustrates how it is possible to output such results so that further

manipulation may be undertaken.

• Pages 4–5 contain the same information for the reciprocal link fit. Here, the estimate of φ is

1/408.8247 = 0.002446, so that the estimated coefficient of variation σ is 0.04946.

PAGE 461

Page 471: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 11 ST 732, M. DAVIDIAN

• Note that the estimates of CV do not agree well at all between the two fits. The reason can

be appreciated when one inspects the lower right panel of Figure 3. Here, the estimated mean

response for each fit is superimposed on the actual data – the solid line represents the fit of the

loglinear model, the dashed line is the fit of the reciprocal model. Note that this second model

appears to provide a much better fit to the data. The calculation of φ, and hence of σ, is based

on squared deviations {Yj − f(x′jβ)}2. Because the loglinear model fits poorly, these deviations

are large, leading to an estimate of CV that is misleading large. The reciprocal model, which fits

the data very well, leads to a much smaller estimate because the deviations of the fit from the

observed responses are much smaller. Based on the visual evidence, the fit of the reciprocal model

is preferred for describing the percentage concentration of plasma-clotting time relationship.

PAGE 462

Page 472: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 12 ST 732, M. DAVIDIAN

12 Population-averaged models for nonnormal repeated measure-

ments

12.1 Introduction

In the previous chapter, we discussed regression models for data that may not be normally distributed,

such as count or binary data or data that take on positive values but that may have skewed distributions.

These models, known as generalized linear models, have several features:

• A by-product of dealing with these types of variables is that the model for mean response may

need to satisfy some restrictions. The most extreme case was that of models for binary data; here,

the mean response is also the probability of seeing the event of interest, which must lie between

0 and 1. The main consequence is that models of interest are no longer necessarily linear in

regression parameters β (p× 1); instead, plausible models tend to be nonlinear functions f of β

through a linear predictor x′

jβ. Thus, the usual theory of linear models does not apply.

• The variance of the response is no longer legitimately viewed as being constant for all values of

the mean response (that is, for all settings of the covariates). Rather, the distributional models

that are sensible for these data impose a relationship between mean and variance; that is, the

variance of a response taken at a particular value of the mean is some known function V of the

mean.

• Because of the nonlinearity of mean response models and the fact that variance also is a function

of the mean, it is no longer possible to derive an expression for the estimator of β in closed form.

However, fortunately, it turns out that for all distributions in the class containing the relevant

distributions, such as the Poisson, Bernoulli, and gamma, the (ML) estimator of β solves a set

of p equations that is a sum of weighted deviations. Although these equations cannot be solved

analytically, they may be solved via a general numerical algorithm (IRWLS). Furthermore, large

sample approximations are available for the sampling distribution of the estimator β, so that

approximate inference may be carried out.

Generalized linear models may thus be viewed as an extension of ordinary linear regression models

for normal data with constant variance. These models and methods are of course only applicable to

the standard regression problem where independent scalar responses Y1, . . . , Yn have been observed at

covariate settings xj1, . . . , xjk for the jth response, j = 1, . . . , n.

PAGE 463

Page 473: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 12 ST 732, M. DAVIDIAN

In this chapter, we are concerned with how we might extend generalized linear models to the situation

of longitudinal data, where now the responses are vectors Y i of repeated count, binary, or other

observations on each of m units.

• Recall in the the case of the linear model with the assumption of normality, the extension from

ordinary regression problems to the longitudinal problem was facilitated by thinking about the

multivariate normal distribution. That is, there is a natural generalization of the probability

model we use for ordinary linear regression (the normal distribution) to that we use for longitudinal

response vectors (multivariate normal).

• Specifically, if individual observations are assumed to be normally distributed, as they are in clas-

sical linear regression, then vectors of such observations have a multivariate normal distribution.

Each component of the data vector is normally distributed individually, with mean determined by

the regression model and variance that of the individual normal distribution. To fully characterize

the multivariate normal distribution that is appropriate, the only additional piece of information

we must specify is how the components of the vector are correlated. Put another way, as long as

(i) we believe individual observations are normally distributed and (ii) are willing to specify the

form of the mean vector through a regression model and the form of the covariance matrix

of a data vector, either by outright assumption or using a mixed effects structure, we can fully

specify the particular multivariate normal distribution that will be used as the basis for infer-

ence. Because of this, it was straightforward to contemplate models for longitudinal, normally

distributed data. Moreover, because we thus had a full probability model, we could write down the

joint probability distribution of the data and use the methods of maximum likelihood or restricted

maximum likelihood to fit the model and make inference.

• By analogy, it is natural to hope that we could do something similar when the elements of a data

vector Y i are now counts, binary responses, or positive responses with constant CV. That is, it

would be desirable if there were extensions of the Poisson, Bernoulli, and gamma distributions

that could be fully specified by simply adding assumptions about correlation to the individual

observation assumptions on mean and variance.

PAGE 464

Page 474: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 12 ST 732, M. DAVIDIAN

• Unfortunately, this is not the case. This same kind of generalization is not so easy for the other

distributions in the scaled exponential family class, like the Poisson, Bernoulli, or gamma. In

particular, multivariate extensions of these probability models are unwieldy or require more than

just an assumption about the correlations among components of a data vector. Thus, sadly, trying

to use multivariate extensions of the distributions used for ordinary regression (generalized linear

models) to longitudinal data vectors is simply too complex to yield useful statistical models for

real situations.

To make matters worse, still another problem complicates things further. We have noted two perspec-

tives on modeling: population-averaged and subject-specific. For continuous, normally distributed

data, it is often relevant, as we have seen, to specify models that are linear:

• With the population-averaged perspective, we modeled the mean response of the elements of

a data vector by some function of time and possibly other covariates. This function was linear

in parameters β, e.g.

E(Yij) = β0 + β1tij .

We then modeled the covariance matrix Σi of a data vector explicitly. This model would (hope-

fully) take into account variation from all sources, among and within individuals simultaneously.

• With the subject-specific perspective, we modeled the individual trajectory of the elements of

a data vector by some function of time. This function was linear in individual-specific parameters;

e.g. we wrote models like the straight-line random coefficient model

Yij = β0i + β1itij + eij .

The individual-specific parameters β0i and β1i were in turn modeled as linear functions of a fixed

parameter β and random effects bi, βi = Aiβ+bi, that characterized respectively the “typical”

values of the elements of βi and how individual values deviated from these typical values. The

result was again a model for mean response averaged across individuals that was a linear function

of β; e.g., with Ai = I,

E(Yij) = β0 + β1tij .

The covariance model Σi arose from the combination of assumptions about bi and ei, thus natu-

rally taking into account variation from both sources separately.

PAGE 465

Page 475: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 12 ST 732, M. DAVIDIAN

Thus, in both cases, although the perspective starts out differently, we end up with a model for mean

response E(Yij) that is a linear function of fixed parameters β of interest. We can end up with the

same linear mean model from either perspective. So, even if two data analysts start out with these

different perspectives, they are likely to arrive at the same mean model, and either of their interpretations

of the model will be valid. The difference will be in what they end up assuming about covariance.

As we will discuss, when we consider models of the generalized linear model type that are no longer

linear, it is no longer the case that the population-averaged and subject-specific perspectives neces-

sarily can lead to the same mean model! Moreover, as a result, the interpretations of the different

types of models are no longer both valid at the same time. This unfortunate problem is the result of

the nonlinearity of the generalized linear models.

Historically, as a consequence of all of these issues, models and method for nonnormal responses that

individually would follow generalized linear models were not widely available. The main impediments

were that

• there are not easy multivariate generalizations of the necessary probability distributions, and

• population-averaged and subject-specific approaches do not necessarily lead to the same models

for mean response.

Because there was no easy resolution to these problems, no one knew quite what to do. Then, in the

mid-1980’s, a paper appeared in the statistical literature that brought to the attention of statisticians

an approach for modeling these data, along with an associated fitting method, that made good practical

sense from a population-averaged perspective. The paper, Liang and Zeger (1986), generated a huge

amount of interest in this approach.

In this chapter, we will introduce this approach and the associated fitting method known as generalized

estimating equations, or GEEs. We will also show how to use PROC GENMOD in SAS to carry out such

analyses. As we will detail in the next section, the modeling of data vectors follows from a population-

averaged perspective, where the mean response of a data vector is modeled explicitly as a function

of time, parameters β, and possibly other covariates. No subject-specific random effects are involved.

We will contrast this approach with one that does use subject-specific random effects in Section 12.5

and in the next chapter.

PAGE 466

Page 476: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 12 ST 732, M. DAVIDIAN

12.2 Population-averaged model

RECALL: The population-averaged approach is focused on modeling the mean response across

the population of units at each time point as a function of time. Thus, the model describes how the

averages across the population of responses at different time points are related over time. The model

usually describes the mean response at any time tij , say, for unit i as a function of fixed parameters β,

time tij , and possibly additional covariates. The model is set up so that questions about how the mean

response changes as a function of time and other covariates may be phrased in terms of questions about

the value of contrasts of the elements of β.

PROBLEM: In the case of normally distributed responses, if we specify such a mean response model

and a model for the covariance matrix of a data vector, we have provided all the necessary ingredi-

ents to write down a multivariate normal probability distribution that we believe describes the

population(s) of data vectors.

• Technically, if we can provide a mean vector and a covariance matrix, this is all we need to fully

describe a corresponding multivariate normal distribution.

• This is a desirable feature of the multivariate normal distribution – it is fully characterized

by a mean and covariance matrix.

In the case of nonnormally distributed response, if we specify such a mean response model and a model

for the covariance matrix, we have not necessarily provided all the necessary ingredients to write down

a corresponding multivariate probability distribution that we believe describes a population of data

vectors. Here is a brief heuristic explanation:

• Technically, to develop multivariate extensions of probability distributions like the those un-

derlying generalized linear models, it is not enough to provide just a mean vector and covariance

matrix.

• Because in these probability distributions the mean and variance of an observation are related in

a specific way, it turns out that it is much more difficult to fully describe a multivariate probability

distribution for several such observations in a data vector. To do so requires not only mean and

covariance matrix models, but additional assumptions about more complicated properties

of observations taken three, four, . . ., n at a time.

• With only the data at hand to guide the data analyst, it may be too difficult and risky to make

PAGE 467

Page 477: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 12 ST 732, M. DAVIDIAN

all of the assumptions required about these complicated properties. Furthermore, the resulting

probability models can be so complex that fitting them to real data may be an insurmountable

challenge.

APPROACH: The approach popularized by Liang and Zeger (1986) is to forget about trying to model

the whole multivariate probability distribution of a data vector. Instead, the idea is just to model the

mean response and the covariance matrix of a data vector as in the normal case, and leave it at

that.

• The problem with this approach is that, consequently, there is no multivariate probability distribu-

tion upon which to base fitting methods and inference on parameters (like maximum likelihood).

• However, Liang and Zeger (1986) described an alternative approach to model fitting for such

mean-covariance models for nonnormal longitudinal data that does not require specification

of a full probability model but rather just requires the mean and covariance matrix. We discuss

this method in the next section.

Here, we describe the modeling strategy.

MEAN–VARIANCE MODEL: The idea is to take generalized linear models for individual observa-

tions as the starting point.

• If we consider a single component of a data vector Y i consisting of counts, binary responses,

or continuous positive response with constant CV at different times, the distribution of possible

values across the population of units might be well-represented by the Poisson, Bernoulli, and

gamma probability models, respectively.

• Thus, the distribution of each observation in a data vector is taken to have ideally a mean and

variance model of the type relevant to or imposed by these distributions.

PAGE 468

Page 478: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 12 ST 732, M. DAVIDIAN

EXAMPLE – EPILEPTIC SEIZURE DATA: Recall Example 4 from Chapter 1, given by Thall and

Vail (1990). Here, 59 subjects suffering from epileptic seizures were assigned at random to receive either

a placebo (subjects 1–28) or the anti-seizure drug progabide (subjects 29–59) in addition to a standard

chemotherapy regimen all were taking. On each subject, the investigators recorded the subject’s age,

ai, say for the ith subject, i = 1, . . . , 59, a baseline number of seizures experienced by each subject

over the 8-week period prior to the start of the study, and then the number of seizures over a 2 week

period for four visits following initiation of assigned treatment. Let δi be the treatment indicator for

the ith patient,

δi = 0 for placebo subjects

= 1 for progabide subjects

Before we consider a model for these data, we discuss an issue that has been of some debate among

practitioners, that of “how to handle “baseline?”

In all of our examples up till now involving different groups, we have treated a baseline response, that

is, a measure of the response taken at the start of a study (and prior to administration of treatment if

there is one) as part of the overall response vector Y i. This takes automatic account of the information

in the baseline response, its correlation with other responses, and the fact that different subjects have

different baseline characteristics.

However, a common approach is to instead view the response vector as just the post-baseline responses

and treat the baseline response as a covariate in a model for mean of this response vector. The idea

is that this takes into account, or “adjusts for,” the fact that different subjects have different baseline

response characteristics.

Here, the baseline response and subsequent responses are not on the same scale; the baseline response

is the number of seizures recorded over an 8-week period prior to the start of the study (initiation of

assigned treatment) while the post-baseline responses are the number recorded in the 2-week period

between the four visits. This discrepancy might especially motivate an analyst to treat baseline as a

covariate, as it does not seem comparable with the rest of the response variables. In fact, the original

analysis of these data by Thall and Vail (1980) did this.

However, this seems to be suboptimal, as it would seem to ignore the fact that baseline response would

be expected to vary within subjects; that is, baseline response is a random variable. It is a simple

matter to address the scaling issue; in the current study, one may divide the baseline responses by 4 to

place them on a two-week basis.

PAGE 469

Page 479: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 12 ST 732, M. DAVIDIAN

The more fundamental issue is whether it is a good idea to treat a baseline response as a covariate in

order to take into account the fact that units differ in their responses prior to treatment or whether it

is preferable to treat the baseline value as part of the response vector for each unit. In the case of a

linear mean response, it turns out that the two strategies can be equivalent, which is why we have

not discussed this until now. However, when the model for mean response is nonlinear, this no longer

holds.

Our position is that as a general strategy, it is preferable to treat a baseline response as part of the

response vector rather than as a covariate. There are theoretical reasons, beyond our scope here, that

support this position. We continue to follow this strategy for the rest of this course.

A very nice, detailed discussion of this issue is given by Fitzmaurice, Laird, and Ware (2004, Section

5.7).

Returning to the seizure data, adopting this view, we take the data vector corresponding to subject i

to be Y i = (Yi1, Yi2, . . . , Yi5)′, where Yi1 is the baseline response based on 8 weeks, and Yi2, . . . , Yi5 are

the responses at each of visits 1–4 based on 2 weeks (we discuss how to take into account the different

time periods momentarily).

Before we specify the model, we consider some summary statistics. This was a randomized study, so

we would expect subjects in the two groups to be similar in their characteristics prior to administration

of the treatment. This seems plausible; the following table lists sample means (standard deviations) of

age and baseline 8-week seizure counts (Yi1) for each group.

Age Baseline

Placebo 29.6 (6.0) 30.8 (26.1)

Progabide 27.7 (6.6) 31.6 (27.9)

Notice that the subjects vary considerably in their baseline seizure counts.

Table 1 lists sample mean seizure counts at baseline and each visit time; those for baseline are divided

by 4 to put them on the same 2-week scale as the others.

PAGE 470

Page 480: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 12 ST 732, M. DAVIDIAN

Table 1: Sample mean seizure counts at baseline and each visit time for the 28 subjects assigned to

placebo and 30 subjects assigned to progabide.

Visit Placebo Progabide

0 (baseline) 7.70 7.90

1 9.35 8.58

2 8.29 8.42

3 8.79 8.13

4 7.96 6.71

average over 8.60 7.96

visits 1–4

The raw sample means suggest a possible slight initial increase in 2-week seizure count followed by a

“leveling-off,” with a possible lowering by visit 4 in the progabide group.

Based on these observations, we might adopt a model for mean response that allows the possibility of

a different mean at baseline and visits 1–4, where the mean at visits 1–4 is the same, and these might

be different by group. Because the responses may be small counts for some subjects and are indeed

counts for all, it is natural to consider a loglinear model.

Define vij = 0 if j = 1 (baseline) and vij = 1 otherwise (visits 1–4), and let oij = 8 if j = 1 and oij = 2

otherwise, so that oij records the observation period on which Yij is based (8 or 2 weeks). Then the

following loglinear model incorporates these features:

E(Yij) = exp(log oij + β0 + β1vij + β2δi + β3δivij), (12.1)

where thus β = (β0, β1, . . . , β3)′ is the vector of fixed regression parameters characterizing the mean

response vector for any subject.

• The fixed quantity log oij cleverly takes account of the different observation periods for baseline

and post-treatment visits. If we take the log of both sides of (12.1) and subtract log oi from both

sides, we get

log{E(Yij)} − log oij = log{E(Yij/oij)} = β0 + β1vij + β2δi + β3δivij ,

so this is equivalent to modeling the means of Yi1/8 and Yij/2 for j = 2, . . . , 5.

PAGE 471

Page 481: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 12 ST 732, M. DAVIDIAN

• Model (12.1) says that, at baseline, the mean response is

E(Yi1/8) = β0 + β2δi

while for visits 1–4 the mean is

E(Yij/2) = β0 + β1 + β2δi + β3δi,

which is the same for all 4 post-baseline visits and may be viewed as reflecting the “overall”

behavior averaged across them. Here, β1 is the amount by which the logarithm of the mean

“shifts” after the study begins. β2 allows the baseline mean to be different by treatment, and β3

reflects the additional amount by which the mean differs by treatment after treatment starts.

As the study was randomized, we would not necessarily expect baseline mean responses to be

different by treatment; certainly the sample means given above do not support this. We might

thus eliminate this term from the model.

• A fancier model might allow the mean response to change smoothly with time (measured in weeks)

following visit 1 somehow. One possibility would be to allow a straight-line relationship between

baseline and visit 1, and then another straight-line relationship from visit 1 onward.

• Alternatively, the sample means seem to suggest that the effect of the progabide may not become

apparent until the last visit. We consider such a model later in this chapter. We also consider

taking into account age.

• On the original scale, note that as before that, for a loglinear model like (12.1), receiving treatment

versus not has the effect of causing a multiplicative change in mean response. In particular,

exp(β3) is the multiplicative effect of progabide relative to placebo post-baseline. If β3 is positive,

then the multiplicative factor is greater than one, and the mean response increases; if β2 is

negative, then the multiplicative factor is less than one, and the mean response decreases.

EXAMPLE – WHEEZING DATA: Recall Example 5 from Chapter 1, given by Lipsitz, Laird, and

Harrington (1992). These data are from a large public health study (the Six Cities study) and concerned

the association between maternal smoking and respiratory health of children. In section 12.7, we will

consider a subset of the full data set, data on 32 of these children. Each child was examined once a year

at a clinic visit (visits at ages 9, 10, 11, and 12) for evidence of “wheezing” – the response was recorded

as a binary variable (0=wheezing absent, 1=wheezing present).

PAGE 472

Page 482: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 12 ST 732, M. DAVIDIAN

In addition, the mother’s current smoking status was recorded (0=none, 1=moderate, 2=heavy). For

some children, visits were missed, so that both the response (wheezing indicator) and maternal smoking

status were missing; for our purposes, we will assume that the reasons for this missingness are not

related to the focus of study. (See Chapter 13 for more on missing data.)

Let Yij be the wheezing indicator (=0 or 1) on the ith child at the jth age tij , where tij ideally takes

on all the values 9, 10, 11, 12. Thus, j = 1, . . . , ni for any child, with ni ≤ 4. As the response is binary,

a logistic regression model would be appropriate for representing E(Yij). For child i, let

δ0ij = 1 if smoking=none at tij

= 0 otherwise

δ1ij = 1 if smoking=moderate at tij

= 0 otherwise

ci = 0 if city=Portage

= 1 if city=Kingston

Recall the discussion in Chapter 10 regarding time-dependent covariates. As maternal smoking

is a time-dependent covariate, the considerations raised in that discussion are relevant. Here, we are

interested in a model for mean response for the jth element of a data vector, E(Yij).

• As a mother’s smoking behavior is something we only can observe, we should probably be more

careful and acknowledge that it should be thought of as random; thus, we would think of the

pair δij = (δ0ij , δ1ij)′ as a random vector characterizing the observed smoking behavior at age

j. Thus, following the discussion in Chapter 10, we are really modeling the E(Yij |δi1, . . . , δini).

• The model used by Lipsitz, Laird, and Harrington (1992) takes E(Yij) as depending on a mother’s

smoking status (δ0ij , δ1ij) at time j only; that is, they assume

E(Yij |δi1, . . . , δini) = E(Yij |δij) = E(Yij |δ0ij , δ1ij).

One possible rationale is that, because measurements are so far apart in time (one year), it might

be believed that a mother’s smoking behavior at one time is not associated with respiratory

problems at another time. However, given the discussion in Chapter 10, this is something that

must be considered critically.

In this example, an objective (see Chapter 1) is to understand whether maternal smoking behavior has

an effect on wheezing.

PAGE 473

Page 483: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 12 ST 732, M. DAVIDIAN

A little thought suggests that this is indeed a complicated question; the children have not been subjected

to a “one-time” treatment (smoking or not) that distinguishes them into groups, as in previous examples.

Rather, the “treatment” changes with time and may be related to the response in a complicated way,

as discussed in Chapter 10. It is not at all clear that a simple model like that above addresses this.

Indeed, this question would seem to involve a causal interpretation! At best, all we can hope for is to

understand associations.

Thus, writing down an appropriate model for E(Yij) requires considerable thought and a clear idea of

how the model is to be used.

• It is sometimes argued that, if the goal is to use the model only to estimate a future child’s risk

of wheezing based on information at a particular time point only, then a model for E(Yij) as a

function of (δ0ij , δ1ij) at j only may be of interest, even if it doesn’t capture the true underlying

mechanism leading to wheezing.

• However, this is almost always not the goal! Rather, the objective is as above: to assess and

compare the effects of smoking patterns on wheezing patterns. Trying to do this based on the

simple model we discuss next is likely to result in flawed and meaningless interpretations.

Further discussion is beyond the scope of this course; however, it is critical that the data analyst

confronted with data such as these appreciate that there are profound issues involved in modeling

them! Frankly, one should be extremely careful when dealing with time dependent covariates

and longitudinal data.

• We again refer the reader to Fitzmaurice, Laird, and Ware (2004) for discussion. A very technical

paper that also discusses this issue is from the literature on causal inference [Robins, Greenland,

and Hu (1999)].

With the above caveats in mind, we show for illustration a model similar to that proposed by Lipsitz,

Laird, and Harrington (1992). The model is

E(Yij) =exp(β0 + β1ci + β2δ0ij + β3δ1ij)

1 + exp(β0 + β1ci + β2δ0ij + β3δ1ij), (12.2)

where thus β = (β0, β1, . . . , β3)′ is the vector of fixed regression parameters characterizing the mean

response vector for any subject. Of course, this implies (see the previous chapter) that the log odds is

given by

log

(E(Yij)

1 − E(Yij)

)= β0 + β1ci + β2δ0ij + β3δ1ij .

PAGE 474

Page 484: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 12 ST 732, M. DAVIDIAN

• Model (12.2) thus says that the log odds of having a wheezing response relative to not having

it depends (linearly) on city and maternal smoking status. We could additionally add an “age”

term to allow dependence on age (maybe as children grow older their tendency toward wheezing

changes).

• Specifically, the model says that the log odds at age tij is equal to β0 for a child from Portage

whose mother is a heavy smoker at tij , since under these conditions ci = δ0ij = δ1ij = 0. For

a child from Kingston, the log odds would change by adding the amount β1; for a child whose

mother was a non (moderate) smoker, the log odds would change by adding the amount β2 (β3).

• With the model written as (12.2), we see that, because the logistic function increases (decreases)

as the linear predictor increases (decreases), we see that the probability of wheezing at time tij ,

E(Yij), will, for example, increase if β1 > 0 and a child is from Kingston (ci = 1) rather than

Portage (ci = 0). If β1 < 0, then the probability of wheezing is smaller for a child from Kingston

than for one from Portage. Similarly, if β2 < 0, this would say that the probability of wheezing

is smaller for a child whose mother is a non- rather than heavy smoker (and similarly for β3 < 0

and moderate smoking).

VARIANCE: The above examples illustrate how one might model the mean response as a function of

time and other covariates using the types of models appropriate for nonnormal data. The next part of

the modeling strategy is to model the variance of each element of the data vector.

• Recall that in the population-averaged approach, the covariance matrix of a data vector is modeled

directly; i.e. the model selected incorporates the aggregate effects both of within- and among-

unit variation. Thus, the diagonal elements of the covariance matrix represent the combined

effects of variance from both sources.

• Thus, in the approach here, when we specify a model for variance of an element Yij , we are

modeling the aggregate variance from both sources.

Thus, for the different types of data, the model for var(Yij) is meant to represent the overall variance

of Yij from both sources. That is, the distribution of each observation in a data vector across the

population of all units and including variability in taking measurements is assumed to have variance

related to the assumed mean for Yij as in the models above. How variance is related to the mean

depends on the type of data:

PAGE 475

Page 485: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 12 ST 732, M. DAVIDIAN

• For example, for binary responses Yij taken on unit i at times tij , variance would be taken to be

that of a binary random variable as imposed by the Bernoulli distribution; i.e.

var(Yij) = E(Yij){1 − E(Yij)}. (12.3)

Thus, for the wheezing data, variance would be modeled as in (12.3) with E(Yij) as in (12.1).

• For responses Yij in the form of counts taken at times tij on unit i, variance would be taken to

be that of a Poisson random variable; i.e.

var(Yij) = E(Yij) (12.4)

• For positive responses with constant coefficient of variation, variance would be modeled as

var(Yij) = σ2{E(Yij)}2, where E(Yij) is modeled by a suitable function like the loglinear or

reciprocal model.

OVERDISPERSION: Sometimes, these models for variance turn out to be inadequate for representing

all the variation in observations taken at a particular time across units. There are many reasons why

this may be the case:

• The aggregate effects of (i) error introduced by taking measurements and (ii) variation because

units differ add up to be more than would be expected if we only considered observations on a

particular unit.

• There may be other factors involved in data collection that make things look more variable than

the usual assumptions might indicate; e.g. the subjects in the seizure study may have not kept

accurate records of the number of seizures that they experienced during a particular period, and

perhaps recalled it as being greater or less than it actually was. This is usually not a problem for

binary data, since it is generally easy to reliably record whether the event of interest occurred.

Theses issue could make the variance in the population of all possible observations across all units

appear to be more variable than expected. Note that the second issue could arise even in the cases

considered in Chapter 11. The extension we are about to discuss may be applied to ordinary generalized

linear regression modeling as well in this case.

PAGE 476

Page 486: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 12 ST 732, M. DAVIDIAN

The phenomenon where variance may be greater than that dictated by a standard model based on one

of these distributions is called overdispersion. To take this phenomenon into account, it is customary

to be a little more flexible about modeling overall variance in some of these models.

• For example, for count data, it is standard to modify the variance model to allow for an additional

scale or overdispersion parameter; i.e.

var(Yij) = φE(Yij). (12.5)

• For binary data, this is not generally required; if we wrote a model

var(Yij) = φE(Yij){1 − E(Yij)},

we would expect φ to be estimated as equal to 1, as the variance of a binary response should be

just E(Yij){1 − E(Yij)}

Fancier ways to deal with “overdispersion” are described in, for example McCullagh and Nelder (1989).

“WORKING” CORRELATION MATRIX: The last requirement is to specify a model describing cor-

relation among pairs of observations on the same data vector. Again, because the modeling is of the

population-averaged type, the model for correlation is attempting to represent how all sources of

variation that could lead to associations among observations “add up,” the aggregate of

• Correlation due to the within-subject “fluctuations” on a particular unit (and possibly measure-

ment error).

• Correlation due to the simple fact the observations on the same unit are “more alike” than those

from different units.

The models that are chosen to represent the overall correlation are the same ones used in modeling

normally distributed data that were discussed in Chapter 8. In the current context one thinks of associ-

ations exclusively in terms of correlations, as the variance is modeled by thinking about it separately

from associations. Popular models are the ones in Chapter 8, which we write here in terms of the

correlation matrices they dictate:

PAGE 477

Page 487: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 12 ST 732, M. DAVIDIAN

• Unstructured correlation: For observations taken at the same time points for different units,

this assumption places no restriction on the nature of associations among elements of a data

vector. If Yij and Yik, j, k = 1, . . . , n, are two observations on the same unit where all units are

observed at the same n times, and if ρjk represents the correlation between Yij and Yik, then

ρjk = 1 if j = k and −1 ≤ ρjk ≤ 1 if j 6= k. The implied correlation matrix for a data vector with

all n observations is the (n × n) matrix

1 ρ12 · · · ρ1n

ρ21 1 · · · ρ2n

......

......

ρn1 · · · ρn,n−1 1

,

where of course ρjk = ρkj for all j, k. Thus, the unstructured “working” correlation assumption

depends on n(n + 1)/2 distinct correlation parameters.

• Compound symmetry (exchangeable) correlation: This assumption says that the correla-

tion between distinct observations on the same unit is the same regardless of when in time the

observations were taken. In principle, this model could be used with balanced data, ideally bal-

anced data with missing values, and unbalanced data where time points are different for different

units. This structure may be written in terms of a single correlation parameter 0 < ρ < 1; i.e.

1 ρ · · · ρ

ρ 1 · · · ρ...

......

...

ρ · · · ρ 1

.

• One-dependent: This assumption says that only observations adjacent in time are correlated

by the same amount −1 < ρ < 1. In principle, this model could be used with any situation;

however, for unbalanced data with different time points, it may not make sense, as we discussed

in Chapter 8. The model may be written

1 ρ 0 · · · 0

ρ 1 ρ · · · 0...

......

......

0 · · · 0 ρ 1

.

PAGE 478

Page 488: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 12 ST 732, M. DAVIDIAN

• AR(1) correlation: This assumption says that correlation among observations “tails off;” if

−1 < ρ < 1, the model is

1 ρ ρ2 · · · ρn−1

ρ 1 ρ · · · ρn−2

......

......

...

ρn−1 · · · ρ2 ρ 1

.

In principle, this model could be used with any situation; however, again, for unbalanced data

with different time points, it may not make sense.

Note that in the case of ideally balanced data, if some data vectors are missing some observations, then

the forms of these matrices must be constructed carefully to reflect this, as discussed in Chapter 8. E.g.,

for n = 5 and a vector missing the observations corresponding to j = 2 and 4, the unstructured matrix

would be constructed as

1 ρ13 ρ15

ρ13 1 ρ35

ρ15 ρ35 1

,

where we have used the fact that ρjk = ρkj .

For unbalanced data where the observations on each unit are taken at possibly different times, the

models such as the Markov model discussed in Chapter 8 may be used in the obvious way; currently,

this capability is not part of PROC GENMOD in SAS. The examples we consider in this chapter are from

longitudinal studies designed (ideally) to be balanced.

The correlation model so specified is popularly referred to in the context of these models as the “working

correlation matrix.” This designation is given because it is well-recognized that such modeling carries

with it much uncertainty; as we have discussed, we are attempting to capture variance and correlation

from all sources with a single model. Thus, the model is considered to be only a “working” model

rather than necessarily representing what is probably a very complex truth. “Working” correlation

became popular in the context of modeling longitudinal data with generalized linear models; however,

it is equally applicable when discussing the the modeling of Chapter 8 in the normal case. Thus, although

this term gained popularity in nonnormal data situations, it has come to be used in the linear, normal

case, too. As we have seen in the linear, normal case, introducing random effects is an alternative way

to generate covariance models that may have an easier time at capturing both sources of variation.

PAGE 479

Page 489: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 12 ST 732, M. DAVIDIAN

ALL TOGETHER: Combining the models for variance and correlation gives a model for the covariance

matrix for a data vector Y i. It is customary to represent this in the “alternative” form in Equation (3.7).

Suppose that unit i has a vector of associated covariates, possibly including time tij , xij .

• It may well be the case that xij does not vary with j, or varies with j only through tij . In this

case, covariates are time-independent.

• Following our previous discussion, it may be that xij includes time-dependent covariates. It

may even include values of such covariates or even responses at other j!

Thus, the notation xij is meant to include all components deemed relevant at j.

We write the mean response model as

µij = E(Yij) = f(x′

ijβ),

where f is one of the functions such as the exponential (loglinear) or logistic regression models. Then

the variance of Yij is modeled by some function of the mean response µij ; e.g.

var(Yij) = φV (µij),

where we include a dispersion parameter φ. The standard deviation of Yij is given by {φV (µij)}1/2.

Suppose that unit i has ni observations, so that j = 1, . . . , ni. Define the standard deviation matrix

for unit i as the (ni × ni) diagonal matrix whose diagonal elements are the standard deviations of the

Yij under this model, except for the dispersion parameter; that is, let

T1/2i =

{V (µi1)}1/2 0 · · · 0

0 {V (µi2)}1/2 · · · 0...

......

...

0 · · · 0 {V (µini)}1/2

. (12.6)

Let Γi be the (ni × ni) correlation matrix under one of the assumptions above, properly constructed

for this unit’s time pattern. Then we may write the covariance matrix Σi for the data vector Y i

implied by the assumptions as (verify)

Σi = φT1/2i ΓiT

1/2i ;

note that we have multiplied by the overdispersion parameter φ = φ1/2φ1/2 to complete the specification

of the standard deviations in each matrix T1/2i .

PAGE 480

Page 490: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 12 ST 732, M. DAVIDIAN

Note that the “i” subscript is needed on both T1/2i and Γi to remind us that the dimensions of these

matrices and the diagonal elements of T1/2i depend on the particular unit i with its own mean response

vector and number of observations ni.

SUMMARY: We may now summarize the modeling strategy and resulting statistical model. To specify

a population-averaged model for mean and covariance matrix of a data vector for nonnormal responses

using this approach:

• The mean response of a data vector Y i is modeled as a function of time, other covariates, and

parameters β by using a generalized linear model-type mean structure to represent the mean

response of each element of Y i.

• The variance of each element of Y i is modeled by the function of the mean that is appropriate

for the type of data; e.g. count data are taken to have the Poisson variance structure, which

says that variance of any element of Y i is equal to the corresponding model for the mean. These

models are often modified to allow for the greater variation both within- and among-units by the

addition of a dispersion parameter φ.

• Correlation among observations on the same unit (elements of Y i) is represented by choosing

a model, such as the correlation structures corresponding to the AR(1), one-dependent, Markov,

or other specifications. Because there is some uncertainty in doing this and (as we’ll see) no

formal way to check it, the chosen model is referred to as the “working correlation matrix” to

emphasize this fact.

With these considerations, we have the following statistical model for the mean vector and covariance

matrix of a data vector Y i consisting of observations Yij , j = 1, . . . , ni on unit i. If

• Mean response of Yij is modeled by a suitable function f of a linear predictor x′

ijβ

• Variance is thus modeled as some function V of mean response times a dispersion parameter φ,

which defines a standard deviation matrix T1/2i as in (12.6) above,

• Correlation is modeled by a “working” correlation assumption Γi

E(Y i) =

f(x′

i1β)

f(x′

i2β)...

f(x′

iniβ)

= f i(β), var(Y i) = φT1/2i ΓiT

1/2i = Σi = φΛi. (12.7)

PAGE 481

Page 491: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 12 ST 732, M. DAVIDIAN

Let ω refer to the distinct unknown parameters that fully describe the chosen “working” correlation

matrix Γi. For example, for the compound symmetry, AR(1), and one-dependent structure, ω = ρ;

for the unstructured model, ω consists of the distinct possible correlation parameters ρjk for the data

vector of maximal size n.

As always, it is assumed that the individual data vectors Y i are independent across individual units.

As noted above, however, we are not in a position to specify a full multivariate probability distribution

corresponding to this mean and covariance model.

12.3 Generalized estimating equations

The considerations in the last section allow specification of a model for the mean and covariance of a

data vector of the form (12.7). However, because this is not sufficient to specify an entire appropriate

multivariate probability distribution, it is not possible to appeal immediately to the principle of

maximum likelihood to develop a framework for estimation and testing.

IDEA: Although we do not have a basis for the maximum likelihood, why not try to emulate situations

where there is such a basis? We have two situations to which we can appeal:

• The normal case with a linear mean model, discussed in Chapter 8. Here, the model was

E(Y i) = X iβ, var(Y i) = Σi

for suitable choice of covariance matrix Σi depending on a vector of parameters ω, say. Assuming

that the Y i follow a multivariate normal, we were led to the estimator for β

β =

(m∑

i=1

X ′

iΣ−1i Xi

)−1 m∑

i=1

X ′

iΣ−1i Y i, (12.8)

where Σi is the covariance matrix with the estimator for ω plugged in. It may be shown (try it!)

that it is possible to rewrite (12.8) in the following form:

m∑

i=1

X ′

iΣ−1i (Y i − Xiβ) = 0. (12.9)

That is, the estimator for β solves an a set of p equations for β (p × 1) (with the estimator for

ω plugged in).

PAGE 482

Page 492: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 12 ST 732, M. DAVIDIAN

• In the case of ordinary generalized linear models, recall that considering maximum likelihood,

which was possible in that case, led to solving a set of equations of the form (11.18); i.e.

n∑

j=1

1

V {f(x′

jβ)}{Yj − f(x′

jβ)}f ′(x′

jβ)xj = 0, (12.10)

where f ′(u) =d

duf(u), the derivative of f with respect to its argument. The method of iteratively

reweighted least squares was used to solve this equation. Note that if there is a scale parameter,

it need not be taken into account in this calculation.

• Comparing (12.9) and (12.10), we see that there is a similar theme – the equations are linear

functions of deviations of observations from their assumed mean are weighted in accordance

with their covariance (for vectors) and variance (for individual observations). The variance or

covariance matrix is not entirely known but is evaluated at estimates of the unknown quantities

it contains (ω in the first case and β in the second case).

GENERALIZED ESTIMATING EQUATION: From these observations, a natural approach for fitting

model (12.7) is suggested: solve an estimating equation consisting of p equations for β (p × 1) that

(i) is a linear function of deviations

Y i − f i(β),

and (ii) weights these deviations in the same way as in (12.9) and (12.10), using the inverse of the

assumed covariance matrix Σi of a data vector with an estimator for the unknown parameters ω in the

“working” correlation matrix plugged in.

Note that even if there is a scale parameter, we really need only use the inverse of Λi in (12.7). As

in (12.10), Σi and Λi will also depend on β through the variance functions V {f(x′

ijβ)}; more in a

moment.

These results lead to consideration of the following equation to be solved for β (with a suitable estimator

for ω plugged in):m∑

i=1

∆′

iΛ−1i {Y i − f i(β)} = 0, (12.11)

where ∆i is the (ni × p) matrix whose (j, s) element (j = 1, . . . , ni, s = 1, . . . , p) is the derivative of

f(x′

ijβ) with respect to the sth element of β, and Λi is the matrix Λi in (12.7) with an estimator for

ω plugged in (see below). Note that φ can be disregarded here.

The matrix ∆i is a function of β. It is also a function of X i, which here is defined as the (ni×p) matrix

whose rows are x′

ij . It is possible to write out the form of ∆i precisely in terms of X i and the elements

f ′(x′

ijβ); this is peripheral to our discussion here; see Liang and Zeger (1986) for the gory details.

PAGE 483

Page 493: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 12 ST 732, M. DAVIDIAN

An equation of the form (12.11) to be solved to estimate a parameter β in a mean response model is

referred to popularly as a generalized estimating equation, or GEE for short.

ESTIMATION OF ω: To use (12.11) to estimate β, an estimator for ω is required. There are a number

of methods that have been proposed to obtain such estimators; the books by Diggle, Heagerty, Liang,

and Zeger (2002) and Vonesh and Carter (1997) discuss this in detail. One intuitive way, and that used

by PROC GENMOD in SAS and originally proposed by Liang and Zeger (1986), is to base the estimation

on appropriate functions of deviations

Y i − f i(β),

where β is some estimator for β.

• For example, one could fit the mean model for all m individuals assuming independence among

all observations using the techniques of Chapter 11 to obtain such an estimate. This estimate

could be used to form deviations and thus to estimate ω.

To see how this might work, let

rij =Yij − f(x′

ijβ)

[V {f(x′

ijβ)}1/2

be the deviation corresponding to the jth observation on unit i divided by an estimate of its standard

deviation. Then the dispersion parameter φ is usually estimated by

φ = (N − p)−1m∑

i=1

ni∑

j=1

{Yij − f(x′

ijβ)}2

V {f(x′

ijβ)}= (N − p)−1

m∑

i=1

ni∑

j=1

r2ij . (12.12)

Compare this to the Pearson chi-square in ordinary generalized linear models in Chapter 11; it is the

same function but taken across all deviations for all units.

• If Γi corresponds to the unstructured correlation assumption, then estimate ρjk by

ρjk = m−1φ−1m∑

i=1

rijrik.

• If Γi corresponds to the compound symmetry structure, then the single parameter ρ may be

estimated by

ρ = m−1φ−1m∑

i=1

(ni − 1)−1ni−1∑

j=1

rijri,j+1.

Note that the rationale here is to consider only adjacent pairs, as you might expect.

ω for other covariance models may be estimated by a similar approach.

PAGE 484

Page 494: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 12 ST 732, M. DAVIDIAN

ALL TOGETHER: The above ideas may be combined to define an estimation scheme for β, ω, and φ

in the model (12.7). Heuristically, the scheme has the following form:

1. Obtain an initial estimator for β by assuming all observations across all individuals are inde-

pendent. This may be carried out using the method of IRWLS for ordinary generalized linear

models, as described in Chapter 11.

2. Using this estimator for β, estimate φ and then ω as appropriate for the assumed “working”

correlation matrix.

3. Use these estimators for β and ω to form an estimate of Λi, Λi. Treat this as fixed in the

generalized estimating equation (12.11). The resulting equation may then be solved by a numerical

technique that is an extended version of the IRWLS method used in the ordinary case. Obtain

a new estimator β.

4. Return to step 2 if desired and repeat the process. Steps 2, 3, and 4 can be repeated until the

results of two successive tries stay the same (“convergence”).

The spirit of this scheme is implemented in the SAS procedure PROC GENMOD.

SAMPLING DISTRIBUTION: As before, it should not be surprising that we must appeal to large

sample theory to obtain an approximation to the sampling distribution of the estimator β obtained

by solving the GEE. Here, “large sample” refers to the number of units, m; this is sensible; each Y i is

from a different unit.

The results may be stated as follows: For m “large,” the GEE estimator β for β satisfies

β·∼ N

β, φ

(m∑

i=1

∆′

iΛ−1i ∆i

)−1 , (12.13)

where ∆i is as defined previously. As in the ordinary generalized linear model case, ∆i and Λi depend

on β and ω; moreover, φ is also unknown. Thus, for practical use, these quantities are replaced by

estimates. Specifically, define

V β = φ

(m∑

i=1

∆′

iΛ−1i ∆i

)−1

,

where ∆i and Λi are ∆i and Λi with the final estimates of β and ω plugged in and φ is the estimate

of φ. φ would just be equal to 1 if no scale parameter is in the model. Again, we use the notation V β

to represent the estimated covariance matrix of β.

PAGE 485

Page 495: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 12 ST 732, M. DAVIDIAN

As usual, standard errors for the elements of β may be obtained as the square roots of the diagonal

elements of V β .

HYPOTHESIS TESTS: As in the ordinary generalized linear model case, Wald testing procedures are

used to test null hypotheses of the form

H0 : Lβ = h.

As usual, we have the large sample approximation

Lβ·∼ N (Lβ, LV βL′),

which may be used to construct test statistics and confidence intervals in a fashion identical to that

discussed previously; for example, if L is a row vector, then the test may be based on comparing

z =Lβ − h

SE(Lβ)

to the critical values from the standard normal distribution. For more general L, one may form the

Wald χ2 statistic More generally, the Wald χ2 test statistic

(Lβ − h)′(LV βL′)−1(Lβ − h)

and compare to the appropriate χ2 critical value with degrees of freedom equal to the number of rows

of L.

12.4 “Robust” estimator for sampling covariance

ISSUE: It is important to recognize that the GEE fitting method for estimating the parameters in

model (12.7) is not a maximum likelihood method; rather, it was arrived at from an ad hoc perspective.

As a result, it is not possible to derive quantities like AIC and BIC to compare different “working”

correlation matrices to determine which assumption is most suitable. Consequently, it is sensible to be

concerned that the validity of inferences on β such as the estimator itself, calculation of approximate

confidence intervals, and tests may be compromised if the assumption on correlation is incorrect.

SOLUTION: One solution to this dilemma is to modify the estimated covariance matrix V β to allow

for the possibility that the choice of Γi used in the model is incorrect. The modified version of V β is

VR

β =

(m∑

i=1

∆′

iΛ−1i ∆i

)−1( m∑

i=1

∆′

iΛ−1i SiΛ

−1i ∆i

)(m∑

i=1

∆′

iΛ−1i ∆i

)−1

, (12.14)

where

Si = {Y i − f i(β)}{Y i − f i(β)}′.

PAGE 486

Page 496: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 12 ST 732, M. DAVIDIAN

• Even if the model has a scale parameter. (12.14) does not require an estimate of it.

• Note that if Si were equal to Σi = φΛi, then (12.14) would be equivalent to V β (verify).

• The rationale for the modification may be appreciated by considering the definition of the true

covariance matrix for Y i; specifically,

var(Y i) = E{Y i − f i(β)}{Y i − f i(β)}′.

In the model, we have chosen Σi (through choosing Γi as our assumption about var(Y i). By

including the “middle” term in (12.14), we are thus hoping to “balance out” an alternative guess

for var(Y i) against the assumed model Σi.

• It turns out that, for large m, VR

β will provide a reliable estimate of the true sampling covariance

matrix of β even if the chosen model Σi (Γi) is incorrect. In contrast, if the model is incorrect,

V β will not provide a reliable estimate.

The alternative estimate of the sampling covariance matrix of β VR

β is often referred to as the robust

covariance matrix estimate. The term is derived from the fact that VR

β is “robust” to the fact that we

may be incorrect about Γi. V β is often referred to as the model-based covariance matrix estimate,

because it uses the model assumption on Γi with no attempt to correct for the possibility it is wrong.

This “robust” modification may also be applied to the linear, normal models in Chapter 8. To get “ro-

bust” standard errors, use the empirical option in the proc mixed statement: proc mixed empirical

data=;

The decision whether to use the model-based estimate V β or the robust estimate VR

β is an “art-

form.” No consensus exists on which one is to be preferred in finite samples in practical problems. If

they are very different, some people take that as an indication that the original assumption is wrong.

On the other hand, if one or more of the Y i vectors contains “unusual” values that are very unlikely

to be seen, this would be enough to “throw off” the estimate VR

β . Because there is no “iron-clad” rule,

we offer no recommendation on which to use.

12.5 Contrasting population-averaged and subject-specific approaches

The model (12.7) is, as stated, a population-averaged model. The mean of a data vector and its

covariance matrix are modeled explicitly. As a result, from our discussions in Chapter 9, we know

that β has the interpretation as the parameters that describe the relationship of the mean response

over time and other covariates.

PAGE 487

Page 497: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 12 ST 732, M. DAVIDIAN

An alternative perspective we discussed was that of the subject-specific approach. In this approach,

one starts with thinking about individual unit trajectories rather than about the mean (average)

across all units. In the linear model case, we did this by the introduction of random effects; e.g., the

random coefficient model that says each unit has its own intercept and slope β0i and β1i, which in

turn are represented as

β0i = β0 + b0i, β1i = β1 + b1i, β = (β0, β1)′.

In this model, the interpretation of β is as the “typical” value of intercept and slope in the population.

It just so happened that in the case of a linear model for either the mean response or individual

trajectory, one arrives at the same mean response model. Thus, in this case, the distinction between

these two interpretations was not important – either was valid.

SUBJECT-SPECIFIC GENERALIZED LINEAR MODEL: It is natural to consider the subject-

specific approach in the case where the functions of generalized linear models are appropriate. For

example, recall the seizure data, where the response is a count. By analogy to linear random coefficient

and mixed effects models, suppose we decided to model the individual trajectory of counts for an

individual subject as a subject-specific loglinear regression model. That is, suppose we wrote the

“mean” for subject i as a function of subject-specific parameters β0i and β3i as

exp(β0i + β3itij) (12.15)

In (12.15), β0i and β3i thus describe the subject’s own (conditional) mean response as a function of

time and individual “intercept” and “slope” on the log scale. Under this perspective, each subject has

his/her own such parameters β0i and β3i that characterize his/her own mean response over time.

Now, just as we did earlier, suppose we thought of the β0i and β4i as arising from populations of such

values. For example, suppose that

β3i = β3 + b3i,

where b3i is a random effect for subject i with mean 0. b3i describes how subject i deviates from the

“typical” value β3. Similarly, we might suppose that

β0i = β0 + b0i

for another mean-zero random effect b0i.

PAGE 488

Page 498: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 12 ST 732, M. DAVIDIAN

To incorporate the covariate information on treatment and age, we might assume that the “typical”

rate of change of log mean with time does not depend on these covariates, but maybe the “typical”

intercept does; e.g., we could write an alternative model depending on covariates ai and δi, say, as

β0i = β0 + β1ai + β2δi + b0i.

Putting all of this together, we arrive at a model for the “mean” for subject i, depending on the random

effect vector bi = (b0i, b3i)′:

E(Yij | bi) = exp(β0 + β1ai + β2δi + b0i + β3tij + b3itij) (12.16)

Following with the analogy, we could assume that the random effects bi ∼ N (0, D) for some covariance

matrix D.

We could write this model another way. Let βi = (β0i, β3i). The we have a first-stage model that says

the conditional mean for Y i, given bi on which βi depends is f i(βi), where

f i(βi) =

exp(β0i + β3iti1)...

exp(β0i + β3itini)

.

At the second stage, we could assume

βi = Aiβ + bi;

for the model above, β = (β0, β1, β2, β3)′ and, for subject i

Ai =

1 ai δi 0

0 0 0 1

.

(Verify.)

ARE THE TWO MODELS THE SAME? All of this is very similar to what we did in the normal, linear

case. In that case, both approaches led to the same representation of the ultimate mean response vector

E(Y i), but with different covariance matrices. The population-averaged model for mean response is

E(Y i) = X iβ. In the subject-specific general linear mixed model, by contrast, the “individual mean”

is

E(Y i | bi) = X iβ + Zibi. (12.17)

But this “individual mean” has expectation

E{Xiβ + Zibi} = X iβ,

since bi has mean zero, which is identical to the population-averaged model.

PAGE 489

Page 499: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 12 ST 732, M. DAVIDIAN

Here, our two competing models are the population-averaged model that says immediately that

E(Y i) has jth element

E(Yij) = exp(β0 + β1ai + β2δi + β3tij),

and, from (12.16), the subject-specific model that says E(Y i | bi) has jth element

exp(β0 + β1ai + β2δi + b0i + β3tij + b3itij).

If the models were the same, we would expect that the expectation of this would be identical to

E(Yij) above. However, this is not the case. Note that we need to evaluate

E {exp(β0 + β1bi + β2ai + β3δi + b0i + β3tij + b3itij)} .

Contrast this with the calculation in (12.17) above – because that function of bi was linear, evaluating

the expectation was straightforward. Here, however, evaluating the expectation is not straightforward,

because it involves a complicated nonlinear function of bi = (b0i, b3i)′. Even though bi are normal, the

expectation of this nonlinear function is not possible to evaluate by a simple rule as in the linear case.

As a result, it is not true that the expectation is identical to E(Yij) above.

RESULT: This is a general phenomenon, although we showed it just for a specific model. In a nonlinear

model, it is no longer true that the population-averaged and subject-specific perspectives lead to the

same model for mean response E(Y i). Thus, the two models are different. Furthermore, the parameter

we called β in each model has a different interpretation; e.g. in the seizure example,

• β for the population-averaged model has the interpretation as the value that leads to the “typical”

or mean response vector

• β for the subject-specific model has the interpretation as the value that is the “typical” value of

“intercept” and “slope” of log mean.

This may seem like a subtle and difficult-to-understand difference, which it is. But the main point is

that the two different modeling strategies lead to two different ways to describe the data with different

interpretations. Obviously, in these more complex models, the distinction matters. See Chapter 13 for

more.

PAGE 490

Page 500: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 12 ST 732, M. DAVIDIAN

12.6 Discussion

The presentation here just scratches the surface of the area of population-averaged modeling for longi-

tudinal data that may not be normally distributed. In fact, this is still an area of active research, and

papers on the subject may be found in current issues of Journal of the American Statistical Association,

Biometrics, and others. See the books by Diggle, Liang, and Zeger (1995) and Vonesh and Carter (1997)

for more extensive treatment.

12.7 Implementation with SAS

We illustrate how to carry out fitting of population-averaged generalized linear models for longitudinal

data via the use of generalized estimating equations for the two examples discussed in this chapter:

1. The epileptic seizure data

2. Wheezing data from the Six Cities study

our main focus is on the use of PROC GENMOD to fit models like those in the examples. We show how to

specify different “working” correlation models via the repeated statement in this procedure, both for

balanced (the seizure data) and unbalanced (the wheezing data) cases and how to interpret the output.

ASIDE: It is possible to implement this fitting, and more variations on it, in SAS in other ways –

one possibility is through use of the GLIMMIX SAS macro, developed at SAS, that is meant to be used

for fitting generalized linear mixed models, which are subject-specific models for nonnormal

longitudinal data incorporating random effects, as the name suggests (see Chapter 13). This is similar

in spirit to using PROC MIXED to fit linear population-averaged regression models to normal data; these

models contain no random effects, yet this procedure may be used to fit them, as we have seen. The

details are beyond the scope of this course.

PAGE 491

Page 501: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 12 ST 732, M. DAVIDIAN

EXAMPLE 1 – EPILEPTIC SEIZURE DATA: We first consider the model (12.1),

E(Yij) = exp(log oij + β0 + β1vij + β2δi + β3vijδi),

discussed earlier. We fit this model using several working correlation matrices. Here, the coefficient

of greatest interest is β3, which reflects whether post-baseline mean response is different in the two

treatment groups.

There is one “unusual” subject (subject 207 in the progabide group) whose seizure counts are very high;

this subject had a baseline count of 151 in the 8 week pre-treatment period. This subject’s data are

sufficiently unusual relative to those for the rest of the participants that it is natural to be concerned

over whether the conclusions are sensitive to them. To investigate, we fit the model excluding the data

for this subject.

Finally, we also allow for the possibility that the mean response changes at the 4th visit and include

age as a covariate to take account of possible association of baseline seizure characteristics with age

of the subject. For the first issue, we define an additional indicator variable v4ij = 0 unless j = 5

corresponding to the visit 4. The model is modified to

E(Yij) = exp(log oij + β0 + β1vij + β2δi + β3vijδi + β4v4ij + β5v4ijδi).

The parameter β5 reflects whether the difference in post-baseline mean response in fact changes at the

fourth visit, while β4 allows the possibility that the mean response “shifts” at the 4th visit relative to

the earlier ones.

To incorporate oij , in the program we use the offset option in the model statement of proc genmod.

PAGE 492

Page 502: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 12 ST 732, M. DAVIDIAN

PROGRAM:

/******************************************************************

CHAPTER 12, EXAMPLE 1

Fit a loglinear regression model to the epileptic seizure data.These are count data, thus we use the Poisson mean/varianceassumptions. This model is fitted with different workingcorrelation matrics.

******************************************************************/

options ls=80 ps=59 nodate; run;

/******************************************************************

The data look like (first 8 records on first 2 subjects)

104 11 0 0 11 31104 5 1 0 11 31104 3 2 0 11 31104 3 3 0 11 31104 3 4 0 11 31106 11 0 0 11 31106 3 1 0 11 30106 5 2 0 11 30106 3 3 0 11 30106 3 4 0 11 30

.

.

.

column 1 subjectcolumn 2 number of seizurescolumn 3 visit (baseine (0) and 1--4 biweekly visits)column 4 =0 if placebo, = 1 if progabidecolumn 5 baseline number of seizures in 8 weeks prior to studycolumn 6 age

******************************************************************/

data seizure; infile ’seize.dat’;input subject seize visit trt base age;

run;

/*****************************************************************

Fit the loglinear regression model using PROC GENMOD andthree different working correlation matrix assumptions:

- unstructured- compound symmetry (exchangeable)- AR(1)

Subject 207 has what appear to be very unusual data -- forthis subject, both baseline and study-period numbers of seizuresare huge, much larger than any other subject. In some publishedanalyses, this subjectis deleted. See Diggle, Heagerty, Liang,and Zeger (2002) and Thall and Vail (1990) for more on this subject.We carry out the analyses with and without this subject.

We fit the mean model in equation (12.1) first. We then add ageas a covariate to allow for systematic differences in baseline responsedue to age. We use log(age) as has been the case in other analyses.

The DIST=POISSON option in the model statement specifiesthat the Poisson requirement that mean = variance, be used.The LINK=LOG option asks for the loglinear model. OtherLINK= choices are available.

The REPEATED statement specifies the "working" correlationstructure to be assumed. The CORRW option in the REPEATEDstatement prints out the estimated working correlation matrixunder the assumption given in the TYPE= option. The COVBoption prints out the estimated covariance matrix of the estimateof beta -- both the usual estimate and the "robust" versionare printed. The MODELSE option specifies that the standarderror estimates printed for the elements of betahat are basedon the usual theory. By default, the ones based on the "robust"version of the sampling covariance matrix are printed, too.

The dispersion parameter phi is estimated rather then being heldfixed at 1 -- this allows for the possibility of "overdispersion"

The new version of SAS will not allow the response to be a nonintegerwhen we declare dist = poisson. Thus, analyzing seize/o is not

PAGE 493

Page 503: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 12 ST 732, M. DAVIDIAN

possible. Instead, one can use the OFFSET option in the MODELstatement. This will fit the model exactly how it is written inmodel (12.1) -- the term log(o_ij) is the known "offset." To getSAS to include this "offset," we form the variable logo in thedata set and then declare logo to be an offset.

******************************************************************/

data seizure; set seizure;logage=log(age);o=2; v=1;if visit=0 then o=8;if visit=0 then v=0;logo=log(o);

run;

title "UNSTRUCTURED CORRELATION";proc genmod data=seizure;class subject;model seize = v trt trt*v / dist = poisson link = log offset=logo;repeated subject=subject / type=un corrw covb modelse;

run;

title "EXCHANGEABLE (COMPOUND SYMMETRY) CORRELATION";proc genmod data=seizure;class subject;model seize = v trt trt*v / dist = poisson link = log offset=logo;repeated subject=subject / type=cs corrw covb modelse;

run;

title "AR(1) CORRELATION";proc genmod data=seizure;class subject;model seize = v trt trt*v / dist = poisson link = log offset=logo;repeated subject=subject / type=ar(1) corrw covb modelse;

run;

/******************************************************************

Delete the unusual subject and run again; we only use thecompound symmetric covariance for the rest of the analyses.

******************************************************************/

data weird; set seizure;if subject=207 then delete;

run;

title "SUBJECT 207 DELETED";proc genmod data=weird;class subject;model seize = v trt trt*v / dist = poisson link = log offset=logo;repeated subject=subject / type=cs corrw covb modelse;

run;

/******************************************************************

Now we fit two additional models on the full data (with 207).In the first, we add logage as a covariate. In the second,we allow an additional shift at visit 4. To do this,we define visit4 to be an indicator of the last visit.

******************************************************************/

data seizure; set seizure;visit4=1;if visit<4 then visit4=0;

run;

title "AGE ADDED";proc genmod data=seizure;class subject;model seize = logage v trt trt*v / dist = poisson link = log offset=logo;repeated subject=subject / type=cs corrw covb modelse;

run;

title "MODIFIED MODEL";proc genmod data=seizure;class subject;model seize = v visit4 trt trt*v trt*visit4 /

dist = poisson link = log offset=logo;repeated subject=subject / type=cs corrw covb modelse;

run;

PAGE 494

Page 504: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 12 ST 732, M. DAVIDIAN

OUTPUT: Following the output, we comment on a few aspects of the output.

UNSTRUCTURED CORRELATION 1

The GENMOD Procedure

Model Information

Data Set WORK.SEIZUREDistribution PoissonLink Function LogDependent Variable seizeOffset Variable logo

Number of Observations Read 295Number of Observations Used 295

Class Level Information

Class Levels Values

subject 59 101 102 103 104 106 107 108 110 111 112 113 114116 117 118 121 122 123 124 126 128 129 130 135137 139 141 143 145 147 201 202 203 204 205 206207 208 209 210 211 213 214 215 217 218 219 220221 222 225 226 227 228 230 232 234 236 238

Parameter Information

Parameter Effect

Prm1 InterceptPrm2 vPrm3 trtPrm4 v*trt

Criteria For Assessing Goodness Of Fit

Criterion DF Value Value/DF

Deviance 291 3577.8316 12.2950Scaled Deviance 291 3577.8316 12.2950Pearson Chi-Square 291 5733.4815 19.7027Scaled Pearson X2 291 5733.4815 19.7027Log Likelihood 6665.9803

Algorithm converged.

Analysis Of Initial Parameter Estimates

Standard Wald 95% Chi-Parameter DF Estimate Error Confidence Limits Square Pr > ChiSq

Intercept 1 1.3476 0.0341 1.2809 1.4144 1565.44 <.0001v 1 0.1108 0.0469 0.0189 0.2027 5.58 0.0181

UNSTRUCTURED CORRELATION 2

The GENMOD Procedure

Analysis Of Initial Parameter Estimates

Standard Wald 95% Chi-Parameter DF Estimate Error Confidence Limits Square Pr > ChiSq

trt 1 0.0265 0.0467 -0.0650 0.1180 0.32 0.5702v*trt 1 -0.1037 0.0651 -0.2312 0.0238 2.54 0.1110Scale 0 1.0000 0.0000 1.0000 1.0000

NOTE: The scale parameter was held fixed.

GEE Model Information

Correlation Structure UnstructuredSubject Effect subject (59 levels)Number of Clusters 59Correlation Matrix Dimension 5Maximum Cluster Size 5Minimum Cluster Size 5

Covariance Matrix (Model-Based)

Prm1 Prm2 Prm3 Prm4

Prm1 0.01205 0.01924 -0.01205 -0.01924Prm2 0.01924 0.03091 -0.01924 -0.03091Prm3 -0.01205 -0.01924 0.02220 0.03696Prm4 -0.01924 -0.03091 0.03696 0.06209

PAGE 495

Page 505: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 12 ST 732, M. DAVIDIAN

Covariance Matrix (Empirical)

Prm1 Prm2 Prm3 Prm4

Prm1 0.23193 0.0007209 -0.23193 -0.000721Prm2 0.0007209 0.01564 -0.000721 -0.01564Prm3 -0.23193 -0.000721 0.32478 -0.03058Prm4 -0.000721 -0.01564 -0.03058 0.06334

Algorithm converged.

Working Correlation Matrix

Col1 Col2 Col3 Col4 Col5

Row1 1.0000 0.9435 0.7324 0.8213 0.6856Row2 0.9435 1.0000 0.8187 0.9435 0.7819Row3 0.7324 0.8187 1.0000 0.7146 0.5375Row4 0.8213 0.9435 0.7146 1.0000 0.6841Row5 0.6856 0.7819 0.5375 0.6841 1.0000

UNSTRUCTURED CORRELATION 3

The GENMOD Procedure

Analysis Of GEE Parameter EstimatesEmpirical Standard Error Estimates

Standard 95% ConfidenceParameter Estimate Error Limits Z Pr > |Z|

Intercept 1.1186 0.4816 0.1747 2.0625 2.32 0.0202v 0.1233 0.1251 -0.1218 0.3684 0.99 0.3241trt 0.0711 0.5699 -1.0459 1.1881 0.12 0.9007v*trt -0.1140 0.2517 -0.6072 0.3793 -0.45 0.6507

Analysis Of GEE Parameter EstimatesModel-Based Standard Error Estimates

Standard 95% ConfidenceParameter Estimate Error Limits Z Pr > |Z|

Intercept 1.1186 0.1098 0.9034 1.3338 10.19 <.0001v 0.1233 0.1758 -0.2213 0.4679 0.70 0.4831trt 0.0711 0.1490 -0.2209 0.3631 0.48 0.6331v*trt -0.1140 0.2492 -0.6023 0.3744 -0.46 0.6474Scale 4.9502 . . . . .

NOTE: The scale parameter for GEE estimation was computed as the square rootof the normalized Pearson’s chi-square.

EXCHANGEABLE (COMPOUND SYMMETRY) CORRELATION 4

The GENMOD Procedure

Model Information

Data Set WORK.SEIZUREDistribution PoissonLink Function LogDependent Variable seizeOffset Variable logo

Number of Observations Read 295Number of Observations Used 295

Class Level Information

Class Levels Values

subject 59 101 102 103 104 106 107 108 110 111 112 113 114116 117 118 121 122 123 124 126 128 129 130 135137 139 141 143 145 147 201 202 203 204 205 206207 208 209 210 211 213 214 215 217 218 219 220221 222 225 226 227 228 230 232 234 236 238

Parameter Information

Parameter Effect

Prm1 InterceptPrm2 vPrm3 trtPrm4 v*trt

Criteria For Assessing Goodness Of Fit

Criterion DF Value Value/DF

Deviance 291 3577.8316 12.2950

PAGE 496

Page 506: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 12 ST 732, M. DAVIDIAN

Scaled Deviance 291 3577.8316 12.2950Pearson Chi-Square 291 5733.4815 19.7027Scaled Pearson X2 291 5733.4815 19.7027Log Likelihood 6665.9803

Algorithm converged.

Analysis Of Initial Parameter Estimates

Standard Wald 95% Chi-Parameter DF Estimate Error Confidence Limits Square Pr > ChiSq

Intercept 1 1.3476 0.0341 1.2809 1.4144 1565.44 <.0001v 1 0.1108 0.0469 0.0189 0.2027 5.58 0.0181

EXCHANGEABLE (COMPOUND SYMMETRY) CORRELATION 5

The GENMOD Procedure

Analysis Of Initial Parameter Estimates

Standard Wald 95% Chi-Parameter DF Estimate Error Confidence Limits Square Pr > ChiSq

trt 1 0.0265 0.0467 -0.0650 0.1180 0.32 0.5702v*trt 1 -0.1037 0.0651 -0.2312 0.0238 2.54 0.1110Scale 0 1.0000 0.0000 1.0000 1.0000

NOTE: The scale parameter was held fixed.

GEE Model Information

Correlation Structure ExchangeableSubject Effect subject (59 levels)Number of Clusters 59Correlation Matrix Dimension 5Maximum Cluster Size 5Minimum Cluster Size 5

Covariance Matrix (Model-Based)

Prm1 Prm2 Prm3 Prm4

Prm1 0.02286 0.01051 -0.02286 -0.01051Prm2 0.01051 0.02393 -0.01051 -0.02393Prm3 -0.02286 -0.01051 0.04296 0.02132Prm4 -0.01051 -0.02393 0.02132 0.04838

Covariance Matrix (Empirical)

Prm1 Prm2 Prm3 Prm4

Prm1 0.02476 -0.001152 -0.02476 0.001152Prm2 -0.001152 0.01348 0.001152 -0.01348Prm3 -0.02476 0.001152 0.04922 0.01525Prm4 0.001152 -0.01348 0.01525 0.04563

Algorithm converged.

Working Correlation Matrix

Col1 Col2 Col3 Col4 Col5

Row1 1.0000 0.7716 0.7716 0.7716 0.7716Row2 0.7716 1.0000 0.7716 0.7716 0.7716Row3 0.7716 0.7716 1.0000 0.7716 0.7716Row4 0.7716 0.7716 0.7716 1.0000 0.7716Row5 0.7716 0.7716 0.7716 0.7716 1.0000

EXCHANGEABLE (COMPOUND SYMMETRY) CORRELATION 6

The GENMOD Procedure

Exchangeable WorkingCorrelation

Correlation 0.7715879669

Analysis Of GEE Parameter EstimatesEmpirical Standard Error Estimates

Standard 95% ConfidenceParameter Estimate Error Limits Z Pr > |Z|

Intercept 1.3476 0.1574 1.0392 1.6560 8.56 <.0001v 0.1108 0.1161 -0.1168 0.3383 0.95 0.3399trt 0.0265 0.2219 -0.4083 0.4613 0.12 0.9049v*trt -0.1037 0.2136 -0.5223 0.3150 -0.49 0.6274

Analysis Of GEE Parameter Estimates

PAGE 497

Page 507: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 12 ST 732, M. DAVIDIAN

Model-Based Standard Error Estimates

Standard 95% ConfidenceParameter Estimate Error Limits Z Pr > |Z|

Intercept 1.3476 0.1512 1.0513 1.6439 8.91 <.0001v 0.1108 0.1547 -0.1924 0.4140 0.72 0.4739trt 0.0265 0.2073 -0.3797 0.4328 0.13 0.8982v*trt -0.1037 0.2199 -0.5348 0.3274 -0.47 0.6374Scale 4.4388 . . . . .

NOTE: The scale parameter for GEE estimation was computed as the square rootof the normalized Pearson’s chi-square.

AR(1) CORRELATION 7

The GENMOD Procedure

Model Information

Data Set WORK.SEIZUREDistribution PoissonLink Function LogDependent Variable seizeOffset Variable logo

Number of Observations Read 295Number of Observations Used 295

Class Level Information

Class Levels Values

subject 59 101 102 103 104 106 107 108 110 111 112 113 114116 117 118 121 122 123 124 126 128 129 130 135137 139 141 143 145 147 201 202 203 204 205 206207 208 209 210 211 213 214 215 217 218 219 220221 222 225 226 227 228 230 232 234 236 238

Parameter Information

Parameter Effect

Prm1 InterceptPrm2 vPrm3 trtPrm4 v*trt

Criteria For Assessing Goodness Of Fit

Criterion DF Value Value/DF

Deviance 291 3577.8316 12.2950Scaled Deviance 291 3577.8316 12.2950Pearson Chi-Square 291 5733.4815 19.7027Scaled Pearson X2 291 5733.4815 19.7027Log Likelihood 6665.9803

Algorithm converged.

Analysis Of Initial Parameter Estimates

Standard Wald 95% Chi-Parameter DF Estimate Error Confidence Limits Square Pr > ChiSq

Intercept 1 1.3476 0.0341 1.2809 1.4144 1565.44 <.0001v 1 0.1108 0.0469 0.0189 0.2027 5.58 0.0181

AR(1) CORRELATION 8

The GENMOD Procedure

Analysis Of Initial Parameter Estimates

Standard Wald 95% Chi-Parameter DF Estimate Error Confidence Limits Square Pr > ChiSq

trt 1 0.0265 0.0467 -0.0650 0.1180 0.32 0.5702v*trt 1 -0.1037 0.0651 -0.2312 0.0238 2.54 0.1110Scale 0 1.0000 0.0000 1.0000 1.0000

NOTE: The scale parameter was held fixed.

GEE Model Information

Correlation Structure AR(1)Subject Effect subject (59 levels)Number of Clusters 59Correlation Matrix Dimension 5Maximum Cluster Size 5Minimum Cluster Size 5

PAGE 498

Page 508: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 12 ST 732, M. DAVIDIAN

Covariance Matrix (Model-Based)

Prm1 Prm2 Prm3 Prm4

Prm1 0.02046 0.007458 -0.02046 -0.007458Prm2 0.007458 0.02829 -0.007458 -0.02829Prm3 -0.02046 -0.007458 0.03859 0.01571Prm4 -0.007458 -0.02829 0.01571 0.05781

Covariance Matrix (Empirical)

Prm1 Prm2 Prm3 Prm4

Prm1 0.02620 -0.003809 -0.02620 0.003809Prm2 -0.003809 0.01248 0.003809 -0.01248Prm3 -0.02620 0.003809 0.04494 0.01198Prm4 0.003809 -0.01248 0.01198 0.06782

Algorithm converged.

Working Correlation Matrix

Col1 Col2 Col3 Col4 Col5

Row1 1.0000 0.8131 0.6611 0.5375 0.4371Row2 0.8131 1.0000 0.8131 0.6611 0.5375Row3 0.6611 0.8131 1.0000 0.8131 0.6611Row4 0.5375 0.6611 0.8131 1.0000 0.8131Row5 0.4371 0.5375 0.6611 0.8131 1.0000

AR(1) CORRELATION 9

The GENMOD Procedure

Analysis Of GEE Parameter EstimatesEmpirical Standard Error Estimates

Standard 95% ConfidenceParameter Estimate Error Limits Z Pr > |Z|

Intercept 1.3119 0.1619 0.9947 1.6292 8.10 <.0001v 0.1515 0.1117 -0.0675 0.3704 1.36 0.1751trt 0.0188 0.2120 -0.3968 0.4343 0.09 0.9295v*trt -0.1283 0.2604 -0.6388 0.3821 -0.49 0.6222

Analysis Of GEE Parameter EstimatesModel-Based Standard Error Estimates

Standard 95% ConfidenceParameter Estimate Error Limits Z Pr > |Z|

Intercept 1.3119 0.1430 1.0316 1.5923 9.17 <.0001v 0.1515 0.1682 -0.1782 0.4811 0.90 0.3678trt 0.0188 0.1965 -0.3663 0.4038 0.10 0.9240v*trt -0.1283 0.2404 -0.5996 0.3429 -0.53 0.5935Scale 4.4907 . . . . .

NOTE: The scale parameter for GEE estimation was computed as the square rootof the normalized Pearson’s chi-square.

SUBJECT 207 DELETED 10

The GENMOD Procedure

Model Information

Data Set WORK.WEIRDDistribution PoissonLink Function LogDependent Variable seizeOffset Variable logo

Number of Observations Read 290Number of Observations Used 290

Class Level Information

Class Levels Values

subject 58 101 102 103 104 106 107 108 110 111 112 113 114116 117 118 121 122 123 124 126 128 129 130 135137 139 141 143 145 147 201 202 203 204 205 206208 209 210 211 213 214 215 217 218 219 220 221222 225 226 227 228 230 232 234 236 238

Parameter Information

Parameter Effect

PAGE 499

Page 509: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 12 ST 732, M. DAVIDIAN

Prm1 InterceptPrm2 vPrm3 trtPrm4 v*trt

Criteria For Assessing Goodness Of Fit

Criterion DF Value Value/DF

Deviance 286 2413.0245 8.4371Scaled Deviance 286 2413.0245 8.4371Pearson Chi-Square 286 3015.1555 10.5425Scaled Pearson X2 286 3015.1555 10.5425Log Likelihood 5631.7547

Algorithm converged.

Analysis Of Initial Parameter Estimates

Standard Wald 95% Chi-Parameter DF Estimate Error Confidence Limits Square Pr > ChiSq

Intercept 1 1.3476 0.0341 1.2809 1.4144 1565.44 <.0001v 1 0.1108 0.0469 0.0189 0.2027 5.58 0.0181

SUBJECT 207 DELETED 11

The GENMOD Procedure

Analysis Of Initial Parameter Estimates

Standard Wald 95% Chi-Parameter DF Estimate Error Confidence Limits Square Pr > ChiSq

trt 1 -0.1080 0.0486 -0.2034 -0.0127 4.93 0.0264v*trt 1 -0.3016 0.0697 -0.4383 -0.1649 18.70 <.0001Scale 0 1.0000 0.0000 1.0000 1.0000

NOTE: The scale parameter was held fixed.

GEE Model Information

Correlation Structure ExchangeableSubject Effect subject (58 levels)Number of Clusters 58Correlation Matrix Dimension 5Maximum Cluster Size 5Minimum Cluster Size 5

Covariance Matrix (Model-Based)

Prm1 Prm2 Prm3 Prm4

Prm1 0.01223 0.001520 -0.01223 -0.001520Prm2 0.001520 0.01519 -0.001520 -0.01519Prm3 -0.01223 -0.001520 0.02495 0.005427Prm4 -0.001520 -0.01519 0.005427 0.03748

Covariance Matrix (Empirical)

Prm1 Prm2 Prm3 Prm4

Prm1 0.02476 -0.001152 -0.02476 0.001152Prm2 -0.001152 0.01348 0.001152 -0.01348Prm3 -0.02476 0.001152 0.03751 -0.002999Prm4 0.001152 -0.01348 -0.002999 0.02931

Algorithm converged.

Working Correlation Matrix

Col1 Col2 Col3 Col4 Col5

Row1 1.0000 0.5941 0.5941 0.5941 0.5941Row2 0.5941 1.0000 0.5941 0.5941 0.5941Row3 0.5941 0.5941 1.0000 0.5941 0.5941Row4 0.5941 0.5941 0.5941 1.0000 0.5941Row5 0.5941 0.5941 0.5941 0.5941 1.0000

SUBJECT 207 DELETED 12

The GENMOD Procedure

Exchangeable WorkingCorrelation

Correlation 0.5941485833

Analysis Of GEE Parameter EstimatesEmpirical Standard Error Estimates

PAGE 500

Page 510: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 12 ST 732, M. DAVIDIAN

Standard 95% ConfidenceParameter Estimate Error Limits Z Pr > |Z|

Intercept 1.3476 0.1574 1.0392 1.6560 8.56 <.0001v 0.1108 0.1161 -0.1168 0.3383 0.95 0.3399trt -0.1080 0.1937 -0.4876 0.2716 -0.56 0.5770v*trt -0.3016 0.1712 -0.6371 0.0339 -1.76 0.0781

Analysis Of GEE Parameter EstimatesModel-Based Standard Error Estimates

Standard 95% ConfidenceParameter Estimate Error Limits Z Pr > |Z|

Intercept 1.3476 0.1106 1.1309 1.5644 12.19 <.0001v 0.1108 0.1233 -0.1308 0.3524 0.90 0.3687trt -0.1080 0.1579 -0.4176 0.2015 -0.68 0.4940v*trt -0.3016 0.1936 -0.6811 0.0779 -1.56 0.1193Scale 3.2469 . . . . .

NOTE: The scale parameter for GEE estimation was computed as the square rootof the normalized Pearson’s chi-square.

AGE ADDED 13

The GENMOD Procedure

Model Information

Data Set WORK.SEIZUREDistribution PoissonLink Function LogDependent Variable seizeOffset Variable logo

Number of Observations Read 295Number of Observations Used 295

Class Level Information

Class Levels Values

subject 59 101 102 103 104 106 107 108 110 111 112 113 114116 117 118 121 122 123 124 126 128 129 130 135137 139 141 143 145 147 201 202 203 204 205 206207 208 209 210 211 213 214 215 217 218 219 220221 222 225 226 227 228 230 232 234 236 238

Parameter Information

Parameter Effect

Prm1 InterceptPrm2 logagePrm3 vPrm4 trtPrm5 v*trt

Criteria For Assessing Goodness Of Fit

Criterion DF Value Value/DF

Deviance 290 3520.0007 12.1379Scaled Deviance 290 3520.0007 12.1379Pearson Chi-Square 290 5476.2836 18.8837Scaled Pearson X2 290 5476.2836 18.8837Log Likelihood 6694.8957

Algorithm converged.

AGE ADDED 14

The GENMOD Procedure

Analysis Of Initial Parameter Estimates

Standard Wald 95% Chi-Parameter DF Estimate Error Confidence Limits Square Pr > ChiSq

Intercept 1 3.2206 0.2482 2.7340 3.7071 168.30 <.0001logage 1 -0.5616 0.0740 -0.7066 -0.4166 57.61 <.0001v 1 0.1108 0.0469 0.0189 0.2027 5.58 0.0181trt 1 -0.0043 0.0469 -0.0962 0.0876 0.01 0.9271v*trt 1 -0.1037 0.0651 -0.2312 0.0238 2.54 0.1110Scale 0 1.0000 0.0000 1.0000 1.0000

NOTE: The scale parameter was held fixed.

GEE Model Information

PAGE 501

Page 511: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 12 ST 732, M. DAVIDIAN

Correlation Structure ExchangeableSubject Effect subject (59 levels)Number of Clusters 59Correlation Matrix Dimension 5Maximum Cluster Size 5Minimum Cluster Size 5

Covariance Matrix (Model-Based)

Prm1 Prm2 Prm3 Prm4 Prm5

Prm1 1.88238 -0.56242 0.009622 -0.05729 -0.009622Prm2 -0.56242 0.17001 -4.92E-18 0.01073 -4.7E-17Prm3 0.009622 -4.92E-18 0.02306 -0.009622 -0.02306Prm4 -0.05729 0.01073 -0.009622 0.04165 0.01956Prm5 -0.009622 -4.7E-17 -0.02306 0.01956 0.04657

Covariance Matrix (Empirical)

Prm1 Prm2 Prm3 Prm4 Prm5

Prm1 1.88843 -0.56699 -0.02199 0.01540 0.03990Prm2 -0.56699 0.17266 0.006605 -0.01262 -0.01202Prm3 -0.02199 0.006605 0.01348 0.0005524 -0.01348Prm4 0.01540 -0.01262 0.0005524 0.04566 0.01574Prm5 0.03990 -0.01202 -0.01348 0.01574 0.04563

Algorithm converged.

AGE ADDED 15

The GENMOD Procedure

Working Correlation Matrix

Col1 Col2 Col3 Col4 Col5

Row1 1.0000 0.7617 0.7617 0.7617 0.7617Row2 0.7617 1.0000 0.7617 0.7617 0.7617Row3 0.7617 0.7617 1.0000 0.7617 0.7617Row4 0.7617 0.7617 0.7617 1.0000 0.7617Row5 0.7617 0.7617 0.7617 0.7617 1.0000

Exchangeable WorkingCorrelation

Correlation 0.7617417343

Analysis Of GEE Parameter EstimatesEmpirical Standard Error Estimates

Standard 95% ConfidenceParameter Estimate Error Limits Z Pr > |Z|

Intercept 4.4338 1.3742 1.7404 7.1272 3.23 0.0013logage -0.9275 0.4155 -1.7419 -0.1131 -2.23 0.0256v 0.1108 0.1161 -0.1168 0.3383 0.95 0.3399trt -0.0266 0.2137 -0.4454 0.3923 -0.12 0.9011v*trt -0.1037 0.2136 -0.5223 0.3150 -0.49 0.6274

Analysis Of GEE Parameter EstimatesModel-Based Standard Error Estimates

Standard 95% ConfidenceParameter Estimate Error Limits Z Pr > |Z|

Intercept 4.4338 1.3720 1.7447 7.1228 3.23 0.0012logage -0.9275 0.4123 -1.7356 -0.1194 -2.25 0.0245v 0.1108 0.1519 -0.1869 0.4084 0.73 0.4656trt -0.0266 0.2041 -0.4266 0.3735 -0.13 0.8965v*trt -0.1037 0.2158 -0.5266 0.3193 -0.48 0.6309Scale 4.3350 . . . . .

NOTE: The scale parameter for GEE estimation was computed as the square rootof the normalized Pearson’s chi-square.

MODIFIED MODEL 16

The GENMOD Procedure

Model Information

Data Set WORK.SEIZUREDistribution PoissonLink Function LogDependent Variable seizeOffset Variable logo

Number of Observations Read 295Number of Observations Used 295

PAGE 502

Page 512: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 12 ST 732, M. DAVIDIAN

Class Level Information

Class Levels Values

subject 59 101 102 103 104 106 107 108 110 111 112 113 114116 117 118 121 122 123 124 126 128 129 130 135137 139 141 143 145 147 201 202 203 204 205 206207 208 209 210 211 213 214 215 217 218 219 220221 222 225 226 227 228 230 232 234 236 238

Parameter Information

Parameter Effect

Prm1 InterceptPrm2 vPrm3 visit4Prm4 trtPrm5 v*trtPrm6 visit4*trt

Criteria For Assessing Goodness Of Fit

Criterion DF Value Value/DF

Deviance 289 3567.6314 12.3447Scaled Deviance 289 3567.6314 12.3447Pearson Chi-Square 289 5673.2719 19.6307Scaled Pearson X2 289 5673.2719 19.6307Log Likelihood 6671.0804

Algorithm converged.

MODIFIED MODEL 17

The GENMOD Procedure

Analysis Of Initial Parameter Estimates

Standard Wald 95% Chi-Parameter DF Estimate Error Confidence Limits Square Pr > ChiSq

Intercept 1 1.3476 0.0341 1.2809 1.4144 1565.44 <.0001v 1 0.1351 0.0501 0.0369 0.2333 7.27 0.0070visit4 1 -0.1009 0.0764 -0.2506 0.0489 1.74 0.1867trt 1 0.0265 0.0467 -0.0650 0.1180 0.32 0.5702v*trt 1 -0.0769 0.0694 -0.2129 0.0591 1.23 0.2676visit4*trt 1 -0.1210 0.1092 -0.3350 0.0931 1.23 0.2679Scale 0 1.0000 0.0000 1.0000 1.0000

NOTE: The scale parameter was held fixed.

GEE Model Information

Correlation Structure ExchangeableSubject Effect subject (59 levels)Number of Clusters 59Correlation Matrix Dimension 5Maximum Cluster Size 5Minimum Cluster Size 5

Covariance Matrix (Model-Based)

Prm1 Prm2 Prm3 Prm4 Prm5 Prm6

Prm1 0.02277 0.01031 0.001711 -0.02277 -0.01031 -0.001711Prm2 0.01031 0.02436 -0.004423 -0.01031 -0.02436 0.004423Prm3 0.001711 -0.004423 0.02569 -0.001711 0.004423 -0.02569Prm4 -0.02277 -0.01031 -0.001711 0.04280 0.02052 0.005259Prm5 -0.01031 -0.02436 0.004423 0.02052 0.04828 -0.006694Prm6 -0.001711 0.004423 -0.02569 0.005259 -0.006694 0.05315

Covariance Matrix (Empirical)

Prm1 Prm2 Prm3 Prm4 Prm5 Prm6

Prm1 0.02476 -0.000931 -0.000952 -0.02476 0.0009314 0.0009516Prm2 -0.000931 0.01770 -0.01079 0.0009314 -0.01770 0.01079Prm3 -0.000952 -0.01079 0.01447 0.0009516 0.01079 -0.01447Prm4 -0.02476 0.0009314 0.0009516 0.04922 0.01554 -0.001292Prm5 0.0009314 -0.01770 0.01079 0.01554 0.05058 -0.01277Prm6 0.0009516 0.01079 -0.01447 -0.001292 -0.01277 0.01681

Algorithm converged.MODIFIED MODEL 18

The GENMOD Procedure

Working Correlation Matrix

PAGE 503

Page 513: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 12 ST 732, M. DAVIDIAN

Col1 Col2 Col3 Col4 Col5

Row1 1.0000 0.7772 0.7772 0.7772 0.7772Row2 0.7772 1.0000 0.7772 0.7772 0.7772Row3 0.7772 0.7772 1.0000 0.7772 0.7772Row4 0.7772 0.7772 0.7772 1.0000 0.7772Row5 0.7772 0.7772 0.7772 0.7772 1.0000

Exchangeable WorkingCorrelation

Correlation 0.7771671618

Analysis Of GEE Parameter EstimatesEmpirical Standard Error Estimates

Standard 95% ConfidenceParameter Estimate Error Limits Z Pr > |Z|

Intercept 1.3476 0.1574 1.0392 1.6560 8.56 <.0001v 0.1351 0.1330 -0.1257 0.3958 1.02 0.3099visit4 -0.1009 0.1203 -0.3366 0.1349 -0.84 0.4017trt 0.0265 0.2219 -0.4083 0.4613 0.12 0.9049v*trt -0.0769 0.2249 -0.5177 0.3639 -0.34 0.7323visit4*trt -0.1210 0.1297 -0.3751 0.1331 -0.93 0.3507

Analysis Of GEE Parameter EstimatesModel-Based Standard Error Estimates

Standard 95% ConfidenceParameter Estimate Error Limits Z Pr > |Z|

Intercept 1.3476 0.1509 1.0518 1.6434 8.93 <.0001v 0.1351 0.1561 -0.1708 0.4410 0.87 0.3868visit4 -0.1009 0.1603 -0.4150 0.2133 -0.63 0.5292trt 0.0265 0.2069 -0.3790 0.4320 0.13 0.8980v*trt -0.0769 0.2197 -0.5076 0.3537 -0.35 0.7262visit4*trt -0.1210 0.2305 -0.5728 0.3308 -0.52 0.5997Scale 4.4307 . . . . .

NOTE: The scale parameter for GEE estimation was computed as the squareroot of the normalized Pearson’s chi-square.

INTERPRETATION:

• Pages 1–3 report the fit of the first model assuming the unstructured “working” correlation struc-

ture; pages 4–6 show the results for the compound symmetry assumption, and pages 7–9 show the

results for the AR(1) assumption.

• On pages 1, 4, and 7, the table Analysis of Initial Parameter Estimates gives the estimates

of β under the independence assumption (thus, these tables are the same for each fit).

• The results of solving the GEE begin on pages 2, 5, and 8 with the Model Information head-

ing. The Covariance Matrix (Model Based) is the estimate V β ; the Covariance Matrix

(Empirical) is the “robust” estimate VR

β . They are somewhat similar for each fit, but differ-

ent enough. How different can be seen in the tables Analysis of GEE Parameter Estimates

that follow; that labeled Empirical Standard Error Estimates uses VR

β to compute standard

errors; that labeled Model-Based Standard Error Estimates uses V β .

• The fits are qualitatively very similar. In all cases, there does not seem to be any evidence that

β3 is different from zero.

• We have no formal method of choosing among the various “working” correlation assumptions.

PAGE 504

Page 514: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 12 ST 732, M. DAVIDIAN

A practical approach is to inspect the results as above for each one – if they are in qualitative

agreement, then we feel reasonably confident that results are not too dependent on the correlation

assumption.

• Pages 10–12 show the results of the fit with the compound symmetric assumption and “un-

usual”subject 207 deleted. Note that now the results are suggestive of an effect of progabide;

β3 = −0.30 with a (robust) standard error of 0.17, yielding a p-value for a test of β3 = 0 of 0.08.

• Adding age to the model [as log(age)] does not alter the results. Taking special account of the

4th visit does not yield any additional insight. It seems that, perhaps due to the magnitude of

variation in the data and probable lack of a strong treatment effect, there is little evidence favoring

progabide over placebo.

PAGE 505

Page 515: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 12 ST 732, M. DAVIDIAN

EXAMPLE 2 – WHEEZING DATA FROM THE SIX CITIES STUDY: Here, we consider fitting the

model (12.2) similar to that fitted in Lipsitz, Laird, and Harrington (1992),

E(Yij) =exp(β0 + β1ci + β2δ0ij + β3δ1ij)

1 + exp(β0 + β1ci + β2δ0ij + β3δ1ij).

We consider as in the seizure example several different “working” correlation assumptions. The output

is in the same form as for the seizure example.

Recall, of course, our previous discussion about time-dependent covariates. The model for E(Yij) may

well suffer the flaws we mentioned earlier; this fitting is mainly for illustration.

A difference between this fit and that in the seizure example is that there are missing values for some

subjects. To make sure that SAS uses the correct convention to construct the covariance matrix for

each individual (and hence the estimate of ω), the within= option of the repeated statement is used

with the class variable time, which is identically equal to the numerical variable age. This has the

effect of telling the program that it should consult the variable time to make sure each observation is

classified correctly at its appropriate level of age.

Because these are binary data, we do not consider an overdispersion scale parameter. This is held fixed

at 1.0 in the analyses by default for binary data.

PAGE 506

Page 516: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 12 ST 732, M. DAVIDIAN

PROGRAM:

/******************************************************************

CHAPTER 12, EXAMPLE 2

Fit a logistic regression model to the "wheezing" data.These are binary data, thus, we use the Bernoulli (bin)mean/variance assumptions. The model is fitted with differentworking correlation matrices.

******************************************************************/

options ls=80 ps=59 nodate; run;

/******************************************************************

The data look like (first 4 records):

1 portage 9 0 1 10 0 1 11 0 1 12 0 02 kingston 9 1 1 10 2 1 11 2 0 12 2 03 kingston 9 0 1 10 0 0 11 1 0 12 1 04 portage 9 0 0 10 0 1 11 0 1 12 1 0

.

.

.

column 1 childcolumn 2 citycolumns 3-5 age=9, smoking indiciator, wheezing responsecolumns 6-8 age=10, smoking indiciator, wheezing responsecolumns 9-11 age=11, smoking indiciator, wheezing responsecolumns 12-14 age=12, smoking indiciator, wheezing response

Some of the children have missing values for smoking and wheezing,as shown in Chapter 1. There are 32 children all together. See theoutput for the full data printed out one observation per line.

We read in the data using the "@@" symbol so that SAS will continueto read for data on the same line and the OUTPUT statement towrite each block of three observations for each age in as a separatedata record. The resulting data set is one with a separate line foreach observation. City is a character variable, so the dollarsign is used to read it in as such.

******************************************************************/

data wheeze; infile ’wheeze.dat’;input child city $ @@;do i=1 to 4;input age smoke wheeze @@;output;

end;run;

proc print data=wheeze; run;

/*****************************************************************

Fit the logistic regression model using PROC GENMOD andthree different working correlation matrix assumptions:

- unstructured- compound symmetry (exchangeable)- AR(1)

We fit a model with linear predictor allowing effects ofcity and maternal smoking status but no "interaction"terms among these.

The DIST=BIN option in the MODEL statement specifies that theBernoulli mean-variance relationship be assumed. The LINK=LOGIToption asks for the logistic mean model.

The REPEATED statement specifies the "working" correlationstructure to be assumed. The CORRW option in the REPEATEDstatement prints out the estimated working correlation matrixunder the assumption given in the TYPE= option. The COVBoption prints out the estimated covariance matrix of the estimateof beta -- both the usual estimate and the "robust" versionare printed. The MODELSE option specifies that the standarderror estimates printed for the elements of betahat are basedon the usual theory. By default, the ones based on the "robust"version of the sampling covariance matrix are printed, too.

The dispersion parameter phi is held fixed at 1 by default.

The missing values are coded in the usual SAS way by periods (.).

PAGE 507

Page 517: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 12 ST 732, M. DAVIDIAN

We delete these from the full data set, so that the data set inputto PROC GENMOD contains only the observed data. We assume that thefact that these observations are missing has nothing to do with thething under study (which may or may not be true). Thus,because these data are not balanced, we use the WITHIN option ofthe REPEATED statement to give SAS the time variable AGE as aclassification variable so that it can figure out where the missingvalues are and use this information in estimating the correlationmatrix.

In versions 7 and higher of SAS, PROC GENMOD will model bydefault the probability that the response y=0 rather thanthe conventional y=1! To make PROC GENMOD model probabilityy=1, as is standard, one must include the DESCENDING option inthe PROC GENMOD statement. In earlier versions of SAS, theprobability y=1 is modeled by default, as would be expected.

If the user is unsure which probability is being modeled, onecan check the .log file. In later versions of SAS, an explicitstatement about what is being modeled will appear. PROC GENMODoutput should also contain a statement about what is beingmodeled.

******************************************************************/

data wheeze; set wheeze;if wheeze=. then delete;time=age;

run;

title "UNSTRUCTURED CORRELATION";proc genmod data=wheeze descending;class child city smoke time;model wheeze = city smoke / dist=bin link=logit;repeated subject=child / type=un corrw covb modelse within=time;

run;

title "COMPOUND SYMMETRY (EXCHANGEABLE) CORRELATION";proc genmod data=wheeze descending;class child city smoke time;model wheeze = city smoke / dist=bin link=logit;repeated subject=child / type=cs corrw covb modelse within=time;

run;

title "AR(1) CORRELATION";proc genmod data=wheeze descending;class child city smoke time;model wheeze = city smoke / dist=bin link=logit;repeated subject=child / type=ar(1) corrw covb modelse within=time;

run;

PAGE 508

Page 518: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 12 ST 732, M. DAVIDIAN

OUTPUT: Following the output, we comment on a few aspects of the output.

The SAS System 1

Obs child city i age smoke wheeze

1 1 portage 1 9 0 12 1 portage 2 10 0 13 1 portage 3 11 0 14 1 portage 4 12 0 05 2 kingston 1 9 1 16 2 kingston 2 10 2 17 2 kingston 3 11 2 08 2 kingston 4 12 2 09 3 kingston 1 9 0 110 3 kingston 2 10 0 011 3 kingston 3 11 1 012 3 kingston 4 12 1 013 4 portage 1 9 0 014 4 portage 2 10 0 115 4 portage 3 11 0 116 4 portage 4 12 1 017 5 kingston 1 9 0 018 5 kingston 2 10 1 019 5 kingston 3 11 1 020 5 kingston 4 12 1 021 6 portage 1 9 0 022 6 portage 2 10 1 023 6 portage 3 11 1 024 6 portage 4 12 1 025 7 kingston 1 9 1 026 7 kingston 2 10 1 027 7 kingston 3 11 0 028 7 kingston 4 12 0 029 8 portage 1 9 1 030 8 portage 2 10 1 031 8 portage 3 11 1 032 8 portage 4 12 2 033 9 portage 1 9 2 134 9 portage 2 10 2 035 9 portage 3 11 1 036 9 portage 4 12 1 037 10 kingston 1 9 0 038 10 kingston 2 10 0 039 10 kingston 3 11 0 040 10 kingston 4 12 1 041 11 kingston 1 9 1 142 11 kingston 2 10 0 043 11 kingston 3 11 0 144 11 kingston 4 12 0 145 12 portage 1 9 1 046 12 portage 2 10 0 047 12 portage 3 11 0 048 12 portage 4 12 0 049 13 kingston 1 9 1 050 13 kingston 2 10 0 151 13 kingston 3 11 1 152 13 kingston 4 12 1 153 14 portage 1 9 1 054 14 portage 2 10 2 055 14 portage 3 11 1 0

The SAS System 2

Obs child city i age smoke wheeze

56 14 portage 4 12 2 157 15 kingston 1 9 1 058 15 kingston 2 10 1 059 15 kingston 3 11 1 060 15 kingston 4 12 2 161 16 portage 1 9 1 162 16 portage 2 10 1 163 16 portage 3 11 2 064 16 portage 4 12 1 065 17 portage 1 9 2 166 17 portage 2 10 2 067 17 portage 3 11 1 068 17 portage 4 12 1 069 18 kingston 1 9 0 070 18 kingston 2 10 0 071 18 kingston 3 11 0 072 18 kingston 4 12 0 073 19 portage 1 9 0 074 19 portage 2 10 . .75 19 portage 3 11 . .76 19 portage 4 12 . .77 20 kingston 1 9 . .78 20 kingston 2 10 0 179 20 kingston 3 11 . .

PAGE 509

Page 519: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 12 ST 732, M. DAVIDIAN

80 20 kingston 4 12 . .81 21 portage 1 9 . .82 21 portage 2 10 . .83 21 portage 3 11 2 184 21 portage 4 12 . .85 22 kingston 1 9 . .86 22 kingston 2 10 . .87 22 kingston 3 11 . .88 22 kingston 4 12 1 089 23 portage 1 9 2 090 23 portage 2 10 1 191 23 portage 3 11 . .92 23 portage 4 12 . .93 24 kingston 1 9 2 094 24 kingston 2 10 . .95 24 kingston 3 11 0 096 24 kingston 4 12 . .97 25 portage 1 9 0 198 25 portage 2 10 . .99 25 portage 3 11 . .

100 25 portage 4 12 0 0101 26 portage 1 9 . .102 26 portage 2 10 0 0103 26 portage 3 11 1 0104 26 portage 4 12 . .105 27 portage 1 9 . .106 27 portage 2 10 1 0107 27 portage 3 11 . .108 27 portage 4 12 1 0109 28 kingston 1 9 . .110 28 kingston 2 10 . .

The SAS System 3

Obs child city i age smoke wheeze

111 28 kingston 3 11 2 0112 28 kingston 4 12 1 1113 29 portage 1 9 1 0114 29 portage 2 10 0 0115 29 portage 3 11 0 0116 29 portage 4 12 . .117 30 kingston 1 9 1 1118 30 kingston 2 10 1 0119 30 kingston 3 11 . .120 30 kingston 4 12 1 1121 31 kingston 1 9 1 0122 31 kingston 2 10 . .123 31 kingston 3 11 1 0124 31 kingston 4 12 2 1125 32 portage 1 9 . .126 32 portage 2 10 1 1127 32 portage 3 11 1 0128 32 portage 4 12 1 0

UNSTRUCTURED CORRELATION 4

The GENMOD Procedure

Model Information

Data Set WORK.WHEEZEDistribution BinomialLink Function LogitDependent Variable wheezeObservations Used 100

Class Level Information

Class Levels Values

child 32 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 2021 22 23 24 25 26 27 28 29 30 31 32

city 2 kingston portagesmoke 3 0 1 2time 4 9 10 11 12

Response Profile

Ordered TotalValue wheeze Frequency

1 1 292 0 71

PROC GENMOD is modeling the probability that wheeze=’1’.

PAGE 510

Page 520: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 12 ST 732, M. DAVIDIAN

Parameter Information

Parameter Effect city smoke

Prm1 InterceptPrm2 city kingstonPrm3 city portagePrm4 smoke 0Prm5 smoke 1Prm6 smoke 2

Criteria For Assessing Goodness Of Fit

Criterion DF Value Value/DF

Deviance 96 117.9994 1.2292Scaled Deviance 96 117.9994 1.2292Pearson Chi-Square 96 99.6902 1.0384Scaled Pearson X2 96 99.6902 1.0384Log Likelihood -58.9997

UNSTRUCTURED CORRELATION 5

The GENMOD Procedure

Algorithm converged.

Analysis Of Initial Parameter Estimates

Standard Wald 95% Confidence Chi-Parameter DF Estimate Error Limits Square

Intercept 1 -0.4559 0.5285 -1.4917 0.5799 0.74city kingston 1 0.2382 0.4479 -0.6398 1.1161 0.28city portage 0 0.0000 0.0000 0.0000 0.0000 .smoke 0 1 -0.4494 0.6159 -1.6565 0.7577 0.53smoke 1 1 -0.8751 0.6029 -2.0568 0.3067 2.11smoke 2 0 0.0000 0.0000 0.0000 0.0000 .Scale 0 1.0000 0.0000 1.0000 1.0000

Analysis Of InitialParameter Estimates

Parameter Pr > ChiSq

Intercept 0.3883city kingston 0.5950city portage .smoke 0 0.4656smoke 1 0.1467smoke 2 .Scale

NOTE: The scale parameter was held fixed.

GEE Model Information

Correlation Structure UnstructuredWithin-Subject Effect time (4 levels)Subject Effect child (32 levels)Number of Clusters 32Correlation Matrix Dimension 4Maximum Cluster Size 4Minimum Cluster Size 1

Covariance Matrix (Model-Based)

Prm1 Prm2 Prm4 Prm5

Prm1 0.25733 -0.09887 -0.19993 -0.18313Prm2 -0.09887 0.22799 -0.02525 -0.02022Prm4 -0.19993 -0.02525 0.36412 0.20072Prm5 -0.18313 -0.02022 0.20072 0.27654

UNSTRUCTURED CORRELATION 6

The GENMOD Procedure

Covariance Matrix (Empirical)

Prm1 Prm2 Prm4 Prm5

Prm1 0.19295 -0.05378 -0.16907 -0.23162Prm2 -0.05378 0.21935 -0.03901 -0.06092Prm4 -0.16907 -0.03901 0.32007 0.30071

PAGE 511

Page 521: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 12 ST 732, M. DAVIDIAN

Prm5 -0.23162 -0.06092 0.30071 0.46706

Algorithm converged.

Working Correlation Matrix

Col1 Col2 Col3 Col4

Row1 1.0000 0.1967 0.1807 -0.1604Row2 0.1967 1.0000 0.5531 -0.1131Row3 0.1807 0.5531 1.0000 0.2524Row4 -0.1604 -0.1131 0.2524 1.0000

Analysis Of GEE Parameter EstimatesEmpirical Standard Error Estimates

Standard 95% ConfidenceParameter Estimate Error Limits Z Pr > |Z|

Intercept -0.6197 0.4393 -1.4806 0.2413 -1.41 0.1583city kingston 0.3126 0.4683 -0.6053 1.2306 0.67 0.5044city portage 0.0000 0.0000 0.0000 0.0000 . .smoke 0 -0.3851 0.5657 -1.4940 0.7237 -0.68 0.4960smoke 1 -0.4098 0.6834 -1.7493 0.9296 -0.60 0.5487smoke 2 0.0000 0.0000 0.0000 0.0000 . .

Analysis Of GEE Parameter EstimatesModel-Based Standard Error Estimates

Standard 95% ConfidenceParameter Estimate Error Limits Z Pr > |Z|

Intercept -0.6197 0.5073 -1.6139 0.3745 -1.22 0.2219city kingston 0.3126 0.4775 -0.6232 1.2485 0.65 0.5126city portage 0.0000 0.0000 0.0000 0.0000 . .smoke 0 -0.3851 0.6034 -1.5678 0.7976 -0.64 0.5233smoke 1 -0.4098 0.5259 -1.4405 0.6209 -0.78 0.4358smoke 2 0.0000 0.0000 0.0000 0.0000 . .Scale 1.0000 . . . . .

NOTE: The scale parameter was held fixed.

COMPOUND SYMMETRY (EXCHANGEABLE) CORRELATION 7

The GENMOD Procedure

Model Information

Data Set WORK.WHEEZEDistribution BinomialLink Function LogitDependent Variable wheezeObservations Used 100

Class Level Information

Class Levels Values

child 32 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 2021 22 23 24 25 26 27 28 29 30 31 32

city 2 kingston portagesmoke 3 0 1 2time 4 9 10 11 12

Response Profile

Ordered TotalValue wheeze Frequency

1 1 292 0 71

PROC GENMOD is modeling the probability that wheeze=’1’.

Parameter Information

Parameter Effect city smoke

Prm1 InterceptPrm2 city kingstonPrm3 city portagePrm4 smoke 0Prm5 smoke 1Prm6 smoke 2

PAGE 512

Page 522: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 12 ST 732, M. DAVIDIAN

Criteria For Assessing Goodness Of Fit

Criterion DF Value Value/DF

Deviance 96 117.9994 1.2292Scaled Deviance 96 117.9994 1.2292Pearson Chi-Square 96 99.6902 1.0384Scaled Pearson X2 96 99.6902 1.0384Log Likelihood -58.9997

COMPOUND SYMMETRY (EXCHANGEABLE) CORRELATION 8

The GENMOD Procedure

Algorithm converged.

Analysis Of Initial Parameter Estimates

Standard Wald 95% Confidence Chi-Parameter DF Estimate Error Limits Square

Intercept 1 -0.4559 0.5285 -1.4917 0.5799 0.74city kingston 1 0.2382 0.4479 -0.6398 1.1161 0.28city portage 0 0.0000 0.0000 0.0000 0.0000 .smoke 0 1 -0.4494 0.6159 -1.6565 0.7577 0.53smoke 1 1 -0.8751 0.6029 -2.0568 0.3067 2.11smoke 2 0 0.0000 0.0000 0.0000 0.0000 .Scale 0 1.0000 0.0000 1.0000 1.0000

Analysis Of InitialParameter Estimates

Parameter Pr > ChiSq

Intercept 0.3883city kingston 0.5950city portage .smoke 0 0.4656smoke 1 0.1467smoke 2 .Scale

NOTE: The scale parameter was held fixed.

GEE Model Information

Correlation Structure ExchangeableWithin-Subject Effect time (4 levels)Subject Effect child (32 levels)Number of Clusters 32Correlation Matrix Dimension 4Maximum Cluster Size 4Minimum Cluster Size 1

Covariance Matrix (Model-Based)

Prm1 Prm2 Prm4 Prm5

Prm1 0.30777 -0.11319 -0.24502 -0.22930Prm2 -0.11319 0.25956 -0.02313 -0.01878Prm4 -0.24502 -0.02313 0.40717 0.24963Prm5 -0.22930 -0.01878 0.24963 0.35226

COMPOUND SYMMETRY (EXCHANGEABLE) CORRELATION 9

The GENMOD Procedure

Covariance Matrix (Empirical)

Prm1 Prm2 Prm4 Prm5

Prm1 0.20021 -0.08869 -0.15237 -0.23871Prm2 -0.08869 0.24782 -0.03222 -0.005869Prm4 -0.15237 -0.03222 0.33433 0.28719Prm5 -0.23871 -0.005869 0.28719 0.45634

Algorithm converged.

Working Correlation Matrix

Col1 Col2 Col3 Col4

PAGE 513

Page 523: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 12 ST 732, M. DAVIDIAN

Row1 1.0000 0.1251 0.1251 0.1251Row2 0.1251 1.0000 0.1251 0.1251Row3 0.1251 0.1251 1.0000 0.1251Row4 0.1251 0.1251 0.1251 1.0000

Analysis Of GEE Parameter EstimatesEmpirical Standard Error Estimates

Standard 95% ConfidenceParameter Estimate Error Limits Z Pr > |Z|

Intercept -0.4771 0.4475 -1.3541 0.3999 -1.07 0.2863city kingston 0.2456 0.4978 -0.7301 1.2213 0.49 0.6217city portage 0.0000 0.0000 0.0000 0.0000 . .smoke 0 -0.4006 0.5782 -1.5338 0.7327 -0.69 0.4885smoke 1 -0.8492 0.6755 -2.1732 0.4748 -1.26 0.2087smoke 2 0.0000 0.0000 0.0000 0.0000 . .

Analysis Of GEE Parameter EstimatesModel-Based Standard Error Estimates

Standard 95% ConfidenceParameter Estimate Error Limits Z Pr > |Z|

Intercept -0.4771 0.5548 -1.5644 0.6102 -0.86 0.3898city kingston 0.2456 0.5095 -0.7529 1.2442 0.48 0.6297city portage 0.0000 0.0000 0.0000 0.0000 . .smoke 0 -0.4006 0.6381 -1.6512 0.8501 -0.63 0.5302smoke 1 -0.8492 0.5935 -2.0125 0.3141 -1.43 0.1525smoke 2 0.0000 0.0000 0.0000 0.0000 . .Scale 1.0000 . . . . .

NOTE: The scale parameter was held fixed.

AR(1) CORRELATION 10

The GENMOD Procedure

Model Information

Data Set WORK.WHEEZEDistribution BinomialLink Function LogitDependent Variable wheezeObservations Used 100

Class Level Information

Class Levels Values

child 32 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 2021 22 23 24 25 26 27 28 29 30 31 32

city 2 kingston portagesmoke 3 0 1 2time 4 9 10 11 12

Response Profile

Ordered TotalValue wheeze Frequency

1 1 292 0 71

PROC GENMOD is modeling the probability that wheeze=’1’.

Parameter Information

Parameter Effect city smoke

Prm1 InterceptPrm2 city kingstonPrm3 city portagePrm4 smoke 0Prm5 smoke 1Prm6 smoke 2

Criteria For Assessing Goodness Of Fit

Criterion DF Value Value/DF

Deviance 96 117.9994 1.2292Scaled Deviance 96 117.9994 1.2292Pearson Chi-Square 96 99.6902 1.0384Scaled Pearson X2 96 99.6902 1.0384

PAGE 514

Page 524: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 12 ST 732, M. DAVIDIAN

Log Likelihood -58.9997

AR(1) CORRELATION 11

The GENMOD Procedure

Algorithm converged.

Analysis Of Initial Parameter Estimates

Standard Wald 95% Confidence Chi-Parameter DF Estimate Error Limits Square

Intercept 1 -0.4559 0.5285 -1.4917 0.5799 0.74city kingston 1 0.2382 0.4479 -0.6398 1.1161 0.28city portage 0 0.0000 0.0000 0.0000 0.0000 .smoke 0 1 -0.4494 0.6159 -1.6565 0.7577 0.53smoke 1 1 -0.8751 0.6029 -2.0568 0.3067 2.11smoke 2 0 0.0000 0.0000 0.0000 0.0000 .Scale 0 1.0000 0.0000 1.0000 1.0000

Analysis Of InitialParameter Estimates

Parameter Pr > ChiSq

Intercept 0.3883city kingston 0.5950city portage .smoke 0 0.4656smoke 1 0.1467smoke 2 .Scale

NOTE: The scale parameter was held fixed.

GEE Model Information

Correlation Structure AR(1)Within-Subject Effect time (4 levels)Subject Effect child (32 levels)Number of Clusters 32Correlation Matrix Dimension 4Maximum Cluster Size 4Minimum Cluster Size 1

Covariance Matrix (Model-Based)

Prm1 Prm2 Prm4 Prm5

Prm1 0.31680 -0.12039 -0.24953 -0.22783Prm2 -0.12039 0.27022 -0.02180 -0.01881Prm4 -0.24953 -0.02180 0.42144 0.24916Prm5 -0.22783 -0.01881 0.24916 0.34094

AR(1) CORRELATION 12

The GENMOD Procedure

Covariance Matrix (Empirical)

Prm1 Prm2 Prm4 Prm5

Prm1 0.22402 -0.08293 -0.18320 -0.26011Prm2 -0.08293 0.23368 -0.02015 -0.007078Prm4 -0.18320 -0.02015 0.34711 0.30564Prm5 -0.26011 -0.007078 0.30564 0.45771

Algorithm converged.

Working Correlation Matrix

Col1 Col2 Col3 Col4

Row1 1.0000 0.2740 0.0751 0.0206Row2 0.2740 1.0000 0.2740 0.0751Row3 0.0751 0.2740 1.0000 0.2740Row4 0.0206 0.0751 0.2740 1.0000

Analysis Of GEE Parameter EstimatesEmpirical Standard Error Estimates

Standard 95% ConfidenceParameter Estimate Error Limits Z Pr > |Z|

PAGE 515

Page 525: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 12 ST 732, M. DAVIDIAN

Intercept -0.5442 0.4733 -1.4719 0.3835 -1.15 0.2502city kingston 0.2755 0.4834 -0.6720 1.2230 0.57 0.5687city portage 0.0000 0.0000 0.0000 0.0000 . .smoke 0 -0.3776 0.5892 -1.5323 0.7771 -0.64 0.5216smoke 1 -0.6861 0.6765 -2.0121 0.6399 -1.01 0.3105smoke 2 0.0000 0.0000 0.0000 0.0000 . .

Analysis Of GEE Parameter EstimatesModel-Based Standard Error Estimates

Standard 95% ConfidenceParameter Estimate Error Limits Z Pr > |Z|

Intercept -0.5442 0.5629 -1.6474 0.5590 -0.97 0.3336city kingston 0.2755 0.5198 -0.7433 1.2943 0.53 0.5961city portage 0.0000 0.0000 0.0000 0.0000 . .smoke 0 -0.3776 0.6492 -1.6500 0.8948 -0.58 0.5608smoke 1 -0.6861 0.5839 -1.8305 0.4583 -1.18 0.2400smoke 2 0.0000 0.0000 0.0000 0.0000 . .Scale 1.0000 . . . . .

NOTE: The scale parameter was held fixed.

INTERPRETATION:

• In this example, the analyses in each “working” case appear to be far less sensitive to whether

V β or VR

β is used to construct standard errors; comparison of these matrices in each case shows

that they are fairly similar.

• It is perhaps because it does not appear that there is any effect of any of the covariates on prob-

ability of wheezing that the analyses all seem to agree. Note from Analysis of GEE Parameter

Estimates in each case that the signs (positive or negative) appear to be intuitively in the right

direction; e.g., the coefficients for the “smoking” indicators are negative, suggesting that probabil-

ity of wheezing is lower for children whose mothers do not smoke or only moderately smoke versus

those who have heavy-smokers for mothers. However, in no case is there evidence to suggest these

are different than zero. As there are only 32 children on which this analysis is based, perhaps the

sample size is too small to detect departures from the various null hypotheses being tested.

• Keep in mind that this interpretation only makes sense under the assumption that the model for

E(Yij) is correct!

PAGE 516

Page 526: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 13 ST 732, M. DAVIDIAN

13 Advanced topics

13.1 Introduction

In this chapter, we conclude with brief overviews of several advanced topics. Each of these topics could

realistically be the subject of an entire course!

13.2 Generalized linear mixed models

The models considered in Chapter 12 were of the population-averaged type; that is, the focus was

on explicit modeling of the mean E(Y i) of a data vector. Of course, the elements of E(Y i), E(Yij),

represent the mean response at a particular time tij and possibly setting of covariates; i.e. the average

over all possible values of Yij we might see under those conditions, the average being over all members

of the population. The models used to represent E(Yij) as a function of tij and other covariates were

of the generalized linear type, so were no longer linear functions of the parameter β characterizing

mean response.

In Section 12.5, we discussed briefly the alternative strategy of subject-specific models for nonnormal

data. Here, the idea is to model individual trajectories, where the “mean” at time tij over all

observations we might see for a specific individual is represented again by a generalized linear model,

but where the parameters are in turn allowed to depend on random effects. A general representation

of such a model is as follows; recall that the conditional expectation of Y i given a vector of random

effects bi unique to individual i may be thought of as the “mean” response for a particular individual.

We have for an element of Y i that, for a suitable function f ,

E(Yij | bi) = f(x′ijβi), (13.1)

where the subject-specific parameter βi may be represented as before, e.g. in the most general case,

βi = Aiβ + Bibi. (13.2)

Here, then β is the parameter that describes the “typical” value of βis across all individuals with

covariate matrix Ai; e.g. all individual in a particular treatment group. bi is a random effect

assumed to come from a distribution with mean 0, almost always taken to be the multivariate normal

distribution, so that

bi ∼ N (0, D).

PAGE 517

Page 527: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 13 ST 732, M. DAVIDIAN

It is further assumed that, at the level of the individual, the data in Y i follow one of the distributions

such as the binomial, Poisson, or gamma in the scaled exponential family. It is common to assume that

observations on a given individual are taken far apart enough in time so that there is no correlation

introduced by the way the data are collected (within an individual); in fact, the observations on a

particular individual i, Yij , j = 1, . . . , ni, are assumed to be independent at the level of the individual.

The variance of an observation at the level of the individual will thus depend on the mean of an

observation at the individual level. Thus, we think of the variance associated with observations within

a particular individual as being conditional on that individual’s random effects, because the mean is

conditional on them. Thus, we think of the variance within an individual as

var(Yij | bi) = φV {f(x′ijβi)},

where φ may or may not be known depending on the nature of the data. For example, if the Yij are

counts, then appropriate distribution; for example, if the Yij are counts, then it follows that

var(Yij | bi) = f(x′ijβi).

The model defined in (13.1) and (13.2) with the stated properties is referred to in the statistical liter-

ature as a generalized linear mixed model, for obvious reasons. It is an alternative model to the

population-averaged models in Chapter 12. Just as in the linear case, it may be more advantageous or

natural to think of individual trajectories rather than the average response over the population; this

model allows thinking this way.

However, as discussed in Section 12.5, it is not the case that this model and a population-averaged

model constructed using the same function f lead to the same model for E(Yij), as was fortuitously

true in the case of a linear model. Thus, whether one adopts a population-averaged or subject-

specific approach will lead to different implied models for the mean response for the population!

Technically, this is because, under the population-averaged model, we would take

E(Yij) = f(x′ijβ),

while under the subject-specific approach, we would take

E(Yij | bi) = f(x′ijβi),

which implies upon averaging over the population that

E(Yij) = E{f(x′ijβi)}.

PAGE 518

Page 528: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 13 ST 732, M. DAVIDIAN

Plugging in (13.2) for βi, we see that under the subject-specific approach, the implied model for mean

over the population is

E(Yij) = E[f{x′ij(Aiβ + Bibi)}].

It is a mathematical fact that, because f is not a linear function of bi, taking this expectation is an

operation that is likely to be impossible to do in closed form. It follows that it is simply not possible

that

f(x′ijβ) = E[f{x′

ij(Aiβ + Bibi)}];

that is, the two types of model for mean response implied by each strategy are almost certainly not the

same.

This has caused some debate about which strategy is more appropriate. For linear models, the debate

is not as strong, because the mean response model turns out to be the same, the only difference being

how one models the covariance. Here, instead, what is implied about the most prominent aspect, the

mean over the population, is not the same. The debate has not been resolved and still rages in the

statistical literature. In real applications, the following is typically true:

• For studies in public health, education, and so on, where the main goal of data analysis is to make

proclamations about the population, the usual strategy has been to use population-averaged

models. The rationale is that interest focuses on what happens on the average in a population,

so why not just model that directly? For example, if a government health agency wishes to

understand whether maternal smoking affects child respiratory health for the purposes of making

public policy statements, it wants to make statements about what happens “on the average” in

the whole population. For the purposes of making general policy, there is no real interest in

individual children and their respiratory trajectories. Thus, the thinking is – “why complicate

matters by assuming a subject-specific model when there is no interest in individual subjects?”

• On the other hand, in the context of a clinical trial, there may be interest in individual patients

and understanding how they evolve over time. For example, in the epileptic seizure study in

Chapter 12, researchers may think that the process of how epileptic seizures occur over time is

something that happens “within” a subject, and they may wish to characterize that for individual

subjects. As a result, it is more common to see generalized linear mixed models used in this kind

of setting.

PAGE 519

Page 529: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 13 ST 732, M. DAVIDIAN

INFERENCE: One major complication in implementing the fitting of generalized linear mixed models

is that it is no longer straightforward to write down the implied likelihood of a data vector. The actual

form of this likelihood is quite complicated and will involve an integral with respect to the elements

of bi. Rather than write down this mess, we note what the problem is by considering again something

that is related to the full likelihood of a data vector – the mean vector. Here, the mean vector is

E(Yij) = E[f{x′ij(Aiβ + Bibi)}],

which is a calculation that we have already noted is generally not possible to do in closed form. This

suggests that trying to derive the whole likelihood function in closed form would be equally difficult,

which it is!

The result is that the function we would like to use as the basis of estimation and testing is not even

something we can write down! A variety of approaches to dealing with this problem by way of

approximations that might allow something “close to” the true likelihood function to be written

down have been proposed. Discussion of these methods is beyond our scope; see the references in

Diggle, Heagerty, Liang, and Zeger (2002) for an introduction to the statistical literature. One of these

approximate approaches is implemented in a macro provided by SAS, glimmix. The procedure proc

nlmixed fits these models directly. A new procedure, proc glimmix, is being developed. It is important

that the user fully understand the basis of these approximate approaches before attempting to fit such

models – the interpretation and fitting can be very difficult!

13.3 Nonlinear mixed effects models

A more complicated version of generalized linear mixed models is possible. In many applications, a

suitable model for individual trajectories is dictated by theoretical concerns. Recall, for example,

the soybean growth data introduced in Chapter 1; the plot is reproduced here as Figure 1. A common

model for the process of growth is the so-called logistic growth function; this function is of a similar

form as the logistic regression model discussed previously, but the interpretation is different.

If one assumes that the rate of change of the growth value (“size” or “weight”, for example) of the

organism (here, plants in a soybean plot) relative to the size of the organism at any time declines in a

linear fashion with increasing growth, it may be shown that the growth value at any particular time t

may be represented by a function of the form

f(t, β) =β1

1 + β2 exp(−β3t), (13.3)

where β1, β2, β3 > 0.

PAGE 520

Page 530: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 13 ST 732, M. DAVIDIAN

Figure 1: Average leaf weight/plant profiles for 8 plots planted with Forrest and 8 plots planted with PI

#416937 in 1989.

0 20 40 60 80

05

1015

2025

Days After Planting

Leaf

Wei

ght/P

lant

(g)

1 1 11

1

1

11

2 2 22

2

2

22

3 3 3 33

3

3

3

4 4 44

4

4

4 4

5 5 5 5

5

5

55

6 6 6 66

6

6

6

7 7 7 77

7

7

7

8 8 88

8

88

8

Genotype F

0 20 40 60 80

05

1015

2025

Days After PlantingLe

af W

eigh

t/Pla

nt (

g)

1 1 1

1

1

1

1

1

2 2 2

22

2

2

2

3 3 3

3

3

3

3

3

4 4 44

4

4

4

4

5 5 55

5

5

5

5

6 66

6

6

6

6

6

7 77

7

7

7

77

8 88 8

8

8

8

8

Genotype P

Here, the value β1 corresponds to the “asymptote” of growth; that is, the value that growth seems to

“level out” at as time grows large. The parameter β3 is sometimes called a “growth-rate” parameter,

because it characterizes how the growth increases as a function of time by decreasing the denominator

of (13.3). A scientist may have specific interest in these features.

It is natural in a setting like this to think that each soybean plot evolves over time according to a

“growth process” “unique” to that plot. If the model (13.3) is a reasonable way to represent the process

a particular plot might undergo, then it is natural to think of representing the situation of several

such plots by allowing each plot to have its own logistic growth model, with its own parameters that

characterize how large it ultimately gets and its “growth-rate.” More formally, if Yij is the measurement

on the growth value at time tij for the ith plot, we might think of the mean at the individual plot

level as being represented by (13.3) with plot-specific values for β1, β2, β3; that is

E(Yij |bi) =β1i

1 + β2i exp(−β3itij), βi =

β1i

β2i

β3i

= Aiβ + Bibi, (13.4)

where bi are random effects and Ai and Bi are suitable matrices allowing covariate information (e.g.

genotype) and other considerations to be represented.

PAGE 521

Page 531: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 13 ST 732, M. DAVIDIAN

This seems like a natural way to think, and it is indeed the way scientists feel comfortable thinking

when trying to formally represent the data. Of course, the model (13.4) and more general versions of

it (e.g. other functions f) is a subject-specific model. Thus, for many applications in the biological

sciences, there is a “theoretical” basis for preferring the subject-specific modeling approach.

This model looks very similar to the general form of a generalized linear mixed model, with one important

exception. The function f in (13.3) is not a function of a single argument, so that tij and the

parameter enter the model only in terms of a linear predictor. Rather, the way time and parameters

enter this model is more complicated. The result is that we have a model one might think of as being

even “more” nonlinear. Indeed, it is the case in biological and physical sciences that theoretical

models that may be derived from scientific principles are typically nonlinear in this more complicated

way.

INFERENCE: The same issues that make model fitting difficult in the generalized linear mixed model

case apply here as well – it is not generally possible to write down the likelihood of a data vector in

closed form. Again, approximations are often used. A full account of these models in biological and

physical applications may be found in Davidian and Giltinan (1995). There is a SAS macro, nlinmix,

that implements approximate methods to accomplish this fitting; however, as above, it should only be

used by those who have a full understanding of the model framework and the approximations used.

13.4 Issues associated with missing data

As we have mentioned, a common issue with longitudinal data, particularly when the units are humans,

is that data may be missing. That is, although we may intend to collect data according to some

experimental plan in which all units are seen at the same n times, it is quite often the case that things

do not end up this way. The obvious consequence is that the resulting data may not be balanced as

was originally intended. However, the fact that the data are not balanced is the least of the problems

– all of the modern methods we have discussed can handle this issue with ease! The real problems are

more insidious and were not in fact truly appreciated until quite recently.

As we have discussed, data may be “missing” for different reasons:

1. Mistakes, screw-ups, etc. – for example, a sample is dropped or contaminated, so that a measure-

ment may not be taken.

2. Issues related to the thing being studied (more in a moment).

PAGE 522

Page 532: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 13 ST 732, M. DAVIDIAN

Missingness of the first type is mainly an annoyance, unless it happens a lot. Missingness of the second

type can be a problem; previously in the course we have noted that if missingness happens in this

way, then intuition suggests that the very fact that data are missing may have information about the

issues under study! The fear is that if we treat the “missingness” as if it has no information, by simply

attributing the fact that data vectors are of different length by chance, and this is not really true, the

inference we draw may be misleading. We are now more formal about this.

TERMINOLOGY: In the literature on missing data, a certain terminology has been developed to

characterize different ways missingness happens. This terminology seems somewhat arcane, but it is

in widespread use. A statistical reference book that introduces this terminology is Little and Rubin

(2002); the recent and current statistical literature always has papers about missing data, too. In

reading further about the consequences of missing data, it is useful to be familiar with this terminology.

MISSING COMPLETELY AT RANDOM: In the first type of example, where, say, a sample is dropped

and ruined, the fact that the associated observation is thus missing has nothing to do with what is

being studied. If the sample is from a patient in a study to compare two treatments, the fact that it

was dropped has nothing to do with the treatments and their effect, but rather (most likely) with the

clumsiness of the person handling the sample! In the event that missingness is in no way related to

the issues under study, it is referred to as occurring completely at random, or MCAR.

The consequence of MCAR is simply that we get less data than we’d hoped. Thus, concerns about

sample size may be an issue – we may not be able to have the power to detect differences that we’d

hoped. If a lot of observations are missing, obviously power will be much less than we had bargained

for, and the ability of a study to detect a desired difference or estimate a particular quantity with a

desired degree of precision will be compromised. If the problem isn’t too bad, then power may not be

too seriously affected. However, we don’t have to worry about the inferences being misleading. Luckily,

because the reason for the missingness has nothing to do with the issues under study, we can assume

that the observation and the individual it came from are similar to all the others in the study, so that

what’s left is legitimately viewed as a fair representation of the response of interest in the population

of interest. What’s left might just be smaller than we hoped.

PAGE 523

Page 533: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 13 ST 732, M. DAVIDIAN

MISSING AT RANDOM: In the second type of example, we may have a situation where a patient

is a participant in a longitudinal study to evaluate a blood pressure medication. The patient’s blood

pressure at the outset may have been very high, which is why he was recruited into the study. The

study plan dictates that the patient be randomized to receive one of two study treatments and return

monthly to the hospital to have his blood pressure recorded. For ethical reasons, however, a patient

may be withdrawn from the study; e.g.

• In many such studies, the study plan dictates that if a patient’s measured blood pressure on

any visit goes above a certain “danger” level, the patient must be removed from the study and

have his treatment options be decided based solely on his condition (rather than continue on his

randomized treatment, which in some cases may be a placebo). This protects patients in the event

they are assigned to a medication that does not work for them.

• The patient’s personal physician may review the measurements taken over his previous monthly

visits and make a judgment that the patient would be better off being removed from the study

treatment. This, of course, would mean that the patient would be removed from the study.

In each of these cases, the patient will have data that are missing after a certain point because he is no

longer a participant. The reason the data will be missing in this way is a direct result of observation

of his previous response values!

Formally, in the event that missingness results because of the values of responses and other variables

already seen for a unit, the missingness is said to be at random, abbreviated MAR.

• The reason for this name is that missingness still happens as the result of observation of random

quantities (the response observed so far), but is no longer necessarily just an annoyance. Because

observations on any given patient are subject to (within-patient) variation, it could be that the

patient registered above the “danger” level just by chance due to measurement error, and, in

reality, his “true” blood pressure is really not high enough to remove him from the study.

• On the other hand, his blood pressure may have registered above the “danger” level because his

true pressure really is high.

We have to be concerned that the latter situation is true; if this is the case, then we fear that the data

end up seeing are not truly representative of the population; data values from patients who may have

registered “high” at some point, whether by chance or not, are not seen.

PAGE 524

Page 534: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 13 ST 732, M. DAVIDIAN

It turns out that, as long as one uses maximum likelihood methods and the assumptions underlying

them are correct, estimation of quantities of interest will not be compromised. However, implementa-

tion of such methods becomes more complicated, and specialized techniques may be necessary. Thus,

some acknowledgment of the problem is required. In the case of GEE methods, things are worse –

because these methods are not based on a likelihood, it is possible that the estimates themselves will

be unreliable; in particular, they can end up being biased. Thus, if MAR is suspected, the user must

be aware that the usual analyses may be flawed. Fancy methods to “correct” the problem are becoming

more popular; these are beyond our scope here.

NONIGNORABLE NONRESPONSE: A more profound case of the second type of missingness is as

follows. We discussed earlier in the course the case of patients in a study to evaluate AIDS treatments.

Suppose patients are to come to the clinic at scheduled intervals and measurements of viral load, a

measure of roughly “how much” HIV virus is in the system, are to be made. Patients with “high” viral

load tend to be sicker than those with “low” viral load. Viral load is thus likely to be seen increasing

over time for patients who are sicker. Moreover, the faster the rate of increase, the more rapidly patients

seem to deteriorate.

Suppose that a particular patient fails to come in for his scheduled clinic visits because his disease has

progressed to the point where he is too sick to come to the clinic ever again. If we think in terms of

a the patient’s individual trajectory of viral load, a patient who is too sick to come in probably also

has a viral load trajectory that is increasing, and may be increasing more quickly than those for other

patients who have not become so sick. Thus, if we think formally of a random coefficient model to

describe viral load as a function of time, e.g.

Yij = β0i + β1itij + eij ,

say, then it may be that the fact that a patient is too sick to come in is reflected in the fact that his

individual slope β1i is large and positive.

PAGE 525

Page 535: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 13 ST 732, M. DAVIDIAN

Now, if the treatment is supposed to be targeting the disease, obviously the fact that this patient is

too sick to return (yielding missing data) is caught up with the treatment. If we think of the random

coefficient model, the fact that data for this patient end up being missing is a consequence of the fact

that his slope β1i, which is supposedly influenced by the treatment, is too large and positive. The

patient has missing data not just because of data already seen, but in a sense because of his underlying

characteristics (represented through his slope) that will carry him through the rest of time, even

beyond the current time. Thus, missingness in this example is even more profound than missingness

that results from values of data already seen; here, missingness is related to all data, observed or not,

that we might see for this patient, because those data would all be the consequence of the patient’s very

steep slope!

This kind of missingness, which is caused by an underlying phenomenon that cannot be observed and

operates throughout time, is known as nonignorable nonresponse, or NINR. Unlike the MAR

situation, as the name indicates, if missingness happens this way, then a patient has missing data not

just by chance, but because of an underlying characteristic of that patient that may be influenced by

the treatment. Thus, we will have a completely unrealistic picture of the population of individuals from

the available data, because we will only have incomplete information from part of it. The result can be

that estimates of quantities of interest (like the difference in typical slope between two treatments) can

be flawed (biased), because information from people who are the sickest is underrepresented.

“Correcting” the problem can be difficult, if not impossible, because the missingness is a consequence

of something we cannot see! If NINR is suspected, it may not be possible to obtain reliable inferences

without making assumptions about things like random effects that cannot be observed. This is a serious

drawback, and one that is not always appreciated.

A full treatment of the consequences of missing data and how to handle the issues in the longitudinal

context would fill an entire course. The foregoing discussion is meant simply to highlight some of the

basic issues.

The book by Verbeke and Molenberghs (2000) devotes considerable attention to issues associated with

missing data in the particular context of the linear mixed effects model. The book by Fitzmaurice,

Laird, and Ware (2004) also offers more extensive introductory discussion.

PAGE 526

Page 536: Applied Longitudinal Data Analysis:Lecture Notes

.

ST 732, SPRING 2005

APPLIED LONGITUDINAL DATA ANALYSISERRATA LIST

The following is a running of list of typos and other errors found in the class notes. It was last

updated on

April 21, 2005

Errata are identified by page and line number, e.g. p. 29.4 means the erratum occurs on page

29, line 4 from the top. When it is more convenient to count from the bottom of the page, the

line number will be negative, e.g. p. 29.-5 means the erratum occurs on page 29, line 5 from the

bottom. A line of an equation counts as one line.

Page Erratum and correction

30.8 y should be Y

30.14 y should be Y

42.-6 “. . . the expected value or mean of Y . . . ” (Y should be Y)

46.-11 y should be Y

59.4 “. . . covariance matrix of Y is”

66.-5 y should be Y (2 instances)

70.-10 Should be cov(Yij , Y`k) = 0

72.7 Should be Y i

110.-1 “. . . all sources of random variation” (missing “of”)

116.7 “We thus see from (5.7) and (5.9) that this model. . . ” (mangled sentence)

126.-6 Missing µ; RHS should be µ + τ` + · · ·

137.-5 To avoid confusion, should be n × (n − 1)

138.-2 To avoid confusion, should be q × (n − 1)

139.1 To avoid confusion, should be (q − 1) × q

139.7 To avoid confusion, should be 1 × (n − 1)

202.3 Should be Y i and Yij

203.11 “. . . each data vector Y i . . . ” (upper case)

Page 537: Applied Longitudinal Data Analysis:Lecture Notes

Page Erratum and correction

205.3,4 Should be var(Y i)

231.-1,-4 Should be Y

232.6 Should be Y

240.-1 Should be Y

241.4,10 Should be Y

243.-7 Replace y by Y

296.-4,-7 Should be Yij

307.4 Should be Yij

314.18 Should be var(e2i) (missing right paren)

314.-11 e1ij should be e2ij

314.-9 Should be σ21Ini

+ σ22Ini

318.5 Should be var(b0i) (missing right paren)

319.9–11 Should read “. . . we would expect the deviations in e2i to be related to Ziβi,

which dictates how large the responses on a particular unit are; we would also

expect them to be related to the deviations e1i”

328.8 Should be D12 = 0

334.2 Should be var(ei) (not var(βi))

379.1 Should be 1ni1′

ni= Jn1

385.-4 Missing paren; should be E(Yij)

387.4-5 “. . . compares to the critical value from the χ22 sampling distribution

(D22 = 0 and “D12 = 0”)”

387.11-13 Should be χ22,0.95 = 5.99 and “comparing to the χ2

2 sampling. . . ”

391.5 Replace “for over 20 years” by “since the 1970s”

411.16 Should be β1i = β1 + β11di + b1i, (= sign not + sign)

412.7 Should read ‘. . . be used with Model (ii) to get a likelihood ratio test of whether

mean rate of change is different depending on whether the diet is followed,

taking into account the baseline covariates”

421.7 Should be β13 (not β + 13)

427.-7 Should be “. . . define 19 dummy variables for year and 9 for corps”

Page 538: Applied Longitudinal Data Analysis:Lecture Notes

Page Erratum and correction

436.8 Should say “additive deviation”

436.9 Should be Y = µ + ε

475.-7 Delete “select”

488.-8 Should be β3i instead of β4i

488.-5 Should be β3i = β3 + b3i,

489.1 Delete “baseline”

489.7 Should be bi = (b0i, b3i)′

489.8 Should be exp(β0 + β1ai + β2δi + b0i + β3tij + b3itij)

490.5 Should be exp(β0 + β1ai + β2δi + b0i + β3tij + b3itij).

490.8 Should be E {exp(β0 + β1bi + β2ai + β3δi + b0i + β3tij + b3itij)} .

490.11 Should be bi = (b0i, b3i)′

492.-1 Replace this sentence by “To incorporate oij , in the program we use the offset

option in the model statement of proc genmod.”

Page 539: Applied Longitudinal Data Analysis:Lecture Notes

.

ST 732, HOMEWORK 1, SPRING 2005

The following exercises are meant to familiarize you with the operations that we will summarizeusing matrix notation throughout the course. This is NOT a course in matrix algebra, so if yourmatrix algebra is rusty, or you are seeing it for the first time, be aware that future homeworks willnot focus on matrix algebra problems like these except where relevant; e.g. use of SAS to carry outthe analyses we will discuss requires some familiarity with matrix notation. So it is important thatyou appreciate what kind of calculations the streamlined matrix formulæ represent, even if we willnot actually be doing them.

1. Suppose A and B are both (2× 2) matrices with

A =

(4 2−3 7

), B =

(1 54 9

).

(a) Verify that |A||B| = |AB|.(b) Verify that |A| = 1/|A−1|.(c) Verify that tr(AB) = tr(BA).

2. (a) Suppose that a1 and a2 are constants, and Y1 and Y2 are (possibly correlated) randomvariables with means µ1 and µ2, respectively. Show that cov(a1Y1, a2Y2) = a1a2cov(Y1, Y2)by using the definition of covariance and results given in Chapter 3.

(b) Now suppose that a1, a2, a3, and a4 are constants, and Y1 and Y2 are (possibly correlated)random variables with means µ1 and µ2, respectively. Show that cov(a1Y1 + a2Y2, a3Y3 +a4Y4) = a1a3cov(Y1, Y3) + a1a4cov(Y1, Y4) + a2a3cov(Y2, Y3) + a2a4cov(Y2, Y4) by using thedefinition of covariance and results given in Chapter 3.

3. (a) Suppose that

c =

(c1

c2

), Y =

(Y1

Y2

),

where c1 and c2 are constants and Y is a random vector with covariance matrix

Σ =

(σ2

1 σ12

σ12 σ22

).

Use results in Problem 2 to verify that var(c′Y ) = c′Σc (bottom of p. 45 of the notes) byevaluating each side of this equation and showing that they are equivalent.

(b) Suppose Y and Σ are as in (a), and let

C =

(c11 c12

c21 c22

).

Using results in Problem 2 to verify that var(CY ) = CΣC ′ (p. 46) by evaluating each sideof this equation and showing that they are equivalent.

The covariance matrix of a linear combination of elements of a random vector is of routineinterest in longitudinal analysis.

1

Page 540: Applied Longitudinal Data Analysis:Lecture Notes

4. Suppose bi and eij are normal random variables for some i = 1, . . . , m and j = 1, . . . , n suchthat

bi ∼ N (0, σ2b ), eij ∼ N (0, σ2

e),

and that µ > 0 is a constant. Suppose further that Yij is a random variable such that

Yij = µ + bi + eij , j = 1, . . . , n,

and let

yi =

Yi1...

Yin

.

(a) Without further information on bi and eij than that above, is it possible to find E(yi)? Ifso, find it and express your result in terms of the vector 1, a (n× 1) vector with all elementsequal to 1. If not, explain why not.

(b) Now suppose that for all j = 1, . . . , n, bi and eij are statistically independent. Similarly,for any two values j, k = 1, . . . , n, suppose that eij and eik are independent.

It may be shown that if U and V are any two independent random variables with meansµu and µv, respectively, then E(UV ) = E(U)E(V ) = µuµv. Using this fact and others givenin Chapter 3, find the covariance matrix of Y i, var(Y i) = Σ, say.

(c) Give the correlation coefficient ρjk between Yij and Yik for any two j 6= k = 1, . . . , n, andwrite down the correlation matrix Γ for Y i.

(d) Using your results in (b) and (c), express Σ in the alternative representation given on p.44 of the notes by finding an appropriate matrix T 1/2. Verify for your choice of T 1/2 thatΣ = T 1/2ΓT 1/2 by multiplying this out in the case n = 2.

5. Suppose that Y is a random vector with mean vector µ, where

Y =

Y1

Y2

Y3

Y4

, µ =

µ1

µ2

µ3

µ4

.

(a) Suppose that we are interested in the null hypothesis H0 : µ2 − µ1 = 0, µ3 − µ1 = 0,µ4 − µ1 = 0, which may be written alternatively as

H0 :

µ2 − µ1

µ3 − µ1

µ4 − µ1

= 0,

where 0 is a (3× 1) vector of 0s.

Give an appropriate matrix L so that H0 may be writing in the form H0 : Lµ = 0.

(b) Now suppose we are interested in the null hypothesis H0 : µ1 − (µ2 + µ3 + µ4)/3 = 0,µ2 − (µ3 + µ4)/2 = 0, µ3 − µ4 = 0. Reexpress H0 in the form H0 : µ′U = 0′ by findingthe appropriate matrix U . Here, 0′ is a (1 × 3) vector, so H0 is being expressed as a rowvector (rather than a column as in (a)). Thus, note that the hypotheses involving severalexpressions may be expressed equivalently as either rows or columns.

2

Page 541: Applied Longitudinal Data Analysis:Lecture Notes

We will see that this way of expressing hypotheses about the elements of a mean vector isstandard for the ANOVA methods we will discuss and is used by SAS and other software forsetting up hypotheses of interest.

6. Consider the dental study data of Example 1 in Chapter 1 on p. 3–4 of the notes. These datamay be found through the class web page in the file dental.dat. The file has 5 columns:(1) observation number, (2) child number (1–27), (3) age, (4) distance measurement, and (5)indicator of gender (0=girl, 1=boy).

(a) Suppose you have not been told that the data represent observations on different subjects;rather, you are just told that columns 3 and 4 of this data set represent n = 4×27 = 108 pairsof measurements on a covariate x (“age”) and response Y (“distance”), respectively. You arealso told that the indicator in column 5 (0 or 1) means that the pairs of measurements areof two different “types.” Finally, you are told that interest focuses on fitting straight lineregression models to these data, one for each type:

Yj = β00 + β01xj + εj , for Type 0 ,

Yj = β10 + β11xj + εj , for Type 1 ,

Having been told nothing else about the data, you decide to use least squares estimation toestimate the parameters in each model, thus assuming all of the responses Yj , j = 1, . . . , nare mutually independent with var(Yj) = σ2

0 for Type 0 and var(Yj) = σ21 for Type 1 the

assumed constant variances for each type. Either by hand or using SAS PROC REG or PROCGLM, fit each model separately, and report the following: estimates of the intercepts β00 andβ10, the slopes β10 and β11, and estimated standard errors for all of these; and the variancesσ2

0 and σ21. If you use SAS, you will need to write a SAS program to

• Read in the data from the file using a DATA step with an INFILE statement.

• Use PROC SORT to sort the data set by type.

• Use PROC REG or PROC GLM with a BY statement to perform 2 separate analyses, one foreach type.

(b) Now suppose instead that you have been told that the data do indeed represent repeatedobservations on each of 27 children, 11 girls and 16 boys, but you are not told that therepeated observations have been made over time. You are also told that interest focuses onthe difference in mean response between boys and girls by performing an analysis of varianceassuming the following statistical model. Let Yh`j represent the jth distance measurementon the hth child form the `th gender, ` = 0, 1 for girls, boys. Then the model is

Yh`j = µ + τ` + eh` + δh`j ,

where µ is an overall mean, τ` is the effect of the `th gender, eh` is the error associated withthe hth child in the `th gender, and δh`j is the error associated with the jth observation onthe hth child in the `th group. Either by hand or using SAS PROC GLM, construct the analysisof variance table for this model and calculate the F statistic appropriate for testing whetherthe mean responses for each gender differ. Note that you will need to be careful in identifyingthe correct mean square for the denominator of the error term for this F ratio!

When we consider a proper longitudinal analysis of this data set later in the course, it will beof interest to compare these results to those we obtain under more complex statistical modelsthat take correlation into account.

3

Page 542: Applied Longitudinal Data Analysis:Lecture Notes

7. In the file weightloss.dat on the class web page you will find longitudinal data on m = 100overweight male subjects. These subjects were judged to be at least 40% above their idealweight for their height and in danger of heart attack or stroke by their private physicians.The men were recruited into a study to compare three weight loss programs. Each subjectwas randomly assigned to follow program 1, 2, or 3. Program 1 was a standard programcurrently in widespread use, and served as a control for the two other programs, which wereexperimental. Both programs 2 and 3 required subjects to follow a strict diet regimen anda daily exercise routine and to see their private physician once a month. Subjects program2 were in addition called by a representative of the study daily and given encouragement tostay with the program, and were visited in person by a representative once a week. Subjectsin program 2 received no such encouragement. At time 0, corresponding to enrollment in theassigned program, subjects were weighed at the study clinic, and returned to the clinic at 3,6, 9, and 12 months thereafter to be weighed again.

The data set has 7 columns:

Column Description1 Subject ID number2–6 Weight in pounds for months 0, 3, 6, 9, 127 Program indicator (1, 2, or 3)

(a) Write a SAS program to obtain the following:

(i) Read in the data in the form they appear in the data set

(ii) Find the means for each group at each day and plot them for each diet group on thesame graph

(iii) Find the sample covariance and sample correlation matrix for each diet group

(iv) Obtain the centered and scaled versions of the responses at each month for each dietgroup and output them to a file

(v) Find the pooled sample covariance matrix and corresponding estimated correlation ma-trix under the assumption of a common covariance matrix

(b) Use R or some other software to obtain scatterplot matrices for each diet group.

(c) Based on inspection of the results in (a) and (b), do you think the assumption of a commoncovariance matrix for each diet is reasonable? Why or why not? Give details of your reasoningas if you were explaining this to an investigator for whom you are analyzing these data.

(d) Based on inspection of the results in (a) and (b), what covariance model(s) do you thinkis(are) appropriate for these data? Give details of your reasoning as if you were explainingthis to an investigator for whom you are analyzing these data.

4

Page 543: Applied Longitudinal Data Analysis:Lecture Notes

.

ST 732, HOMEWORK 1, SOLUTIONS, SPRING 2005

1. (a) We have |A| = 28− (−6) = 34, |B| = 9− 20 = −11, so that |A||B| = (34)(−11) =-374.Furthermore,

AB =

(4 2−3 7

) (1 54 9

)=

(12 3825 48

),

so that |AB| = (12)(48)− (25)(38) = 576− 950 = −374.

(b) We have

A−1 =134

(7 −23 4

)=

(7/34 −2/343/34 4/34

).

Thus, |A−1| = (7/34)(4/34)− (3/34)(−2/34) = (28 + 6)/1156 = 34/1156 = 1/34.

(c) We calculated AB above, so it follows that tr(AB) = 12+48 = 60. To calculate tr(BA),we have

BA =

(−11 37−11 71

),

so that tr(BA) = −11 + 71 = 60.

2. (a) From the definition of covariance on p. 40,

cov(a1Y1, a2Y2) = E{a1(Y1 − µ1)a2(Y2 − µ2)} = E{(a1a2)(Y1 − µ1)(Y2 − µ2)}.(a1a2) is a scalar constant, so the covariance is just the expectation (average) of all possiblevalues of (Y1 − µ1)(Y2 − µ2) where each value in the average is multiplied by (a1a2). Thus,using the results on p. 35,

cov(a1Y1, a2Y2) = a1a2E{(Y1 − µ1)(Y2 − µ2)} = a1a2cov(Y1, Y2)

by the definition of covariance.

(b) Here is one way. Both a1Y1 + a2Y2 and a3Y1 + a4Y2 are linear combinations of the vectorY . Thus, using the result on the bottom of p. 45, we may find their means to be

E(a1Y1 + a2Y2) = a1µ1 + a2µ2, E(a3Y1 + a4Y2) = a3µ1 + a4µ2.

We may thus write, by the definition of covariance, that

cov(a1Y1 + a2Y2, a3Y1 + a4Y2)= E{(a1Y1 + a2Y2 − a1µ1 − a2µ2)(a3y1 + a4y2 − a3µ1 − a4µ2)}= E[{a1(Y1 − µ1) + a2(Y2 − µ2)}{a3(Y1 − µ1) + a4(Y2 − µ2)}.

The last expression may be rewritten as

E{a1a3(Y1 − µ1)2 + a1a4(Y1 − µ1)(Y2 − µ2) + a2a3(Y1 − µ1)(Y2 − µ2) + a2a4(Y2 − µ− 2)2}= a1a3E{(Y1−µ1)2}+a1a4E{(Y1−µ1)(Y2−µ2)}+a2a3E{(Y1−µ1)(Y2−µ2)}+a2a4E{(Y2−µ2)2}.This follows because the quantity for which the expectation is to be found in the first line isjust another linear combination [of the random variables (Y1 − µ1)2, (Y1 − µ1)(Y2 − µ2), and

1

Page 544: Applied Longitudinal Data Analysis:Lecture Notes

(Y2−µ2)2]. Inspection of the second line then leads to the result, as E{(Yk−µk)2} = var(Yk)for k = 1, 2, and E{(Y1 − µ1)(Y2 − µ2)} = cov(Y1, Y2) by definition, so that combining thesecond and third terms gives

cov(a1Y1 + a2Y2, a3Y1 + a4Y2) = a1a3var(Y1) + a2a4var(Y2) + (a1a4 + a2a3)cov(Y1, Y2),

as required.

3. (a) We have var(c′Y ) = var(c1Y1 + c2Y2) = var(c1Y1)+var(c2Y2)+2cov(c1Y1, c2Y2). From p.35 and 2(a), letting c1 and c2 play the roles of a1, a2, this is equal to c2

1var(Y1) + c22var(Y2) +

2c1c2cov(Y1, Y2) = c21σ

21 + c2

2σ22 + 2c1c2σ12. But cΣc′ =

(c1 c2

) (σ2

1 σ12

σ12 σ22

) (c1

c2

)=

(c1σ

21 + c2σ12 c1σ12 + c2σ

22

) (c1

c2

),

which may be shown to be equal to the above.

(b) We have

CY =

(c11Y1 + c12Y2

c21Y1 + c22Y2

),

which is a (2×1) random vector. Thus var(CY ) is a (2×2) matrix. The 2 diagonal elementsare the variances of quantities of the form ck1Y1 + ck2Y2, where k = 1, 2. Using Problem2(a) and the result on p. 35, we have that these variances have form var(ck1Y1 + ck2Y2) =var(ck1Y1) + var(ck2Y2) + 2cov(ck1Y1, ck2Y2) = c2

k1σ21 + c2

k2σ22 + 2ck1ck2σ12. The off-diagonal

elements will be the same and equal to cov(c11Y1 + c12Y2, c21Y1 + c22Y2). This is of the formof the result in 2(b); thus, letting the roles of a1, . . . , a4 be played by c11, c12, c21, c22, wehave that the off-diagonal elements are equal to c11c21σ

21 + c12c22σ

22 + (c11c22 + c12c21)σ12.

Combining, we get that var(CY ) is equal to(

c211σ

21 + c2

12σ22 + 2c11c12σ12 c11c21σ

21 + c12c22σ

22 + (c11c22 + c12c21)σ12

c11c21σ21 + c12c22σ

22 + (c11c22 + c12c21)σ12 c2

21σ21 + c2

22σ22 + 2c21c22σ21

).

We now must show that this is equal to CΣC ′ =(c11 c12

c21 c22

) (σ2

1 σ12

σ12 σ22

) (c11 c21

c21 c22

)

=

(c11σ

21 + c12σ12 c11σ12 + c12σ

22

c21σ21 + c22σ12 c21σ12 + c22σ

22

) (c11 c21

c21 c22

).

Doing the final matrix multiplication and simplifying yields the expression for var(CY ) cal-culated directly above.

Thus, note that if we have linear combinations CY of the elements of a random vector Y ,the variances and covariances of such combinations are complicated functions of the vari-ances and covariances of the elements of y. The matrix notation allows us to express thissuccinctly. This is important because when we have observations that are correlated and wishto test hypotheses or estimate quantities of interest, such hypotheses and estimators are oftenexpressed as linear combinations of observations, as we will see.

2

Page 545: Applied Longitudinal Data Analysis:Lecture Notes

4. (a) This is possible without further information; all we need is the information on the meansof the two random variables bi and eij , as follows. For an j = 1, . . . , n, Yij = µ + bi + eij isjust a linear combination of the two random variables bi and eij , shifted by µ. From p. 44,then, E(bi + eij) = 0 + 0 = 0. So the random variable bi + eij has mean 0; applying the factat the bottom of p. 35 then yields E(Yij) = µ + E(bi + eij) + µ = 0 + µ = µ. We may applythis argument to each j; thus, we may summarize as

E(Y i) =

µµ...µ

= µ

11...1

= µ1.

(b) We have for j = 1, . . . , n

var(Yij) = var(µ + bi + eij) = var(bi + eij)= var(bi) + var(eij)− 2cov(bi, eij) = var(bi) + var(eij) + 0 = σ2

b + σ2e

because bi and eij are independent. Also, using the independence,

cov(Yij , Yik) = E(Yij − µ)(Yik − µ) = E(bi + eij)(bi + eik)= E(b2

i + bieij + bieik + eijeik)= E(b2

i ) + E(bieij) + E(bieik) + E(eijeik)= E(bi − 0)2 + E(bi)E(eij) + E(bi)E(eik) + E(eij)E(eik)= var(bi) + (0)(0) + (0)(0) + (0)(0) = σ2

b .

Thus,

Σ =

σ2b + σ2

e σ2b · · · σ2

b

σ2b σ2

b + σ2e · · · σ2

b...

......

...σ2

b · · · σ2b σ2

b + σ2e

.

(c) The correlation coefficient ρjk is thus given as

σ2b√

σ2b + σ2

e

√σ2

b + σ2e

=σ2

b

σ2b + σ2

e

.

We may thus write the correlation matrix as

Γ =

1 σ2b/(σ2

b + σ2e) · · · σ2

b/(σ2b + σ2

e)...

......

...σ2

b/(σ2b + σ2

e) · · · σ2b/(σ2

b + σ2e) 1

.

(d) In general,

T 1/2 =

(σ2b + σ2

e)1/2 0 · · · 0

......

......

0 · · · 0 (σ2b + σ2

e)1/2

.

3

Page 546: Applied Longitudinal Data Analysis:Lecture Notes

When n = 2, we have T 1/2ΓT 1/2 =((σ2

b + σ2e)

1/2 00 (σ2

b + σ2e)

1/2

) (1 σ2

b/(σ2b + σ2

e)σ2

b/(σ2b + σ2

e) 1

) ((σ2

b + σ2e)

1/2 00 (σ2

b + σ2e)

1/2

)

=

((σ2

b + σ2e)

1/2 σ2b/(σ2

b + σ2e)

1/2

σ2b/(σ2

b + σ2e)

1/2 (σ2b + σ2

e)1/2

) (1 σ2

b/(σ2b + σ2

e)σ2

b/(σ2b + σ2

e) 1

)

=

((σ2

b + σ2e) σ2

b

σ2b (σ2

b + σ2e)

)

as required.

5. (a) We need L to be such that “sweeping” each row of L down the column vector µ givesthe corresponding element of H0. Note that µ2−µ1 = (−1)µ1 +(1)µ2 +(0)µ3 +(0)µ4, so thefirst row of L should be (−1, 1, 0, 0). The other rows are similar, leading to

L =

−1 1 0 0−1 0 1 0−1 0 0 1

.

(b) Note that we want to write H0 as a (1× 3) vector; i.e.

H0 :(

µ1 − µ2/3− µ3/3− µ4/3, µ2 − µ3/2− µ4/2, µ3 − µ4

).

Now µ′ = (µ1, µ2, µ3, µ4), so we want to find U such that “sweeping” the row µ′ down eachcolumn of U gives these elements (which are columns of a row vector). Note that the firstelement may be written as (1)µ1 +(−1/3)µ2 +(−1/3)µ3 +(−1/3)µ4, so that the first columnof U should be

1

−1/3−1/3−1/3

.

Using the same reasoning for the other elements, we get

U =

1 0 0−1/3 1 0−1/3 −1/2 1−1/3 −1/2 −1

.

We will see the utility of writing things this way in Chapter 5.

6. A SAS program and output for fitting a straight line model to the data on girls and boysseparately and for doing the one-way analysis of variance where we have more than oneobservation on each unit (child) may be found in the files hwk1 6.sas and hwk1 6.lst,respectively, on the class web page. (a) From the output, we have the following estimateswith estimated standard errors in parentheses:

β00 = 17.373(1.638), β01 = 0.480(0.146), β10 = 16.341(1.454), β11 = 0.784(0.130).

4

Page 547: Applied Longitudinal Data Analysis:Lecture Notes

The estimates of the assumed common variances are

σ20 = 4.683, σ2

1 = 5.372.

Informal inspection of these estimates shows that the slope (rate of change) of distanceseems greater for boys than for girls. Moreover, the variability of distance measurementsseems greater for boys than girls. Of course, this model and fit ignores the fact that theobservations are actually repeated measures on different children in each group, so it is notclear what to make of this – the conclusions based on this analysis, which ignores a key featureof the data, might be erroneous.

(b) From the output, the analysis of variance table looks like

Source DF SS MS FGender 1 140.465 140.465 140.465/15.117 = 9.29Children within Genders 25 377.915 15.117Obs within Children 81 399.312 4.930Total 107 917.962

The appropriate F ratio is found by taking the quotient of the Gender MS to that for Childrenwithin Genders, as the children are regarded here as the experimental units, hence the ap-propriate measure of experimental error comes from them. This analysis treats the repeatedmeasures over age as if each child was just subsampled 4 times; there is no regard for theordering over time.

7. (a) See the program hwk1 7.sas and its output in hwk1 7.lst on the class web page. We donot plot the means, but you should have.

(b) See R program in the file scatterplots.R and the resulting postscript file with thescatterplots on the class web page.

(c) This is of course subjective. From the output of PROC CORR, it seems as though the samplecorrelation matrices are fairly similar, with relatively constant correlations in the 0.8 range.The diagonal elements of the covariance matrices (the variances at each month) seem a bitlower in diet group 1 than in the other 2, although it is hard to tell. Overall, it seems asthough assuming a common covariance structure wouldn’t be too farfetched. You of courseneeded to explain all this to the investigator in more detail.

(d) Of all the covariance models discussed in Chapter 4, compound symmetric models seemthe best fit, as the correlations seem relatively constant across months. Whether the homo-geneous or heterogeneous version is better is not entirely clear, although the variances doseem relatively constant across time (keeping in mind that the values are just estimates soare subject to variation). In the spirit of parsimony, the homogeneous version would probablybe a reasonable choice. You of course needed to explain all this to the investigator in moredetail.

5

Page 548: Applied Longitudinal Data Analysis:Lecture Notes

.

ST 732, HOMEWORK 2, SPRING 2005

1. Suppose that we have a situation in which units have been randomized into q = 3 groups andeach unit is observed at the same n = 4 times. As in the notation in the notes, let µ`j be themean for the `th group at the jth time.

(a) In terms of the µ`j , write down the M matrix for this problem.

(b) Suppose Y i is the data vector for the ith unit. If we assume the model given in equation(5.11), write down the vector ai appropriate for a unit in group 3.

(c) Suppose µ`j = µ + τ` + γj + (τγ)`j . If we express the model in the alternative “regressionform” given on page 119 of the notes, Y i = Xiβ + εi, write down the appropriate vector βand “design matrix” Xi for the ith unit in the 2nd group.

(d) Write down the appropriate matrix U that would be used in this situation to characterizea set of contrasts focusing on difference among the n = 4 times.

(e) Taking into account the usual constraints imposed on an overparametrized model like(5.11), write down the form of the null hypothesis that the mean profiles are parallel acrossthe q = 3 groups in terms of µ, the τ`, the γj and the (τγ)`j . Write down appropriate matricesC and U that could be used to express this null hypothesis in the form H0 : CMU = 0.

2. Suppose that we have a situation in which units have been randomized into q = 4 groups andeach unit is observed at the same n = 3 times. As in the notation in the notes, let µ`j be themean for the `th group at the jth time satisfying µ`j = µ + τ` + γj + (τγ)`j for ` = 1, . . . , qand j = 1, . . . , n.

(a) In terms of the µ`j , write down the M matrix for this problem.

(b) Suppose that mean profiles for the q = 4 groups are approximately parallel, and we areinterested in testing whether they in fact coincide for the 4 groups. Taking in to accountthe usual constraints, write down the null hypothesis relevant to this situation in terms of µ,the τ`, the γj and the (τγ)`j . Then write down appropriate matrices C and U that wouldallow the null hypothesis to be written in the form H0 : CMU = 0. Perform the matrixmultiplication CMU and verify that your choice of C and U indeed leads to the correctform of the null hypothesis.

(c) Suppose that mean profiles for the q = 4 groups are approximately parallel, and we areinterested in testing whether they in fact constant over the 3 time points. Taking into accountthe usual constraints, write down the null hypothesis relevant to this situation in terms of µ,the τ`, the γj and the (τγ)`j . Then write down appropriate matrices C and U that wouldallow the null hypothesis to be written in the form H0 : CMU = 0. Perform the matrixmultiplication CMU and verify that your choice of C and U indeed leads to the correctform of the null hypothesis.

3. Estimation of σ2b and σ2

e . For a general problem with q groups and n time points, with mtotal units, suppose we construct the usual univariate repeated measures analysis of variancetable given on the top of page 130 of the notes. Suppose that the value of mean squarecorresponding to among-unit error, MSEU , has numerical value a, and the mean squarecorresponding to within-unit error, MSE , has numerical value c.

1

Page 549: Applied Longitudinal Data Analysis:Lecture Notes

(a) Consider the table of expected mean squares on the top of page 131. How would youestimate σ2

b and σ2e given the values a and c? Answer this question by providing expressions

for the estimates, σ2b and σ2

e , say, in terms of the numerical values a and c.

(b) Suppose that c = 6, a = 2, and n = 4. Based on (a), assuming that the model underlyingthe univariate repeated measures analysis of variance is correct, provide numerical estimatesof the (assumed common) covariance matrix Σ and correlation matrix Γ of a data vector.

4. Suppose n = 5. Write down the form of the Helmert transformation matrix U for thissituation.

5. The Human Immunodeficiency Virus (HIV) attacks the immune system, and it has becomestandard practice to monitor the progression of the disease in HIV-infected subjects by mea-suring CD4+ t-lymphocyte count (cells/mm3) at periodic intervals; the higher the CD4 count,the better. (The “official” definition of whether an HIV-infected individual has progressed tothe “full-blown” disease of Acquired Immunodeficiency Syndrome (AIDS) is based in part onwhether the patient’s CD4 count has dropped to less than 200 cells/mm3.) Accordingly, it isstandard to collect longitudinal data on CD4 count in studies of treatments for HIV diseaseand base inferences on treatment differences in part of differences in observed patterns of CD4change over the course of treatment.

In the file cd4.dat, available on the class web page, you will find longitudinal data on m = 250HIV-infected subjects participating in a randomized study to compare three treatment strate-gies. Subjects were recruited into the study and randomly assigned to receive one of threetreatment strategies; subjects are identified in the data set by ID numbers 1–250. Subjects1–100 received the standard regimen of Highly Active AntiRetroviral Therapy (HAART)(treatment group 1), subjects 101–175 received HAART plus an anti-HIV therapeutic vac-cine (treatment group 2), and subjects 176–250 received HAART plus interleukin 2 (IL-2)(treatment group 3); the additional agents received by groups 2 and 3 were meant to enhancethe effect of the standard therapy. For each subject, a CD4 count was taken at baseline (priorto initiation of assigned therapy; time 0). Subjects then returned at weeks 8, 16, 24, and32, at which CD4 count was again ascertained. Miraculously, all 250 subjects returned asscheduled for all visits.

The investigators were interested in whether subjects like those in the study assigned to thethree strategies exhibit different patterns of CD4 count over the study period. Note thatpatterns of increase would be interpreted as reflecting improved immunological status.

The data set has 7 columns:

Column Description1 Subject ID number2–6 Natural logarithm of CD4 count (cells/mm3) for weeks 0, 8, 16, 24,327 Treatment group indicator (1, 2, or 3)

It is conventional to transform CD4 counts to make them appear more “normally distributed,”and a logarithmic transformation is fairly standard. Note that the CD4 counts are alreadytransformed in the data set.

(a) Using your favorite graphical software, make separate spaghetti plots of the raw longi-tudinal profiles for each treatment group separately. Give your general impressions on the“overall” observed patterns and how they might compare across treatment groups.

2

Page 550: Applied Longitudinal Data Analysis:Lecture Notes

(b) Write a SAS program to obtain the following analyses:

(i) Read in the data in the form they appear in the data set

(ii) Find the means for each group at each day and plot them for each group on the samegraph

(iii) Calculate the sample covariance matrices and associated estimated correlation matricesfor each group separately

(iv) Calculate the centered and scaled versions of the data separately by group and outputto a file. Separately, make scatterplot matrices for each group separately.

(v) Conduct a univariate repeated measures ANOVA using PROC GLM via the “split-plot”specification of the model; this will require you to create a new data set with one datarecord per subject/week. Use a random statement to get SAS to print out the table ofexpected mean squares.

(vi) Conduct a univariate repeated measures ANOVA using PROC GLM using the repeatedstatement. Have your program print out the test for sphericity.

(vii) Use PROC GLM and appropriate repeated statements to obtain specialized within-unitanalyses using the polynomial, profile, and Helmert transformations.

On the basis of the output, answer (c)–(k) below.

(c) Informally, from the plot of the CD4 means over time for each group from (b)(ii), do youthink that the visual evidence supports the contention that the pattern of mean CD4 countover the time period of the study is similar across treatment strategies? Explain your answer.

(d) From the output of (b)(iii) and the scatterplot matrices from (b)(iv), do you think theassumptions regarding covariance and correlation underlying the univariate repeated measuresanalysis of variance seem plausible? Explain your answer.

(e) From the output of (b)(v), write down the numerical value of the F ratio suitable fortesting the null hypothesis that the change in mean CD4 over time is the same for the 3treatment strategies versus the alternative that is is not. At level of significance α = 0.05, isthere sufficient evidence to reject the null hypothesis? Provide justification for your answer.

(f) From the output of (b)(v) and using your answer to Problem 3 above, provide estimatesof σ2

b and σ2e under the assumption of the compound symmetry model, and write down an

estimate for the covariance matrix of a data vector from any treatment group. Providean estimate of the correlation among two CD4 observations on the same subject from anytreatment group.

(g) Returning to the issue in (c), cite appropriate results from the output of (b)(vi) thatprovide further insight into whether the assumption on covariance underlying the univariaterepeated measures analysis of variance is appropriate. Is there sufficient evidence to con-clude that the assumption is inappropriate? Is it necessary to use the “adjusted” F test forparallelism here?

(h) Does it make sense to consider the test of whether mean CD4 differs between the treatmentstrategies averaged across time? Why or why not?

(i) Regardless of your answer to (h), write down the numerical value of the F ratio that wouldbe appropriate for addressing this issue.

(j) From the output for (b)(vii), give the numerical value of the F test statistic that would beappropriate for testing whether the groups differ in terms of linear trend over time. Is there

3

Page 551: Applied Longitudinal Data Analysis:Lecture Notes

sufficient evidence to conclude at level α = 0.05 that the mean CD4 count patterns for the 3treatments differ in this way? From the plot in (ii), does the result of this test seem to agreewith the visual evidence? Explain your answer.

(k) The investigators had high hopes for the addition of the vaccine to the standard HAARTregimen (treatment 2). In particular, they expected that, on average, subjects on followingthis treatment strategy would exhibit an initial rise in CD4 by week 8, followed by (hopefully)continued elevated CD4. In contrast, they expected any rise over the 32-week period for theother two strategies to be more gradual, at a relatively constant rate. They wanted to obtainsome formal evidence that the patterns of mean CD4 differ across strategies in this kind ofway.

From the specialized analyses performed in (b)(vii), identify one that you think most nearlytries to address this issue, and explain why you chose it. Give the numerical value of the Ftest statistic that would be appropriate for testing this issue. Is there sufficient evidence toconclude at level α = 0.05 that this phenomenon occurred on average? From the plot in (ii),does the result of the test seem to agree with the visual evidence? Explain your answer.

4

Page 552: Applied Longitudinal Data Analysis:Lecture Notes

.

ST 732, HOMEWORK 2, SOLUTIONS, SPRING 2005

1. (a) We have

M =

µ11 µ12 µ13 µ14

µ21 µ22 µ23 µ24

µ31 µ32 µ33 µ34

.

(b) We have a′i = (0, 0, 1), so that a′iM = (µ31, µ32, µ33, µ34).

(c) We have

β =

µτ1

τ2

τ3

γ1

γ2

γ3

γ4

(τγ)11(τγ)12(τγ)13(τγ)14(τγ)21(τγ)22(τγ)23(τγ)24(τγ)31(τγ)32(τγ)33(τγ)34

.

For a unit in group 2, we need Xi to “pick off” the appropriate elements so that the productXiβ gives the vector µ′i = (µ21, µ22, µ23, µ24)′. We know that µ`j = µ+τ` +γj +(τγ)`j . Thus,we have

Xi =

1 0 1 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 01 0 1 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 01 0 1 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 01 0 1 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0

.

(d) With n = 4, we need a matrix with n− 1 = 3 columns and n = 4 rows:

U =

1 0 0

−1 1 00 −1 10 0 −1

.

Other such matrices are possible; the important thing is that they have 4 rows and enableone to derive any contrast of 2 means over times from the 3 columns.

1

Page 553: Applied Longitudinal Data Analysis:Lecture Notes

(e) From the discussion on pages 121–124 in the notes, the hypothesis of interest under theconstraints is H0 : all (τγ)`j = 0 for ` = 1, 2, 3 and j = 1, . . . , 4. To express this in thealternative form H0 : CMU = 0, we need a C matrix that addresses differences amonggroups and a U matrix that addresses differences among the times, both of the correctdimensions for q = 3 and n = 4. The appropriate U matrix is as in (d) above. Theappropriate C matrix needs to be q − 1× q, so 2× 3; one such matrix is(

1 −1 01 0 −1

).

2. (a) We have

M =

µ11 µ12 µ13

µ21 µ22 µ23

µ31 µ32 µ33

µ41 µ42 µ43

.

(b) From the discussion on pages 125–127, we are interested here in the Main Effect of Groups.Under the usual constraints, the null hypothesis may be written as H0 : τ1 = τ2 = τ3 = τ4 = 0.

To express the hypothesis in the form H0 : CMU = 0, we want U to average mean responseover time and C to address differences among groups, so that the result compares averagemean response (over time) among groups. With q = 4, we need a matrix with q− 1 = 3 rowsand q = 4 columns to yield an appropriate C; one such C is

C =

1 −1 0 01 0 −1 01 0 0 −1

.

The appropriate U would be 1/31/31/3

.

Multiplying out, we get

CMU =

1 −1 0 01 0 −1 01 0 0 −1

µ11 µ12 µ13

µ21 µ22 µ23

µ31 µ32 µ33

µ41 µ42 µ43

1/3

1/31/3

;

doing the first multiplication gives µ11 − µ21 µ12 − µ22 µ13 − µ23

µ11 − µ31 µ12 − µ32 µ13 − µ33

µ11 − µ41 µ12 − µ42 µ13 − µ43

1/3

1/31/3

.

We may re-express each element of the first matrix in terms of the τ`, γj , and (τγ)`j forexample, the elements of the first row of this matrix are τ1 − τ2 + (τγ)11 − (τγ)21, τ1 − τ2 +(τγ)12 − (τγ)22, τ1 − τ2 + (τγ)13 − (τγ)23, and similarly for the elements of the other rows.Now if we “sweep” this first row down the column U , note that we end up with

3(τ1 − τ2)/3 +3∑

j=1

(τγ)1j/3 +3∑

j=1

(τγ)2j/3.

2

Page 554: Applied Longitudinal Data Analysis:Lecture Notes

Similarly sweeping the second and third rows gives

3(τ1 − τ3)/3 +3∑

j=1

(τγ)1j/3 +3∑

j=1

(τγ)3j/3

and

3(τ1 − τ4)/3 +3∑

j=1

(τγ)1j/3 +3∑

j=1

(τγ)4j/3.

Now by the usual constraints∑n

j=1(τγ)`j = 0, note that the sums in these expressions are all0. Thus, combining, we have that

CMU =

τ1 − τ2

τ1 − τ3

τ1 − τ4

.

Thus, H0 says that τ1−τ2 = 0, τ1−τ3 = 0, and τ1−τ4 = 0. However, under the usual constraint∑q`=1 τ` = 0, we have further that τ1 + τ2 + τ3 + τ4 = 0. H0 says that τ1 = τ2 = τ3 = τ4;

plugging this in gives τ1+τ1+τ1+τ1 = 4τ1 = 0. So τ1 = 0, and furthermore τ2 = 0, τ3 = 0, andτ + 4 = 0. Thus, the constraint and H0 together say that in fact H0 : τ1 = τ2 = τ3 = τ4 = 0as required.

(c) From the discussion on page 128, we are interested here in the Main Effect of Time. Underthe usual constraints, the null hypothesis may be written as H0 : γ1 = γ2 = γ3 = 0.

To express the hypothesis in the form H0 : CMU = 0, we want C to average mean responseacross groups and U to address differences across time, so that the result compares averagemean response (across groups) over time. An appropriate U (n× n− 1) is 1 0

−1 10 −1

.

The appropriate C would be (1/4 1/4 1/4 1/4

).

Multiplying out, we get

CMU =(

1/4 1/4 1/4 1/4)

µ11 µ12 µ13

µ21 µ22 µ23

µ31 µ32 µ33

µ41 µ42 µ43

1 0−1 1

0 −1

.

If we do the multiplication MU first, we getµ11 − µ12 µ12 − µ13

µ21 − µ22 µ22 − µ23

µ31 − µ32 µ32 − µ33

µ41 − µ42 µ42 − µ43

.

3

Page 555: Applied Longitudinal Data Analysis:Lecture Notes

We may write each of these entries in terms of elements of γj and (τγ)`j ; for example, thefirst column may be written γ1 − γ2 + (τγ)11 − (τγ)12

γ1 − γ2 + (τγ)21 − (τγ)22γ1 − γ2 + (τγ)31 − (τγ)32γ1 − γ2 + (τγ)41 − (τγ)42

.

If we now sweep the row C across each column to complete the operation, we get for the firstcolumn

4(γ1 − γ2)/4 +4∑

`=1

(τγ)`1/4 +4∑

`=1

(τγ)`2/4

and similarly for the other column. By the usual constraints, all sums over ` of the (τγ)`j are0, so we end up with

CMU =(

γ1 − γ2 γ2 − γ3

),

so that H0 says that γ1−γ2 = 0, γ2−γ3 = 0. The usual constraint also says that γ1+γ2+γ3 =0. Under H0, we see that γ1 = γ2 = γ3; acting exactly as in (b), we may conclude that allof these must equal zero under H0 and the constraint, which is H0 : γ1 = γ2 = γ3 = 0 asrequired.

3. (a) We do this by the usual tactic of equating MSs to their expected values.

Clearly, the numerical value of MSE would be an appropriate estimate of σ2e from the table;

thus, we would take σ2e = c. Similarly, the numerical value of MSEU would be an appropriate

estimate of its expected value σ2e +nσ2

b . Thus, setting this equal to the numerical value a andsetting σ2

e to its estimate, c, we have

a = c + nσ2b ;

solving this expression for σ2b gives the estimate

σ2b =

a− c

n.

(b) Under the assumed model, Σ has the specific form given in (5.7) and (5.9), and Γ isthe corresponding compound symmetric correlation matrix. Now we may estimate σ2

b by(a − c)/n = (2-6)/4=−1. This is perturbing; the estimate of variance is negative! Underthese circumstances, with a negative estimate of variance, it is usually taken as evidence thatthe variance is so small that it is basically negligible, and the estimate is usually taken to be0. Thus, we obtain σ2

b = 0. Also, σ2e = c = 6. Thus, we estimate σ2

b + σ2e by

σ2e + σ2

b = 6 + 0 = 6.

Thus, the estimate of Σ is (4× 4) with the value 6 on the diagonal and the value 0 on the offdiagonal. The corresponding correlation matrix is thus an identity matrix, as σ2

b/(σ2b + σ2

e) =0/6 = 0. Thus, we estimate the correlation by 0, and the estimate of Γ is given by

1 0 0 00 1 0 00 0 1 00 0 0 1

.

Here, it appears that the evidence suggests that the observations are completely uncorrelated!Under the normality assumptions, that means that they are in fact independent.

4

Page 556: Applied Longitudinal Data Analysis:Lecture Notes

4. For the Helmert transformation with n = 5,

U =

1 0 0 0

−1/4 1 0 0−1/4 −1/3 1 0−1/4 −1/3 −1/2 1−1/4 −1/3 −1/2 −1

.

5. (a) An R program to do this is in the file hwk2plot.R. From the plots, the overall impressionis that of an increasing trend in CD4 count over the period of the study in each group thatlooks roughly like it could have an inherent, underlying trend like a straight line for eachsubject. The mean trend over time also looks like it could be roughly a straight line in eachgroup, but it is hard to tell. It is also admittedly difficult to get a sense of whether, onaverage, the pattern over time (e.g., with a constant rate of change for mean profiles thatfollow an approximate straight line) is similar in the three groups.

(b) A SAS program performing steps (i)–(vii) is found in the file hwk2 5.sas and the outputin hwk2 5.lst. An R program to create the scatterplot matrices based on the output datafile in (iv) is in the file hwk2 5.R. The answers to (c)–(k) are based on these results.

(c) A crude plot of the means is in hwk 5.lst; a “prettier” one is given with the spaghettiplots. From either, the relationship of the means over time seems perhaps similar for groups1 and 3, but different for group 2. In particular, the sample means for groups 1 and 3 seemsto increase gradually over time at what appears overall to be an approximately constant rate,while the sample mean profile for group 2 seems to rise quickly and then continue a shallowincrease appearing to be moving toward “leveling off” at the end of the 32 week period. Ofcourse, this is just sample evidence, so it is not necessarily the case that these visual patternsreflect the real means at each time point for each treatment. The informal evidence doesgive a suggestion that the pattern for group 2 may be different from those for the other twogroups.

Note that the mean CD4 at time 0 is about the same in each group. This is reassuring –as subjects were randomly assigned to each treatment strategy, we would hope that beforestarting their assigned treatments they are the same on average in each group.

(d) The univariate analysis assumes that the covariance matrices for all three groups exhibitthe same, homogeneous compound symmetric structure. From pages 2–4 of the output forproc corr, the estimated correlation matrices for each group seem to be pretty similar, andeach has a pattern suggestive of compound symmetry. The correlations are all roughly in the0.75 – 0.85 range; recalling that these are just estimates, and thus would not be expected to beall the same even if the true correlations are identical for each pair of times (as for compoundsymmetry), the estimated correlation matrices do not seem to contradict the assumption ofcompound symmetric correlation structure. Moreover, the diagonal elements of the estimatedcovariance matrices seem to be roughly in the same “ballpark” for all three treatments and donot seem to be all that different over time (remember, these are just sample values, so wouldnot be expected to be identical even if the homogeneous variance structure holds). Again,the observed pattern of these estimated variance does not seem to contradict the assumptionof homogeneity of variances over time and group.

The scatterplot matrices, created in the R program hwk2 5.R, are consistent with the aboveimpressions. Each panel looks to have similar variation in the “cloud” of points for any pairof points, with a similar positive association, regardless of group.

5

Page 557: Applied Longitudinal Data Analysis:Lecture Notes

(e) The question may be rephrased as asking whether the mean CD4 profiles are parallel;thus, we want the F ratio corresponding to the trt*week interaction. From pages 6 or 8 ofthe output, this value is 15.69, with an associated p-value very close to 0. This p-value isclearly much smaller than the level of significance α = 0.05; thus, we conclude that there isstrong evidence to suggest that the mean CD4 profiles for the three groups are not parallel.This seems to confirm the visual impression from the mean plot.

(f) We have immediately that σ2e = 0.058. The numerical value of MSEU = 1.195; thus, we

have σ2b = (1.195− 0.058)/5 ≈ 0.227 The estimate for Σ is a (5× 5) matrix with off-diagonal

elements all equal to 0.06 and diagonal elements equal to 0.06 + 0.23 = 0.29. This gives anestimated correlation of approximately 0.23/0.29 ≈ 0.79. Under the assumption of commonhomogeneous compound symmetry, 0.79 is an estimate of the correlation between CD4 countsat any two time points for the same subject.

(g) From page 11 of the output, we see that the test for sphericity applied to orthogonalcomponents has test statistic 5.37; this statistic has an approximate chi-square distributionwith 9 degrees of freedom, so that the p-value is 0.80. This is much larger than 0.05; thus, atthis level of significance (α = 0.05), we do not have enough evidence to reject the hypothesisthat Σ has the Type H structure. Although we cannot reject compound symmetry, thisdoes not mean we have enough evidence to say it is so. However, because the p-value islarge (close to 1), we might informally take this as assurance that our visual impression of acommon homogeneous compound symmetric structure is reasonable. Accordingly, it does notseem at all warranted to use the “adjusted” tests. Given this result and the visual evidence,a data analyst would feel pretty good about the compound symmetry assumption and thusthe validity of the inferences based on the F ratios.

(h) We had very strong evidence to reject the hypothesis of parallelism in (e), suggestingthat the way that the group means differ is different at different time points. The visualevidence suggests that this may be due to a different pattern over time for group 2 relativeto the other two groups. Except for the expected phenomenon that the profiles start outat roughly the same place due to randomization, the profiles do not “cross,” and that forgroup 2 seems “above” the others. Thus, the test of the Main Effect of Groups may have areasonable interpretation, as discussed on pages 125–126 of the notes. This test would addressto some extent the question of how average CD4 compares over the study period. However,it seems that the test of parallelism addresses the central question of whether the patternsdiffer over time (so whether the progression of CD4 count following treatment differs acrossthe treatment strategies).

(i) If we were to conduct this test, which is the test for the main effect of group, the F ratio= 7.76 from page 19 of the output. The associated p-value of virtually 0 suggests that thereis indeed strong evidence (at level α = 0.05) to reject the null hypothesis in (h).

(j) We consider the results for applying the orthogonal polynomial contrast matrix on pages15–18. On page 18, the appropriate test is that for trt listed under contrast variable week 1,for the linear component of the trend. The F statistic is 11.29 with an associated p-value ofvirtually 0; comparing to the level of significance 0.05, we see that we have strong evidenceto suggest that the three mean CD4 profiles over time differ in their overall linear trend. Theplot of the sample means seems to support this contention; if we drew a straight line throughthe means for each treatment, the overall trend for treatment group 2 appears to be on asteeper straight-line trajectory than do those for the other two.

(k) One could interpret this in various ways; there is no strictly “right” or “wrong” answer.

6

Page 558: Applied Longitudinal Data Analysis:Lecture Notes

One way is to think of the pattern expected for treatment 2 as exhibiting some “curvature”as would be expected from a quadratic function – from the plot, one could envision the meansover time falling on a curve that starts out rising and then levels off – while those for treat-ments 1 and 3 are expected to follow more or less a straight line. Testing whether the meanprofiles differ across groups in their quadratic components would get at this issue. Takingthis point of view, on page 18, the test for trt listed under contrast variable week 2 gets atthis. Here, the F statistic has numerical value 26.94 with a virtually 0 p-value, suggestingthat, under this interpretation, the mean profiles differ in their quadratic components (so intheir tendencies for “curvature”).

Another way to view this is to think in terms of the Helmert transformation, in particularthe contrast that compares the mean at the first time to the average of those subsequent.The fact that there is a suspected initial “rise” in CD4 for group 2 might show up as makingthe average of the subsequent means of measurements after time 0 different from the mean attime 0 more “dramatic” than this same difference in the other two groups. Taking this pointof view, from page 28, the test for trt under the contrast variable week 1 addresses this issue.Here, the F ratio takes the value 40.57, with virtually 0 p-value, suggesting a difference.

You may have come up with still other ways to interpret this; for example, examining contrastsin the profile transformation matrix. Overall, it seems that any view would tell the same,consistent story, supporting the investigator’s suspicion that there is a rise in mean CD4 forgroup 2.

7

Page 559: Applied Longitudinal Data Analysis:Lecture Notes

.

ST 732, HOMEWORK 3, SPRING 2005

1. A diabetes researcher was interested in comparing patterns of blood sugar reduction broughtabout by the use of several different insulin mixtures. He conducted an experiment involving36 rabbits, where 12 rabbits were randomly assigned to each of 3 groups: group 1 rabbitsreceived the “standard” insulin mixture, group 2 rabbits received a mixture containing 1%less protamine than the standard, and group 3 rabbits received a mixture containing 5%less protamine. Rabbits were injected with the assigned mixture at time 0, and blood sugarmeasurements were taken on each rabbit at the time of injection and 0.5, 1.0, 1.5, 2.5, and3.0 hours post-injection. The data for all 36 rabbits are shown in Figure 1; the first threepanels show the individual rabbit trajectories by insulin group, and the lower right panelshows the sample means at each observation time for each group over all of its 12 rabbits(plotting symbol indicates the group).

Figure 1: Blood sugar levels following insulin injection

time

bloo

d su

gar

0.0 0.5 1.0 1.5 2.0 2.5 3.0

4060

8010

012

0

Insulin group 1

time

bloo

d su

gar

0.0 0.5 1.0 1.5 2.0 2.5 3.0

4060

8010

012

0

Insulin group 2

time

bloo

d su

gar

0.0 0.5 1.0 1.5 2.0 2.5 3.0

4060

8010

012

0

Insulin group 3

11

11

1 1 1

time

bloo

d su

gar

0.0 0.5 1.0 1.5 2.0 2.5 3.0

4060

8010

012

0

Mean trajectories

2

22

22

2 2

3

3

33

33

3

The data are available on the class web page in the file insulin.dat. Each data record inthe file represents a single observation; the columns of the data set are (1) rabbit number, (2)hours (time), (3) response (blood sugar level), and (4) insulin group (1, 2, or 3).

(a) It was expected that when insulin was given in any of the 3 mixtures, blood sugar levelsover the 3-hour post-injection period would decline at a relatively constant rate but at somepoint might begin to “level off” or even begin to climb back (“rebound”) toward pre-injectionlevels. This would likely manifest itself as a tendency for upward “curvature” at the latertime points.

1

Page 560: Applied Longitudinal Data Analysis:Lecture Notes

Let tij denote the jth time of observation tij (hours) for that rabbit, and let Yij denote thecorresponding measure blood sugar, where i = 1, . . . , m = 36. Based on the investigator’sexpectations and the visual evidence, write down an appropriate model of the form of thosefor Yij in Chapter 8 of the notes that allows mean blood sugar trajectories for each group toexhibit “curvature” over time in a way that may have different features for each group. (Thatis, write a model like that in equation (8.10) that reflects the investigator’s expectations andthe features suggested by the plots).

(b) Let Y i be the data vector for the ith rabbit in the study. Express your model in (a) as amodel for Y i in terms of a design matrix Xi and parameter vector β, defining each. Be sureto give the form of Xi for rabbits in each of the groups.

(c) The investigator’s first question was whether all the patterns of mean blood sugar levelsexhibit a constant rate of change over the study period (that could be different for differentgroups) or whether at least one of the mean patterns exhibits “curvature” reflecting “leveling-off” or “rebound” on average toward pre-treatment levels. In the context of your model in(a) and (b), write down a set of null and alternative hypotheses that addresses this question.Express your hypotheses in terms of Lβ for some appropriate matrix L, giving the form ofL.

(d) The investigator’s second question was whether the mean blood sugar profiles in factfollow an identical pattern for the 3 groups. Assuming your model in (a) and (b), write downa set of null and alternative hypotheses that addresses this issue. Express your hypotheses interms of Lβ for some appropriate matrix L, giving the form of L.

(e) Mixtures 2 and 3 containing less protamine were expected to induce greater reductions inblood sugar than the standard treatment over the 3 hour period. Thus, it was of interest tolearn whether there were differences in mean blood sugar levels among the groups at the endof the 3-hour post-injection period. Assuming your model in (a) and (b), write down a setof null and alternative hypotheses addressing this issue. Express your hypotheses in terms ofLβ for some appropriate matrix L, giving the form of L.

2. A study was conducted in which the response was to be measured on each subject at time0 (baseline), and then subjects were to return at 1, 3, 6, and 12 months post-baseline foradditional responses to be ascertained. Thus, let (t1, t2, t3, t4, t5) = (0, 1, 3, 6, 12) be theintended times of observation for each subject.

(a) Consider a subject who is missing the month-1 and month-6 responses. Letting j indexthe number of observations for such a subject i, give the numerical value of ni, the numberof observations actually available for i, and with this indexing write down the vector Y i ofresponses for such a unit and times tij corresponding to each element of Y i.

(b) Now let j index the intended times of observation. With this alternative indexing scheme,write down the vector Y i of responses for such a unit and the vector of times correspondingto each element of Y i.

(c) Using the indexing scheme in (b), write down generically the covariance matrix of Y i,Σi = var(Y i) in terms of the variances of and covariances among pairs of elements of Y i.

(d) Suppose that, even though the data aren’t equally spaced, we wish to assume the homo-geneous one-dependent covariance structure. Write down the form of Σi in this case, definingany symbols you use.

(e) Suppose that instead we are willing to assume a homogeneous compound symmetriccovariance structure. Write down the form of Σi in this case, defining any symbols you use.

2

Page 561: Applied Longitudinal Data Analysis:Lecture Notes

(f) Finally, suppose we wish to assume a Markovian covariance structure with the samevariance at all time points for any unit. Write down the form of Σi in this case, defining anysymbols you use.

3. A study was conducted to investigate two treatments for patients suffering from multiplesclerosis. 150 suffers of the disease were recruited into the study, and 75 were randomized toreceive azathioprine (AZ) alone (group 1), and 75 were randomized to receive azathioprineplus methylprednisone (AZ+MP, group 2). For each participant, a measure of autoimmunity,AFCR, was planned at clinic visits at baseline (time 0, at initiation of treatment) and at 3,6, 9, 12, 15, and 18 months thereafter. Multiple sclerosis affects the immune system; lowvalues of AFCR (approaching 0) are evidence that immunity is improving, which is hopefullyassociated with a better prognosis for suffers of MS. Figure 2 shows the square roots ofAFCR levels for all participants; square roots were taken so that the AFCR observationsbetter satisfy the assumption of normality. It appears that, averaged across subjects, AFCRlevels show a decline over time in both groups with approximately constant rate of change.Also recorded for each subject was age at entry into the study and an indicator of whether ornot the subject had had previous treatment with either of the study agents (0=no, 1=yes).

These data may be found in the file afcr.dat on the class web page. Each data recordcorresponds to a single observation, with columns (1) subject id, (2) time (months), (3)square root AFCR (4) group, (5) prior treatment indicator, and (6) age. The average age ofthe men across both treatment groups was 50.45, with SD 6.69.

As is clear from inspection of the plot, for some participants, AFCR is not available at allintended observation times. This might be because the subject skipped a visit or due to anerror in measuring AFCR, or it might be because the subject died from the disease. In theformer case, the missing values are probably not the result of anything to do with the assignedtreatments. In the latter case, one might be concerned that the fact AFCR levels are missing(due to death) is related to the assigned treatment. For this study, none of the subjects diedover the 18 month period, so it seemed safe to assume that missingness is not related to theissues under study. As we will discuss later in the course, the validity of an analysis may becompromised if missingness is related to the thing under study in certain ways.

The investigators had several questions of interest. The primary focus was whether bothtreatments lower AFCR over the 18 month period. It was suspected that AFCR levels andtheir progression over time might be associated with a subject’s age and prior treatmenthistory. Thus, the investigators started with the following model.

Let Yij denote the jth AFCR measurement for the ith subject at time tij for that subject,j = 1, . . . , ni. Note that the tij for each subject and ni may be different. Define ai = 0 ifsubject i’s age is ≤ 50 and ai = 1 if age is > 50. Let pi indicate prior treatment for the ithsubject; i.e. pi = 0 if none, pi = 1 if the subject has had either of the study agents in thepast.

Yij = β1 + β2pi + β3ai + β4piai + β5tij + β6tijpi + β7tijai + β8tijpiai + εij , i in AZ group= β9 + β10pi + β11ai + β12piai + β13tij + β14tijpi + β15tijai + β16tijpiai + εij ,

i in AZ+MP group (1)

You will want to run one SAS program repeatedly, adding on to the program and rerunning itas you work through the following problems. Turn in the final program that does everythingrequired and its output. Use PROC MIXED to carry out all model fits using the ML method.

3

Page 562: Applied Longitudinal Data Analysis:Lecture Notes

Figure 2: AFCR for two groups of MS sufferers

months

AF

CR

leve

l

0 5 10 15

510

15

AZ alone

• •

••

••

•••

••

••

••

••

• •

••

••

••

•• •

• •

••

••

••

• •

• •

••

• •

•• •

••

••

• •

••

••

• •

• •

••

••

• •

• •

• •••

• •

••

••

• •

• •

••

• •

••

••

• •

•• •

••

• •

•• •

••

• ••

••

• • •

••

• ••

••

• •

••

••

••

••

• •

•• •

••

••

• •

• ••

• •

•• •

•• •

••

••

• •

months

AF

CR

leve

l

0 5 10 15

510

15

AZ+MP

••

••

••

• •

•• •

••

••

•• •

•• •

••

••

••

••

• •

• •

••

••

••

••

••

••

••

• •

••

••

••

••

••

• •

••

••

•• •

••

••

• •

• •

••

• •

• •

• • • •

••

••

••

• •

••

• •

••

•• •

•• •

••

••

••

• •

••

• •

• • •

••

• •

••

••

•• •

••

••

••

••

••

•• •

••

••

• •

••

••

•• • •

••

••

••

Whenever you carry out a hypothesis test, be sure to state the level of significance at whichyou are conducting the test.

(a) Re-write model (1) in a way that shows clearly that the model assumes that (i) meanAFCR at baseline may be different for all possible combinations of prior treatment status andage category; and (ii) rate of change of mean AFCR may be different for all combinations ofprior treatment status and age category.

(b) As always, it is first necessary to investigate the nature of variation, as the validity ofsubsequent inferences depends on an accurate model for covariance structure. Fit model(1) under the assumption that the covariance matrix of a data vector for a given subjectis completely unstructured and different in each treatment group. BE CAREFUL, asthe data are not balanced because of the missing values. Have your program print outthe estimated covariance and correlation matrix for subject 7 (complete data) and subject 1(missing data) in group 1 and subject 77 (complete data) and 76 (missing data) in group 2.

Also fit the model assuming a common completely unstructured covariance matrix, andprint out the estimated covariance and correlation matrix for subject 7 (complete data) andsubject 1 (missing data).

Based on your subjective inspection of these estimated correlation matrices, which covariancemodels do you think are likely candidates?

(c) To investigate the covariance assumption more formally, fit (1) assuming the followingcovariance models (again, BE CAREFUL to account for the missingness):

(i) Independence in both groups

4

Page 563: Applied Longitudinal Data Analysis:Lecture Notes

(ii) Homogeneous compound symmetry same in both groups and then different in bothgroups

(iii) Homogeneous one-dependent same in both groups and then different in both groups(iv) Homogeneous AR(1) same in both groups and then different in both groups

Make a table of AIC and BIC values for these models and those in (b). Based on theseresults, select the model for which you think the evidence in the data is strongest, explainingyour answer.

(d) One of the investigators suspected that, although there may be a difference in the rateof change of mean AFCR between the two groups over the study period, the rates of changewithin each group are the same regardless of age or prior treatment history of a subject. Writedown an appropriate null hypothesis that formalizes this suspicion in terms of the model in(1), and express it in the form H0 : Lβ = 0, defining β and L. Re-fit the model in (1)using your favored choice of covariance structure from (c). To test H0, include a contraststatement corresponding to the matrix L, using the chisq option to obtain the Wald test.Write down the value of the test statistic TL and the associated p-value from the output. Isthere sufficient evidence in these data to refute the investigator’s claim?

(e) Write down the “reduced” model implied by H0 in (d). Fit this model assuming yourfavored covariance structure, and, based on the output from this fit and a fit of the “full”model in (1), obtain (by hand) the likelihood ratio statistic TLRT . State the appropriatedegrees of freedom for this test statistic and the appropriate χ2 critical value from yourfavorite χ2 table or the p-value from your favorite software package. Based on this test, isthere sufficient evidence to refute the investigator’s claim? Does the inference from the Waldtest agree with that here?

(f) Based on the fit in (d) of the model in (1), use estimate statements to estimate the ratesof change for subjects over 50 who have had prior treatment in (i) the AZ alone group (1)and (ii) the AZ+MP group (2). Write down the estimates and suitable standard errors foreach.

(g) One investigator was concerned that the randomization at time 0 was not carried outcorrectly. If it were done correctly, we would expect mean AFCR at baseline for subjectswith each age/prior treatment status combination to be the same in each group, becauseat time 0 the treatments had not yet been administered so that the two groups should besimilar. Write down a null hypothesis in the form Lβ = 0 that addresses this issue, definingL, and use a contrast statement in the fit of model (1) to obtain the appropriate Wald teststatistic and p-value using the chisq option. Interpret the result; is there enough evidenceto suggest proper randomization procedures may not have been followed?

4. Spline model. Recall the guinea pig diet data first discussed in Example 2 of Chapter 1; thedata are plotted below as in Figure 2 of Chapter 1.

15 guinea pigs were all given a growth-inhibiting substance at the beginning of week 1 of thestudy (time 0, prior to the first measurement), and body weight was measured at the ends ofweeks 1, 3, and 4. Thus, in the plot, the values at week 3, say, correspond to body weightsmeasured at the end of week 3 (= beginning of week 4). At the beginning of week 5/end ofweek 4, the pigs were randomized into 3 groups of 5, and vitamin E therapy was started. Onegroup received zero dose of vitamin E, another received a low dose, and the third received ahigh dose. The body weight (g) of each guinea pig was measured at the end of weeks 5, 6,and 7.

5

Page 564: Applied Longitudinal Data Analysis:Lecture Notes

Figure 3: Guinea pig diet data

0 2 4 6 8

400

450

500

550

600

650

700

750

Weeks

Bod

y W

eigh

t (g)

1 1

1 1

1

12

2

22

2

2

3

3

33

3

3

4

4

44

4 4

55

55

55

Zero dose

0 2 4 6 8

400

450

500

550

600

650

700

750

Weeks

Bod

y W

eigh

t (g)

6

6 6

6

6

6

7

7

7

7

7 7

8

8 88 8

8

9

99

9

9

9

10

10

1010

10

10

Low dose

0 2 4 6 8

400

450

500

550

600

650

700

750

Weeks

Bod

y W

eigh

t (g)

11

11

11 11 11

11

12

12

12

1212

12

13

13

1313

13

13

1414

1414

1414

15

15

1515 15

15

High dose

0 2 4 6 8

400

450

500

550

600

650

700

750

Weeks

Bod

y W

eigh

t (g)

Zero doseLow doseHigh dose

Sample averages

These data may be found in the file diet.dat on the class web page. The data are in theformat with one unit per line; the columns are (1) pig id, (2)–(6) body weight at the end ofweeks 1,3,4,5,6,7, and (7) group indicator (1=zero dose, 2=low dose, 3=high dose).

The investigators were interested in understanding possible differences in growth patternsacross the three dose groups. Because of the fact that the study agent, vitamin E therapy,was not administered until the end of week 4/beginning of week 5, these questions were a bitdifferent from the questions we might ordinarily see:

• Intuition would suggest that the growth pattern for all three groups prior to the end ofweek 4 should be identical, given that all pigs were treated the same. Is there evidencein the data to contradict this?

• One would expect differences in growth patterns to emerge at the beginning of week5 and beyond, once the different doses of vitamin E were administered. Was thereindeed an effect of vitamin E therapy on growth after administration, and was this effectdifferent in the different groups?

From the plots, it appears that it may be reasonable to assume that the mean response patternup to the end of week 4 can be represented by a straight line in each group. After the endof week 4/beginning of week 5, the mean response seems to “shift.” In the zero-dose group,response seems to decline somewhat, while in the low- and high-dose groups, there seemsto be an overall increase (although note the slight “dip” in all patterns between the ends ofweeks 4 and 5 – with only 5 pigs per group, it is questionable whether this is a real feature ofthe mean response, as some pigs do not and some pigs do experience this dip in each group).Because there are only 4 time points in this second “phase,” it is probably sensible not to

6

Page 565: Applied Longitudinal Data Analysis:Lecture Notes

postulate a complicated model for mean response. Thus, as a simple way of representing theoverall trend from the end of week 4 (when treatment started) to the end of the study, onemight consider a straight line model for the mean response, where the slope differs from thatprior to the end of week 4 and might be different among the 3 groups.

Thus, a reasonable model for mean response for each group that tries to describe the mainfeatures is that of a straight line from the end of week 1 to the end of week 4 connected toanother straight line, with possibly different slope, from the end of week 4/beginning of week5 and beyond. A model with this feature is a so-called “linear spline model” with one “knot”at the end of week 4 (week=4). Letting Yij be the weight of the ith pig at the jth time ofobservation, a general form of such a model is

Yij = β01 + β11tij + β21(tij − 4)+ + εij , i from group 1,= β02 + β12tij + β22(tij − 4)+ + εij , i from group 2, (2)= β03 + β13tij + β23(tij − 4)+ + εij , i from group 3.

In (2), the notation “x+” has a special meaning; in particular,

x+ = x if x ≥ 0= 0 if x < 0

Thus, if t is time in weeks (corresponding to the end of the week), (t− 4)+ is equal to 0 fort = 1, 3, 4 and equal to 1,2,3 for t = 5, 6, 7, respectively. Focusing on group 1 for definiteness(the other groups are similar), note then that at weeks up to the end of week 4 (t ≤ 4), beforevitamin E was started, the model says that mean response follows the straight line

β01 + β11t

with slope β11. For t ≥ 4, mean response looks instead like

β01 + β11t + β21(t− 4),

which may be rewritten, by adding β11(4)−β11(4) (which is equal to zero and does not changeanything),

{β01 + β11(4)}+ (β11 + β21)(t− 4). (3)

If we considered the end of week 4 to be the “origin” for time, with time subsequent measuredas time since week 4, i.e. (t−4), (3) represents a straight line with “intercept” (value at origin4 weeks) of β01 +β11(4) and “slope” (β11 +β21). Note that at week 4 both the pre- and post-week-4 models have value of the mean response equal to this “intercept.” Note also that ifβ21 = 0, then (3) reduces to the same straight line model prior to week 4 (slope does notchange after week 4).

Thus, we see that (2) gives a model for each group where the mean response is a straight linewith some slope up to the end of week 4 and then changes to a straight line with possiblydifferent slope at week 4, where the change in slope is governed by the “β2k” terms in themodel for each group k = 1, 2, 3.

Such a model is referred to as a “spline” model. In general, such models are formed by linkingtogether several different functions at each of several “knots” (time points), thus allowing themean response to exhibit rather complicated patterns over time. They are especially handyin situations like this one, where mean response is expected to change behavior at certain,

7

Page 566: Applied Longitudinal Data Analysis:Lecture Notes

known time points. In (2), the spline is “linear” because the functions are straight lines, andthere is one “knot,” at the end of week 4. Such functions are also often called “piecewiselinear,” for obvious reasons.

Note that (2) allows the possibility that the first straight line, prior to week 4, is differentacross groups, although we might expect otherwise, as all pigs are treated identically up tothat point.

You will want to run one SAS program repeatedly, adding on to the program as you workthrough the problems below. Turn in your final, complete program (that carries out allnecessary calculations) and its output along with your interpretation. As this is a small dataset for which estimation of variance and covariance parameters may be suspect, use PROCMIXED with the method of restricted maximum likelihood to carry out all model fits.

(a) To obtain valid inferences, it is of course necessary to fit the model under an appropriateassumption on the covariance matrix of a data vector. To begin investigating this, fit model (2)under the assumption that the covariance matrix of a data vector for a given plot is completelyunstructured but identical for all plots, regardless of variety. Obtain the estimated correlationmatrix implied under this assumption and write it out. Based on your subjective inspectionof these estimated matrices which covariance models do you think are likely candidates torepresent the true pattern of variation in a data vector?

Note: To fit the model, you will first have to reformat the data set in the form of oneobservation per line, as PROC MIXED requires; see Example 2 in Section 5.8. Note that youwill want to include the in data step the statement

if week>1 then week=week+1;

to create the correct week variable with values 1,3,4,5,6,7 for each pig. You will also want tocreate a new variable corresponding to (t−4)+. This may be accomplished with the followingadditional two lines of code:

weekplus = week-4;if weekplus<0 then weekplus=0;

You may then treat weekplus as simply another covariate in the model. It would be wise touse proc print at some point to print the contents of the data set you create to be sure youhave formatted things and defined weekplus correctly.

(b) To investigate the covariance assumption more formally, fit (2) assuming the followingcovariance models (assume covariance is the same regardless of group; note that the data areunequally spaced but balanced):

(i) Independence (this may be accomplished by not including a repeated statement at all)

(ii) Compound symmetry

(iii) Markov

From the results of these fits, make a table of the values of the AIC and BIC criteria, includingthat for the unstructured matrix from (a). Based on these criteria, for which of the covariancemodels in (a) or in (i)–(iii) above does the evidence in the data appear strongest? Explainwhy you selected the model you did on the basis of AIC and BIC values.

Note: It is important to remember that there are only 15 guinea pigs in the entire experiment,each observed at 6 time points. In the unstructured matrix, there are thus 6 variances and 15

8

Page 567: Applied Longitudinal Data Analysis:Lecture Notes

covariances to be estimated! With only 15 units, it is unlikely that any of these is estimatedwell at all; moreover, having to estimate this many parameters from such scant information isprobably asking much too much of a small data set. In such a situation, it may not be wise tofollow the implications of information criteria “blindly.” Rather, a more pragmatic strategyfor selecting a reasonable covariance structure with fewer parameters that takes into accountboth the AIC/BIC results and informal inspection of the estimated covariance/correlationmatrices may be more sensible. Keep this in mind when you make your selection.

For (c)–(i) below, use the covariance structure you selected in (b). In each case, state thelevel of significance you choose to conduct the test.

(c) Because the 15 pigs were randomly chosen from the same population prior to the startof the experiment and were treated the same up to the end of week 4, we would expect that(i) the (true) means at week 0 would be the same, and (ii) the (true) pattern of change upto week 4 would be the same in all three groups. In terms of model (2), write down a set ofnull and alternative hypotheses addressing this issue. Express the null hypothesis in the formH0 : Lβ = 0, giving the form of β and L. Assuming the covariance structure you identified in(b), re-fit model (2). To test H0, include a contrast statement corresponding to the matrixL, using the chisq option to obtain the Wald test. Write down the value of the test statisticTL and the associated p-value from the output. Is there sufficient evidence in these data toconclude that the mean profiles up to the end of week 4 differ?

(d) Regardless of your answer to (c), consider the “reduced” model in (c), where the week 0means and patterns of change are assumed identical in all three groups. Fit this model usingyour chosen covariance structure. For each group, (i) use an estimate statement to obtainan estimate of the “second phase” slope (slope of the straight line describing mean weightafter the end of week 4) for the group and a suitable standard error, and (ii) make a spaghettiplot of the raw data using your favorite plotting software, and superimpose the fitted splinemodel for the group on the plot.

(e) Consider the same model in (d). Under this model, is there evidence to support thecontention that the slope of the straight line mean profile prior to the end of week 4 differsfrom that for the straight line mean profile after the end of week 4 in at least one of thegroups? In terms of this reduced model, write down a set of null and alternative hypothesesaddressing this question, expressing the null hypothesis in the form H0 : Lβ = 0, giving theform of β and L. Fit the model including a contrast statement corresponding to the matrixL, using the chisq option to obtain the Wald test. Write down the value of the test statisticTL and the associated p-value from the output. Is there sufficient evidence in these data toconclude that pre- and post- end-of-4-week slopes differ for at least one of the groups?

(f) Consider the same model as in (d). Under this model, is there evidence to support thecontention that the slopes of the straight lines that describe the mean response subsequentto the end of week 4 differ across the groups? In terms of this reduced model, write down aset of null and alternative hypotheses addressing this question, expressing the null hypothesisin the form H0 : Lβ = 0, giving the form of L. Include in the fit of this model a contraststatement corresponding to the matrix L, using the chisq option to obtain the Wald test.Write down the value of the test statistic TL and the associated p-value from the output. Isthere sufficient evidence in these data to conclude that post-week-4 slopes differ?

(g) Consider the same model as in (d). Use an estimate statement to obtain an estimateof the mean response for group 3 at 7 weeks. Give the estimate and standard error for theestimate.

9

Page 568: Applied Longitudinal Data Analysis:Lecture Notes

(i) In your fit of the model in (d), use the covb option in the model statement to obtainthe estimated covariance matrix V β corresponding to the estimate of β. Verify that thestandard errors given in the Solution for Fixed Effects table are consistent with thismatrix, explaining why you believe this is the case.

10

Page 569: Applied Longitudinal Data Analysis:Lecture Notes

.

ST 732, HOMEWORK 3, SOLUTIONS, SPRING 2005

1. (a) The model that seems reasonable to capture the possibility of curvature of the meanprofiles is one that allows the mean as a function of time in each group to be quadratic intime. Furthermore, the visual evidence suggests that the relationship might be different ineach group. One way to write such a model is

Yij = β1 + β2tij + β3t2ij + εij , Group 1

Yij = β4 + β5tij + β6t2ij + εij , Group 2

Yij = β7 + β8tij + β9t2ij + εij , Group 3

(b) We may express the model in (a) succinctly as

Y i = Xiβ + εi,

where εi is the vector of random deviations εij for rabbit i, β = (β1, β2, . . . , β9)′, and

Xi =

1 ti1 t2i1 0 0 0 0 0 0...

......

......

......

......

1 tini t2ini0 0 0 0 0 0

for Group 1,

Xi =

0 0 0 1 ti1 t2i1 0 0 0...

......

......

......

......

0 0 0 1 tini t2ini0 0 0

for Group 2,

Xi =

0 0 0 0 0 0 1 ti1 t2i1...

......

......

......

......

0 0 0 0 0 0 1 tini t2ini

for Group 3.

(c) In the context of this model, we are interested in whether we need the quadratic coefficientsat all for any of the groups; the null hypothesis is that rate of change is constant (but possiblydifferent) in each group. Thus H0 : β3 = β6 = β9 = 0 vs. H0 : at least one of β3, β6, β9 isnot equal to zero. Under H0, the rates of change are constant for each group but possiblydifferent; under H1, at least one of the groups has some curvature in the mean response, sorate of change is not constant. Alternatively, we can express H0 as Lβ = 0, where

L =

0 0 1 0 0 0 0 0 00 0 0 0 0 1 0 0 00 0 0 0 0 0 0 0 1

.

(d) In the context of the model in (a), the question is whether, assuming that all three meanresponse profiles allow the possibility of curvature, the profiles are actually the same for eachgroup. The null hypothesis is thus that the parameters that describe intercept, linear, andquadratic components are the same in all three groups. That is, we have H0 : β1 = β4 = β7,

1

Page 570: Applied Longitudinal Data Analysis:Lecture Notes

β2 = β5 = β8, β3 = β6 = β9. vs. H1 : H0 is not true, so at least one of the intercept, linear,or quadratic parameters differs among groups. We can express H0 as Lβ = 0, where

L =

1 0 0 −1 0 0 0 0 01 0 0 0 0 0 −1 0 00 1 0 0 −1 0 0 0 00 1 0 0 0 0 0 −1 00 0 1 0 0 −1 0 0 00 0 1 0 0 0 0 0 −1

.

(e) The interest is now on whether, allowing for the possibility of curvature and differentmean profiles as in model (a), whether the means at t = 3 hours differ. This may be writtenThis may be expressed as H0 : β1 + β2(3) + β3(9) = β4 + β5(3) + β6(9), β1 + β2(3) + β3(9) =β7 +β8(3)+β9(9) vs. H1 : H0 not true; at least one of the means at 3 hours is different. Notethat we only need two statements to specify H0; if those two statements (equating the group1 and 2 and 1 and 3 means, respectively) are true, that the group 2 and 3 means must alsobe equal. This may be written in the form Lβ = 0, where

L =

(1 3 9 −1 −3 −9 0 0 01 3 9 0 0 0 −1 −3 −9

).

2. (a) Here, ni = 3, and we have (ti1, ti2, ti3) = (0, 3, 12). The corresponding Y i = (Yi1, Yi2, Yi3)T .

(b) With the alternative indexing, we have observations at j = 1, 3, 5, corresponding to times(t1, t3, t5) = (0, 3, 12), and would write Y i = (Yi1, Yi3, Yi5)T .

(c) This matrix will be (3× 3); in terms of the second indexing scheme, we have

Σi = var(Y i) =

var(Yi1) cov(Yi1, Yi3) cov(Yi1, Yi5)cov(Yi1, Yi3) var(Yi3) cov(Yi3, Yi5)cov(Yi1, Yi5) cov(Yi3, Yi5) var(Yi5)

.

(d) Under the homogeneous one-dependent assumption, defining σ2 = var(Yij) for all j andρ as the correlation between two adjacent observations, because there are no adjacent obser-vations here, we end up with

Σi =

σ2 0 00 σ2 00 0 σ2

.

(e) Defining σ2 = var(Yij) for all j and ρ as the correlation between any two observations, wehave

Σi = σ2

1 ρ ρρ 1 ρρ ρ 1

.

(f) Defining σ2 = var(Yij) for all j and a parameter ρ, we have in the second indexing schemethe distances d13 = |3− 0| = 3, d15 = |12− 0| = 12, and d35 = |12− 3| = 9. Thus, we have

Σi = σ2

1 ρ3 ρ12

ρ3 1 ρ9

ρ12 ρ9 1

.

Note that ρ has the interpretation as the correlation between two observations 1 month apart.

2

Page 571: Applied Longitudinal Data Analysis:Lecture Notes

3. (a) We may rewrite the model slightly as

Yij = (β1 + β2pi + β3aiβ4piai) + (β5 + β6pi + β7ai + β8piai)tij + εij , i in AZ= (β9 + β10pi + β11ai + β12piai) + (β13 + β14pi + β15ai + β16piai)tij + εij , i in AZ+MP

This shows clearly that the “intercept” and “slope” for the mean trajectory of each groupwill be different depending on the combination of prior treatment and age category. E.g.,for the standard treatment, the “intercept” is β1 + β2pi + β3ai + β4piai and the “slope” isβ5 + β6pi + β7ai + β8piai. For each combination of (pi, ai) = (0, 0), (0, 1), (1, 0), (1, 1), each ofthese is something different.

(b) On pages 2 of the attached output, the estimated covariance and associated correlationmatrix for a subject having all 5 measurements are given. Inspection of the correlationmatrix shows that estimated correlations seem to “jump around” a bit, but they don’t seemto “drop off” substantially in any kind of systematic way as observations become fartherapart in time. The suspicion is that a compound symmetric model might be reasonable. Theestimated correlation matrices do not necessarily seem to have similar correlations for eachgroup, suggesting different covariance structures in each group, but it is hard to tell for sure.

(c) From the fits on pages 2–32, we have

Model AIC BIC

Unstructured, Different 3542.8 3759.5Unstructured, Same 3518.3 3650.8Independence 3603.1 3683.7Compound symmetry, Different 3481.7 3541.9Compound symmetry, Same 3479.2 3533.3One-dependent, Different 3574.0 3634.2One-dependent, Same 3571.0 3625.2AR(1), Different 3553.9 3614.1AR(1), Same 3551.1 3605.3

Note that, for each structure, AIC and BIC tend to be smaller when the matrix is taken to bethe same in each group than when it is assumed to be different. This is reasonably interpretedas suggesting that a common covariance structure of some sort is sufficient. Comparingacross structures, the common compound symmetry assumption gives the smallest values ofboth AIC and BIC. Thus, according to these criteria, the evidence in the data seems tobe most strongly in favor of a model where correlation does not “drop off” as in the one-dependent and AR(1) models, but rather remains relatively constant regardless of how farapart measurements are taken. The assumption of independence over time is clearly notsupported. We thus use the common compound symmetry model for the rest of the problem.

(d) According the model in (a), the rates of change in each group are (β5+β6pi+β7ai+β8piai)(group 1) and (β13 + β14pi + β15ai + β16piai) (group 2). These are different within eachgroup depending on the previous treatment/age category into which a subject falls. If withingroup 1 the rate of change were the same regardless of previous treatment/age combination,then we might as well set β6 = β7 = β8 = 0; similarly, in group 2, we might as well setβ14 = β15 = β16 = 0. Thus, we may express the investigator’s suspicion as

H0 : β6 = β7 = β8 = β14 = β15 = β16 = 0.

3

Page 572: Applied Longitudinal Data Analysis:Lecture Notes

Defining β = (β1, . . . , β16)′, we may express this as Lβ = 0 as

L =

0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 00 0 0 0 0 0 1 0 0 0 0 0 0 0 0 00 0 0 0 0 0 0 1 0 0 0 0 0 0 0 00 0 0 0 0 0 0 0 0 0 0 0 0 1 0 00 0 0 0 0 0 0 0 0 0 0 0 0 0 1 00 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1

.

From the output on page 35, the contrast statement gives a Wald statistic of TL = 8.65with p-value 0.19. There does not seem to be enough evidence at any reasonable level ofsignificance (e.g., 0.05) in these data to claim that the rates of the change in each group differacross prior/age combinations. This, of course, does not mean there is enough evidence toconclude there is no difference, but the result does not contradict the investigator’s claim,which should make the investigator feel nice.

(e) The “reduced model” may be written as

Yij = (β1 + β2pi + β3ai + β4piai) + β5tij + εij , i in AZ= (β9 + β10pi + β11ai + β12piai) + β13tij + εij , i in AZ+MP

Pages 36–37 of the output show the fit of this model using the common compound symmetrystructure. From this “reduced fit” and the “full fit” we can construct the LRT test statisticTLRT = 3451.8−3443.2 = 8.6. This statistic is approximately distributed as χ2 with 6 degreesof freedom. This leads to a critical value of 12.6 for a test at level 0.05 and a p-value of about0.2, both of which do not suggest enough evidence to reject H0.

The numerical values of the Wald test statistic (8.65) and the LRT test statistic are verysimilar. This need not always be the case, but often they are close. In any event, thequalitative result of the two tests is similar.

(f) We want to estimate for group 1 β5 + β6 + β7 + β8 and for group 2 β13 + β14 + β15 + β16.From page 35 of the output and the fit of the model (1) in (d), these estimates (standarderrors) are −0.13 (0.02) and −0.29 (0.02), respectively.

Some of you based this on the fit of the reduced model, which of course is not unreasonableif one takes the result of the test in (d) as reassurance that one can simplify the model inthis way. (Of course, technically, one can’t take things this way, but in practice, from apragmatic point of view, many analysts will decide to go with a simpler model on the basisof failure to reject a null hypothesis. Usually, though, one would be more apt to do this ifthe p-value associated with the test of the simplifying null hypothesis is closer to 1 than tolevel of significance.) In this case, the estimated values and their standard errors can be readright off the Solution for Fixed Effects table. For completeness, we use an estimatestatement to obtain these values in the fit of the reduced model; the result is on page 37 ofoutput.

(g) According to the full model in (a), the mean at baseline for the AZ group is (β1 + β2pi +β3ai + β4piai) for men with prior history and age category (pi, ai) and in the AZ+MP groupis (β9 + β10pi + β11ai + β12piai). The question is whether these means are the same. Theywill be the same for each prior/age combination if β1 = β9, β2 = β10, β3 = β11, and β4 = β12.

4

Page 573: Applied Longitudinal Data Analysis:Lecture Notes

The appropriate L matrix is thus

L =

1 0 0 0 0 0 0 0 −1 0 0 0 0 0 0 00 1 0 0 0 0 0 0 0 −1 0 0 0 0 0 00 0 1 0 0 1 0 0 0 0 −1 0 0 0 0 00 0 0 1 0 0 0 1 0 0 0 −1 0 0 0 0

.

From the output on page 35, the Wald test statistic is TL = 2.29 with a p-value of 0.68. Atany reasonable level of significance (e.g., 0.05), one would conclude that there is not enoughevidence to suggest that the means are different at baseline. Although this doesn’t say thatthey are, this result might allay the concerns of the investigator that the randomization wasflawed.

Again, some of you did this in the context of the reduced model. From page 38 of the output,this yields TL = 1.91 with a p-value of 0.75.

4. (a) From the output of the attached program, we find that the estimated correlation matrixbased on the unstructured fit is (rounded to 2 decimal places)

1 0.87 0.73 0.79 0.79 0.781 0.94 0.91 0.87 0.93

1 0.92 0.90 0.921 0.93 0.96

1 0.961

It is pretty difficult to say anything definitive – there are a lot of parameters being estimatedhere (15), so we can’t take our informal observations based on the unstructured estimatetoo seriously. From the look of things, there seems to be a suggestion that correlation ishigh and somewhat similar across all time (like compound symmetry). It doesn’t really seemthat correlation “tails off” over time, making the Markov structure seem implausible. Theindependence structure also seems unlikely, as the seems to be strong evidence of within-pigcorrelation. These observations are all very tenuous, however; it is very hard to make adefinite determination based on limited sample information.

(b) From the fits on pages 1–12, we have (smaller values are preferred for this version of SAS).

Model AIC BIC

Unstructured 805.1 820.0Independence 870.7 873.1Compound symmetry 815.5 816.9Markov 810.3 811.7

The AIC criterion is smallest for the unstructured model, while the BIC criterion is smallestfor the Markov model. As noted in class, AIC tends to favor “larger” models with moreparameters rather than less, while BIC tends to do the reverse. In fact, on the basis of BIC,the more parsimonious compound symmetry or Markov models would be preferred over theunstructured one.

Such inconclusive and conflicting results often can leave the data analyst in a quandary. Itmust be kept in mind that procedures like AIC and BIC are based on large sample theory; in

5

Page 574: Applied Longitudinal Data Analysis:Lecture Notes

particular, they are only approximate procedures in finite samples, and thus their performanceis reliable only when m is large. With such a small sample size (15 pigs), it is hard to feelconfident that this large-sample approximate performance would have “kicked in,” so thatAIC is favoring the unstructured matrix with 21 parameters (!) might be viewed as not reallycredible. Judging by the informal evidence in the estimated unstructured covariance matrix,among the more parsimonious models, the compound symmetric assumption seems to be bestsupported, as the estimated correlations all seem to be in the same “ballpark.” However, theMarkov assumption is favored by BIC. It is really a toss-up on which one to choose; manyanalysts might go with the compound symmetric one on the basis of the estimate, citingconcern that because of the small sample size BIC isn’t too reliable anyway.

Bottom line: There is no “right” answer here. As in the statement of the problem, a combi-nation of inspection of all the evidence and pragmatism should be used to come to a decision.Different data analysts may see things differently and be willing to make different assump-tions.

(c) The null hypothesis in words is that the intercepts and slopes for the pre-treatment phase(to end of week 4) are the same in all groups. Writing

β = (β01, β02, β03, β11, β12, β13, β21, β22, β23)′

(same order as in the table Solution for Fixed Effects, the null hypothesis may be ex-pressed as H0 : β01 = β02 = β03 and β11 = β12 = β13, with alternative H1 : at least one ofthe intercepts or slopes differs from the others. The null may be expressed as H0 : Lβ = 0,where

L =

1 −1 0 0 0 0 0 0 01 0 −1 0 0 0 0 0 00 0 0 1 −1 0 0 0 00 0 0 1 0 −1 0 0 0

.

In the attached program, we include the appropriate contrast statement in each of the callsto PROC MIXED for each covariance structure. Here are the results from pages 4–12 of theoutput; the Wald test statistic has an approximate χ2 distribution with 4 degrees of freedom.Because of the small sample size, the F statistic might be preferred. We list both in the table:

Covariance Model TL p-value F p-valueUnstructured 17.21 0.00 4.30 0.02Independence 2.44 0.66 0.61 0.66Compound symmetry 2.99 0.56 0.75 0.56Markov 1.73 0.79 0.43 0.79

Note that the qualitative conclusion from the compound symmetry and Markov fits is thesame: there does not seem to be enough evidence to suggest that the “first phase” meanprofiles are different in the three groups at any reasonable level of significance (e.g. 0.05).This is consistent with intuition; as the pigs were treated identically in all three groups, wewould not expect there to be a difference in the form of the true mean profiles, which weassume here to be straight lines. In contrast, the fit using the unstructured matrix seems tosuggest strong evidence that there is a difference among the three straight lines for the threegroups prior to the end of week 4. This result seems to contradict both intuition and the

6

Page 575: Applied Longitudinal Data Analysis:Lecture Notes

visual evidence in the plot; the plot of the raw sample means suggests that the pattern priorto the end of week 4 is pretty similar.

In all likelihood, under the fit with the unstructured matrix, this result is an artifact of thefact that we have a very small sample size and are trying to fit a large number of parameters.This rather strange result would probably be taken as further evidence by a pragmatic dataanalyst that the assumption of an unstructured covariance matrix is problematic. Most wouldbe willing to build an assumption of a common mean response in the “first phase” into themodel and assume a more parsimonious covariance structure on the basis of the evidenceabove.

(d) The “reduced” model may be written as

Yij = β0 + β1tij + β21(tij − 4)+ + εij , i from group 1,= β0 + β1tij + β22(tij − 4)+ + εij , i from group 2,= β0 + β1tij + β23(tij − 4)+ + εij , i from group 3,

say. Here, β1 is the common pre-week-4 slope, and the post-4-week slopes are β1+β21, β1+β22,and β1 + β23. We fit this model under both the compound symmetric and Markov structuresin the program; the results are on pages 13–18. In each call to PROC MIXED, we include anestimate statement for each “second phase” slope. From the Markov fit, for example, theresults are:

Group Estimate Standard Error1 (β1 + β21) 0.38 5.902 (β1 + β22) 23.46 5.903 (β1 + β23) 15.71 5.90

The results for the compound symmetry fit are comparable. In each case, the estimates andtheir standard errors for group 1 do not rule out the contention that the “second phase” slopeis no different from 0; i.e., because the standard error is so large relative to the estimate, abasically “flat” or even downward trend is consistent with this result for the zero-dose group.In contrast, the results for the low- and high-dose groups suggest that the assumed straightline trend is indeed increasing in this second phase (post-vitamin E). We show the plot forthis fit in the figure. The fitted “second phase” straight lines seem to capture the overalltrend in each group. For the zero-dose group, it is important to keep in mind that there isone “unusual” pig (pig 1), whose profile is likely driving down the sample means more so thanthe fitted line is reflecting.

If you used the unstructured fit and made this plot, you were probably left confused. Theestimated slopes are quite different under this fit, and the superimposed estimated splinemodel does not seem to fit any of the groups very well! This again is likely a warning sign –trying to fit all those variance and covariance parameters with such limited data is probablyleading to some strange weighting of data values, which is showing up as implausible estimates.It is always a good idea to make plots of fitted models like this to make sure that the visualevidence and the fit seem to be consistent.

(e) In the model in (d), we wish to test whether any of the post-4-week slopes differ from β1;thus, the null hypothesis is that all of β21, β22, β23 are equal to 0. Formally, we now want to

7

Page 576: Applied Longitudinal Data Analysis:Lecture Notes

test H0 : β21 = β22 = β23 = 0 vs. H1 : at least one of these is not =0. This may be expressedin the form H0 : Lβ = 0 with

L =

0 0 1 0 00 0 0 1 00 0 0 0 1

.

From pages 15 and 18 of the output, we have TL = 18.57 (compound symmetry fit) TL = 15.52(Markov fit), both with p-value of 0. Given the small sample size, we might prefer to inspectthe F tests, which give qualitatively similar results. There seems to be strong evidence thatin at least one of the groups the “second phase” slope differs from that in the first.

Note that, in fact, in the Type 3 Tests of Fixed Effects table, the chi-square and Fstatistics for weekplus*group are 18.57 and 6.19 (compound symmetry) or 15.52 or 5.17(Markov), respectively, identical to those we calculated using the contrast statement. Thetest in this table is a test of whether all weekplus*group terms are all equal to zero, whichis exactly the test we have constructed.

(f) We are interested in whether the post-4-week slopes β1 +β21 = β1 +β22 = β1 +β23, whichof course is the case if β21 = β22 = β23. Thus, we have H0 : β21 = β22 = β23 vs. H1 : at leastone of these equalities does not hold, and

L =

(0 0 1 −1 00 0 1 0 −1

).

From pages 15 and 18 of the output, we have TL = 11.45 with a p-value of 0 (compoundsymmetry fit) TL = 8.91 with a p-value of 0.01 (Markov fit). The results for the F testsare similar. Both fits seems to suggest strong evidence that the “second phase” slopes differacross groups. From (d) above, it seems that this is reflecting the fact that the rate of increaseof mean body weight after the end of week 4 is flat for pigs who did not receive vitamin Eis basically flat, while in pigs who did receive vitamin E at either dose, there is a positiveincrease in mean weight.

(g) The mean at week 7 is β0 +β1(7)+β23(3),” as (7-4)=3. The estimate statement gives anestimate of 608.49 (SE 13.95) from the compound symmetry fit on page 15 and 616.16 (SE17.40) from the Markov fit on page 18, which are fairly similar.

(h) The covb option prints out the estimated covariance matrix of the sampling distributionof the estimator β. The square roots of the diagonal elements of this matrix are the standarderrors so should be equal to the Standard Errors in the Solution for Fixed Effectstable, which you should have verified to be the case for your preferred model. For example,for the compound symmetric fit,

√153.67 = 12.40, which, rounded to 2 decimal places, is the

same as the standard error for the intercept in the Solution for Fixed Effects table.

8

Page 577: Applied Longitudinal Data Analysis:Lecture Notes

.

ST 732, HOMEWORK 4, SPRING 2005

1. Consider a straight line model for individual behavior as in Equation (9.1) of the notes, whichfor unit i is of the form

Yij = β0i + β1itij + eij , (1)

where Yij is the random variable representing the observation that might be seen for unit iat time tij ; j = 1, . . . , ni indexes the time points for unit i; β0i and β1i are the unit-specificintercept and slope, respectively, dictating the “inherent trajectory” for unit i; and eij is amean-zero random deviation representing how Yij deviates from the inherent trajectory. Let

βi =

(β0i

β1i

)

be the vector of unit-specific parameters for individual i in model (1), and let Y i =(Yi1, . . . , Yini)

′ denote the random vector of observations on i, with ei defined similarly.

(a) If we write (1) in the form Y i = Ziβi + ei, give the form of Zi if ni = 4.

(b) Now suppose that units arise from 3 populations, labeled A, B, and C. Write down asecond-stage population model that allows each population to have its own mean intercept andslope β0,k and β1,k, respectively, where k = A, B, or C, about which unit-specific interceptsand slopes vary in each population. Express your model in the form in Equation (9.5) in thenotes; i.e.,

βi = Aiβ + bi,

defining β and bi and giving the form of Ai when unit i is from each of populations A, B,and C, respectively.

(c) Define

δAi = 1 if unit i is from population A= 0 otherwise

δBi = 1 if unit i is from population B= 0 otherwise

δCi = 1 if unit i is from population C= 0 otherwise

Express the Ai matrices found in (b) compactly by giving form of Ai for any unit i in termsof δAi, δBi, δCi.

(d) As shown on pages 320–321 of the notes, the model under the conditions in (a)–(c) canbe expressed as

Y i = Xiβ + Zibi + ei.

Give the form of Xi for a unit i with ni = 4 if the unit is from each of populations A, B, andC, respectively.

(e) Give the form of Xi for any unit i in terms of δAi, δBi, δCi defined in (c). Note that writingXi this way corresponds to how we think about how model statements in proc mixed andproc glm are constructed under the “explicit parameterization” (see Section 8.9 of the classnotes).

1

Page 578: Applied Longitudinal Data Analysis:Lecture Notes

2. Consider model for individual behavior as on page 323 in the notes that takes the “inherenttrajectory” for unit i to be a quadratic function of time; i.e.,

Yij = β0i + β1itij + β2it2ij + eij . (2)

Here, Yij , tij , j = 1, . . . , ni, eij , Y i, and ei are defined as in Problem 1, and β0i, β1i, andβ2i are the unit-specific intercept, linear coefficient, and quadratic coefficient, respectively,dictating the “inherent trajectory” for unit i.

(a) If we write (2) in the form Y i = Ziβi + ei, give the form of Zi if ni = 4.

(b) Now suppose that units arise from 2 populations, labeled A and B. Write down a second-stage population model that allows each population to have its own mean intercept, linearcoefficient, and quadratic coefficient β0,k, β1,k, and β2,k, respectively, where k = A or B,about which unit-specific such parameters vary in each population. Express your model inthe form in Equation (9.5) in the notes; i.e.,

βi = Aiβ + bi,

defining β and bi, giving the form of Ai when unit i is from each of populations A and B,respectively.

(c) As shown on pages 320–321 of the notes, the model under the conditions in (a)–(b) canbe expressed as

Y i = Xiβ + Zibi + ei.

Give the form of Xi for a unit i with ni = 4 if the unit is from populations A or B, respectively.

(d) Now define

δAi = 1 if unit i is from population A= 0 otherwise

δBi = 1 if unit i is from population B= 0 otherwise

Express the Xi matrices found in (c) compactly by giving form of Xi for any unit i in termsof δAi, δBi.

3. Suppose we have a straight-line first stage individual model of the form in Problem 1, and asecond stage population model of the form

βi = Aiβ + bi

as in Equation (9.8) of the notes for some Ai and β, with bi = (b0i, b1i)′. Under the assump-tions that ei and bi are independent (as discussed on page 319 of the notes) and that thecovariance matrix of bi is the same regardless of group and equal to

D =

(D11 D12

D12 D22

)

(as discussed after Equation (9.8) of the notes), it is demonstrated on pages 320–322 of thenotes that the covariance matrix of a data vector under a model of this form is given by

Σi = ZiDZ ′i + Ri,

2

Page 579: Applied Longitudinal Data Analysis:Lecture Notes

where var(ei) = Ri.

Suppose we have balanced data with equally-spaced time points t1, . . . , tn (so ni = n for alli), and we assume that

Ri = σ21Γi + σ2

2In

as in Equation (9.6) of the notes, where Γi is the AR(1) correlation matrix with parameter ρ.

(a) Under this model, give expressions for var(Yij) and cov(Yij , Yik) in terms of the distinctelements of D, σ2

1, σ22, and ρ. (Hint: You may find the result at the top of page 328 of the

notes helpful.)

(b) Under this model, is it possible for var(Yij) to be different at different time points tj?Explain.

(c) Under this model, is it assumed that cov(Yij , Yik) is the same for all pairs of time points?Explain.

(d) Suppose n = 3. Write down the assumed form of Σi.

(e) How many parameters are involved in describing the overall aggregate covariance matrixof a data vector, Σi, under this model? How many parameters would there be in a completelyunstructured model for Σi if n = 3 and we took the modeling approach of Chapter 8? In thecase of n = 3, do you see any advantage to one approach over the other? Explain. If n = 10,how would you answer this question? Explain.

(f) Suppose D12 = 0, so that unit-specific intercepts and slopes are uncorrelated in thepopulation(s) of interest. Under this model and this condition, are elements of Y i assumedto be correlated? Explain.

4. A study was conducted at a major research laboratory to investigate the effect of differentstrategies for raising laboratory mice. Ordinarily, young mice at the laboratory are given astandard diet and are provided an exercise treadmill on which to run, but no formal exerciseregimen that requires the mice to spend time running on the treadmill is instituted. Theinvestigators wished to learn if providing such mice with an alternative high-calorie dietand/or subjecting them to a formal exercise program involving two 1/2-hour sessions a dayof running on the treadmill would alter growth patterns.

60 young mice were assigned at random to one of 4 strategies, 15 mice per strategy:

Strategy 1 standard diet, no formal exercise programStrategy 2 high-calorie diet, no formal exercise programStrategy 3 standard diet, formal exercise programStrategy 4 high-calorie diet, formal exercise program

Thus, Strategy 1 involves treating the mice as they are ordinarily treated, while the otherstrategies represent modifications of diet, exercise, or both. The protocol for the study spec-ified that each mouse would be weighed at time 0 (baseline), immediately prior to startinghis/her assigned strategy, and a weekly intervals thereafter for the next 5 weeks (so at weeks1, 2, 3, 4, 5 after starting the strategy).

The data are in the file mice.dat on the class web page. In the data set, each recordcorresponds to a single observation with columns (1) mouse id, (2) time in weeks, (3) bodyweight of mouse (gm), and (4) strategy indicator. Note from the data set that some of themice are missing all 6 intended measurements. This turned out to be because one of the lab

3

Page 580: Applied Longitudinal Data Analysis:Lecture Notes

technicians helping to collect data for the study forgot to weigh some of the mice every week(the lab technician has since been reassigned to cleaning cages).

More formally, then, the investigators were interested in learning whether patterns of mousebody weight over the study period were different under different strategies.

(a) Make separate spaghetti plots for the mice assigned to each strategy. From your plots, doyou think the assumption that the weights for mice in each group follow “inherent trajectories”that may be represented by mouse-specific straight lines seems reasonable?

(b) Consider the random coefficient model with straight-line first stage

Yij = β0i + β1itij + eij

for mouse i, where we may define βi = (β0i, β1i)′ for mouse i. Suppose that as an ini-tial model the investigators assumed that, for strategy k, k = 1, . . . , 4, there is a “typ-ical” mean value of intercept β0,k and a “typical” mean value of slope β1,k. Defineβ = (β0,1, β0,2, β0,3, β0,4, β1,1, β1,2, β1,3, β1,4)′. Then the investigators assumed the second stagepopulation model is

βi = Aiβ + bi, bi = (b0i, b1i)′,

and Ai is the appropriate design matrix for mouse i that “picks off” the correct mean interceptand slope from β corresponding to the strategy i underwent.

The investigators were willing to assume the following:

(i) The scale used to weigh mice commits errors whose magnitude is unrelated to the weightof the mouse being weighed; and

(ii) Weights are taken sufficiently far apart in time that correlation due to within-mousefluctuations in weight is negligible, and the magnitude of such fluctuations is constantover time. Such fluctuations are independent of weight of the mouse.

The investigators were not sure whether (iii) the magnitude of within-mouse fluctuations inweight or (iv) the way in which mouse-specific intercepts and slopes vary and co-vary are thesame under all four strategies.

Using proc mixed, fit using REML three different versions of the random coefficient model,all of which incorporate assumptions (i) and (ii) above but allow different assumptions about(iii) and (iv), namely:

• Magnitude of within-mouse fluctuations in weight and the way mouse-specific interceptsand slopes vary/co-vary are both the same under all four strategies

• Magnitude of within-mouse fluctuations in weight are possibly different under the fourstrategies but the way mouse-specific intercepts and slopes vary/co-vary is the same

• Magnitude of within-mouse fluctuations in weight is the same under the four strategiesbut the way in which mouse-specific intercepts and slopes vary/co-vary is are possiblydifferent.

(c) From inspection of AIC and BIC for each model fit, which set of assumptions on within-mouse fluctuations and among-mouse variation in intercepts/slopes do you prefer? Under themodel that embodies these assumptions, is there evidence to suggest that the “typical” meanslopes of growth patterns for the four different strategies are not the same? To address this,include an appropriate contrast statement in the fit of your preferred model and obtain theWald test statistic. State the value of the statistic, the associated p-value, and your conclusionregarding the strength of the evidence supporting the contention that the mean slopes differ.

4

Page 581: Applied Longitudinal Data Analysis:Lecture Notes

.

ST 732, HOMEWORK 4, SOLUTIONS, SPRING 2005

1. (a) Here, the dimension of βi is (2 × 1), so Zi is (ni × 2) matrix in general. When ni = 4,this matrix becomes

Zi =

1 ti11 ti21 ti31 ti4

,

so that sweeping the jth row of Zi down βi yields the expression for the individual “inherent”straight-line trajectory in (1).

(b) Here, each of the populations A, B, and C has a mean intercept and slope; thus, there are6 parameters total that describe mean response across all populations. We can stack theseup into a single (6× 1) vector

β =

β0,A

β1,A

β0,B

β1,B

β0,C

β1,C

.

For each unit i, there will be a random effect corresponding to intercept and slope that allowsthe unit-specific intercept and slope β0i and β1i for i to deviate from the mean values for i’spopulation. Thus, we define for each i

bi =

(b0i

b1i

).

We may thus write the population model as

βi = Aiβ + bi,

where, for each i, Ai is the appropriate (2×6) matrix that “picks off” the right mean interceptand slope corresponding to the population from which i arises. Thus, sweeping the 2 rowsof Ai down β should yield a (2× 1) vector corresponding to the correct mean intercept andslope. It is straightforward to see that

Ai =

(1 0 0 0 0 00 1 0 0 0 0

)for population A

Ai =

(0 0 1 0 0 00 0 0 1 0 0

)for population B

Ai =

(0 0 0 0 1 00 0 0 0 0 1

)for population C.

(c) Note that only one of δAi, δBi, δCi can be equal to 1, because i belongs only to one of thepopulations A, B, C. Thus, for example, if δAi = 1, because i arises from population A, thenδ + Bi = δCi = 0. Accordingly, we can write the three Ai matrices in (b) compactly as

Ai =

(δAi 0 δBi 0 δCi 00 δAi 0 δBi 0 δCi

);

1

Page 582: Applied Longitudinal Data Analysis:Lecture Notes

substituting in for δAi, δBi, δCi under each of the conditions i arising from A, B, C, respectively,can be seen to give the matrices in (b).

(d) As on pages 320–321 of the notes, Xi = ZiAi. Thus, to find the form of Xi for a uniti from each population, we need to pre-multiply the appropriate Ai matrix from (b) by Zi.For i from population A, this gives

Xi = ZiAi =

1 ti11 ti21 ti31 ti4

(1 0 0 0 0 00 1 0 0 0 0

)=

1 ti1 0 0 0 01 ti2 0 0 0 01 ti3 0 0 0 01 ti4 0 0 0 0

.

Similarly, for i from B,

Xi = ZiAi =

1 ti11 ti21 ti31 ti4

(0 0 1 0 0 00 0 0 1 0 0

)=

0 0 1 ti1 0 00 0 1 ti2 0 00 0 1 ti3 0 00 0 1 ti4 0 0

,

and for i from C

Xi = ZiAi =

1 ti11 ti21 ti31 ti4

(0 0 0 0 1 00 0 0 0 0 1

)=

0 0 0 0 1 ti10 0 0 0 1 ti20 0 0 0 1 ti30 0 0 0 1 ti4

.

(e) We can either multiply this out as, from (c),

Xi = ZiAi =

1 ti11 ti21 ti31 ti4

(δAi 0 δBi 0 δCi 00 δAi 0 δBi 0 δCi

)=

δAi δAiti1 δBi δBiti1 δCi δCiti1δAi δAiti2 δBi δBiti2 δCi δCiti2δAi δAiti3 δBi δBiti3 δCi δCiti3δAi δAiti4 δBi δBiti4 δCi δCiti4

,

or just notice immediately that, as only one of δAi, δBi, δCi can be equal to 1 at a time, thethree Xi matrices in (d) can be written in this form.

From Section 8.9 of the notes, this matrix basically spells out how a model statement withthe noint option works. Analogous to page 300 of the notes, if we have the classificationvariable pop, say, taking on values A, B, and C, then the model statement

model Y = pop pop*time noint solution;

will create

β0,A I(pop=A) + β0,B I(pop=B)+ β0,C I(pop=C)+ β1,A t I(pop=A) + β1,B t I(pop=B)+ β1,C t I(pop=C),

which can be reordered as

β0,A I(pop=A) + β1,A t I(pop=A) + β0,B I(pop=B)+ β1,B t I(pop=B)+ β0,C I(pop=C) + β1,C t I(pop=C).

2

Page 583: Applied Longitudinal Data Analysis:Lecture Notes

Noting the δAi is analogous to I(pop=A) and similarly for B and C, we see that, with βdefined as above, the terms in this “SAS” expression correspond exactly to sweeping rows ofXi down β. This is consistent with the description of the proc mixed syntax in Section 9.6on page 333, where the model statement contains “columns of X.”

Of course, SAS by default will order things with all the intercepts first followed by allthe slopes, as above, We could re-do everything above to be in this form by definingβ = (β0,A, β0,B, β0,C , β1,A, β1,B, β1,C)′. Here, the form of the Ai and Xi matrices wouldchange; in particular, the order of the columns from what is given above would be differentreflecting that the elements of β here are in a different order. Regardless of how we choose toorder these elements and hence write the model, it is the same model, and what is importantfor using the SAS procedures is understanding how the model statement translates the effectspresent into the model for the mean.

2. (a) Here, the dimension of βi is (3 × 1), so Zi is (ni × 3) matrix in general. When ni = 4,this matrix becomes

Zi =

1 ti1 t2i11 ti2 t2i21 ti3 t2i31 ti4 t2i4

,

so that sweeping the jth row of Zi down βi yields the expression for the individual “inherent”quadratic trajectory in (2).

(b) We have 2 populations, each with a mean intercept, linear coefficient, and quadraticcoefficient. Suppose we define

β =

β0,A

β1,A

β2,A

β0,B

β1,B

β2,B

.

For each unit i, there will be a random effect corresponding to intercept, linear coefficient, andquadratic coefficient that allows the unit-specific intercept, linear coefficient, and quadraticcoefficient β0i, β1i, and β2i for i to deviate from the mean values for i’s population. Thus, wedefine for each i

bi =

b0i

b1i

b2i

.

We may thus write the population model as

βi = Aiβ + bi,

where, for each i,

Ai =

1 0 0 0 0 0

0 1 0 0 0 00 0 1 0 0 0

for population A

Ai =

0 0 0 1 0 0

0 0 0 0 1 00 0 0 0 0 1

for population B.

3

Page 584: Applied Longitudinal Data Analysis:Lecture Notes

(c) We have for i from A

Xi = ZiAi =

1 ti1 t2i11 ti2 t2i21 ti3 t2i31 ti4 t2i4

1 0 0 0 0 0

0 1 0 0 0 00 0 1 0 0 0

=

1 ti1 t2i1 0 0 01 ti2 t2i2 0 0 01 ti3 t2i3 0 0 01 ti4 t2i4 0 0 0

,

and for i from B

Xi = ZiAi =

1 ti1 t2i11 ti2 t2i21 ti3 t2i31 ti4 t2i4

0 0 0 1 0 0

0 0 0 0 1 00 0 0 0 0 1

0 0 0 1 ti1 t2i10 0 0 1 ti2 t2i20 0 0 1 ti3 t2i30 0 0 1 ti4 t2i4

.

(d) By the same logic as in Problem 1, we have

Xi =

δAi δAiti1 δAit2i1 δBi δBiti1 δBit

2i1

δAi δAiti2 δAit2i2 δBi δBiti2 δBit

2i2

δAi δAiti3 δAit2i3 δBi δBiti3 δBit

2i3

δAi δAiti4 δAit2i4 δBi δBiti4 δBit

2i4

.

Note: If we had instead defined β = (β0,A, β0,B, β1,A, β1,B, β2,A, β2,B)′, we would have had

Ai =

1 0 0 0 0 0

0 0 1 0 00 0 0 0 1 0

for population A

Ai =

0 1 0 0 0 0

0 0 0 1 0 00 0 0 0 0 1

for population B;

Xi =

1 0 ti1 0 t2i1 01 0 ti2 0 t2i2 01 0 ti3 0 t2i3 01 0 ti4 0 t2i4 0

for unit i from A and

Xi =

0 1 0 ti1 0 t2i10 1 0 ti2 0 t2i20 1 0 ti3 0 t2i30 1 0 ti4 0 t2i4

for unit i from B, i.e.,

Xi =

δAi δBi δAiti1 δBiti1 δAit2i1 δBit

2i1

δAi δBi δAiti2 δBiti2 δAit2i2 δBit

2i2

δAi δBi δAiti3 δBiti3 δAit2i3 δBit

2i3

δAi δBi δAiti4 δBiti4 δAit2i4 δBit

2i4

.

This is in the same order that would be gotten from the proc mixed model statement, lettingtime2 = time**2,

4

Page 585: Applied Longitudinal Data Analysis:Lecture Notes

model Y = pop pop*time pop*time2 noint solution;

as this model statement orders the intercept terms first, followed by the linear coefficientsand quadratic coefficients.

3. (a) var(Yij) and cov(Yij , Yik) are, respectively, the jth diagonal element of the matrix Σi andthe (j, k) off-diagonal element. Because Σi = ZiDZ ′

i +Ri, in fact var(Yij) is thus in fact thesum of the jth diagonal element of ZiDZ ′

i and the jth diagonal element of Ri. Similarly,cov(Yij , Yik) is the sum of the (j, k) off-diagonal element of ZiDZ ′

i and the (j, k) off-diagonalelement of Ri.

Using the hint, on page 238, var(Yij) and cov(Yij , Yik) are found for a simpler model than theone here with the same Zi and D but with Ri = σ2Ini . On this page, we see that the firstpart of the expression for var(Yij), given by

vj = D11 + D22t2j + 2D12tj ,

is clearly the contribution from the jth diagonal element of ZiDZ ′i and σ2 is the contribution

from the jth diagonal element of σ2Ini . Similarly, because with Ri = σ2In the (j, k) off-diagonal element of Ri is 0 for any (j, k), it is clear that the expression for cov(Yij , Yik),

cjk = D11 + D22tjtk + D12(tj + tk)

must be the (j, k) off-diagonal element of ZiDZ ′i. Thus, because ZiDZ ′

i is the same for ourproblem as it is on page 328, it should be clear that var(Yij) for us is the sum of vj above andthe j diagonal element of Ri = σ2

1Γi + σ22In, which is σ2

1 + σ22 for any j. Thus, we have that

var(Yij) = vj + σ21 + σ2

2 = D11 + D22t2j + 2D12tj + σ2

1 + σ22

under this model. Similarly, cov(Yij , Yik) for us is the sum of cjk above and the (j, k) off-diagonal element of Ri = σ2

1Γi + σ22In. This off-diagonal element = σ2

1ρ if j and k are onetime interval apart, = σ2

1ρ2 if j and k are two time intervals apart, and so on. Thus, noting

that |j − k| gives how many time intervals apart j and k are, we have that

cov(Yij , Yik) = cjk + σ21ρ

|j−k| = D11 + D22tjtk + D12(tj + tk) + σ21ρ

|j−k|.

(b) Yes. Under this model, var(Yij) depends on D22t2j + 2D12tj , which clearly is different

for each time point tj . Thus, a feature of the implied overall model for Σi is that variancechanges over time.

(c) No. Under this model, cov(Yij , Yik) depends not only on D22tjtk +D12(tj + tk), which hasnumerical value depending explicitly on the times tj and tk, but it also depends on σ2

1ρ|j−k|.

This second term changes for pairs indexed by (j, k) depending on how many time intervalsapart they are. Thus, overall covariance under the implied model for Σi depends on theparticular pair of time points in question both through their actual times on the time scaleas well as the number of time intervals apart they are.

(d) With n = 3, Σi is thus

Σi =

D11 + D22t

21 + 2D12t1 + σ2

1 + σ22 D11 + D22t1t2 + D12(t1 + t2) + σ2

1ρ D11 + D22t1t3 + D12(t1 + t3) + σ21ρ

2

D11 + D22t1t2 + D12(t1 + t2) + σ21ρ D11 + D22t

22 + 2D12t2 + σ2

1 + σ22 D11 + D22t2t3 + D12(t2 + t3) + σ2

1ρD11 + D22t1t3 + D12(t1 + t3) + σ2

1ρ2 D11 + D22t2t3 + D12(t2 + t3) + σ2

1ρ D11 + D22t23 + 2D12t3 + σ2

1 + σ22

.

5

Page 586: Applied Longitudinal Data Analysis:Lecture Notes

(e) Under this model, there are 6 parameters that go into the description of Σi: D11, D12, D22, σ21, σ

22, ρ.

Likewise, if we had just modeled Σi directly as unstructured as under the approach of Chap-ter 8, for n = 3 there would be 3 variances and 3 covariances, for a total of 6 parameters.Thus, if n = 3, the number of parameters is the same – either way, we are using 6 parametersto describe 6 things (3 variances and 3 covariances). There does not seem to be an advantageto one description over the other; either one requires a lot of parameters to characterize Σi.

In fact, in light of the discussion on page 335 about identifiability, one might be wary ofeither approach. In the case of the random coefficient model, one might worry that it mightbe difficult to identify all of these covariance parameters with any confidence.

On the other hand, if n = 10, the unstructured matrix would involve n = 10 distinct variancesplus (from page 86 of the notes) n(n − 1)/2 = 45 distinct covariances, for a total of 55parameters to describe the covariance matrix of a data vector! Under these conditions, themodel implied by the random coefficient structure is much more parsimonious, representingall of these variances and covariances in terms of only 6 parameters. The implied model stillallows variances and covariances to be different for different time points, but in a specificway imposed by the structure of ZiDZ ′

i + Ri. If we think that the random coefficient modelis a reasonable way to represent the overall situation, then this offers a big advantage overjust letting the covariance matrix be completely unstructured; moreover, it allows us to thinkof the contributions of among- and within-unit sources of variation separately and take ourbeliefs into account explicitly.

(f) If D12 = 0, cov(Yij , Yik) becomes

D11 + D22tjtk + σ21ρ

|j−k|.

This is clearly non-zero in general. Thus, even if the unit-specific intercepts and slopes areuncorrelated in the population, there is still non-zero correlation between elements of Y i.

This makes intuitive sense. Whether D12 = 0 or not, the elements of Y i all share a commondependence on the random effects b0i and b1i. Thus, they would be expected to be associatedwith one another on this basis alone. In the particular model here, we have moreover that,because of within-unit fluctuations, there is a further component of correlation, ρ|j−k|, whichalso contributes to the overall correlation among observations in Y i.

4. (a) Here are the spaghetti plots:

6

Page 587: Applied Longitudinal Data Analysis:Lecture Notes

0 1 2 3 4 5

220

240

260

280

300

320

week

wei

ght (

g)

Strategy 1 −− Standard Diet and Exercise

0 1 2 3 4 5

220

240

260

280

300

320

week

wei

ght (

g)

Strategy 2 −− High−Calorie Diet, Standard Exercise

0 1 2 3 4 5

220

240

260

280

300

320

week

wei

ght (

g)

Strategy 3 −− Standard Diet, Formal Exercise

0 1 2 3 4 5

220

240

260

280

300

320

week

wei

ght (

g)

Strategy 4 −− High−Calorie Diet, Formal Exercise

Each individual mouse weight trajectory looks like it reasonably follows an overall straight-line trend, with some “jitter.” This suggests that the assumed straight-line random coefficientmodel is reasonable.

(b) Model assumptions (i) and (ii) mean the following:

(i) The scale used to weigh mice commits errors whose magnitude is unrelated to the weightof the mouse being weighed implies that we believe bi and e2i are independent and thatthe variance of measurement errors is constant regardless of time or weight of mouse.

(ii) Weights are taken sufficiently far apart in time that correlation due to within-mousefluctuations in weight is negligible, and the magnitude of such fluctuations is constantover time. Such fluctuations are independent of weight of the mouse. This implies abelief that the elements of e1i are uncorrelated with constant variance over time and areindependent of bi and e2i.

Under (i) and (ii), we thus have that Ri is of the general form on the bottom of page 314,

Ri = σ21Ini + σ2

2Ini .

Under the first assumption on (iii) and (iv), D is the same for all strategies and σ21 is the

same for all strategies, so that the total within-mouse variance σ21 + σ2

2 = σ2 is the same forall four strategies.

Under the second assumption on (iii) and (iv), D is the same for all strategies but now σ21

might be different, so that total within-mouse variance σ21 + σ2

2 is possibly different.

Under the third assumption on (iii) and (iv), D is possibly different for all strategies but σ21

is the same for all strategies, so that the total within-mouse variance σ21 +σ2

2 = σ2 is the samefor all four strategies.

The attached SAS program fits the model under these three different assumptions.

(c) From the output, we have

7

Page 588: Applied Longitudinal Data Analysis:Lecture Notes

Model AIC BIC

Same D and same within-mouse variance 1965.6 1973.9Same D and different within-mouse variance 1969.0 1983.6Different D and same within-mouse variance 1973.7 2000.9

Both criteria prefer that model with the same D (variation/covariation of intercepts/slopes)same in each strategy and same within-mouse variance (reflecting that magnitude of within-mouse fluctuations is similar in each strategy).

From the contrast statement for the fit of this model, TL = 16.6 with an associated p-valueof 0.001. The evidence is very strong to support the contention that there is a difference ingrowth patterns, as represented by mean slope for each strategy.

8

Page 589: Applied Longitudinal Data Analysis:Lecture Notes

.

ST 732, HOMEWORK 5, SPRING 2005

1. Women often develop anemia during pregnancy. There is currently considerable debate amongpublic health researchers whether administration of iron supplements to pregnant women maydecrease the risk of anemia. A group of researchers at the Wake County Health Departmentand UNC-Chapel Hill conducted a study to investigate the relationship between iron sup-plement use and anemia in pregnant women. The study had many parts; here, we willconsider the effect of iron supplementation on levels of serum ferritin, a measure of totalbody iron stores, during pregnancy. Serum ferritin levels tend to be low among sufferersof iron-deficiency anemia, so these levels are often used as a way to evaluate whether anindividual suffers from this condition.

The researchers recruited women who were at 3 months gestation (i.e., were 3 months preg-nant) and who showed signs of possible anemia from among women receiving prenatal care atthe Health Department. A total of 100 such women were recruited and assigned at randomto 2 groups, 50 women per group. The first group served as a control; women in this groupwere given a supply of “fake” iron supplement pills (placebo). The second group received asupply of iron supplements. All women were instructed by Department nurses to take theirassigned pills daily as directed.

At baseline (time of recruitment; i.e., 3 months gestation, immediately before iron supple-mentation use began), and then monthly thereafter through the eighth month of pregnancy(so at months 3, 4, 5, 6, 7, and 8 gestation), a blood sample was to be taken from eachwoman, and the level of serum ferritin (ng/ml) was determined. Whether the woman had aprior history of anemia (0=no, 1=yes) and whether she had had a prior pregnancy (0=no,1=yes) was also recorded for each woman at baseline.

The data from the study are on the class web page in the file anemia.dat; each record in thefile corresponds to a single observation, and the columns are (1) woman id number (1–100), (2)history of anemia, (3) prior pregnancy (4) gestational month (month of pregnancy, measuredfrom the start of pregnancy), (5) serum ferritin level, and (6) group indicator (1=control,2=iron supplementation). Note that for some patients, the response is not available at allintended time points; some samples were mishandled and in some instances department nursesneglected to obtain samples. These reasons for the missing values was determined to havenothing to do with iron supplement use or patterns of serum ferritin. Figure 1 shows a plotof the longitudinal serum ferritin levels for all women in the study.

From the plot, it appears that the pattern of serum ferritin change seems to follow a roughstraight line trajectory for each woman, some increasing, some decreasing, and some relativelyflat. To represent this, investigators proposed the following model. Because the investigatorswere interested only in the period from 3 to 8 months gestation, they defined time in themodel so that t = 0 corresponds to 3 months gestation (baseline), and let tij , the time of thejth serum ferritin measurement on woman i, be defined as

tij = sij − 3,

where sij = time of the jth level on woman i measured from the start of pregnancy (so sij

equals the gestational month value given in the data file). Letting Yij be the correspondingserum ferritin level for woman i at the jth time, the model for woman i is

Yij = β0i + β1itij + eij , (1)

1

Page 590: Applied Longitudinal Data Analysis:Lecture Notes

Figure 1: Serum ferritin levels for two groups of pregnant women

3 4 5 6 7 8

020

4060

80

Gestation (months)

Ser

um F

errit

in (

ng/m

l)

Control

3 4 5 6 7 80

2040

6080

Gestation (months)

Ser

um F

errit

in (

ng/m

l)

Iron Supplments

where the parameters β0i and β1i describe the “inherent” serum ferritin trajectory startingat 3 months gestation for the ith woman, and eij represents a mean-zero deviation associatedwith the jth serum ferritin level, assumed to be normally distributed. This model thus allowsthe pattern after 3 months gestation to follow a straight line for each woman.

(a) The investigators believed that, for model (1), the “typical” inherent (mean) serum ferritinlevel at 3 months gestation has the following features:

• is associated with whether a woman has a history of anemia

• is associated with whether a woman has been pregnant previously

• the way in which it is associated with whether a woman has a history of anemia isdifferent depending on whether the woman has also had a prior pregnancy.

Because the women were randomly assigned to the two groups, the investigators believed thatmean serum ferritin at 3 months gestation and the way the above features occur is the samefor both groups, as the women could all be regarded as being from a common population(prior to iron supplementation) at time 0 (i.e., 3 months gestation).

The investigators believed that the “typical” or mean rate of change of serum ferritin over thestudy period also has these features. However, they believed that the mean rate of change andits dependence on history of anemia and previous pregnancy could be different for each group,reflecting the possibility that whether iron supplementation is given or not is associated withthe pattern of change of serum ferritin in different ways for women with different prior anemiaand pregnancy characteristics.

Let ai = 0 if woman i does not have a history of anemia and ai = 1 if she does. Similarly, letpi = 0 if woman i has had no prior pregnancy, and pi = 1 if she has. Express the beliefs ofthe investigators given above by writing down models for β0i and β1i for woman i for

(i) the control group

2

Page 591: Applied Longitudinal Data Analysis:Lecture Notes

(ii) the iron supplementation group.

Be sure to define and describe fully all additional symbols you use.

(b) Write the expressions you defined in (a) in the form βi = Aiβ + bi, defining βi, β,bi, and Ai. Be sure to define Ai for each group and to state clearly any assumptions youmake. Rewrite (1) and your model for βi in the form Y i = Xiβ + Zibi + ei, where Y i =(Yi1, . . . , Yini)

′ and ei = (ei1, . . . , eini)′, defining Xi and Zi for all possible i.

(c) In terms of your model in (a) and (b)

(i) Give an expression that represents the typical value of serum ferritin at 3 months gestationfor women with no history of anemia who have had a prior pregnancy.

(ii) Give an expression for mean serum ferritin for women in the control group who are 7months pregnant who have a history of anemia but have not had a prior pregnancy.

In the following parts, you will develop a SAS program to carry out several different analyses.You will have to modify your program for each part to obtain desired analyses. Please turnin your final program and output that carries out all necessary analyses.

(d) The investigators were all willing to believe that serum ferritin levels obtained 1 monthor more apart are sufficiently separated in time so that correlation due to within-womanfluctuations is negligible. They were also willing to believe that the magnitude of within-woman fluctuations in serum ferritin is the same regardless of whether a woman is takingiron supplements are not and does not change over the course of pregnancy in either group.Furthermore, they were were sure that variation caused by assays used to measure serumferritin levels is nonnegligible and of similar magnitude regardless of true serum ferritin levelin any sample.

However, there was a point of disagreement on other aspects of variation. The investigatorswere willing to believe that a bivariate normal distribution would be a reasonable model forthe way in which woman-specific serum ferritin levels at 3 months gestation and rates ofchange of serum ferritin levels over the study period take on their values for both groups.However, one of the investigators (Investigator 1) felt that there would be more woman-to-woman variation in the woman-specific rates of change of serum ferritin level over thestudy period among women not receiving iron supplementation than among those receivingit. Another investigator, Investigator 2, did not agree, and thought that all aspects of howwoman-specific serum ferritin levels at 3 months and subsequent woman-specific rates ofchange vary and co-vary would be similar in both groups.

Give two different sets of assumptions on ei and bi in your model in (b) that incorporatethe beliefs on which all investigators agreed and (i) the beliefs of Investigator 1 and (ii)Investigator 2. For each set of assumptions, fit the model using SAS proc mixed with themethod of restricted maximum likelihood. Which model do you think the evidence in thedata better supports? Justify your answer.

For the remaining parts of this problem, carry out all analyses under the model you feel bestcharacterizes variation given your results in part (d).

(e) The investigators were interested first in using their data to consider the following long-standing question: Is the typical value of serum ferritin at 3 months gestation for women witha history of anemia different depending on whether they have had a prior pregnancy? Writedown a set of hypotheses that addresses this issue in terms of the model you have chosen,and express your null hypothesis in terms of a linear function Lβ, defining L. Using Wald

3

Page 592: Applied Longitudinal Data Analysis:Lecture Notes

methods, carry out the test at level of significance 0.05 based on a REML fit. State yourconclusion as a meaningful sentence.

(f) One of the investigators had a theory that the way in which mean serum ferritin levelat 3 months gestation depends on whether a woman has a history of anemia is the sameregardless of whether she has been pregnant before or not. Write down a set of hypothesesthat addresses this issue in terms of the your chosen model, and express your null hypothesisin terms of a linear function Lβ, defining L. Using Wald methods, carry out the test at levelof significance 0.05 based on a REML fit. State your conclusion as a meaningful sentence.

(g) Another investigator was interested in whether the typical rate of change of serum ferritinover the period of 3 to 8 months gestation differs depending on whether or not women receiveiron supplementation among women who have a history of anemia but have never been preg-nant. Write down a set of hypotheses that addresses this issue in terms of the your chosenmodel, and express your null hypothesis in terms of a linear function Lβ, defining L. UsingWald methods, carry out the test at level of significance 0.05 based on a REML fit. Stateyour conclusion as a meaningful sentence.

Also obtain estimates and standard errors of the mean rates of change for women with a his-tory of anemia who have never been pregnant for each of the control and iron supplementationgroups.

(h) Under your preferred model, provide estimates of mean serum ferritin at 8 months ges-tation for women receiving iron supplementation (i) with no history of anemia and no priorpregnancy; (ii) with no history of anemia and prior pregnancy; (iii) with history of anemiaand no prior pregnancy; and (iv) with history of anemia and prior pregnancy.

2. Consider again the iron supplementation study in Problem 1. Consider also the model youspecified in (b) and (d).

As before, you will develop a SAS program to carry out several different analyses. You willhave to modify your program for each part to obtain desired analyses. Please turn in yourfinal program and output that carries out all necessary analyses.

(a) Using SAS proc mixed, fit the model using maximum likelihood. This time, have yourprogram print out both the estimates of the fixed parameters in β and the approximate bestlinear unbiased predictors (BLUPs) of the random effects bi.

(b) In your program, create 4 data sets and have the program print out their contents:

(i) A data set containing only the data for woman 1 in group 1

(ii) A data set containing only the data for woman 6 in group 1

(iii) A data set containing only the data for woman 51 in group 2

(iv) A data set containing only the data for woman 100 in group 2

This may be carried out by using the where statement to create a new data set as follows;e.g., for (i), if the variable woman is the woman id indicator,

data woman1; set alldata;where woman=1;

run;

The resulting data set will contain only the data on all variables where woman=1 (so for thefirst woman).

4

Page 593: Applied Longitudinal Data Analysis:Lecture Notes

(c) From the output of your proc mixed run in (a), calculate by hand the approximate BLUPsfor intercept and slope (β0i and β1i) for each of the women in (b).

(d) Consider the data for each woman in (b). Suppose we wished to estimate the woman-specific intercept and slope for each woman based only on her data alone.

(i) Do the assumptions on within-individual variation in your model support doing this usingordinary least squares? Explain.

(ii) Is it possible to obtain a reliable estimate for each of these women based on her dataalone? Explain.

(e) Using proc reg or proc glm, estimate the intercept and slope separately for each of thewomen in (b) for whom reliable estimates are possible using ordinary least squares. Comparethese to the BLUPs you calculated in (c).

(f) Suppose the model is thought to hold except that it is assumed that all of the woman-to-woman variation among slopes in each group is taken to be a consequence of whetherthe women have had anemia or prior pregnancy so that, once these factors are taken intoaccount in slope, there is no apparent biological among-woman variation. Fit this modelusing proc mixed and the method of maximum likelihood, printing out the estimates of thefixed parameters β and the approximate BLUPs for bi.

Informally, which model do you prefer, the original one or this one? Explain.

(g) One of the investigators would like to conduct a formal test of whether there is evidencethat the original model is better than the one in (f). Do whatever you think is appropriateto address this question.

5

Page 594: Applied Longitudinal Data Analysis:Lecture Notes

.

ST 732, HOMEWORK 5, SOLUTIONS, SPRING 2005

1. (a) Note that in the model written as in (1), β0i has the interpretation as the inherent,woman-specific serum ferritin level at 3 months gestation for woman i. Thus, by defining tijas we have done, this value appears explicitly in the model (as the intercept).

(i) For group 1 we have

β0i = β0 + β0aai + β0ppi + β0apaipi + b0i

β1i = β11 + β1a1ai + β1p1pi + β1ap1aipi + b1i

(ii) For group 2 we have

β0i = β0 + β0aai + β0ppi + β0apaipi + b0i

β1i = β12 + β1a2ai + β1p2pi + β1ap2aipi + b1i

Here, β0 +β0aai +β0ppi +β0apaipi is thus the mean serum ferritin level at 3 months gestationamong women in the control group 1 as well as in the iron supplementation group 2 withprior anemia history ai and prior pregnancy status pi; as on page 2 of the assignment, thesemeans should be the same in both groups by virtue of randomization.

On the other hand, the fixed parameters β1k, β1ak, β1pk, and β1apk for groups k = 1, 2 aredifferent for each group, reflecting the belief given on page 2 of the assignment that the meanrate of change and its dependence on history of anemia and previous pregnancy could bedifferent for each group.

In each case, there is an interaction term involving aipi; this term allows the way in whichmean intercept and slope in (1) are associated with whether a woman has a history of anemiato be different depending on whether the woman has also has had a prior pregnancy.

In each case, b0i and b1i are random effects with mean 0; we say more about these in part (d).

(b) We may write this model compactly by defining

β = (β0, β0a, β0p, β0ap, β11, β12, β1a1, β1a2, β1p1, β1p2, β1ap1, β1ap2)′,

where we have ordered things in the same way SAS does later. We also define βi = (β0i, β1i)′

for any i. Then, we may write the above as βi = Aiβ + bi, where for group 1

Ai =

(1 ai pi aipi 0 0 0 0 0 0 0 00 0 0 0 1 0 ai 0 pi 0 aipi 0

),

and for group 2

Ai =

(1 ai pi aipi 0 0 0 0 0 0 0 00 0 0 0 0 1 0 ai 0 pi 0 aipi

).

Thus, letting Y i = (Yi1, . . . , Yini)′ and ei = (ei1, . . . , eini)

′ and defining β, bi as above, wemay write the model in the form Y i = Xiβ + Zibi + ei by defining for all i

Zi =

1 ti1...

...1 tini

1

Page 595: Applied Longitudinal Data Analysis:Lecture Notes

and letting Xi = ZiAi. Thus, for group 1, for example,

Xi =

1 ai pi aipi ti1 0 ti1ai 0 ti1pi 0 ti1aipi 0...

......

......

......

......

......

...1 ai pi aipi tini 0 tiniai 0 tinipi 0 tiniaipi 0

.

(c) (i) The expression that represents the typical value of serum ferritin at 3 months gestationfor a woman with no history of anemia (ai = 0) who has had a prior pregnancy (pi = 1) is

β0 + β0p.

(ii) We would like the value of the mean serum ferritin when t = 7− 3 = 4 for women in thecontrol group with no prior pregnancy (pi = 0) and a history of anemia (ai = 1). The modelin (b) implies that the mean serum ferritin at time t for women in the control group witharbitrary values ai and pi is

β0 + β0aai + β0ppi + β0apaipi + (β11 + β1a1ai + β1p1pi + β1ap1aipi)t.

Setting t = 4, ai = 1, and pi = 0 gives

β0 + β0a + (β11 + β1a1)(4).

(d) The requirements that the investigators agree on describe assumptions on within-patientvariation, characterized by a matrix var(ei) = Ri. Thinking of ei in to parts,

ei = e1i + e2i,

where e1i is the random vector of deviations due to within-woman fluctuations and e2i is thatcontaining deviations due to measurement error, negligible correlation due to fluctuationsallows the assumption that var(e1i) is a diagonal matrix. Moreover, the assumption that themagnitudes of these fluctuations are the same in both groups and don’t change over timemeans we can assume

var(e1i) = σ21Ini ,

say for any woman i from either group. The assumption that measurement errors are ofthe same magnitude regardless of true serum ferritin level means we can assume that e2i

is independent of e1i and bi. This also validates the assumption that measurement errorsare of similar magnitude regardless of group. So we can assume var(e2ij = σ2

2 for all i andj. Furthermore, making the usual assumption that measurement errors are all mutuallyindependent, var(e2i) is reasonably taken to be a diagonal matrix. Putting this together, wemay assume that

var(e2i = σ22Ini .

Combining and using the independence , we have that

Ri = var(e1i) + var(e2i) = σ21Ini + σ2

2Ini = σ2Ini ,

say, where σ2 = σ21 + σ2

2 is the overall within-woman variance arising from both sources ofwithin-woman variation. So we have the assumption that ei ∼ N ({0, σ2Ini), on which allinvestigators would agree.

2

Page 596: Applied Longitudinal Data Analysis:Lecture Notes

With bi = (b0i, b1i)′, the requirement that the intercepts and rates of change vary and covaryacross women in the same way in both groups according to a bivariate normal distribution,advocated by Investigator 2, may be expressed as

bi ∼ N (0, D),

where

D =

(D11 D12

D12 D22

).

Thus, the variance of intercepts is D11, the variance of slopes is D22, and D12 is their covari-ance. These values are the same for both groups. On the

Investigator 1 would disagree. She thinks that the values of D22 might be different in thecontrol and supplementation groups. Thus, she believes that the matrix D could be differentin each group. Her belief can be expressed as

bi ∼ N (0, D1)

for group 1 (control) andbi ∼ N (0, D2)

for group 2 (iron), where D1 and D2 are different matrices, differing in the very least in their(2,2) elements (they could also differ in their (1,2) elements, the covariances; if the variancesof b1i differ in each group, it stands to reason that how they covary with b0i might also differ).

In the SAS program, these models are fit using REML and version 8.2 of SAS. We have

Model AIC BICSame D, same σ2 3355.5 3366.0

Different D, same σ2 3359.5 3377.7

Both criteria prefer the model with above with common D matrix (and common σ2). Fromthe output, the estimated common D matrix is

D =

(40.22 −3.17−3.17 5.44

),

with corresponding correlation estimate −0.21. When the D is allowed to differ, the estimatedmatrices are

D1 =

(40.35 −5.13−5.13 5.12

), D2 =

(40.11 −1.24−1.24 5.80

).

with respective estimated correlations −0.36 and −0.82.

Note that the estimated variances of b1i for each group are very close (5.12 and 5.80) eventhough they are allowed to be different, and these are very close to the common estimate5.44, suggesting that Investigator 1’s concern may be unfounded. The estimated variancesof b0i are also very similar to each other and to the common estimate. The estimated co-variances/correlations differ somewhat, but this is not of great concern; correlation estimatesare the most sensitive and least reliable. All are negative, suggesting that women with aninherent tendency for high serum ferritin at 3 months gestation tend to have smaller (couldbe negative) rates of change.

3

Page 597: Applied Longitudinal Data Analysis:Lecture Notes

(e) The typical value at 3 months is the same regardless of group; thus, we do not need toconsider group here. The typical value for women with a history of anemia is β0 + β0a forwomen without prior pregnancy and β0 + β0a + β0p + β0ap for women with prior pregnancy.So the question is whether these two means are the same. The null hypothesis may be statedas H0 : β0p + β0ap = 0 vs. H1 : β0p + β0ap 6= 0. This may be written in terms of

L =(

0 0 1 1 0 0 0 0 0 0 0 0)

.

From the output, page 3, TL = 2.69 with a p-value of 0.10.. Unfortunately, this questionwill continue to be unresolved; there is not enough evidence to suggest that the typical valueof serum ferritin at 3 months for women with anemia is different depending on whether thewoman has had a prior pregnancy.

(f) This question is about the interaction term β0ap. The model says that the mean serumferritin level at 3 months gestation is β0 + β0aai + β0ppi + β0apaipi for arbitrary ai and pi.Because of the interaction term, the way in which this mean depends on whether a womanhas a history of anemia is different depending on whether she has been pregnant or not. Thatis, if she has not had a prior pregnancy, the mean becomes β0 +β0aai, whereas if she has, themean is β0 +β0aai +β0ppi +β0apaipi, which may be re-written as β0 +(β0a +β0appi)ai +β0ppi.Thus, here the dependence of the mean on anemia depends on whether pi = 0 or 1. If theinteraction term were eliminated, so that the mean is β0 + β0aai + β0ppi for arbitrary ai andpi, then the dependence of the mean on anemia is always the same (mean shifts by β0a as wemove from no anemia to anemia regardless of whether the woman has had a prior pregnancy(value of pi).

Thus, the hypothesis is H0 : β0ap = 0, and the appropriate L is

L =(

0 0 0 1 0 0 0 0 0 0 0 0)

.

We can get the Wald test statistic right from the Solution for Fixed Effects table onpage 2 – TL = (0.38)2 = 0.14 with a p-value of 0.71 based on the F approximation. For thosetoo lazy to square this value, we can also get this by using the chisq option in the modelstatement; the Type 3 Test of Fixed Effects for anemia*preg shows the test statisticTL = 0.14 directly with the p-value of 0.71 based on the chi-square approximation. Alterna-tively, we used a a contrast statement to get this independently; see page 3.

In any event, there is not enough evidence to suggest that the interaction term is needed; i.e.,that the way in which mean serum ferritin level at 3 months gestation depends on whethera woman has a history of anemia is the same regardless of whether she has been pregnantbefore or not.

(g) The typical rate of change among control women who have a history of anemia but havenever been pregnant (ai = 1 and pi = 0) is β11 + β1a1; that among such women receivingiron supplements is β12 + β1a2. Thus, the question is whether β11 + β1a1 = β12 + β1a2, orH0 : β11 + β1a1 − β12 − β1a2 = 0 vs. H1 : this is not true. The appropriate L is

L =(

0 0 0 0 1 −1 1 −1 0 0 0 0)

.

From the output, page 3, TL = 0.01 with a p-value 0.93. There is no evidence to suggest that,for women with no prior pregnancy but history of anemia, the mean rate of change of serumferritin during 3–8 months gestation is different depending on whether iron supplements weretaken.

4

Page 598: Applied Longitudinal Data Analysis:Lecture Notes

The estimate statements yield estimates of the mean rate of change for women with a historyof anemia who have never been pregnant of −0.44 (SE 0.72) for the control group and −0.36(SE 0.65) for the control group. From inspection of these results, one gets the impression(could be formally tested) that there is not enough evidence to suggest that either of theserates of change are different from 0.

(h) Here, we wish to estimate the following quantities:

(i) β0 + β12(5)

(ii) β0 + β0p + (β12 + β1p2)(5)

(iii) β0 + β0a + (β12 + β1a2)(5)

(iv) β0 + β0a + β0p + β0ap + (β12 + β1a2 + β1p2 + β1ap)(5)

From the estimate statement output on page 3, we obtain the following estimates (approxi-mate standard errors):

(i) 63.99 (3.41) ng/ml

(ii) 54.49 (3.00) ng/ml

(iii) 40.64 (3.17) ng/ml

(iv) 34.27 (5.23) ng/ml

2. (a) See the program.

(b) See the program.

(c) From the output, we have from the Solution for Fixed Effects table

β = (50.0667,−7.5933,−4.9582, 1.1573, 0.4055, 2.7785,−0.8513,−3.1465,

−3.4737,−0.9001, 0.1247, 0.3865)′.

From the Solution for Random Effects, we can find the approximate BLUPs, bi, say, forbi for each of our 4 women. These are

Woman b0i b1i

1 5.3034 −2.24076 7.0937 0.788151 2.8701 −0.3941100 0.8800 1.1542

We may thus obtain the approximate BLUPs for each of these women by using the expressionat the bottom of page 384 of the notes,

βi = Aiβ + bi,

where Ai contains the information on anemia and prior pregnancy for the ith woman. Forexample, for woman 1, who is in group 1 and has not had prior anemia and but has had aprior pregnancy,

Ai =

(1 0 1 0 0 0 0 0 0 0 0 00 0 0 0 1 0 0 0 1 0 0 0

),

5

Page 599: Applied Longitudinal Data Analysis:Lecture Notes

and we end up with

β0i = 50.0667− 4.9582 + 5.3034 = 50.4119, β1i = 0.4055− 3.4737− 2.2407 = −5.3089.

For all 4 women, we have

Woman β0i β1i

1 50.4119 −5.30896 45.7662 −3.006751 47.9786 1.4843100 43.3534 0.7862

(d) (i) Yes, the classical assumptions for ordinary least squares are that the data are normallydistributed, independent, and have constant variance. There are indeed the within-womanassumptions of the model in (b) and (d) of Problem 1. Thus, with these assumptions, it isjustifiable to use ordinary least squares to estimate the woman-specific intercepts and slopesbased on the data from each woman alone.

(ii) Women 1 and 100 have 4 serum ferritin observations, and woman 6 has 6 observations.However, woman 51 only has 2 observations. Although we can fit a line perfectly to 51’s data,this takes no account of the fact that there is within-woman variability in serum ferritin! Thefitted line will fit “perfectly” through the 2 points, not acknowledging this, so the result couldbe misleading; if the data had turned out differently, the line could be very different. Thus,this is not reliable at all. Only when we have at least 3 observations are we in a positionto begin to sort out the “signal” from the “noise;” that is, get a sense of the trend whileacknowledging variation. With 3 measurements, this won’t be very good, of course. With 4or 6 measurements, it might be better, but the fit still might not be that reliable.

(e) See the program. We calculated the least squares estimate for woman 51 even though itis unreliable, just to see how it turns out. Here are the least squares estimates for β0i and β1i

for each of the women from the output:

Woman β0i,OLS β1i,OLS

1 53.0231 −6.16926 46.9191 −3.234251 50.6333 0.6667100 42.2500 1.3000

These values are similar to those of the BLUPs. Notice that the OLS estimates of slope forwomen 1, 6, and 100 (for whom we can actually get credible estimates) are “more extreme”than those obtained from the BLUPs; e.g., for woman 1, the OLS estimate −6.1692 is “morenegative” than the BLUP of −5.3089. This probably reflects the fact that the BLUPs area “compromise” between the information on each individual woman (which is pretty scant)and that on the population; the woman-specific information is supplemented by that fromthe population to obtain the BLUPs, the so-called “borrowing strength” phenomenon. As isoften the case when the number of observations on a given woman is small, there is a tendencyfor the BLUPs to be “pulled toward” the population mean values, as the BLUP weights thisinformation more heavily when that on the individual is scant.

6

Page 600: Applied Longitudinal Data Analysis:Lecture Notes

(f) See the program. We are now assuming that

(i) For group 1β0i = β0 + β0aai + β0ppi + β0apaipi + b0i

β1i = β11 + β1a1ai + β1p1pi + β1ap1aipi

(ii) For group 2β0i = β0 + β0aai + β0ppi + β0apaipi + b0i

β1i = β12 + β1a2ai + β1p2pi + β1ap2aipi

There is no random effect corresponding to slope; thus, any variation in slope is attributable tothe fact that women may have had anemia or a prior pregnancy or both. This means that theβ1i could only take on one of 4 possible values in each group, depending on the combination ofanemia and prior pregnancy! This seems incredibly unrealistic; it is biologically implausiblethat all women who have the same combination of past history would have exactly the samerate of change of serum ferritin! So on these grounds alone we would probably prefer theoriginal model, which allows these rates of change to vary in the population of women with aparticular anemia-prior pregnancy combination, which seems much more consistent with whatwe would expect biologically. We can compare the models informally by looking at the AICand BIC values. For the original model, AIC = 3398.7, while for this model AIC = 3552.6;similarly, for the original and this model, BIC = 3440.4 and 3589.1, respectively. Thus, inboth cases, the information criterion prefers the original model that allows random variationin slopes. This further supports the case against the model here.

(g) As discussed in Section 10.6 of the notes, because of the “boundary” problem, it is notlegitimate to conduct a likelihood ratio test comparing the two models by just comparing theLRT statistic to the χ2

2 critical value for the test at the chosen level α. Accordingly, technicallyspeaking this would not be an appropriate way to address the investigator’s question. Wewould need to compare the LRT statistic to the critical value from a mixture of two χ2

distributions, as discussed on page 387. So one appropriate response is to do nothing – givenwhat we know about this problem and given that SAS does not provide the correct results,we could simply argue to the investigator that the “reduced model” is incredibly implausibleon biological grounds, so there is no need to conduct a formal test. Another appropriateresponse would be to follow the recommendation of Fitzmaurice et al. (2004) on page 387 ofthe notes, calculate the LRT statistic, and to conduct a test a level α = 0.05 compare to theχ2 critical value for a 0.1-level test. Here, we have TLRT = 3524.6 − 3366.7 = 157.9. Thistest statistic value is very large; compared to the ad hoc critical value of χ2

2,0.90 = 4.61, itwould lead to strong rejection of the null hypothesis that the “reduced model” is appropriate.Still another response would be to consult the table in Fitzmuarice et al. (2004) and get theappropriate critical value, which, according to page 387, is 5.14. One could then compare157.9 to 5.14 and claim the same result.

Alternatively, the test statistic is huge; thus, even without conducting any kind of formaltest, most statisticians would agree that there seems to be strong evidence against the nullhypothesis. That is, regardless of what the true sampling distribution of the LRT is, thistest statistic would surely exceed the appropriate critical value, because it is so big. So onemight tell the investigator that doing the usual LRT test is inappropriate, and instead theLRT statistic must be compared to an unusual “mixture” distribution;” however, because thetest statistic is so overwhelming, if one did this, one would surely reject the null hypothesis

7

Page 601: Applied Longitudinal Data Analysis:Lecture Notes

strongly. The only problem with this reasoning is that one could not rely on this sort ofstrategy in general – it only works when the test statistic is so large as it is here, which onewouldn’t know before calculating the statistic.

8

Page 602: Applied Longitudinal Data Analysis:Lecture Notes

.

ST 732, HOMEWORK 6, SPRING 2005

1. Recall the “wheezing data” of Example 5 in Chapter 1. Here, we consider a similar, butmuch larger set of data from a longitudinal study of 200 children and their mothers. In thisproblem, we focus on a cross-section of these longitudinal data at the single time point age10.

The data are in the file respiratory.dat on the class web page; each data record correspondsto a single child at age 10. The columns are (1) child id (1–200), (2) “wheezing” response(0=no wheezing, 1=wheezing), (3) city (0=Columbia, 1=Statesville), (4) maternal smokingstatus (0=none, 1=smoker). Note that, here, smoking status is just a binary variable (asopposed to categorical with 3 categories as in the data in the notes).

In parts (b)–(i) of this problem, you will build up a SAS program that does several differentthings through different calls to proc genmod. The purpose of the problem is to illustrateto you some of the features of proc genmod that we did not discuss in class. Turn in yourfinal program that carries out the required analyses and its output. Note: You should be usingversion 7 or higher of SAS. Remember that you need to use the descending option in yourmodel statements so that SAS fits the model for P (Yj = 1), as discussed in the class notes.

Consider first the following model: Let Yj be the wheezing response (0 or 1) for the jth child.Define the following “dummy” variables:

sj = 1 if mother is a smoker= 0 otherwise

cj = 1 if city = Statesville= 0 otherwise

Consider the following logistic regression model for E(Yj):

E(Yj) =exp(β0 + β1cj + β2sj + β3cjsj)

1 + exp(β0 + β1cj + β2sj + β3cjsj). (1)

(a) (i) Under model (1), write down an expression for the expected wheezing response for achild from Columbia whose mother smokes.

(ii) Under model (1) , write down an expression for the probability that a child from Statesvillewhose mother smokes does not exhibit wheezing at age 10.

(b) Let city and smoke be the names of the city and smoking indicator (dummy) variablesthat you read in from the data set (these have values 0 or 1 as indicated above). Use procgenmod to fit model (1) in (a) three ways:

(i) Declare city and smoke to be class variables. Does SAS parameterize the model thesame way we did in (1)? Possibly defining new dummy variables and parameters, write downthe model as it is parameterized by proc genmod here.

(ii) Do not declare city and smoke to be class variables. Does SAS parameterize the modelthe same way we did in (1)?

(iii) In a data step, define new variables cityrev=1-city and smokerev=1-smoke, where“rev” stands for “reverse meaning.” Fit the model using these variables, not defining themas class variables. Does SAS parameterize the model the same way we did in (1)?

1

Page 603: Applied Longitudinal Data Analysis:Lecture Notes

(c) Calculate by hand the estimate of the probability that a child from Columbia whosemother is a smoker is wheezing at age 10 from the output of each fit (i)–(iii) in (b). What doyou notice? Does it matter which way the model is parameterized?

(d) (i) Re-run your code for (b)(i), but add the options type3 and wald in the model state-ment. These options given together cause proc genmod to construct Wald test statistics forhypotheses of the form H0 : Lβ = 0 for some L, where β is the set of parameters in the model.These will appear in the table Wald Statistics For Type 3 Analysis in the output.

(ii) We will now see what these Wald tests are testing when the linear predictor contains aninteraction term, as in (1), by considering the result for the city effect.

Consider the model as parameterized in (1). Write down the linear predictor for each ofthe four possible combinations of values of cj and sj . Then write down the average of thevalues the linear predictor takes on when cj = 0, sj = 0 and cj = 0, sj = 1. Similarly, writedown the average of the values the linear predictor takes on when cj = 1, sj = 0 and whencj = 1, sj = 1. Each of these averages represents the value of the linear predictor for eachvalue of city, averaged across the two levels of smoking status.

Now form the difference of these two averages (do the algebra to simplify). This expression isthe difference in the average values of the linear predictor (averaged across levels of smokingstatus) for each level of city. I.e., we may think of this difference as the “main effect of city”for the linear predictor.

Finally, write this difference in the form Lβ. Re-run your code for (b)(ii), but add a contraststatement for testing H0 : Lβ = 0. Compare the output from this contrast to the resultsin your fit in (d)(i). What do you conclude that the “default” Wald statistics for city andsmoke are testing in fit (d)(i)?

Note: Please see the solutions to this homework assignment for discussion of the usefulnessof these hypotheses and tests for data like these.

(e) Is there evidence in the data to suggest that the way in which the probability of a childwheezing depends on city is different depending on mother’s smoking status? In any param-eterization of the model you choose, state the null hypothesis corresponding to this question.From any of the fits so far (state which one you choose), give the value of an appropriatetest statistic and p-value for addressing this hypothesis, and state the result as a meaningfulsentence.

(f) Consider the simpler model with no interaction term

E(Yj) =exp(β0 + β1cj + β2sj)

1 + exp(β0 + β1cj + β2sj)(2)

Fit model (2) using proc genmod two ways:

(i) Declare city and smoke to be class variables. Also include the options type3 and waldin the model statement. Does SAS parameterize the model the same way we did in (2)?

(ii) Use the variables city and smoke but do not declare these to be class variables. Alsoinclude the options type3 and wald in the model statement. Does SAS parameterize themodel the same way we did in (2)?

What do you notice about the numerical values of the estimates from these two fits?

(g) In terms of the parameterization in model (2), write down an appropriate matrix L for anull hypothesis of the form H0 : Lβ = 0, where β is the vector of parameters in the model,that addresses the following question: “Does smoking status of a mother make a difference

2

Page 604: Applied Longitudinal Data Analysis:Lecture Notes

in the probability of a child wheezing?” In the call to proc genmod in part (f)(ii), use acontrast statement to obtain the Wald test statistic for your hypothesis. Cite the value ofthe statistic and the associated p-value, and compare these to the values for smoke in thetable Wald Statistics For Type 3 Analysis in the output of the calls in (f)(i) and (ii).What do you notice?

(h) Another way to test hypotheses of the form H0 : Lβ = 0 is by the “full” versus “reduced”model principle; i.e. by using a likelihood ratio test. Recall that the method used to fitgeneralized linear models is a maximum likelihood method; thus, this principle is applicablehere. In your program, call proc genmod again to fit the model as in part (f)(i); however, thistime, include only the type3 option (leaving off the wald option). The result of this action isto ask proc genmod to compute the likelihood ratio test statistic corresponding to hypothesesof the form H0 : Lβ = 0 for each of the factors in the class statement automatically.

Compare the results of the likelihood ratio test of the issue in (g) to that obtained by Waldmethods in (g). Do the qualitative conclusions agree?

(i) Under model (2), write down the odds ratio comparing the odds of a child wheezing atage 10 if his/her mother smokes to the odds if his/her mother does not smoke. In your fitthe model in f(ii), include an estimate statement to obtain the estimated log odds ratio andthe estimated odds ratio (see page 457 of the notes). Based on the results, is there evidenceto suggest that maternal smoking has adverse effects on the respiratory health of children?

Note: In the output of the estimate statement, proc genmod presents a “Standard Error”and “Confidence Limits” for the odds ratio. Both are based on large-sample approximation.But because the odds ratio is not a linear function of elements of β, these quantities areobtained by further approximations based on the basic large-sample results for estimation ofβ described in the class notes. The confidence interval is not found taking the estimate andadding and subtracting 1.96 times the estimated standard error; rather, it uses an approxi-mation that is thought to be more accurate in finite samples. Thus, when making inferenceon the odds ratio, it is best to base it on this confidence interval. If the confidence intervaldoes not contain 1 and has lower limit greater than 1, most practitioners would interpret thisas approximate evidence suggesting that the odds ratio is greater than 1 (with “confidence”equalling the confidence level of the interval); if the upper limit is less than 1, this wouldmean evidence that the odds ratio is less than 1.

2. Recall the epileptic seizure data discussed in Example 4 of Chapter 1 of the class notes.The data are from a clinical trial conducted on 59 subjects suffering from seizures who wererandomized to receive a placebo (subjects 1–28) or the anti-seizure agent progabide (subjects29–59). The numbers of seizures experienced by each subject was recorded during an 8-weekbaseline (pre-treatment) period and then during each of four post-treatment, consecutive 2-week periods. Here, we will focus on the cross-section of these data corresponding to thefourth and final 2-week period. The data are on the class web page in the file seize4.dat,with columns (1) subject id, (2) number of seizures during fourth 2-week period, and (3)treatment indicator (0 = placebo, 1 = progabide).

The goal of an analysis is to compare the two groups (placebo and progabide) in regard tothe number of seizures experienced in the fourth 2-week period of the study.

(a) Let pj = 0 if subject j received placebo and 1 if progabide. Consider the model for meannumber of seizures given as

E(Yj) = exp(β0 + β1pj). (3)

3

Page 605: Applied Longitudinal Data Analysis:Lecture Notes

Fit this model parameterized exactly as in (3) (so regarding the treatment variable as numericrather than as a classification variable) using proc genmod, assuming that the seizure countsfollow a Poisson distribution. Based on the results, is there sufficient evidence to support thecontention that the mean number of seizures during the fourth 2-week period is associatedwith whether placebo or progabide is administered? Give an appropriate test statistic basedon your fit and the associated p-value.

(b) Model (3) gives the form of the expected count or number of events (seizures) in this caseover a 2-week period. Thus, note that the expected rate of seizures per week under treatmentpj is

E(Yj)/2 = exp(β0 + β1pj)/2.

The rate ratio (for progabide relative to placebo) is thus given by the ratio of E(Yj)/2 forpj = 1 to E(Yj)/2 for pj = 0; i.e.,

exp(β0 + β1)/2exp(β0)/2

= exp(β1).

Thus, exp(β1) has interpretation as the rate ratio for progabide relative to placebo (and henceβ1 has interpretation as the log rate ratio). A rate ratio less than 1 means that progabide iseffective at reducing the seizure rate relative to placebo.

It is possible to use an estimate statement with the exp option exactly as was done in Problem1(i) to get proc genmod to output the estimated rate ratio, an approximate standard error,and a confidence interval for the true rate ratio. Add this to your call to proc genmod in (a).Based on the results, does the evidence suggest that the seizure rate is lower on progabidethan on placebo?

Note: The rate ratio and the odds ratio in a logistic regression model as in Problem 1 turnout to be of the same form. Thus, all of the comments regarding approximate inference onodds ratios in the note in Problem 1(i) apply similarly to approximate inference on a rateratio here.

4

Page 606: Applied Longitudinal Data Analysis:Lecture Notes

.

ST 732, HOMEWORK 6, SOLUTIONS, SPRING 2005

1. (a) (i) For such a child, cj = 0, sj = 1. The expected wheezing response E(Yj) for such achild (which is the same as the probability that the child wheezes under these conditions,P (Yj = 1)), is

eβ0+β2

1 + eβ0+β2

.

(ii) For such a child, cj = 1, sj = 1. The probability of interest is P (Yj = 0) = 1 − P (Yj =1) − 1 − E(Yj), which under these conditions is

1 − exp(β0 + β1 + β2 + β3)

1 + exp(β0 + β1 + β2 + β3)=

1

1 + exp(β0 + β1 + β2 + β3).

(b) See the program and its output. We see that fits (i) and (iii) are parameterized identically,but in a way different from (ii), which is parameterized exactly as in model (1). For the fitsin (i) and (iii), the model is parameterized instead as follows: letting c∗j = 1 for Columbiaand 0 for Statesville (so c∗j = 1 − cj) and similarly s∗j = 0 for smokers and 1 for non-smokers(so s∗j = 1 − sj), the model may be written in the alternative form

E(Yj) =exp(β∗

0 + β∗

1c∗j + β∗

2s∗j + β∗

3c∗js∗

j )

1 + exp(β∗

0 + β∗

1c∗j + β∗

2s∗j + β∗

3c∗js∗

j ).

(c) From the fits in (i) and (iii), this corresponds to c∗j = 1 and s∗j = 0. From the output, weget the probability to be

exp(−1.0776 + 1.2599)

1 + exp(−1.0776 + 1.2599)= 0.54.

For the fit in (ii), this corresponds to cj = 0, sj = 1, and we get the probability to be

exp(−0.3054 + 0.4877)

1 + exp(−0.3054 + 0.4877)= 0.54.

We thus get the same estimate of the desired probability! Of course, this is entirely expected;the way of writing the model above, in terms of the “reverse” dummy variables, and the wayin (1) are just two equivalent ways of representing the same relationship.

(d)(i) See the program and output.

(ii) The values of the linear predictor in model (1) are as follows:

cj = 0, sj = 0 β0

cj = 0, sj = 1 β0 + β2

cj = 1, sj = 0 β0 + β1

cj = 1, sj = 1 β0 + β1 + β2 + β3

1

Page 607: Applied Longitudinal Data Analysis:Lecture Notes

The average of these for when cj = 0 is

β0 + β0 + β2

2= β0 + β2/2.

The average for cj = 1 is

β0 + β1 + β0 + β1 + β2 + β3

2= β0 + β1 + β2/2 + β3/2.

The difference (cj = 1 − cj = 0) is thus given by

β1 + β3/2.

This may be written in the form Lβ by choosing

L = (0, 1, 0, 1/2).

See the program for the contrast statement corresponding to this L. The test statisticand p-value for city main eff are 0.92 and 0.34. From the Wald Statistics For Type 3

Analysis in the output in (i) above, we see that the test statistic and p-value correspondingto city are identical.

Thus, we see that these “default” tests printed out when the dummy variables are declared tobe class variables are tests of “interaction” and “main effects” for each factor. However, it isnot clear what these mean, really. In particular, the “main effects” correspond to functions ofthe linear predictor, not to functions of the probabilities that are really the focus of interest.That is, if we wanted something like a “main effect” of city corresponding to the probabilitiesthemselves, we really should be considering the difference in the averages of the expressionsfor E(Yj) instead! That is, if p00, p10, p01, and p11 correspond to E(Yj) for each combinationof city-smoking status, then we’d want to look at (p00+p01)/2−(p10+p11)/2. This, of course,is a horrible expression of the elements of β that is not linear, and hence cannot be expressedin the form Lβ. The result is that it is not really clear whether these “main effect” testscorrespond to anything of real scientific interest.

(e) The question is whether the interaction term is necessary. In terms of model (1), then,we have H0 : β3 = 0. From any of the previous fits, we see that the Wald test statisticcorresponding to the null hypothesis that the interaction term in the model is equal to 0 isequal to 0.36 with a p-value of 0.55. Thus, there is not sufficient evidence in these data tosuggest that the way in which the probability of wheezing depends on a mother’s smokingstatus is different for the two cities.

(f) (i) From the fit of (2) with city and smoke as class variables, we see that the effect of theclass statement is again to “reverse” the meanings of 0 and 1, as in the more complicatedmodel (1). Thus, it does not parameterize the model the same way as in (2), but rather itdoes it as given in (b), with β∗

3 = 0. See the program/output for the fit of (ii); here, the modelis parameterized as in (2).

The numerical values of the estimates corresponding to city and smoke in each fit are thenegatives of one another. The intercept is different. This can be explained by simply consid-ering the two parameterizations. If we instead define c∗j = 1 − cj and s∗j = 1 − sj as in (b),then the fit (i) is using the parameterization

E(Yj) =exp(β∗

0 + β∗

1c∗j + β∗

2s∗j )

1 + exp(β∗

0 + β∗

1c∗j + β∗

2s∗j )

2

Page 608: Applied Longitudinal Data Analysis:Lecture Notes

compared to that for (ii)

E(yj) =exp(β0 + β1cj + β2sj)

1 + exp(β0 + β1cj + β2sj).

If we re-write the first parameterization in terms of cj and sj , we get after some algebra

E(Yj) =exp{(β∗

0 + β∗

1 + β∗

2) − β∗

1cj − β∗

2sj}1 + exp{(β∗

0 + β∗

1 + β∗

2) − β∗

1cj − β∗

2sj}.

Thus, the first parameterization, when written in terms of cj and sj , has linear predictor with“intercept” (β∗

0 + β∗

1 + β∗

2) and coefficients of cj and sj equal to −β∗

1 and −β∗

2 , respectively.Now from the output of (i), (β∗

0 + β∗

1 + β∗

2) = −0.1875 + 0.2823 − 1.0936 = −0.9988, whichis, of course, the “intercept” estimate in (ii). Similarly, −β∗

1 = −0.2833 and −β∗

2 = 1.0936.Thus, we see explicitly that the two parameterizations really are saying exactly the samething, and that the numerical values are exactly as expected.

(g) Here, H0 : β2 = 0, which may be written as H0 : Lβ = 0 with L = (0, 0, 1). Fromthe output of the contrast statement, we obtain the test statistic and p-value 12.39 andvirtually 0. Note that this is the same from the table of Wald Statistics for the fit in f(i), asexpected. We also obtain this result directly from the Analysis of Parameter Estimates.There seems to be strong evidence that the probability of wheezing depends on smoking.

(h) See the program/output. Here, the likelihood ratio test statistic and p-value correspondingto to the hypotheses in (g) is 12.67 with a p-value of virtually 0. Both the numerical valuesand p-values are very close to those obtained via Wald methods. This is not really surprising.With a sample size of n = 200 children, we would hope that the large sample approximationsbeing used by both the Wald and likelihood methods are good and thus would be expectedto yield the same conclusions.

(i) The odds ratio for smoking is exp(β2) in model (2). In the program (fit of f(ii)), we includean estimate statement using the exp option as described on page 457 of the class notes. Thisyields an estimated odds ratio of 2.99, with approximate standard error 0.93 and confidenceinterval for the true odds ratio of 1.62 to 5.49. Following the note for this part of the problem,we examine the confidence interval. The lower limit is well above 1, suggesting that there isevidence at this confidence level that the odds ratio is different from 1. It seems safe to inferthat a mother smoking increases the odds that her 10 year old child will exhibit wheezing(relative to not smoking).

2. (a) See the program and output. In the context of model (3), we would like to test H0 : β2 = 0vs. the alternative H1 : β2 6= 0. From the output for the first call to genmod, the Wald teststatistic may be read immediately from the Analysis of Parameter Estimates table andis equal to 3.16, with a p-value of about 0.08. At level of significance 0.05, we do not haveenough evidence to infer that mean seizure count is associated with whether progabide orplacebo is administered. Note, however, that the p-value is “close” to the chosen significancelevel so seems “borderline” or “suggestive.” Moreover, the estimate of β2 is negative, whichwould imply a reduction in mean number of seizures on progabide relative to placebo. Soalthough we can’t reject H0, everything else seems to be “trying” to tell a story leaning towardprogabide, but just doesn’t quite make it.

(b) See the program and output. From the output of the estimate statement, the estimatedrate ratio is 0.84, which favors progabide, and the approximate confidence interval has limits

3

Page 609: Applied Longitudinal Data Analysis:Lecture Notes

(0.70,1.02). This interval contains 1, so the inference is that, at this level of confidence,we can’t infer that the rate of seizures is lower for progabide. The estimate is in the “right”direction, but there is too much uncertainty, as reflected by the confidence interval, to suggestan advantage of progabide.

4

Page 610: Applied Longitudinal Data Analysis:Lecture Notes

.

ST 732, HOMEWORK 7, SPRING 2005

1. A study of treatments for leprosy was conducted at the Eversley Childs Sanitorium in thePhillipines. 30 patients with leprosy at the Sanitorium were randomized to receive either oftwo antibiotics (denoted treatment drugs A and B) or to a placebo (denoted treatment drugC). At baseline (time 0), prior to initiation of the assigned drugs, the total number of leprosybacilli at six sites of the body where the bacilli tend to congregate were recorded for eachpatient. After 1 month of treatment, the number of leprosy bacilli at the same six sites wasrecorded again.

The main objective of the study was to determine whether treatment with antibiotics (drugsA and B) reduces the abundance of leprosy bacilli at these six sites in the body relative toplacebo (drug C).

The data are in the file leprosy.dat on the class web page. The columns are (1) subjectid; (2) drug (A,B,C); (3) time (months); (4) number of bacilli (at all six sites); (5) indicatorvariable = 1 if drug = A, = 0 otherwise; (6) indicator variable = 1 if drug = B, = 0 otherwise.

(a) As a preliminary step, use proc means (or other approach of your choice) to calculatethe sample mean number of leprosy bacilli in each drug treatment group at baseline and thenafter one month on assigned treatment. Does this raw sample evidence seem to suggest thatthe antibiotics reduce the number of bacilli after 1 month?

(b) Let Yij denote the number of leprosy bacilli observed for subject i at time tij , j = 1, 2,where ti1 = 0 and ti2 = 1 for all subjects. Letting ai = 1 if subject i was assigned to antibioticA and = 0 otherwise, and bi = 1 if subject i was assigned to antibiotic B and = 0 otherwise,write down an appropriate model for mean number of bacilli at time tij in terms of ai and bi

that has the following features:

(i) The mean number of bacilli at time 0 is the same in all three treatment groups (becausethe study is randomized);

(ii) After 1 month, the mean number of bacilli is potentially different in each treatmentgroup;

(iii) Estimates of the mean number of bacilli in any group at any time can never be negative.

Write down the vector of parameters, β, that describes your mean model.

(c) Fit your model in (b) using proc genmod.,allowing for the possibility that the observationsYi1 and Yi2 on the same subject are correlated in the same way regardless of treatment groupand that the observed values of numbers of bacilli may be subject to overdispersion. Haveyour program print out the estimated correlation matrix of (Y1i, Y2i)′. Also have your programcalculate standard errors using the model-based estimate of the covariance matrix of theestimator for β.

(d) From the results, informally, does there seem to be evidence of overdispersion? Alsoinformally, does it seem necessary to take into account correlation among the pre- and post-treatment observed numbers of bacilli? Explain your answers.

(e) The first question of interest to the investigators was whether one or both of the antibiotics(drugs A and B) leads to a different mean number of bacilli at 1 month than placebo (drugC). Write down a null hypothesis that addresses this issue, and then express it in the formLβ = 0, giving the form of L. Have your call to proc genmod provide an appropriate test

1

Page 611: Applied Longitudinal Data Analysis:Lecture Notes

statistic and p-value (you may do this however you like). Give the test statistic and p-value,and state what you conclude.

(f) The next question of interest was whether in fact the mean number of bacilli at 1 monthis the same for both antibiotics (drugs A and B). Write down a null hypothesis that addressesthis issue, and then express it in the form Lβ = 0, giving the form of L. Have your call toproc genmod provide an appropriate test statistic and p-value (you may do this however youlike). Give the test statistic and p-value, and state what you conclude.

(g) Now write down a new model in which only two groups are considered: antibiotic (drugsA and B) or placebo (drug C). In particular, define di = 1 if subject i received either drugA or B and = 0 otherwise, and write down a model for mean number of bacilli at time tij interms of di that has the following features:

(i) The mean number of bacilli at time 0 is the same in both groups (because the study israndomized);

(ii) After 1 month, the mean number of bacilli is potentially different for the antibiotic andplacebo groups;

(iii) Estimates of the mean number of bacilli in either group at any time can never be negative.

Fit your model using proc genmod.

(h) Use an estimate statement with the exp option to obtain an estimate of and confidenceinterval for the multiplicative change in mean number of bacilli at month 1 if antibiotic isused relative to placebo (i.e. the rate ratio for for antibiotic relative to placebo). Does thesample evidence suggest that antibiotics are effective at reducing the mean number of leprosybacilli after 1 month? Explain.

2. A clinical trial was conducted to study the effectiveness of a treatment patients with respi-ratory illness. m = 111 patients were recruited and randomized to receive either an activetreatment (coded as A) or a placebo (coded as P). At baseline (week 0), prior to administra-tion of the assigned interventions, each subject’s respiratory status was classified as “poor”(coded as 0) or “good” (coded as 1). Subjects returned to the clinic at the end of each ofthe next 4 weeks (coded as week = 1, 2, 3, 4), at which their respiratory status was againevaluated (recorded as 0, poor, or 1, good). Also recorded for each subject was his or her ageat baseline and gender.

The main objective of the study was to determine whether subjects receiving the active treat-ment show signs of improvement under treatment with the active agent. The investigatorswere also interested in whether the extent of improvement depended on age or gender of asubject.

The data are in the file respstatus.dat on the class web page. The columns are (1) subjectid; (2) drug (A,P); (3) gender (0 = female, 1 = male); (4) age at baseline (years); (5) week;(6) respiratory status (0 = poor, 1 = good).

(a) As a preliminary step, use proc means (or other approach of your choice) to find thesample proportion of subjects with “good” respiratory status in each group at each week(recall that the mean of a binary random variable is the probability the variable takes onthe value 1). Does this raw sample evidence seem to suggest an increase in the proportion ofsubjects with “good” respiratory status under active treatment relative to placebo?

(b) Let Yij be the respiratory status for patient i at time tij , where tij = 0, 1, 2, 3, 4 weeksfor all subjects. Let δi = 0 if patient i was assigned to placebo and 1 if assigned to active

2

Page 612: Applied Longitudinal Data Analysis:Lecture Notes

treatment. Let wij = 0 if tij = 0 and wij = 1 if tij > 0. Consider the following model for theprobability that a subject has good respiratory status at time j:

E(Yij) = P (Yij = 1) =exp(β0 + β1wij + β2wijδi)

1 + exp(β0 + β1wij + β2wijδi), (1)

Explain what model (1) assumes about the probability of good respiratory status over thecourse of the study in each group. In light of the sample evidence in (a), does the modelmake sense? Explain.

(c) Fit model (1) using proc genmod under the working assumption that pairs of respiratorystatus observations on the same subject exhibit the same overall correlation regardless of howclose or far in time they are from one another. (You will have to define a new variable forwij in your program.)

(d) Is there evidence to suggest that, after week 0, undergoing treatment results in a changein the log odds of having good respiratory status relative to that for placebo? Express thisquestion as a null hypothesis in terms of model (1), and obtain the relevant test statisticand p-value using proc genmod, allowing the possibility that the working assumption oncorrelation in (c) may be incorrect. What do you conclude?

(e) Using an estimate statement, obtain an estimate of the odds ratio comparing the oddsthat a patient receiving active treatment will have good respiratory status after week 1 to theodds of having good respiratory status after week 1 if s/he were to take placebo instead, andobtain a confidence interval for the odds ratio. Is there evidence to suggest that the activetreatment has a positive effect on respiratory status?

(f) The investigators were also interested in whether the probability of having good respiratorystatus post-baseline is associated with whether a patient is male or female. Defining gi = 0 ifsubject i is female and gi = 1 if i is male, they considered the following model:

E(Yij) = P (Yij = 1) =exp(β0 + β1wij + β2wijgi + β3wijδi + β4wijδigi)

1 + exp(β0 + β1wij + β2wijgi + β3wijδi + β4wijδigi)(2)

Fit this model using proc genmod under the same working assumption on correlation as in(d), parameterizing the model exactly as it appears above, treating the treatment indicatorand gender indicator as numeric.

(g) Under model (2), write down the log odds of good respiratory status after week 0 for afemale who received active treatment and for a male who received active treatment. Use acontrast statement to obtain a test of whether the log odds is different for males and females.Based on the fit, is there evidence to suggest that the log odds is different for males andfemales, so that gender seems to matter in the effectiveness of treatment?

3

Page 613: Applied Longitudinal Data Analysis:Lecture Notes

.

ST 732, HOMEWORK 7, SOLUTIONS, SPRING 2005

1. (a) See the attached program; we used proc means. Here are sample means (standard devi-ations) of number of bacilli:

Drug Time 0 Time 1(Baseline) (1 month)

A 9.3 5.3(4.8) (4.6)

B 10.0 6.1(5.2) (6.1)

C 12.9 12.3(4.0) (7.1)

For Drugs A and B, the sample means appear to decrease from baseline to 1 month, whereasin the placebo group (drug C), the sample means at each of the times are pretty much thesame. Thus, from just informal inspection of these means, there is a suggestion that the twoantibiotics do have an effect reducing the number of bacilli. Interestingly, the placebo grouphas sample mean number of bacilli at baseline that is highest of the three groups by whatappears to be a considerable amount. This, of course, could be just by chance; with only 10subjects in each group, one “unusual” subject would be enough to lead to such sample meanbehavior. There is no reason to suspect that the randomization was carried out incorrectly,so in all likelihood this feature is just a result of chance.

(b) An appropriate model, given that the response is in the form of a count, is the loglinearmodel

E(Yij) = exp(β0 + β1tij + β2tijai + β3tijbi).

The model says that the mean number of bacilli is exp(β0) for all of drugs A, B, and Cat baseline (tij = 0). At month 1 (post-treatment, tij = 1), the model says that the meannumber of bacilli for drugs A, B, and C is exp(β0+β1+β2), exp(β0+β1+β3), and exp(β0+β1),respectively. Here, the vector of parameters β = (β0, β1, β2, β3)

′.

The model as given above uses a “difference parameterization” in the sense that that exp(β0+β1) is the mean at 1 month for placebo (drug C) and exp(β2) is the multiplicative amountby which the mean changes on drug A (and similarly for exp(β3) and drug B) relative to themean on placebo. Alternatively, we could parameterize the model another way by definingci = 1 if drug C, = 0 otherwise, and then writing the linear predictor as

β0 + β4aitij + β5bitij + β6citij .

With this parameterization, the mean is still exp(β0) at baseline for all groups, but at 1 monththe means are now exp(β0 + β4), exp(β0 + β5), and exp(β0 + β6) for groups A, B, and C,respectively. In this case, exp(βk), k = 4, 5, 6, represents the multiplicative amount by whichthe mean changes from baseline under each of the drugs A,B,C.

For the rest of the problem and in the program, we use the first model (“difference” param-eterization).

1

Page 614: Applied Longitudinal Data Analysis:Lecture Notes

(c) Because ni = 2 for all subjects, there is only one possibility for a working correlationmatrix; namely, of the form (

1 ρρ 1

),

where ρ is a correlation. We can get proc genmod to create such a working correlation matrixby almost any type= declaration. In the program, we demonstrate that using either type=unor type=cs of necessity results in the exact same analysis. We also show fitting of the modelusing both the indicator variables ai and bi in the data set, treating these as numeric, andallowing SAS to create the indicators itself by using a class statement with the variable drugdeclared.

See the program.

(d) From the output of the fit, the scale parameter is estimated to be φ = (1.8578)2 = 3.45.This seems to be nontrivially different from 1, which is the value we would expect if therewere no overdispersion. It is probably the case that inter-subject heterogeneity represents anonnegligible component of the overall variation, so that overall variability is greater thanthat expected due to intra-subject Poisson variation in the response alone.

From the output of the corrw option, we also see that the estimate of the correlation (ρabove) is about 0.80. Informally, this suggests that there is considerable correlation amongthe baseline and 1-month responses. It seems that it is wise to take possible such correlationinto account.

(e) The null hypothesis is H0 : β2 = β3 = 0. Thus, with the definition of β in (b), theappropriate L is

L =

(0 0 1 00 0 0 1

).

We can easily construct an appropriate contrast statement; see the program. In the fit of themodel using the indicator variables as given (so treated as numeric, not class variables), weuse a contrast statement to obtain the results.

(Alternatively, one can fit the model with drug as a class variable, we use the insightsgained in Homework 6, Problem 1 to realize that including the wald and type3 options willproduce this test automatically. We can note that genmod initially over-parameterizes themodel (and then decides on a reference); as with proc glm, the contrast statement in thiscase is constructed as if the over-parameterized model holds; see the program.)

In any case, the test statistic is 6.99 with a p-value of 0.03. There appears to be evidence(at level of significance 0.05) to suggest that at least one of the antibiotics changes the meannumber of bacilli relative to placebo after one month treatment.

(f) The mean at 1 month will be the same for Drugs A and B (the two antibiotics) if β2 = β3.We thus wish to test the null hypothesis is now H0 : β2 = β3, for which L = (0, 0, 1,−1).See the program: We use a contrast statement in both types of fits to get the Wald teststatistic and p-value. The test statistic is 0.08, with a p-value of 0.78. There seems to be noevidence to support the contention that the two antibiotics lead to different mean numbers ofbacilli at 1 month (and hence to different multiplicative changes in mean relative to placebo)at 1 month. A pragmatic data analyst would conclude that it may be more parsimonious toconsider a mean model that does not distinguish between the two antibiotics, assuming thatthey have similar effects after 1 month. This is exactly the situation in the next part of theproblem.

2

Page 615: Applied Longitudinal Data Analysis:Lecture Notes

(g) The new model isE(Yij) = exp(β0 + β1tij + β2tijdi),

where now exp(β2) represents the multiplicative change at 1 month between the mean numberof bacilli for placebo and that for either antibiotic (which is assumed the same for both Aand B).

See the program. We defined in the initial data step a new variable anti, which takes onthe value 1 if the subject was assigned to either drug A or B and 0 otherwise. The model isfitted by treating anti as a numeric variable. Note that the estimates of the scale parameterand correlation are similar to those in the “full” model above.

(h) See the program. The estimated rate ratio (multiplicative change) is 0.60, which is lessthan 1. The associated 95% confidence interval for the true value of rate ratio is (0.41,0.88),which does not include 1. The sample evidence seems to suggest rather strongly that an-tibiotics are effective relative to placebo at reducing the mean number of bacilli in thesepatients.

2. (a) (a) See the attached program; we used proc means. Here are sample proportions havinggood respiratory status at each time:

Drug week 0 week 1 week 2 week 3 week 4

Active 0.44 0.69 0.70 0.72 0.61Placebo 0.46 0.49 0.39 0.46 0.44

In the placebo group, the sample proportion stays relatively constant. In contrast, in theactive treatment group, the sample proportion, which at baseline is pretty much the same asthat for the placebo group, jumps up after 1 week and then stays “high” for the rest of thestudy (although it seems to drop off at week 4). These raw results seem to indicate a positiveeffect of the active treatment over the study period, while the placebo appears to do nothing.

(b) For the placebo group, the model assumes that the probability of good respiratory statusis eβ0/(1+eβ0) at baseline and then might change to be eβ0+β1/(1+eβ0+β1) for all subsequentweeks. For the treatment group, the model again assumes that the probability is eβ0/(1+eβ0)at baseline (same as for placebo based on the randomization) and then might change to beeβ0+β1+β2/(1 + eβ0+β1+β2) for all subsequent weeks. Thus, β2 represents the change in logodds between using active treatment and placebo after week 0.

The evidence in (a) seems to suggest that, after week 0, the probability stays constant ineach group (so it does not seem to change over time after week 0). In the placebo group,the parameter β1 allows for the possibility that the probability changes from week 0 to afterweek 0; the sample evidence in fact seems to suggest that the probability does not seemto change at all over the whole study period, so we might in fact expect β1 = 0. In thetreatment group, there seems to be an immediate rise in probability after baseline, and thenthe probability stays relative constant over the remainder of the period (with a slight dropat week 4, although we don’t know if this is “real” or not, and the model does not allow it).In the model, β1 + β2 > 0 allows the probability to change between week 0 and after week 0,where β2 is the additional amount by which it might change under active treatment relativeto placebo. If β1 = 0 but β2 > 0, then the model would allow the probability to go up in theactive treatment group after week 0.

Overall, the model seems to be able to represent the kind of behavior observed.

3

Page 616: Applied Longitudinal Data Analysis:Lecture Notes

(c) See the program. The working correlation model being described is compound symmetry,so we fit using the compound symmetry working model. We do not ask for model-basedstandard errors; SAS will use the robust standard errors by default. Given we are not sureabout the compound symmetry assumption, we will want to use robust standard errors in allinferences.

(d) The null hypothesis is H0 : β2 = 0; that is, we are interested in whether, after treatment(so subsequent to week 0), the probability of good status is different for the treated than forthose who received placebo. From the output, the Wald test statistic is 3.842 ≈ 14.76, whichhas an associated p-value of 0.0001. There seems to be strong evidence that the probabilityof having good status is different if treatment was received. The estimate of β2 is positive,suggesting that in fact the probability goes up.

(e) The odds that a patient will have good status at any time after starting treatment accord-ing to the model is exp(β0 + β1 + β2) while the odds that a placebo patient will have goodstatus at any time after baseline is exp(β0 + β1). Thus, the odds ratio of interest is exp(β2).From the estimate statement (see the program), the estimated odds ratio is 2.74 with a 95%confidence interval of (1.64,4.58). There seems to be pretty compelling evidence to suggestthat the treatment is effective, increasing the odds of good respiratory status.

(f) Under model (2), the log odds for a female on treatment after week 0 is β0 +β1 +β3, whilethat for a male is β0 + β1 + β2 + β3 + β4. Thus, the difference is β2 + β4. See the program forthe contrast statement. The test statistic is 1.80 with an associated p-value of 0.18. Theredoes not seem to be evidence to suggest that the log odds of a good response under treatmentis associated with the gender of a subject.

4

Page 617: Applied Longitudinal Data Analysis:Lecture Notes

REFERENCES ST 732, M. DAVIDIAN

14 References

Full citations for all books, monographs, and journal articles referenced in the notes are given here.

Also included are references to texts from which material in the notes was adapted. The books and

monographs cited are all useful resources for learning about futher developments in the analysis of

repeated measurement data.

Crowder, M.J. and Hand, D.J. (1990) Analysis of Repeated Measures. London: Chapman and

Hall/CRC Press.

Davidian, M. and Giltinan, D.M. (1995) Nonlinear Models for Repeated Measurement Data. London:

Chapman and Hall/CRC Press.

Diggle, P.J., Heagerty, P., Liang, K.-Y., and Zeger, S.L. (2002) Analysis of Longitudinal Data, 2nd

edition. New York: Oxford University Press.

Fitzmaurice, G.M., Laird, N.M., and Ware, J.H. (2004) Applied Longitudinal Analysis. New York:

Wiley.

Gumpertz, M. and Pantula, S.G. (1989) A simple approach to inference in random coefficient models.

The American Statistician 43, 203-210.

Hand, D.J., Daly, F., Lunn, A.D., McConway, K.J., and Ostrowski, E. (1994) A Handbook of Small

Data Sets. London: Chapman and Hall/CRC Press.

Johnson, R.A. and Wichern, D.W. (2002) Applied Multivariate Statistical Analysis, Fifth Edition.

Englewood Cliffs, New Jersey: Prentice Hall.

Laird, N.M. and Ware, J.H. (1982) Random effects models for longitudinal data. Biometrics 38,

963–974.

Lindsey, J.K. (1993) Models for Repeated Measurements. New York: Oxford University Press.

Lipsitz, S.R., Laird, N.M., and Harrington, D.P. (1992) A three-stage estimator for studies with

repeated and possibly missing binary outcomes. Applied Statistics 41, 203–213.

Littell, R.C., Milliken, G.A., Stroup, W.W., and Wolfinger, R.D. (1996) SAS System for Mixed Models,

Cary NC: SAS Institute, Inc.

Little, R.J.A. and Rubin, D.B. (2002) Statistical Analysis with Missing Data, 2nd edition. New York:

Wiley.

527

Page 618: Applied Longitudinal Data Analysis:Lecture Notes

REFERENCES ST 732, M. DAVIDIAN

Longford, N.T. (1993) Random Coefficient Models. New York: Oxford University Press.

McCullagh, P. and Nelder, J.A. (1989) Generalized Linear Models, 2nd edition. London: Chapman

and Hall/CRC Press.

Pepe, M.S. and Anderson, G. L. (1994) A cautionary note on inference in marginal regression models

with longitudinal data and general correlated response data. Communications in Statistics –

Simulation and Computation 24, 939–951.

Potthoff, R.F. and Roy, S.N. (1964) A generalized multivariate analysis of variance model useful

especially for growth curve problems. Biometrika 51, 313–326.

Robins, J.M., Greenland, S., and Hu, F.-C. (1999) Estimation of the causal effect of a time-varying

exposure on the marginal mean of a repeated binary outcome. Journal of the American Statistical

Association 94, 687–712.

Rowell, J.G. and Walters, D.E. (1976) Analyzing data with repeated observations on each experimental

unit. Journal of Agricultural Science 87, 423–432.

Steel, R.D.G., Torrie, J.H., and Dickey, D.A. (1997) Principles and Procedures of Statistics: A Bio-

metrical Approach, 3rd Ed. New York: McGraw-Hill.

Thall, P.F. and Vail, S.C. (1990) Some covariance models for longitudinal count data with overdisper-

sion. Biometrics 46, 657–671.

Vonesh, E.F. and Chinchilli, V.M. (1997) Linear and Nonlinear Models for the Analysis of Repeated

Measurements. New York: Marcel Dekker.

528

Page 619: Applied Longitudinal Data Analysis:Lecture Notes

REFERENCES ST 732, M. DAVIDIAN

14 References

Full citations for all books, monographs, and journal articles referenced in the notes are given here.

Also included are references to texts from which material in the notes was adapted. The books and

monographs cited are all useful resources for learning about futher developments in the analysis of

repeated measurement data.

Crowder, M.J. and Hand, D.J. (1990) Analysis of Repeated Measures. London: Chapman and

Hall/CRC Press.

Davidian, M. and Giltinan, D.M. (1995) Nonlinear Models for Repeated Measurement Data. London:

Chapman and Hall/CRC Press.

Diggle, P.J., Heagerty, P., Liang, K.-Y., and Zeger, S.L. (2002) Analysis of Longitudinal Data, 2nd

edition. New York: Oxford University Press.

Fitzmaurice, G.M., Laird, N.M., and Ware, J.H. (2004) Applied Longitudinal Analysis. New York:

Wiley.

Gumpertz, M. and Pantula, S.G. (1989) A simple approach to inference in random coefficient models.

The American Statistician 43, 203-210.

Hand, D.J., Daly, F., Lunn, A.D., McConway, K.J., and Ostrowski, E. (1994) A Handbook of Small

Data Sets. London: Chapman and Hall/CRC Press.

Johnson, R.A. and Wichern, D.W. (2002) Applied Multivariate Statistical Analysis, Fifth Edition.

Englewood Cliffs, New Jersey: Prentice Hall.

Laird, N.M. and Ware, J.H. (1982) Random effects models for longitudinal data. Biometrics 38,

963–974.

Lindsey, J.K. (1993) Models for Repeated Measurements. New York: Oxford University Press.

Lipsitz, S.R., Laird, N.M., and Harrington, D.P. (1992) A three-stage estimator for studies with

repeated and possibly missing binary outcomes. Applied Statistics 41, 203–213.

Littell, R.C., Milliken, G.A., Stroup, W.W., and Wolfinger, R.D. (1996) SAS System for Mixed Models,

Cary NC: SAS Institute, Inc.

Little, R.J.A. and Rubin, D.B. (2002) Statistical Analysis with Missing Data, 2nd edition. New York:

Wiley.

527

Page 620: Applied Longitudinal Data Analysis:Lecture Notes

REFERENCES ST 732, M. DAVIDIAN

Longford, N.T. (1993) Random Coefficient Models. New York: Oxford University Press.

McCullagh, P. and Nelder, J.A. (1989) Generalized Linear Models, 2nd edition. London: Chapman

and Hall/CRC Press.

Pepe, M.S. and Anderson, G. L. (1994) A cautionary note on inference in marginal regression models

with longitudinal data and general correlated response data. Communications in Statistics –

Simulation and Computation 24, 939–951.

Potthoff, R.F. and Roy, S.N. (1964) A generalized multivariate analysis of variance model useful

especially for growth curve problems. Biometrika 51, 313–326.

Robins, J.M., Greenland, S., and Hu, F.-C. (1999) Estimation of the causal effect of a time-varying

exposure on the marginal mean of a repeated binary outcome. Journal of the American Statistical

Association 94, 687–712.

Rowell, J.G. and Walters, D.E. (1976) Analyzing data with repeated observations on each experimental

unit. Journal of Agricultural Science 87, 423–432.

Steel, R.D.G., Torrie, J.H., and Dickey, D.A. (1997) Principles and Procedures of Statistics: A Bio-

metrical Approach, 3rd Ed. New York: McGraw-Hill.

Thall, P.F. and Vail, S.C. (1990) Some covariance models for longitudinal count data with overdisper-

sion. Biometrics 46, 657–671.

Vonesh, E.F. and Chinchilli, V.M. (1997) Linear and Nonlinear Models for the Analysis of Repeated

Measurements. New York: Marcel Dekker.

528

Page 621: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 12 ST 732, M. DAVIDIAN

An alternative perspective we discussed was that of the subject-specific approach. In this approach,

one starts with thinking about individual unit trajectories rather than about the mean (average)

across all units. In the linear model case, we did this by the introduction of random effects; e.g., the

random coefficient model that says each unit has its own intercept and slope β0i and β1i, which in

turn are represented as

β0i = β0 + b0i, β1i = β1 + b1i, β = (β0, β1)′.

In this model, the interpretation of β is as the “typical” value of intercept and slope in the population.

It just so happened that in the case of a linear model for either the mean response or individual

trajectory, one arrives at the same mean response model. Thus, in this case, the distinction between

these two interpretations was not important – either was valid.

SUBJECT-SPECIFIC GENERALIZED LINEAR MODEL: It is natural to consider the subject-

specific approach in the case where the functions of generalized linear models are appropriate. For

example, recall the seizure data, where the response is a count. By analogy to linear random coefficient

and mixed effects models, suppose we decided to model the individual trajectory of counts for an

individual subject as a subject-specific loglinear regression model. That is, suppose we wrote the

“mean” for subject i as a function of subject-specific parameters β0i and β3i as

exp(β0i + β3itij) (12.15)

In (12.15), β0i and β3i thus describe the subject’s own (conditional) mean response as a function of

time and individual “intercept” and “slope” on the log scale. Under this perspective, each subject has

his/her own such parameters β0i and β3i that characterize his/her own mean response over time.

Now, just as we did earlier, suppose we thought of the β0i and β4i as arising from populations of such

values. For example, suppose that

β3i = β3 + b3i,

where b3i is a random effect for subject i with mean 0. b3i describes how subject i deviates from the

“typical” value β3. Similarly, we might suppose that

β0i = β0 + b0i

for another mean-zero random effect b0i.

PAGE 488

Page 622: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 12 ST 732, M. DAVIDIAN

To incorporate the covariate information on treatment and age, we might assume that the “typical”

rate of change of log mean with time does not depend on these covariates, but maybe the “typical”

intercept does; e.g., we could write an alternative model depending on covariates ai and δi, say, as

β0i = β0 + β1ai + β2δi + b0i.

Putting all of this together, we arrive at a model for the “mean” for subject i, depending on the random

effect vector bi = (b0i, b3i)′:

E(Yij | bi) = exp(β0 + β1ai + β2δi + b0i + β3tij + b3itij) (12.16)

Following with the analogy, we could assume that the random effects bi ∼ N (0, D) for some covariance

matrix D.

We could write this model another way. Let βi = (β0i, β3i). The we have a first-stage model that says

the conditional mean for Y i, given bi on which βi depends is f i(βi), where

f i(βi) =

exp(β0i + β3iti1)...

exp(β0i + β3itini)

.

At the second stage, we could assume

βi = Aiβ + bi;

for the model above, β = (β0, β1, β2, β3)′ and, for subject i

Ai =

1 ai δi 0

0 0 0 1

.

(Verify.)

ARE THE TWO MODELS THE SAME? All of this is very similar to what we did in the normal, linear

case. In that case, both approaches led to the same representation of the ultimate mean response vector

E(Y i), but with different covariance matrices. The population-averaged model for mean response is

E(Y i) = X iβ. In the subject-specific general linear mixed model, by contrast, the “individual mean”

is

E(Y i | bi) = X iβ + Zibi. (12.17)

But this “individual mean” has expectation

E{Xiβ + Zibi} = X iβ,

since bi has mean zero, which is identical to the population-averaged model.

PAGE 489

Page 623: Applied Longitudinal Data Analysis:Lecture Notes

CHAPTER 12 ST 732, M. DAVIDIAN

Here, our two competing models are the population-averaged model that says immediately that

E(Y i) has jth element

E(Yij) = exp(β0 + β1ai + β2δi + β3tij),

and, from (12.16), the subject-specific model that says E(Y i | bi) has jth element

exp(β0 + β1ai + β2δi + b0i + β3tij + b3itij).

If the models were the same, we would expect that the expectation of this would be identical to

E(Yij) above. However, this is not the case. Note that we need to evaluate

E {exp(β0 + β1bi + β2ai + β3δi + b0i + β3tij + b3itij)} .

Contrast this with the calculation in (12.17) above – because that function of bi was linear, evaluating

the expectation was straightforward. Here, however, evaluating the expectation is not straightforward,

because it involves a a complicated nonlinear function of bi = (b0i, b3i)′. Even though bi are normal,

the expectation of this nonlinear function is not possible to evaluate by a simple rule as in the linear

case. As a result, it is not true that the expectation is identical to E(Yij) above.

RESULT: This is a general phenomenon, although we showed it just for a specific model. In a nonlinear

model, it is no longer true that the population-averaged and subject-specific perspectives lead to the

same model for mean response E(Y i). Thus, the two models are different. Furthermore, the parameter

we called β in each model has a different interpretation; e.g. in the seizure example,

• β for the population-averaged model has the interpretation as the value that leads to the “typical”

or mean response vector

• β for the subject-specific model has the interpretation as the value that is the “typical” value of

“intercept” and “slope” of log mean.

This may seem like a subtle and difficult-to-understand difference, which it is. But the main point is

that the two different modeling strategies lead to two different ways to describe the data with different

interpretations. Obviously, in these more complex models, the distinction matters. See Chapter 13 for

more.

PAGE 490

Page 624: Applied Longitudinal Data Analysis:Lecture Notes

.

ST 732, TEST 1, SPRING 2005

Please sign the following pledge certifying that the work on this test is your own:

“I have neither given nor received aid on this test.”

Signature:

Printed Name:

There are SIX questions, each with multiple parts. For each part of each question, please writeyour answers in the space provided. If you need more space, continue on the back of the page andindicate clearly where on the back you have continued your answer. Scratch paper is available fromthe proctor.

You are allowed ONE (1) SHEET of HANDWRITTEN NOTES (FRONT ONLY). Calculators areNOT allowed (you will not need one). NOTHING should be on your desk but this test paper, yourone page of notes, and scratch paper given to you by the proctor.

Points for each part of each problem are given in the left margin. TOTAL POINTS = 100.

In all problems, all symbols and notation are defined exactly as they are in the class notes.

1

Page 625: Applied Longitudinal Data Analysis:Lecture Notes

1. In each of (a) and (b) below, a study has been conducted in which m units have been randomlysampled from a single population, each unit has been observed at the same n time points, andthe sample covariance matrix Σ and the corresponding sample correlation matrix Γ based onthe data from the m units have been calculated. For each of (a) and (b), answer the following:

(i) Which covariance model would you choose to describe the true pattern of variance andcorrelation in the population? Explain your reasons for your choice.

(ii) Does a particular source of variation/correlation appear to be “dominant?” If so, identifythe source and say why you think this is the case. If not, explain why you do not think so.

For each of (i) and (ii), you must give an explanation to receive credit!

(a) n = 5, observations at times 0, 1, 2, 4, and 8 hours[5 points]

Σ =

3.451 2.593 1.651 0.806 0.3402.593 3.343 2.482 2.005 0.5811.651 2.482 3.811 2.879 1.3000.806 2.005 2.879 5.180 2.1460.340 0.581 1.300 2.146 3.890

, Γ =

1.00 0.76 0.46 0.19 0.090.76 1.00 0.70 0.48 0.160.46 0.70 1.00 0.65 0.340.19 0.48 0.65 1.00 0.480.09 0.16 0.34 0.48 1.00

.

(b) n = 6, observations at times 0, 0.5, 1, 1.5, 2, 2.5 months[5 points]

Σ =

1.933 1.482 2.479 2.306 3.132 2.4611.482 2.610 2.982 3.446 2.974 3.7642.479 2.982 7.561 5.864 5.544 5.2932.306 3.446 5.864 11.369 4.925 7.9883.132 2.974 5.544 4.925 11.630 9.9272.461 3.764 5.293 7.988 9.927 17.215

, Γ =

1.00 0.66 0.65 0.49 0.66 0.430.66 1.00 0.67 0.63 0.54 0.560.65 0.67 1.00 0.63 0.59 0.460.49 0.63 0.63 1.00 0.43 0.570.66 0.54 0.59 0.43 1.00 0.700.43 0.56 0.46 0.57 0.70 1.00

.

2

Page 626: Applied Longitudinal Data Analysis:Lecture Notes

2. In the notation in the notes, the statistical model underlying the univariate repeated measuresanalysis of variance is

Yh`j = µ + τ` + bh` + γj + (τγ)`j + eh`j , (1)

where Yh`j is the response for the hth unit in group ` at time j, ` = 1, . . . , q, j = 1, . . . , n,and h = 1, . . . , r` in group `; µ, the τ`, the γj , and the (τγ)`j are fixed parameters; and thebh` and eh`j are random components.

Give short answers to the following questions.

(a) Which component of this model represents deviations due to variation among units in the[5 points]populations corresponding to each group? Under the standard assumptions made about thefixed and random components in the model, does the model allow the nature of this variationto change over time? Explain your answer.

(b) Consider again the standard assumptions that are made for this model. Given these,[5 points]would you feel comfortable adopting this model in a situation where the response, (systolic)blood pressure, will be measured on each unit every 2 minutes over a 30 minute period?Explain why or why not.

(c) Under the usual constraints on the fixed parameters in this model, state in terms of[5 points]these parameters a null hypothesis appropriate for addressing the question of whether meanresponse changes over time in a way that is similar for all groups.

3

Page 627: Applied Longitudinal Data Analysis:Lecture Notes

3. m = 30 units were randomized to 3 treatment groups, 10 units per group. At time 0, theassigned treatments were initiated for all units, and at weeks 1, 3, 5, 7, 9, and 11 thereafter,the response was recorded for each unit. The raw data are depicted below along with themeans at each observation time for each group.

time

repo

nse

2 4 6 8 10

100

150

200

250

300

350

400

Group 1

• • • •

• •

•• •

• •

••

• • ••

••

••

• •

••

• •

••

••

•• •

••

••

••

••

••

time

repo

nse

2 4 6 8 10

100

150

200

250

300

350

400

Group 2

•• •

••

••

••

••

••

• •

••

••

••

••

••

• ••

••

••

••

time

repo

nse

2 4 6 8 10

100

150

200

250

300

350

400

Group 3

•• •

• •

• ••

• • •

••

• ••

• ••

• •• •

••

• •

•• •

••

1 1 11

1

1

timere

pons

e

2 4 6 8 10

100

150

200

250

300

350

400

Mean trajectories

2 22

2

2

2

33 3

3

3

3

(a) The visual evidence suggests that mean trajectories over time for each group follow a[5 points]smooth trend exhibiting “curvature” over time. Letting Yij be the response at the jth timeof observation for unit i, write down an appropriate statistical model for Yij that explicitlyallows mean response trajectories to exhibit “curvature” over time in a way that may havedifferent features for each group and that represents deviations from the mean at any timedue to all sources of variation by a single random component.

Answer (b) and (c) on the next page assuming your model in (a).

4

Page 628: Applied Longitudinal Data Analysis:Lecture Notes

(Problem 3, continued)

(b) The investigators had expected that mean response in each group would show a constant[5 points]but possibly different rate of change in each group, so they wondered whether there wasevidence to suggest that the apparent curvature is a real phenomenon for at least one ofthe groups. Collect all the parameters that describe the mean trajectories in your modelin (a) into a parameter vector β. Give the form of β, and then write down the matrix Lcorresponding to the appropriate null hypothesis of the form H0 : Lβ = 0.

(c) The investigators also wondered whether the pattern of change after initiation of the[5 points]treatments was identical in each group. In terms of β defined in (b), write down the matrixL corresponding to the appropriate null hypothesis of the form H0 : Lβ = 0.

5

Page 629: Applied Longitudinal Data Analysis:Lecture Notes

4. A study was conducted to investigate whether patients with different severity of diabetes mustundertake different levels of physical exertion to complete simple physical tasks. Subjects wererandomly sampled from three populations (groups) of patients, 30 subjects per group:

• Group 1: Diabetic patients without complications (30 subjects)

• Group 2: Diabetic patients with hypertension (more serious) (30 subject)

• Group 3: Diabetic patients with postural hypertension (even more serious) (30 subjects).

Each subject began performing a simple physical task, and the subject’s level of physicalexertion was measured immediately after starting the task (at time 0) and then repeatedly at1, 2, 3, 4, 5, 6 minutes thereafter. The higher the physical exertion measurement, the worseoff the subject is in terms of the stress of expending energy on the task.

Luckily, measurements were recorded for all 90 subjects at each time point. The exertionresponses are shown below, along with the sample means in each group:

0 1 2 3 4 5 6

02

46

810

12

time (min)

phys

ical

exe

rtio

n

Group 1 −− No Complications

0 1 2 3 4 5 6

02

46

810

12

time (min)

phys

ical

exe

rtio

n

Group 2 − Hypertension

0 1 2 3 4 5 6

02

46

810

12

time (min)

phys

ical

exe

rtio

n

Group 3 − Postural Hypertension

0 1 2 3 4 5 6

02

46

810

12

time (min)

phys

ical

exe

rtio

n

Group means

1 1 1 1 1 1 12 2 2 2 2 2 23 3 3 3 3 33

The investigators decided to adopt the statistical model for univariate repeated measuresanalysis of variance in Equation (1) in Problem 2, along with its standard assumptions, asthe framework in which they would address their scientific questions. On the 3 pages followingthe next one, you will find some SAS code and excerpts of its output; use this information toanswer the following questions.

(a) Based on the code and output, do you have any concerns about the investigators’ choice[5 points]of statistical model? Explain your answer, citing specific information in the output that leadsyou to feel this way.

6

Page 630: Applied Longitudinal Data Analysis:Lecture Notes

SAS code and output are on the next 3 pages.

(b) Regardless of your answer to (a), assuming this statistical model is correct, is there[5 points]evidence in these data to suggest that the way in which mean physical exertion changed overthe study period differs in some way for the three populations of diabetic subjects? Citespecific information in the output in support of your answer.

(c) The investigators were interested in whether the average of mean physical exertion over[5 points]time is the same for all three populations of patients. Based on the available information, doyou think that it is interesting or relevant to ask this question?

If you think that it is not, state why not, giving a justification for your answer.

If you think that it is, state why you think so, giving a justification for your answer, andthen address the question “Is there enough evidence in these data to suggest that the aver-age of mean physical exertion over time differs somehow across the groups?”, citing specificinformation in the output in support of your answer (assuming as in (b) that the model iscorrect).

(d) One investigator suspected that the overall trend of mean physical exertion over the 6[5 points]minutes, as reflected by a straight line, is different for the three groups. Is there evidence inthese data to support his claim? Cite specific information in the output in support of youranswer (assuming as in (b) that the model is correct).

7

Page 631: Applied Longitudinal Data Analysis:Lecture Notes

/* Note: the variable "age" is not used in this problem */

data exert1; infile "exert.dat";input subject min exert age group; * min = time in minutes;minplus=min+1; * exert = physical exertion measurement;

run;

proc sort data=exert1; by group subject age; run;data exert2(keep=min0-min6 group subject age);array ee{7} min0-min6;do minplus=1 to 7;

set exert1; by group subject age;ee{minplus}=exert;if last.subject then return;

end; run;

proc sort data=exert2; by group; run;proc corr cov; by group;var min0 min1 min2 min3 min4 min5 min6; run;

proc glm data=exert2;class group;model min0 min1 min2 min3 min4 min5 min6 = group /nouni;repeated min 7 (0 1 2 3 4 5 6) polynomial / printe printm summary nom;

run;

-------------------------------------------- group=1 --------------------------------------------------

The CORR Procedure

7 Variables: min0 min1 min2 min3 min4 min5 min6

Covariance Matrix, DF = 29

min0 min1 min2 min3 min4 min5 min6

min0 1.81637 1.70810 2.09379 2.04620 2.22706 2.23775 2.10344min1 1.70810 2.05564 2.24967 2.21558 2.33748 2.45086 2.34813min2 2.09379 2.24967 3.15085 2.96634 3.11462 3.11758 2.84455min3 2.04620 2.21558 2.96634 3.25627 3.02075 3.05000 2.83055min4 2.22706 2.33748 3.11462 3.02075 3.49196 3.32017 3.13951min5 2.23775 2.45086 3.11758 3.05000 3.32017 3.56120 3.19896min6 2.10344 2.34813 2.84455 2.83055 3.13951 3.19896 3.29406

Pearson Correlation Coefficients, N = 30Prob > |r| under H0: Rho=0

min0 min1 min2 min3 min4 min5 min6

min0 1.00000 0.88397 0.87522 0.84137 0.88429 0.87986 0.85993<.0001 <.0001 <.0001 <.0001 <.0001 <.0001

min1 0.88397 1.00000 0.88396 0.85636 0.87245 0.90583 0.90237<.0001 <.0001 <.0001 <.0001 <.0001 <.0001

min2 0.87522 0.88396 1.00000 0.92608 0.93898 0.93069 0.88294<.0001 <.0001 <.0001 <.0001 <.0001 <.0001

min3 0.84137 0.85636 0.92608 1.00000 0.89582 0.89565 0.86426<.0001 <.0001 <.0001 <.0001 <.0001 <.0001

min4 0.88429 0.87245 0.93898 0.89582 1.00000 0.94151 0.92568<.0001 <.0001 <.0001 <.0001 <.0001 <.0001

min5 0.87986 0.90583 0.93069 0.89565 0.94151 1.00000 0.93400<.0001 <.0001 <.0001 <.0001 <.0001 <.0001

min6 0.85993 0.90237 0.88294 0.86426 0.92568 0.93400 1.00000<.0001 <.0001 <.0001 <.0001 <.0001 <.0001

--------------------------------------------- group=2 -------------------------------------------------

Covariance Matrix, DF = 29

min0 min1 min2 min3 min4 min5 min6

min0 2.13774 1.87087 2.26498 2.15583 2.59367 2.47259 2.69510min1 1.87087 2.00602 2.16018 2.10519 2.51218 2.48981 2.69420min2 2.26498 2.16018 2.84878 2.50549 2.99091 2.83087 3.05993min3 2.15583 2.10519 2.50549 2.67081 2.90408 2.82174 2.99762min4 2.59367 2.51218 2.99091 2.90408 3.63729 3.38735 3.49431min5 2.47259 2.48981 2.83087 2.82174 3.38735 3.47705 3.50868min6 2.69510 2.69420 3.05993 2.99762 3.49431 3.50868 4.29596

8

Page 632: Applied Longitudinal Data Analysis:Lecture Notes

Pearson Correlation Coefficients, N = 30Prob > |r| under H0: Rho=0

min0 min1 min2 min3 min4 min5 min6

min0 1.00000 0.90344 0.91782 0.90223 0.93014 0.90692 0.88934<.0001 <.0001 <.0001 <.0001 <.0001 <.0001

min1 0.90344 1.00000 0.90364 0.90950 0.93002 0.94274 0.91777<.0001 <.0001 <.0001 <.0001 <.0001 <.0001

min2 0.91782 0.90364 1.00000 0.90833 0.92915 0.89947 0.87468<.0001 <.0001 <.0001 <.0001 <.0001 <.0001

min3 0.90223 0.90950 0.90833 1.00000 0.93175 0.92596 0.88496<.0001 <.0001 <.0001 <.0001 <.0001 <.0001

min4 0.93014 0.93002 0.92915 0.93175 1.00000 0.95250 0.88398<.0001 <.0001 <.0001 <.0001 <.0001 <.0001

min5 0.90692 0.94274 0.89947 0.92596 0.95250 1.00000 0.90784<.0001 <.0001 <.0001 <.0001 <.0001 <.0001

min6 0.88934 0.91777 0.87468 0.88496 0.88398 0.90784 1.00000<.0001 <.0001 <.0001 <.0001 <.0001 <.0001

---------------------------------------------- group=3 ------------------------------------------------

Covariance Matrix, DF = 29

min0 min1 min2 min3 min4 min5 min6

min0 2.42786 2.50310 2.36006 2.55924 2.65758 2.96827 2.82351min1 2.50310 3.20764 2.98109 3.10258 3.34327 3.54385 3.30862min2 2.36006 2.98109 3.40516 3.34162 3.44534 3.71350 3.51234min3 2.55924 3.10258 3.34162 3.84837 3.65189 4.03603 3.81179min4 2.65758 3.34327 3.44534 3.65189 4.04396 4.04258 4.03034min5 2.96827 3.54385 3.71350 4.03603 4.04258 4.66005 4.27206min6 2.82351 3.30862 3.51234 3.81179 4.03034 4.27206 4.37958

Pearson Correlation Coefficients, N = 30Prob > |r| under H0: Rho=0

min0 min1 min2 min3 min4 min5 min6

min0 1.00000 0.89696 0.82081 0.83726 0.84815 0.88246 0.86589<.0001 <.0001 <.0001 <.0001 <.0001 <.0001

min1 0.89696 1.00000 0.90201 0.88306 0.92827 0.91661 0.88275<.0001 <.0001 <.0001 <.0001 <.0001 <.0001

min2 0.82081 0.90201 1.00000 0.92310 0.92845 0.93222 0.90952<.0001 <.0001 <.0001 <.0001 <.0001 <.0001

min3 0.83726 0.88306 0.92310 1.00000 0.92571 0.95306 0.92848<.0001 <.0001 <.0001 <.0001 <.0001 <.0001

min4 0.84815 0.92827 0.92845 0.92571 1.00000 0.93124 0.95768<.0001 <.0001 <.0001 <.0001 <.0001 <.0001

min5 0.88246 0.91661 0.93222 0.95306 0.93124 1.00000 0.94564<.0001 <.0001 <.0001 <.0001 <.0001 <.0001

min6 0.86589 0.88275 0.90952 0.92848 0.95768 0.94564 1.00000<.0001 <.0001 <.0001 <.0001 <.0001 <.0001

The GLM ProcedureClass Level Information

Class Levels Values

group 3 1 2 3

Number of observations 90

Repeated Measures Analysis of Variance

Repeated Measures Level Information

Dependent Variable min0 min1 min2 min3 min4 min5 min6

Level of min 0 1 2 3 4 5 6

min_N represents the nth degree polynomial contrast for min

M Matrix Describing Transformed Variables

min0 min1 min2 min3 min4 min5 min6

min_1 -.566946 -.377964 -.188982 0.000000 0.188982 0.377964 0.566946min_2 0.545544 -.000000 -.327326 -.436435 -.327326 -.000000 0.545544min_3 -.408248 0.408248 0.408248 0.000000 -.408248 -.408248 0.408248min_4 0.241746 -.564076 0.080582 0.483493 0.080582 -.564076 0.241746min_5 -.109108 0.436435 -.545544 0.000000 0.545544 -.436435 0.109108min_6 0.032897 -.197385 0.493463 -.657951 0.493463 -.197385 0.032897

9

Page 633: Applied Longitudinal Data Analysis:Lecture Notes

The GLM ProcedureRepeated Measures Analysis of Variance

Sphericity Tests

Mauchly’sVariables DF Criterion Chi-Square Pr > ChiSqTransformed Variates 20 0.5559223 49.775296 0.0002Orthogonal Components 20 0.5559223 49.775296 0.0002

Repeated Measures Analysis of VarianceTests of Hypotheses for Between Subjects Effects

Source DF Type III SS Mean Square F Value Pr > F

group 2 360.120413 180.060206 8.79 0.0003Error 87 1781.279524 20.474477

Repeated Measures Analysis of VarianceUnivariate Tests of Hypotheses for Within Subject Effects

Adj Pr > FSource DF Type III SS Mean Square F Value Pr > F G - G H - F

min 6 75.1563175 12.5260529 36.08 <.0001 <.0001 <.0001min*group 12 5.7995873 0.4832989 1.39 0.1653 0.1827 0.1754Error(min) 522 181.2298095 0.3471835

Greenhouse-Geisser Epsilon 0.8161Huynh-Feldt Epsilon 0.8905

Repeated Measures Analysis of VarianceAnalysis of Variance of Contrast Variables

min_N represents the nth degree polynomial contrast for min

Contrast Variable: min_1

Source DF Type III SS Mean Square F Value Pr > F

Mean 1 73.98858730 73.98858730 115.32 <.0001group 2 4.30403175 2.15201587 3.35 0.0395Error 87 55.82095238 0.64162014

Contrast Variable: min_2

Source DF Type III SS Mean Square F Value Pr > F

Mean 1 0.11433333 0.11433333 0.26 0.6107group 2 0.43466667 0.21733333 0.50 0.6106Error 87 38.11028571 0.43804926

Contrast Variable: min_3

Source DF Type III SS Mean Square F Value Pr > F

Mean 1 0.09600000 0.09600000 0.42 0.5187group 2 0.17733333 0.08866667 0.39 0.6796Error 87 19.88666667 0.22858238

Contrast Variable: min_4

Source DF Type III SS Mean Square F Value Pr > F

Mean 1 0.03620202 0.03620202 0.14 0.7121group 2 0.29628283 0.14814141 0.56 0.5728Error 87 22.98413853 0.26418550

Contrast Variable: min_5

Source DF Type III SS Mean Square F Value Pr > F

Mean 1 0.81719048 0.81719048 3.60 0.0610group 2 0.20352381 0.10176190 0.45 0.6400Error 87 19.73571429 0.22684729

Contrast Variable: min_6

Source DF Type III SS Mean Square F Value Pr > F

Mean 1 0.10400433 0.10400433 0.37 0.5465group 2 0.38374892 0.19187446 0.68 0.5113Error 87 24.69205195 0.28381669

10

Page 634: Applied Longitudinal Data Analysis:Lecture Notes

5. Consider the physical exertion data in Problem 4. Based on the visual evidence, one inves-tigator proposed adopting instead the following statistical model for Yij = physical exertionmeasurement for subject i at time tij :

Yij = β1 + β4tij + εij , i in group 1= β2 + β5tij + εij , i in group 2= β3 + β6tij + εij , i in group 3

Define β = (β1, β2, β3, β4, β5, β6)′.

(a) The investigators first fit this model several times, each time assuming something different[5 points]about the εij . The basic code they used looked like

proc mixed data=exert1;class group subject;model exert = group group*min / noint solution;repeated / STUFF;

run;

Here, STUFF looked different depending on the assumption on the εij . In the following table,AIC and BIC values resulting from taking STUFF to be several different things are given:

STUFF AIC BIC

type=un subject=subject group=group r rcorr; 1497.5 1707.5type=un subject=subject r rcorr; 1445.5 1515.5type=cs subject=subject group=group r rcorr; 1504.6 1519.6type=cs subject=subject r rcorr; 1498.3 1503.3type=ar(1) subject=subject group=group r rcorr; 1553.5 1568.5type=ar(1) subject=subject r rcorr; 1547.0 1552.0

Based on these results, state the particular covariance model among those considered by theinvestigators that you would assume for this analysis and explain why you chose it, citingspecific information here and in Problem 4 that you may have used to decide. (Give the nameof the model, not just the SAS type designation.)

(b) Explain what is being modeled by the covariance structure in (a).[5 points]

11

Page 635: Applied Longitudinal Data Analysis:Lecture Notes

For convenience, here is the statistical model again:

Yij = β1 + β4tij + εij , i in group 1= β2 + β5tij + εij , i in group 2, β = (β1, β2, β3, β4, β5, β6)′

= β3 + β6tij + εij , i in group 3

The investigators assumed one of the covariance models. On the next page you will find thecode they ran and excerpts of its output; use this information to answer the following:

(c) One investigator wondered whether or not the 3 mean physical exertion profiles in fact[5 points]coincide over the entire period from 0 to 6 minutes. From the output, give the value of thetest statistic and associated p-value appropriate for testing the relevant null hypothesis H0,and state your conclusion regarding the strength of the evidence against H0. (You need notstate H0.)

(d) The main question of interest was whether or not the way in which mean physical exertion[5 points]changes over the study period is same for all 3 groups. From the output, give the value ofthe test statistic and associated p-value appropriate for testing the relevant null hypothesisH0, and state your conclusion regarding the strength of the evidence against H0. (You neednot state H0.)

Part (e) of this problem is on the next page!

12

Page 636: Applied Longitudinal Data Analysis:Lecture Notes

(e) In the data set, the variable age is an indicator of whether the subject’s age is < 50 years[5 points](age=0) or ≥ 50 (age=1). One investigator thought that, although there is no associationbetween age and initial mean physical exertion at time 0, the rate of change of mean physicalexertion within each group might be different depending on age in a way that might bedifferent for each group. Defining ai = 0 if age< 50 and ai = 1 if age≥ 50, modify thestatistical model on the previous page to incorporate this possibility.

Also, treating age as a numerical variable (so it would not be included in the class statement),modify the model statement used by the investigators so that proc mixed will fit your modelexactly as you have parameterized it.

data exert1; infile "exert.dat";input subject min exert age group;

run;

proc mixed data=exert1;class group subject;model exert = group group*min / noint solution;repeated / INVESTIGATORS’ STUFF;contrast ’A’ group 0 0 0 group*min 1 0 0,

group 0 0 0 group*min 0 1 0,group 0 0 0 group*min 0 0 1 / chisq;

contrast ’B’ group 0 0 0 group*min 1 -1 0,group 0 0 0 group*min 1 0 -1 / chisq;

contrast ’C’ group 1 -1 0 group*min 0 0 0,group 1 0 -1 group*min 0 0 0 / chisq;

contrast ’D’ group 1 0 0 group*min -1 0 0,group 0 1 0 group*min 0 -1 0,group 0 0 1 group*min 0 0 -1 / chisq;

contrast ’E’ group 1 -1 0 group*min 0 0 0,group 1 0 -1 group*min 0 0 0,group 0 0 0 group*min 1 -1 0,group 0 0 0 group*min 1 0 -1 / chisq;

run;

Solution for Fixed Effects

StandardEffect group Estimate Error DF t Value Pr > |t|

group 1 4.9331 0.3181 87 15.51 <.0001group 2 5.7429 0.3181 87 18.06 <.0001group 3 6.4857 0.3181 87 20.39 <.0001min*group 1 0.1264 0.02019 537 6.26 <.0001min*group 2 0.1614 0.02019 537 8.00 <.0001min*group 3 0.2262 0.02019 537 11.20 <.0001

Contrasts

Num DenLabel DF DF Chi-Square F Value Pr > ChiSq Pr > F

A 3 537 228.63 76.21 <.0001 <.0001B 2 537 12.57 6.28 0.0019 0.0020C 2 537 11.92 5.96 0.0026 0.0028D 3 537 898.27 299.42 <.0001 <.0001E 4 537 30.16 7.54 <.0001 <.0001

13

Page 637: Applied Longitudinal Data Analysis:Lecture Notes

6. Continue to consider the physical exertion data of Problem 4. Another investigator proposedinstead the following model for Yij = physical exertion measurement for subject i at time tij :

Yij = β0i + β1itij + eij ,

β0i = β1 + b0i, β1i = β4 + b1i, i in Group 1β0i = β2 + b0i, β1i = β5 + b1i, i in Group 2β0i = β3 + b0i, β1i = β6 + b1i, i in Group 3

where eij , b0i, and b1i are mean-zero random variables.

The investigators fit this model using the following SAS code:

proc mixed data=exert1;class group subject;model exert = group group*min / noint solution;random intercept min / type=un subject=subject g gcorr v vcorr;repeated / type=ar(1) subject=subject r rcorr;

run;

(a) Write down the expression for population mean physical exertion at time tij in Group 1[5 points]implied by the above model.

(b) The call to proc mixed above incorporates assumptions about sources of variation. Ex-[5 points]plain exactly what is being assumed about the sources of variation.

(c) Give an interpretation of the parameter β4.[5 points]

14

Page 638: Applied Longitudinal Data Analysis:Lecture Notes

.

ST 732, TEST 1, SPRING 2005, SOLUTIONS

Please sign the following pledge certifying that the work on this test is your own:

“I have neither given nor received aid on this test.”

Signature:

Printed Name:

There are SIX questions, each with multiple parts. For each part of each question, please writeyour answers in the space provided. If you need more space, continue on the back of the page andindicate clearly where on the back you have continued your answer. Scratch paper is available fromthe proctor.

You are allowed ONE (1) SHEET of HANDWRITTEN NOTES (FRONT ONLY). Calculators areNOT allowed (you will not need one). NOTHING should be on your desk but this test paper, yourone page of notes, and scratch paper given to you by the proctor.

Points for each part of each problem are given in the left margin. TOTAL POINTS = 100.

In all problems, all symbols and notation are defined exactly as they are in the class notes.

NOTE: My answers are much more detailed than I expected your answers to be!

1

Page 639: Applied Longitudinal Data Analysis:Lecture Notes

1. In each of (a) and (b) below, a study has been conducted in which m units have been randomlysampled from a single population, each unit has been observed at the same n time points, andthe sample covariance matrix Σ and the corresponding sample correlation matrix Γ based onthe data from the m units have been calculated. For each of (a) and (b), answer the following:

(i) Which covariance model would you choose to describe the true pattern of variance andcorrelation in the population? Explain your reasons for your choice.

(ii) Does a particular source of variation/correlation appear to be “dominant?” If so, identifythe source and say why you think this is the case. If not, explain why you do not think so.

For each of (i) and (ii), you must give an explanation to receive credit!

(a) n = 5, observations at times 0, 1, 2, 4, and 8 hours[5 points]

Σ =

3.451 2.593 1.651 0.806 0.3402.593 3.343 2.482 2.005 0.5811.651 2.482 3.811 2.879 1.3000.806 2.005 2.879 5.180 2.1460.340 0.581 1.300 2.146 3.890

, Γ =

1.00 0.76 0.46 0.19 0.090.76 1.00 0.70 0.48 0.160.46 0.70 1.00 0.65 0.340.19 0.48 0.65 1.00 0.480.09 0.16 0.34 0.48 1.00

.

(i) The diagonal elements of Σ, which estimate overall variance in the population at eachtime point, are in the same “ballpark.” This suggests that a homogeneous covariance modelmay be adequate. Inspection of Γ indicates that the estimated correlations seem to “fall off”as pairs of time become further separated. The time points are unequally spaced; thus, thissuggests that a model like the Markov may be appropriate (homogeneous version).

(ii) Correlation that “falls off” as times become more and more separated is characteristic ofthe tendency for deviations due to within-unit fluctuations to become less alike the furtherapart in time they are. This suggest that the within-unit source of correlation is dominant.Variance stays pretty constant over time, suggesting that there is no tendency for individualprofiles to deviate (e.g. due to different unit-specific slopes) over time, further supportingthis contention.

(b) n = 6, observations at times 0, 0.5, 1, 1.5, 2, 2.5 months[5 points]

Σ =

1.933 1.482 2.479 2.306 3.132 2.4611.482 2.610 2.982 3.446 2.974 3.7642.479 2.982 7.561 5.864 5.544 5.2932.306 3.446 5.864 11.369 4.925 7.9883.132 2.974 5.544 4.925 11.630 9.9272.461 3.764 5.293 7.988 9.927 17.215

, Γ =

1.00 0.66 0.65 0.49 0.66 0.430.66 1.00 0.67 0.63 0.54 0.560.65 0.67 1.00 0.63 0.59 0.460.49 0.63 0.63 1.00 0.43 0.570.66 0.54 0.59 0.43 1.00 0.700.43 0.56 0.46 0.57 0.70 1.00

.

(i) The diagonal elements of Σ, which estimate overall variance in the population at each timepoint, appear to increase rather substantially over time. This suggests that a heterogeneouscovariance model may be required. Inspection of Γ indicates that the estimated correlationsseem to be in the same “ballpark” regardless of how close or far apart in time pairs of timepoints are. This suggests that something like the compound symmetry assumption may beappropriate (heterogeneous version).

(ii) Correlation that is constant regardless of how far apart in time observations are takentends to suggest that among-unit variation dominates. In particular, in our conceptual model,if “inherent trajectories” vary a lot, observations from the same trajectory will tend to be very“alike” relative to those compared from different trajectories. This is further supported bythe variances that increase over time, suggesting the possibility that inherent unit trajectoriesbecome more “different” over time.

2

Page 640: Applied Longitudinal Data Analysis:Lecture Notes

2. In the notation in the notes, the statistical model underlying the univariate repeated measuresanalysis of variance is

Yh`j = µ + τ` + bh` + γj + (τγ)`j + eh`j , (1)

where Yh`j is the response for the hth unit in group ` at time j, ` = 1, . . . , q, j = 1, . . . , n,and h = 1, . . . , r` in group `; µ, the τ`, the γj , and the (τγ)`j are fixed parameters; and thebh` and eh`j are random components.

Give short answers to the following questions.

(a) Which component of this model represents deviations due to variation among units in the[5 points]populations corresponding to each group? Under the standard assumptions made about thefixed and random components in the model, does the model allow the nature of this variationto change over time? Explain your answer.

Under the standard assumptions, bh` is the mean-zero deviation that represents how observa-tions on the hth unit in the `th group deviate from the mean for that group. This componentdoes not have a “j” subscript. As j indexes the times of observation, this says that theway in which the (h, `)th unit’s observations vary about the population mean at time j,µ`j = µ + τ` + γj + (τγ)`j , does not depend on time. In fact, the standard assumption is thatbh` ∼ N (0, σ2

b ) for all (h, `) regardless of time, so that the contribution to overall variancefrom among-unit sources at any time point is equal to σ2

b , the same value at any time. Thus,this model assumes that the nature of among-unit variation is similar regardless of the timeof observation.

(b) Consider the standard assumptions that are made for this model. Given these, would[5 points]you feel comfortable adopting this model in a situation where the response, (systolic) bloodpressure, will be measured on each unit every 2 minutes over a 30 minute period? Explainwhy or why not.

It is well-known that a person’s true blood pressure may vary considerably from minuteto minute. In the context of our “conceptual model” for longitudinal data, this would berepresented by the “fluctuations” about the “inherent trajectory.” We might be worried thatblood pressure measurements taken every 2 minutes might thus be close enough together intime that correlation due to the within-person “fluctuations” might be nonnegligible. Themodel (1) has as one of the standard assumptions that the within-unit deviations eh`j areindependent (so uncorrelated). This assumption would thus be suspect under this bloodpressure scenario. The potentially nonnegligible correlation could cause a violation of thestandard assumption of an overall compound symmetric correlation structure. I would notbe comfortable.

(c) Under the usual constraints on the fixed parameters in this model, state in terms of[5 points]these parameters a null hypothesis appropriate for addressing the question of whether meanresponse changes over time in a way that is similar for all groups.

The model implies that the mean for group ` at time j is µ+τ` +γj +(τγ)`j . The (τγ)`j allowthe difference in mean response among groups to be different at different time points. Withthe usual constraints

∑nj=1(τγ)`j =

∑q`=1(τγ)`j = 0, the hypothesis becomes H0 : (τγ)`j = 0

for all (`, j).

3

Page 641: Applied Longitudinal Data Analysis:Lecture Notes

3. m = 30 units were randomized to 3 treatment groups, 10 units per group. At time 0, theassigned treatments were initiated for all units, and at weeks 1, 3, 5, 7, 9, and 11 thereafter,the response was recorded for each unit. The raw data are depicted below along with themeans at each observation time for each group.

time

repo

nse

2 4 6 8 10

100

150

200

250

300

350

400

Group 1

• • • •

• •

•• •

• •

••

• • ••

••

••

• •

••

• •

••

••

•• •

••

••

••

••

••

time

repo

nse

2 4 6 8 10

100

150

200

250

300

350

400

Group 2

•• •

••

••

••

••

••

• •

••

••

••

••

••

• ••

••

••

••

time

repo

nse

2 4 6 8 10

100

150

200

250

300

350

400

Group 3

•• •

• •

• ••

• • •

••

• ••

• ••

• •• •

••

• •

•• •

••

1 1 11

1

1

timere

pons

e

2 4 6 8 10

100

150

200

250

300

350

400

Mean trajectories

2 22

2

2

2

33 3

3

3

3

(a) The visual evidence suggests that mean trajectories over time for each group follow a[5 points]smooth trend exhibiting “curvature” over time. Letting Yij be the response at the jth timeof observation for unit i, write down an appropriate statistical model for Yij that explicitlyallows mean response trajectories to exhibit “curvature” over time in a way that may havedifferent features for each group and that represents deviations from the mean at any timedue to all sources of variation by a single random component.

Such a model is

Yij = β1 + β2tij + β3t2ij + εij , i in group 1

= β4 + β5tij + β6t2ij + εij , i in group 2

= β7 + β8tij + β9t2ij + εij , i in group 3

The single deviation component εij captures deviations due to both among- and within-unitsources of variation.

Answer (b) and (c) on the next page assuming your model in (a).

4

Page 642: Applied Longitudinal Data Analysis:Lecture Notes

(Problem 3, continued)

(b) The investigators had expected that mean response in each group would show a constant[5 points]but possibly different rate of change in each group, so they wondered whether there wasevidence to suggest that the apparent curvature is a real phenomenon for at least one ofthe groups. Collect all the parameters that describe the mean trajectories in your modelin (a) into a parameter vector β. Give the form of β, and then write down the matrix Lcorresponding to the appropriate null hypothesis of the form H0 : Lβ = 0.

Define β = (β1, β2, . . . , β8, β9)′. The question is whether there is a need for the quadraticterm, which allows “curvature,” in at least one of the groups. The appropriate L asks whetherat least one of β3, β6, β9 = 0, i.e.,

L =

0 0 1 0 0 0 0 0 00 0 0 0 0 1 0 0 00 0 0 0 0 0 0 0 1

.

(c) The investigators also wondered whether the pattern of change after initiation of the[5 points]treatments was identical in each group. In terms of β defined in (b), write down the matrixL corresponding to the appropriate null hypothesis of the form H0 : Lβ = 0.

For Group 1, β2t + β3t2 dictates how things change for t > 0 (after initiation of treatment);

similarly, this is β5t + β6t2 and β8 + β9t

2 in Groups 2 and 3, respectively. If the patternis identical in all groups, then it must be that β2 = β5 = β8 AND β3 = β6 = β9. Theappropriate L is thus

L =

0 1 0 0 −1 0 0 0 00 1 0 0 0 0 0 −1 00 0 1 0 0 −1 0 0 00 0 1 0 0 0 0 0 −1

.

Some of you also asked simultaneously if the intercepts are different; these describe meanresponse at the time of treatment initiation, so do not reflect the pattern of change afterinitiation of treatment.

5

Page 643: Applied Longitudinal Data Analysis:Lecture Notes

4. A study was conducted to investigate whether patients with different severity of diabetes mustundertake different levels of physical exertion to complete simple physical tasks. Subjects wererandomly sampled from three populations (groups) of patients, 30 subjects per group:

• Group 1: Diabetic patients without complications (30 subjects)• Group 2: Diabetic patients with hypertension (more serious) (30 subject)• Group 3: Diabetic patients with postural hypertension (even more serious) (30 subjects).

Each subject began performing a simple physical task, and the subject’s level of physicalexertion was measured immediately after starting the task (at time 0) and then repeatedly at1, 2, 3, 4, 5, 6 minutes thereafter. The higher the physical exertion measurement, the worseoff the subject is in terms of the stress of expending energy on the task.

Luckily, measurements were recorded for all 90 subjects at each time point. The exertionresponses are shown below, along with the sample means in each group:

0 1 2 3 4 5 6

02

46

810

12

time (min)

phys

ical

exe

rtio

n

Group 1 −− No Complications

0 1 2 3 4 5 6

02

46

810

12

time (min)

phys

ical

exe

rtio

n

Group 2 − Hypertension

0 1 2 3 4 5 6

02

46

810

12

time (min)

phys

ical

exe

rtio

n

Group 3 − Postural Hypertension

0 1 2 3 4 5 6

02

46

810

12

time (min)

phys

ical

exe

rtio

n

Group means

1 1 1 1 1 1 12 2 2 2 2 2 23 3 3 3 3 33

The investigators decided to adopt the statistical model for univariate repeated measuresanalysis of variance in Equation (1) in Problem 2, along with its standard assumptions as theframework in which they would address their scientific questions. On the 3 pages followingthe next one, you will find some SAS code and excerpts of its output; use this information toanswer the following questions.

(a) Based on the code and output, do you have any concerns about the investigators’ choice[5 points]of statistical model? Explain your answer, citing specific information in the output that leadsyou to feel this way.

YES. Although the assumption of compound symmetric correlation structure in each groupdoes not seem to be contradicted by the sample correlation matrices for each group, thereis some mild evidence that the variances (diagonal elements of sample covariance matrices)may increase over time or be different for different groups. But the real kicker is that theTest of Sphericity yields a p-value of virtually 0, which suggests there is strong evidence thatthe assumption of compound symmetry (and the weaker assumption of “Type H” covariancestructure) is violated for these data. As this assumption is required for validity of the testingprocedures based on the F statistics, I would feel very concerned about the reliability ofinferences based on these procedures.

6

Page 644: Applied Longitudinal Data Analysis:Lecture Notes

SAS code and output are on the next 3 pages.

(b) Regardless of your answer to (a), assuming this statistical model is correct, is there[5 points]evidence in these data to suggest that the way in which mean physical exertion changed overthe study period differs in some way for the three populations of diabetic subjects? Citespecific information in the output in support of your answer.

This question may be addressed by testing the hypothesis of parallelism. From the output,the appropriate F statistic is given in the table of Univariate Tests of Hypotheses forWithin Subject Effects, corresponding to the min*group effect and is equal to 1.39, witha corresponding p-value under the assumption that the model is correct of 0.16. As this isgreater than any reasonable level of significance (e.g. 0.05 or even 0.10), we would concludethat there is not enough evidence to reject the hypothesis of parallelism. Thus, assuming themodel is correct (which is dubious), we conclude that there is not enough evidence to suggestthat the way in which mean physical exertion changed over the study period differs for the 3groups.

(c) The investigators were interested in whether the average of mean physical exertion over[5 points]time is the same for all three populations of patients. Based on the available information, doyou think that it is interesting or relevant to ask this question?

If you think that it is not, state why not, giving a justification for your answer.

If you think that it is, state why you think so, giving a justification for your answer, andthen address the question “Is there enough evidence in these data to suggest that the aver-age of mean physical exertion over time differs somehow across the groups?”, citing specificinformation in the output in support of your answer (assuming as in (b) that the model iscorrect).

The three observed mean physical exertion profiles lie “on top of one another;” that is, theydo not cross, so that mean exertion for group 3 appears to lie entirely above that for group2, which in turn lies entirely above that for group 1. This suggests that, on average, exertionmay be progressively worse at any time point as seriousness of disease worsens. We did notreject the hypothesis of parallelism in (a), either, so given the visual impression we might feelcomfortable with the idea that the profiles are approximately parallel. As discussed on pages125-126 of the notes, under this perspective, it may be reasonable to ask whether the averageof means over time is different in each group. This corresponds to the testing the Groupmain effect. The appropriate test statistic may be found in the Tests of Hypotheses forBetween Subjects Effects section of the output; the test statistic is 8.79, with a p-valueof virtually 0. If the model is correct (dubious), we would thus reject the null hypothesisthat the averages are the same for all groups at any reasonable level of significance (e.g. 0.05or even 0.01). We would conclude that there is strong evidence to suggest that the averagesover time differ. If parallelism really holds, then we could conclude that the profiles do notcoincide.

(d) One investigator suspected that the overall trend of mean physical exertion over the 6[5 points]minutes, as reflected by a straight line, is different for the three groups. Is there evidence inthese data to support his claim? Cite specific information in the output in support of youranswer (assuming as in (b) that the model is correct).

This may be addressed (assuming the model is correct) by the test for the portion of thegroup*min effect associated with the contrast among the polynomial contrasts associatedwith the linear component. The test statistic and p-value may be found under the Analysisof Variance of Contrast Variables section of the output under Contrast Variable:

7

Page 645: Applied Longitudinal Data Analysis:Lecture Notes

min 1 and corresponds to the group effect. The test statistic is 3.35 with an associated p-value of 0.04. At level of significance 0.05, we would reject the null hypothesis that the overalllinear trend is the same in each group; there seems to be some evidence in support of theinvestigator’s suspicion.

/* Note: the variable "age" is not used in this problem */

data exert1; infile "exert.dat";input subject min exert age group; * min = time in minutes;minplus=min+1; * exert = physical exertion measurement;

run;

proc sort data=exert1; by group subject age; run;data exert2(keep=min0-min6 group subject age);array ee{7} min0-min6;do minplus=1 to 7;

set exert1; by group subject age;ee{minplus}=exert;if last.subject then return;

end; run;

proc sort data=exert2; by group; run;proc corr cov; by group;var min0 min1 min2 min3 min4 min5 min6; run;

proc glm data=exert2;class group;model min0 min1 min2 min3 min4 min5 min6 = group /nouni;repeated min 7 (0 1 2 3 4 5 6) polynomial / printe printm summary nom;

run;

-------------------------------------------- group=1 --------------------------------------------------

The CORR Procedure

7 Variables: min0 min1 min2 min3 min4 min5 min6

Covariance Matrix, DF = 29

min0 min1 min2 min3 min4 min5 min6

min0 1.81637 1.70810 2.09379 2.04620 2.22706 2.23775 2.10344min1 1.70810 2.05564 2.24967 2.21558 2.33748 2.45086 2.34813min2 2.09379 2.24967 3.15085 2.96634 3.11462 3.11758 2.84455min3 2.04620 2.21558 2.96634 3.25627 3.02075 3.05000 2.83055min4 2.22706 2.33748 3.11462 3.02075 3.49196 3.32017 3.13951min5 2.23775 2.45086 3.11758 3.05000 3.32017 3.56120 3.19896min6 2.10344 2.34813 2.84455 2.83055 3.13951 3.19896 3.29406

Pearson Correlation Coefficients, N = 30Prob > |r| under H0: Rho=0

min0 min1 min2 min3 min4 min5 min6

min0 1.00000 0.88397 0.87522 0.84137 0.88429 0.87986 0.85993<.0001 <.0001 <.0001 <.0001 <.0001 <.0001

min1 0.88397 1.00000 0.88396 0.85636 0.87245 0.90583 0.90237<.0001 <.0001 <.0001 <.0001 <.0001 <.0001

min2 0.87522 0.88396 1.00000 0.92608 0.93898 0.93069 0.88294<.0001 <.0001 <.0001 <.0001 <.0001 <.0001

min3 0.84137 0.85636 0.92608 1.00000 0.89582 0.89565 0.86426<.0001 <.0001 <.0001 <.0001 <.0001 <.0001

min4 0.88429 0.87245 0.93898 0.89582 1.00000 0.94151 0.92568<.0001 <.0001 <.0001 <.0001 <.0001 <.0001

min5 0.87986 0.90583 0.93069 0.89565 0.94151 1.00000 0.93400<.0001 <.0001 <.0001 <.0001 <.0001 <.0001

min6 0.85993 0.90237 0.88294 0.86426 0.92568 0.93400 1.00000<.0001 <.0001 <.0001 <.0001 <.0001 <.0001

--------------------------------------------- group=2 -------------------------------------------------

Covariance Matrix, DF = 29

min0 min1 min2 min3 min4 min5 min6

min0 2.13774 1.87087 2.26498 2.15583 2.59367 2.47259 2.69510min1 1.87087 2.00602 2.16018 2.10519 2.51218 2.48981 2.69420min2 2.26498 2.16018 2.84878 2.50549 2.99091 2.83087 3.05993min3 2.15583 2.10519 2.50549 2.67081 2.90408 2.82174 2.99762min4 2.59367 2.51218 2.99091 2.90408 3.63729 3.38735 3.49431min5 2.47259 2.48981 2.83087 2.82174 3.38735 3.47705 3.50868min6 2.69510 2.69420 3.05993 2.99762 3.49431 3.50868 4.29596

8

Page 646: Applied Longitudinal Data Analysis:Lecture Notes

Pearson Correlation Coefficients, N = 30Prob > |r| under H0: Rho=0

min0 min1 min2 min3 min4 min5 min6

min0 1.00000 0.90344 0.91782 0.90223 0.93014 0.90692 0.88934<.0001 <.0001 <.0001 <.0001 <.0001 <.0001

min1 0.90344 1.00000 0.90364 0.90950 0.93002 0.94274 0.91777<.0001 <.0001 <.0001 <.0001 <.0001 <.0001

min2 0.91782 0.90364 1.00000 0.90833 0.92915 0.89947 0.87468<.0001 <.0001 <.0001 <.0001 <.0001 <.0001

min3 0.90223 0.90950 0.90833 1.00000 0.93175 0.92596 0.88496<.0001 <.0001 <.0001 <.0001 <.0001 <.0001

min4 0.93014 0.93002 0.92915 0.93175 1.00000 0.95250 0.88398<.0001 <.0001 <.0001 <.0001 <.0001 <.0001

min5 0.90692 0.94274 0.89947 0.92596 0.95250 1.00000 0.90784<.0001 <.0001 <.0001 <.0001 <.0001 <.0001

min6 0.88934 0.91777 0.87468 0.88496 0.88398 0.90784 1.00000<.0001 <.0001 <.0001 <.0001 <.0001 <.0001

---------------------------------------------- group=3 ------------------------------------------------

Covariance Matrix, DF = 29

min0 min1 min2 min3 min4 min5 min6

min0 2.42786 2.50310 2.36006 2.55924 2.65758 2.96827 2.82351min1 2.50310 3.20764 2.98109 3.10258 3.34327 3.54385 3.30862min2 2.36006 2.98109 3.40516 3.34162 3.44534 3.71350 3.51234min3 2.55924 3.10258 3.34162 3.84837 3.65189 4.03603 3.81179min4 2.65758 3.34327 3.44534 3.65189 4.04396 4.04258 4.03034min5 2.96827 3.54385 3.71350 4.03603 4.04258 4.66005 4.27206min6 2.82351 3.30862 3.51234 3.81179 4.03034 4.27206 4.37958

Pearson Correlation Coefficients, N = 30Prob > |r| under H0: Rho=0

min0 min1 min2 min3 min4 min5 min6

min0 1.00000 0.89696 0.82081 0.83726 0.84815 0.88246 0.86589<.0001 <.0001 <.0001 <.0001 <.0001 <.0001

min1 0.89696 1.00000 0.90201 0.88306 0.92827 0.91661 0.88275<.0001 <.0001 <.0001 <.0001 <.0001 <.0001

min2 0.82081 0.90201 1.00000 0.92310 0.92845 0.93222 0.90952<.0001 <.0001 <.0001 <.0001 <.0001 <.0001

min3 0.83726 0.88306 0.92310 1.00000 0.92571 0.95306 0.92848<.0001 <.0001 <.0001 <.0001 <.0001 <.0001

min4 0.84815 0.92827 0.92845 0.92571 1.00000 0.93124 0.95768<.0001 <.0001 <.0001 <.0001 <.0001 <.0001

min5 0.88246 0.91661 0.93222 0.95306 0.93124 1.00000 0.94564<.0001 <.0001 <.0001 <.0001 <.0001 <.0001

min6 0.86589 0.88275 0.90952 0.92848 0.95768 0.94564 1.00000<.0001 <.0001 <.0001 <.0001 <.0001 <.0001

The GLM ProcedureClass Level Information

Class Levels Values

group 3 1 2 3

Number of observations 90

Repeated Measures Analysis of Variance

Repeated Measures Level Information

Dependent Variable min0 min1 min2 min3 min4 min5 min6

Level of min 0 1 2 3 4 5 6

min_N represents the nth degree polynomial contrast for min

M Matrix Describing Transformed Variables

min0 min1 min2 min3 min4 min5 min6

min_1 -.566946 -.377964 -.188982 0.000000 0.188982 0.377964 0.566946min_2 0.545544 -.000000 -.327326 -.436435 -.327326 -.000000 0.545544min_3 -.408248 0.408248 0.408248 0.000000 -.408248 -.408248 0.408248min_4 0.241746 -.564076 0.080582 0.483493 0.080582 -.564076 0.241746

9

Page 647: Applied Longitudinal Data Analysis:Lecture Notes

min_5 -.109108 0.436435 -.545544 0.000000 0.545544 -.436435 0.109108min_6 0.032897 -.197385 0.493463 -.657951 0.493463 -.197385 0.032897

The GLM ProcedureRepeated Measures Analysis of Variance

Sphericity Tests

Mauchly’sVariables DF Criterion Chi-Square Pr > ChiSqTransformed Variates 20 0.5559223 49.775296 0.0002Orthogonal Components 20 0.5559223 49.775296 0.0002

Repeated Measures Analysis of VarianceTests of Hypotheses for Between Subjects Effects

Source DF Type III SS Mean Square F Value Pr > F

group 2 360.120413 180.060206 8.79 0.0003Error 87 1781.279524 20.474477

Repeated Measures Analysis of VarianceUnivariate Tests of Hypotheses for Within Subject Effects

Adj Pr > FSource DF Type III SS Mean Square F Value Pr > F G - G H - F

min 6 75.1563175 12.5260529 36.08 <.0001 <.0001 <.0001min*group 12 5.7995873 0.4832989 1.39 0.1653 0.1827 0.1754Error(min) 522 181.2298095 0.3471835

Greenhouse-Geisser Epsilon 0.8161Huynh-Feldt Epsilon 0.8905

Repeated Measures Analysis of VarianceAnalysis of Variance of Contrast Variables

min_N represents the nth degree polynomial contrast for min

Contrast Variable: min_1

Source DF Type III SS Mean Square F Value Pr > F

Mean 1 73.98858730 73.98858730 115.32 <.0001group 2 4.30403175 2.15201587 3.35 0.0395Error 87 55.82095238 0.64162014

Contrast Variable: min_2

Source DF Type III SS Mean Square F Value Pr > F

Mean 1 0.11433333 0.11433333 0.26 0.6107group 2 0.43466667 0.21733333 0.50 0.6106Error 87 38.11028571 0.43804926

Contrast Variable: min_3

Source DF Type III SS Mean Square F Value Pr > F

Mean 1 0.09600000 0.09600000 0.42 0.5187group 2 0.17733333 0.08866667 0.39 0.6796Error 87 19.88666667 0.22858238

Contrast Variable: min_4

Source DF Type III SS Mean Square F Value Pr > F

Mean 1 0.03620202 0.03620202 0.14 0.7121group 2 0.29628283 0.14814141 0.56 0.5728Error 87 22.98413853 0.26418550

Contrast Variable: min_5

Source DF Type III SS Mean Square F Value Pr > F

Mean 1 0.81719048 0.81719048 3.60 0.0610group 2 0.20352381 0.10176190 0.45 0.6400Error 87 19.73571429 0.22684729

Contrast Variable: min_6

Source DF Type III SS Mean Square F Value Pr > F

Mean 1 0.10400433 0.10400433 0.37 0.5465group 2 0.38374892 0.19187446 0.68 0.5113Error 87 24.69205195 0.28381669

10

Page 648: Applied Longitudinal Data Analysis:Lecture Notes

5. Consider the physical exertion data in Problem 4. Based on the visual evidence, one inves-tigator proposed adopting instead the following statistical model for Yij = physical exertionmeasurement for subject i at time tij :

Yij = β1 + β4tij + εij , i in group 1= β2 + β5tij + εij , i in group 2= β3 + β6tij + εij , i in group 3

Define β = (β1, β2, β3, β4, β5, β6)′.

(a) The investigators first fit this model several times, each time assuming something different[5 points]about the εij . The basic code they used looked like

proc mixed data=exert1;class group subject;model exert = group group*min / noint solution;repeated / STUFF;

run;

Here, STUFF looked different depending on the assumption on the εij . In the following table,AIC and BIC values resulting from taking STUFF to be several different things are given:

STUFF AIC BIC

type=un subject=subject group=group r rcorr; 1497.5 1707.5type=un subject=subject r rcorr; 1445.5 1515.5type=cs subject=subject group=group r rcorr; 1504.6 1519.6type=cs subject=subject r rcorr; 1498.3 1503.3type=ar(1) subject=subject group=group r rcorr; 1553.5 1568.5type=ar(1) subject=subject r rcorr; 1547.0 1552.0

Based on these results, state the particular covariance model among those considered by theinvestigators that you would assume for this analysis and explain why you chose it, citingspecific information here and in Problem 4 that you may have used to decide. (Give the nameof the model, not just the SAS type designation.)

Of course, the AIC and BIC results are in conflict; AIC prefers a common (for all groups)unstructured covariance structure (type=un, AIC = 1445.5) while BIC prefers the (common)compound symmetric structure (type = cs, BIC = 1503.3). From Problem 4, the samplecovariance matrices for each group did seem to suggest that compound symmetric correlationstructure is plausible; the correlations were all very strong and positive for all time pointpairs. (Although in that problem we were a bit concerned about variance changing overtime; note here that the investigators have restricted attention to homogeneous covariancestructures). On the basis of this observation and parsimony, among the models consideredby the investigators, it thus seems like the (homogeneous) compound symmetric structure,same for all groups, would be an appropriate choice. On the other hand, as there is someevidence of variance changing over time or different by group (reflected possibly by the test forsphericity), we might feel safer with the unstructured assumption, which is the only structureconsidered by the investigators that allows variance to be different at different time points.This is really a judgment call!

(b) Explain what is being modeled by the covariance structure in (a).[5 points]

In this modeling strategy, εij is an overall deviation corresponding to the aggregate effectsof deviations due to both within- and among-unit sources of variation and correlation. Thecovariance structure is a model for the covariance matrix of the vector of εijs, and hence the

11

Page 649: Applied Longitudinal Data Analysis:Lecture Notes

covariance matrix of a data vector, taking into account the aggregate effects of both sourcesof variation.

Many of you gave different answers for this; e.g., you explained the form of the model youassumed. No credit was taken off unless you said something that is incorrect.

12

Page 650: Applied Longitudinal Data Analysis:Lecture Notes

For convenience, here is the statistical model again:

Yij = β1 + β4tij + εij , i in group 1= β2 + β5tij + εij , i in group 2, β = (β1, β2, β3, β4, β5, β6)′

= β3 + β6tij + εij , i in group 3

The investigators assumed one of the covariance models. On the next page you will find thecode they ran and excerpts of its output; use this information to answer the following:

(c) One investigator wondered whether or not the 3 mean physical exertion profiles in fact[5 points]coincide over the entire period from 0 to 6 minutes. From the output, give the value of thetest statistic and associated p-value appropriate for testing the relevant null hypothesis H0,and state your conclusion regarding the strength of the evidence against H0. (You need notstate H0.)

With this definition of β, we wish to test whether, simultaneously, β1 = β2 = β3 and β4 =β5 = β6. An appropriate L matrix is

L =

1 −1 0 0 0 01 0 −1 0 0 00 0 0 1 −1 00 0 0 1 0 −1

.

Thus, we see that a test statistic for this null hypothesis is given by contrast E; from theoutput, the numerical value of the chi-square statistic is 30.16, with a corresponding p-valueof virtually 0. The evidence is very strong in support of the contention that the 3 meanphysical exertion profiles do not coincide.

(d) The main question of interest was whether or not the way in which mean physical exertion[5 points]changes over the study period is same for all 3 groups. From the output, give the value ofthe test statistic and associated p-value appropriate for testing the relevant null hypothesisH0, and state your conclusion regarding the strength of the evidence against H0. (You neednot state H0.)

According to the model, in each group, mean physical exertion changes at constant rate β4,β5, or β6 for Groups 1, 2, or 3, respectively. Thus, the question is whether β4 = β5 = β6. Anappropriate L matrix is

L =

(0 0 0 1 −1 00 0 0 1 0 −1

).

Thus, we see that a test statistic for this null hypothesis is given by contrast B; from theoutput, the numerical value of the chi-square statistic is 12.57, with a corresponding p-valueof 0.002 The evidence is strong in support of the contention that the way mean physicalexertion changes (which is at a constant rate) is not the same for all groups.

Part (e) of this problem is on the next page!

13

Page 651: Applied Longitudinal Data Analysis:Lecture Notes

(e) In the data set, the variable age is an indicator of whether the subject’s age is < 50 years[5 points](age=0) or ≥ 50 (age=1). One investigator thought that, although there is no associationbetween age and initial mean physical exertion at time 0, the rate of change of mean physicalexertion within each group might be different depending on age in a way that might bedifferent for each group. Defining ai = 0 if age< 50 and ai = 1 if age≥ 50, modify thestatistical model on the previous page to incorporate this possibility.

Also, treating age as a numerical variable (so it would not be included in the class statement),modify the model statement used by the investigators so that proc mixed will fit your modelexactly as you have parameterized it.

Such a model is given by

Yij = β1 + (β4 + β7ai)tij + εij , i in group 1= β2 + (β5 + β8ai)tij + εij , i in group 2= β3 + (β6 + β9ai)tij + εij , i in group 3

This model can be rewritten as

Yij = β1 + β4tij + β7aitij + εij , i in group 1= β2 + β5tij + β8aitij + εij , i in group 2= β3 + β6tij + β9aitij + εij , i in group 3

This model says that the slope in group 1 for patients < 50 (ai = 0) is β4 while for patients≥ 50 (ai = 1) the slope is β4 + β7, and similarly for group 2 (slope β5 for ai = 0 and β5 + β8

for ai = 1) and group 3 (slope β6 for ai = 0 and β6 + β9 for ai = 1).

By “the rules” for how SAS parameterizes models in Section 8.9 of the notes, if we treat ageas a numeric variable, it is straightforward that the following model statement will produceexactly this model:

model exert = group group*min group*age*min / noint solution;

In particular, with group as a class variables (but not age), the group variable will createthe three intercepts β1, β2, β3 and the group*min effect will create the three slopes β4, β5, β6

as in the investigators’ code. The addition of the group*age*min effect with age as numericsimply creates an additional term of the form βk(ta) for each group; that is, for group 1, itwill create a term β7aitij (which is 0 unless ai = 1) and similarly for the other groups, justas in the model specification above.

Some of you left off the noint option. This would cause SAS to revert to the “difference”parameterization, so that the resulting fit would not corespond exactly to the model as youparameterized it.

For those interested, here is the resulting Solution for Fixed Effects table:

Solution for Fixed Effects

StandardEffect group Estimate Error DF t Value Pr > |t|

group 1 4.9331 0.3158 87 15.62 <.0001group 2 5.7429 0.3158 87 18.19 <.0001group 3 6.4857 0.3158 87 20.54 <.0001min*group 1 0.08260 0.02725 534 3.03 0.0026min*group 2 0.1754 0.02573 534 6.82 <.0001min*group 3 0.1999 0.02386 534 8.38 <.0001min*age*group 1 0.09393 0.03950 534 2.38 0.0178min*age*group 2 -0.03503 0.04022 534 -0.87 0.3841min*age*group 3 0.08766 0.04300 534 2.04 0.0420

14

Page 652: Applied Longitudinal Data Analysis:Lecture Notes

If instead we declared age to be a class variable, it would be up to SAS to choose the“reference” category for age, so we run the risk that it would not parameterize the modelexactly as we had intended. It turns out that if instead we ran the code with

class group subject age;model exert = group group*min group*age*min / noint solution;

SAS will choose to parameterize the model as

Yij = β1 + β∗4tij + β∗7(1− ai)tij + εij , i in group 1= β2 + β∗5tij + β∗8(1− ai)tij + εij , i in group 2= β3 + β∗6tij + β∗9(1− ai)tij + εij , i in group 3;

that is, now β∗4 , β∗5 , β∗6 will be the slopes when ai = 1 and β∗4 + β∗7 , β∗5 + β∗8 , β∗6 + β∗9 theslopes when ai = 0. Thus, SAS chooses to make age=1 the “reference” category whose slopeis parameterized explicitly, while our code above makes age=0 the reference. Here is theresulting Solution for Fixed Effects table:

Solution for Fixed Effects

StandardEffect group age Estimate Error DF t Value Pr > |t|

group 1 4.9331 0.3158 87 15.62 <.0001group 2 5.7429 0.3158 87 18.19 <.0001group 3 6.4857 0.3158 87 20.54 <.0001min*group 1 0.1765 0.02910 534 6.07 <.0001min*group 2 0.1404 0.03139 534 4.47 <.0001min*group 3 0.2876 0.03618 534 7.95 <.0001min*group*age 1 0 -0.09393 0.03950 534 -2.38 0.0178min*group*age 1 1 0 . . . .min*group*age 2 0 0.03503 0.04022 534 0.87 0.3841min*group*age 2 1 0 . . . .min*group*age 3 0 -0.08766 0.04300 534 -2.04 0.0420min*group*age 3 1 0 . . . .

In the first solution, we have β4 = 0.08260 (slope in group 1 for ai = 0) and β4 + β7 =0.08260 + 0.09393 = 0.1765 (slope in group 1 for ai = 1). In the second solution, we haveβ∗4 = 0.1765 (slope for group 1 when ai = 1) and β∗4 + β∗7 = 0.1765 + −0.09393 = 0.08260(slope for group 1 when ai = 0). It is similar for the other two groups.

Moral: Although the fit of the model is the same, and no credit was taken if you did notrealize this point, this underscores how important it is to understand what your model is andhow it is parameterized and the relationship of this to the SAS code.

15

Page 653: Applied Longitudinal Data Analysis:Lecture Notes

data exert1; infile "exert.dat";input subject min exert age group;

run;

proc mixed data=exert1;class group subject;model exert = group group*min / noint solution;repeated / INVESTIGATORS’ STUFF;contrast ’A’ group 0 0 0 group*min 1 0 0,

group 0 0 0 group*min 0 1 0,group 0 0 0 group*min 0 0 1 / chisq;

contrast ’B’ group 0 0 0 group*min 1 -1 0,group 0 0 0 group*min 1 0 -1 / chisq;

contrast ’C’ group 1 -1 0 group*min 0 0 0,group 1 0 -1 group*min 0 0 0 / chisq;

contrast ’D’ group 1 0 0 group*min -1 0 0,group 0 1 0 group*min 0 -1 0,group 0 0 1 group*min 0 0 -1 / chisq;

contrast ’E’ group 1 -1 0 group*min 0 0 0,group 1 0 -1 group*min 0 0 0,group 0 0 0 group*min 1 -1 0,group 0 0 0 group*min 1 0 -1 / chisq;

run;

Solution for Fixed Effects

StandardEffect group Estimate Error DF t Value Pr > |t|

group 1 4.9331 0.3181 87 15.51 <.0001group 2 5.7429 0.3181 87 18.06 <.0001group 3 6.4857 0.3181 87 20.39 <.0001min*group 1 0.1264 0.02019 537 6.26 <.0001min*group 2 0.1614 0.02019 537 8.00 <.0001min*group 3 0.2262 0.02019 537 11.20 <.0001

Contrasts

Num DenLabel DF DF Chi-Square F Value Pr > ChiSq Pr > F

A 3 537 228.63 76.21 <.0001 <.0001B 2 537 12.57 6.28 0.0019 0.0020C 2 537 11.92 5.96 0.0026 0.0028D 3 537 898.27 299.42 <.0001 <.0001E 4 537 30.16 7.54 <.0001 <.0001

16

Page 654: Applied Longitudinal Data Analysis:Lecture Notes

6. Continue to consider the physical exertion data of Problem 4. Another investigator proposedinstead the following model for Yij = physical exertion measurement for subject i at time tij :

Yij = β0i + β1itij + eij ,

β0i = β1 + b0i, β1i = β4 + b1i, i in Group 1β0i = β2 + b0i, β1i = β5 + b1i, i in Group 2β0i = β3 + b0i, β1i = β6 + b1i, i in Group 3

where eij , b0i, and b1i are mean-zero random variables.

The investigators fit this model using the following SAS code:

proc mixed data=exert1;class group subject;model exert = group group*min / noint solution;random intercept min / type=un subject=subject g gcorr v vcorr;repeated / type=ar(1) subject=subject r rcorr;

run;

(a) Write down the expression for population mean physical exertion at time tij in Group 1[5 points]implied by the above model.

Substituting the “second stage” population model for β0i and β1i for Group 1 into the “firststage” individual model and rearranging yields

Yij = β1 + β4tij + (b0i + b1itij + eij) = β1 + β4tij + εij ,

say, where we have written the “overall deviation” εij = b0i+b1itij +eij . This overall deviationhas mean 0, so that the mean physical exertion at time tij is given by

β1 + β4tij .

Some of you included random components in your expression for the population mean. Thepopulation mean by its very nature averages across all random components, so an expressionfor it cannot contain random components.

(b) The call to proc mixed above incorporates assumptions about sources of variation. Ex-[5 points]plain exactly what is being assumed about the sources of variation.

The repeated statement incorporates the assumption on within-subject sources of variationand correlation. Here, as there is no group= option, the assumption is that these sources areof a similar nature in each group. The type=ar(1) option means that we assume that thecovariance matrix of ei is Ri = σ2Γi, where Γi is the (7 × 7) AR(1) correlation model withparameter ρ, say. This suggests that perhaps the investigators are assuming that measure-ment error is negligible, so that the predominant source of within-unit variation is due to“fluctuations” in physical exertion over time. By virtue of the AR(1) assumption, they arealso assuming that the time scale over which the observations were taken is sufficiently shortthat the correlation due to these “fluctuations” may not be negligible.

The random statement also does not have a group= option, so the assumption on the natureof among-unit variation is that this is also similar across groups. The type=un specificationstates that the subject-specific intercepts and slopes are possibly correlated in the populations(e.g., large slopes may be associated with small intercepts) and that the variances of interceptsand slopes may be anything (recall that, as intercept and slope are on different scales ofmeasurement, we would not expect their variances to be the same).

Most of you did not describe things to this level of detail. No credit was taken off on thisquestion unless you said something that is incorrect or that I could not understand.

17

Page 655: Applied Longitudinal Data Analysis:Lecture Notes

(c) Give an interpretation of the parameter β4.[5 points]

This is a “subject-specific” model, so the usual interpretation of β4 is as the “typical” ormean rate of change (slope) in the population of diabetic patients with no complications. Ofcourse, as discussed in Chapter 9 and as evident in the answer to part (a), because this modelimplies a “population-averaged” model, we may equally well interpret β4 as the slope of theassumed straight-line relationship among the means in this group over time (so describingthe “typical” or mean response profile).

18

Page 656: Applied Longitudinal Data Analysis:Lecture Notes

.

ST 732, TEST 2, SPRING 2005

Please sign the following pledge certifying that the work on this test is your own:

“I have neither given nor received aid on this test.”

Signature:

Printed Name:

There are SIX questions, each with multiple parts. For each part of each question, please writeyour answers in the space provided. If you need more space, continue on the back of the page andindicate clearly where on the back you have continued your answer. Scratch paper will be provided.

You are allowed ONE (1) SHEET of HANDWRITTEN NOTES (FRONT ONLY). Calculators areNOT allowed (you will not need one). NOTHING should be on your desk but this test paper, yourone page of notes, and scratch paper given to you.

Points for each part of each problem are given in the left margin. TOTAL POINTS = 100.

In all problems, all symbols and notation are defined exactly as they are in the class notes.

If you are asked to provide a NUMERICAL ESTIMATE or EXPRESSION, and the ONLY WAYyou can see to do this involves some arithmetic (e.g., adding several numbers), YOU DO NOTHAVE TO DO THE ARITHMETIC. JUST GIVE THE EXPRESSION.

HOWEVER, if a numerical estimate IS AVAILABLE DIRECTLY from the output WITHOUThaving to do arithmetic, I will only give partial credit if you do not recognize this.

If you believe it is IMPOSSIBLE to provide a numerical estimate or expression from what is

provided, STATE THIS.

1

Page 657: Applied Longitudinal Data Analysis:Lecture Notes

1. A study was conducted to compare the effectiveness of two regimens for treating high totalcholesterol in patients with confirmed total cholesterol over 180 mg/dl who had never takencholesterol-lowering medication. (High cholesterol is thought to be associated with increasedrisk of cardiovascular disease.) m = 120 such subjects were randomized as follows:

• Treatment regimen 1: Standard (treat with Blipitor only) – 60 subjects

• Treatment regimen 2: Combination (treat with both Blipitor and Drocor) – 60 subjects

At baseline (month 0), immediately prior to starting his/her assigned regimen, each patientprovided a blood sample from which total cholesterol (mg/dl) was to be measured. Patientsthen started treatment and were to return to the clinic at 0.5, 1, 3, 6, and 9 months thereafterto provide blood samples from which total cholesterol was again to be ascertained.

Some baseline samples were contaminated, so that a baseline cholesterol measurement wasunavailable for some patients. Also, some cholesterol measurements after month 0 weredetermined to be subject to assay errors for some patients and were thrown out. Finally,some subjects were unable to appear at the clinic and provide samples for some scheduledvisits due to vacation, work-related travel, and other reasons determined to have nothing todo with the treatments or the health of the patients. Thus, not all patients have all intendedmeasurements. The data set contains 588 cholesterol measurements across the 120 patients.

Here are the data, along with the sample means for each regimen group:

0 2 4 6 8

100

150

200

250

300

Time on study (months)

Tot

al c

hole

ster

ol (

mg/

dl)

Standard treatment

0 2 4 6 8

100

150

200

250

300

Time on study (months)

Tot

al c

hole

ster

ol (

mg/

dl)

Combination treatment

0 2 4 6 8

100

150

200

250

300

Time on study (months)

Tot

al c

hole

ster

ol (

mg/

dl)

Sample means at each time (unbalanced data)

StandardCombination

Also recorded for each patient was an indicator of whether the patient was deemed to beoverweight at baseline (0 = not overweight, 1 = overweight).

The primary objective was to determine whether there is a difference in the pattern of changeof total cholesterol depending on whether patients received standard or combination therapy.A secondary objective was to conduct exploratory analyses of whether being overweight isassociated with high cholesterol before treatment and with changes in cholesterol after eithertreatment is initiated.

2

Page 658: Applied Longitudinal Data Analysis:Lecture Notes

To address the primary objective, the investigators adopted the following statistical model.Let Yij be the total cholesterol measurement for subject i, i = 1, . . . , m, at time tij , wherej = 1, . . . , ni and ni ≤ 6. Let

δi = 0 if patient i was assigned to the Standard regimen= 1 if patient i was assigned to the Combination regimen

The model isYij = β0i + β1itij + eij (1)

β0i = β00 + b0i, β1i = β10 + β11δi + b1i. (2)

(a) In the model given in (1), (2), write down the symbol that represents the “typical,” or[5 points]mean, inherent total cholesterol at baseline for patients in the Standard regimen group.

On page 4, you will find some SAS code and selected portions of its output. Use this to

answer the next two parts of this problem.

(b) The investigators’ model assumes that the “typical” (mean) “inherent” rate of change of[5 points]total cholesterol is constant over time for each regimen. Thus, the primary study hypothesisis that this “typical” (mean) rate of change differs in the population of patients dependingon whether they follow the Standard or Combination regimen.

In terms of symbols in model (1), (2), give a set of null and alternative hypotheses H0 andH1 that address this issue. From the output, give the numerical values of a test statistic andassociated p-value appropriate for testing H0 against H1, and state your conclusion regardingthe strength of the evidence against H0.

3

Page 659: Applied Longitudinal Data Analysis:Lecture Notes

Here is the model again for convenience:

δi = 0 if patient i was assigned to the Standard regimen= 1 if patient i was assigned to the Combination regimen

Yij = β0i + β1itij + eij (1)

β0i = β00 + b0i, β1i = β10 + β11δi + b1i. (2)

(c) The investigators were interested in whether the “typical” (mean) change in total choles-[5 points]terol per month that could be achieved if all patients in the high cholesterol population wereto follow the Combination regimen is different from 0. From the output, give the numeri-cal values of a test statistic and associated p-value appropriate for testing the relevant nullhypothesis H0, and state your conclusion regarding the strength of the evidence against H0

(you need not state H0).

data chol; infile "cholesterol.dat";input id overwt month chol trt; run;

proc print data=chol(obs=7); run;

proc mixed data=chol method=ml;class id;model chol = month trt*month / solution;random int month / type=un subject=id;contrast ’A’ month 1 trt*month 1 / chisq;contrast ’B’ month 1, trt*month 1 /chisq;

run;

Obs id overwt month chol trt

1 1 1 0 240.2 02 1 1 1 241.1 03 1 1 3 221.4 04 1 1 9 167.6 05 2 0 0 218.9 06 2 0 1 228.1 07 2 0 6 180.6 0

The Mixed Procedure

Solution for Fixed Effects

StandardEffect Estimate Error DF t Value Pr > |t|

Intercept 241.42 1.6265 119 148.43 <.0001month -4.5444 0.5064 117 -8.97 <.0001month*trt -3.3218 0.7157 349 -4.64 <.0001

Type 3 Tests of Fixed Effects

Num DenEffect DF DF F Value Pr > F

month 1 117 80.52 <.0001month*trt 1 349 21.54 <.0001

Contrasts

Num DenLabel DF DF Chi-Square F Value Pr > ChiSq Pr > F

A 1 349 241.60 241.60 <.0001 <.0001B 2 349 321.93 160.97 <.0001 <.0001

4

Page 660: Applied Longitudinal Data Analysis:Lecture Notes

2. Consider the cholesterol study in Problem 1. To conduct exploratory analyses regardingassociation between total cholesterol and whether patients are overweight at baseline, theinvestigators considered a modified model. Defining

δi = 0 if patient i was assigned to the Standard regimen= 1 if patient i was assigned to the Combination regimen

oi = 0 if patient i was not overweight at baseline= 1 if patient i was overweight at baseline

the model isYij = β0i + β1itij + eij (3)

β0i = β00 + β01oi + b0i, β1i = β10 + β11δi + β12oi + β13δioi + b1i. (4)

On page 7 you will find SAS code and selected portions of its output. Use this to answer the

following.

(a) One investigator was interested in whether the data support the contention that “typi-[5 points]cal” (mean) inherent total cholesterol in patients who have never taken cholesterol-loweringmedication is associated with whether the patient is overweight or not. From the output, citethe numerical values of a test statistic and associated p-value appropriate for addressing thisissue (you need not state formal hypotheses). State your conclusion regarding the strengthof the evidence in support of this contention.

(b) Another investigator wondered whether the data support the hypothesis that, among[5 points]patients taking the Combination regimen, there is an association of the “typical” (mean)rate of change of total cholesterol with whether a patient is overweight or not. From theoutput, cite the numerical values of a test statistic and associated p-value appropriate foraddressing this issue (you need not state formal hypotheses). State your conclusion regardingthe strength of the evidence in support of this hypothesis.

5

Page 661: Applied Longitudinal Data Analysis:Lecture Notes

Here is the model again for convenience:

δi = 0 if patient i was assigned to the Standard regimen= 1 if patient i was assigned to the Combination regimen

oi = 0 if patient i was not overweight at baseline= 1 if patient i was overweight at baseline

Yij = β0i + β1itij + eij (3)

β0i = β00 + β01oi + b0i, β1i = β10 + β11δi + β12oi + β13δioi + b1i. (4)

(c) Based on the output, provide a numerical estimate of the “typical” (mean) rate of change[5 points]of total cholesterol for overweight patients following the Standard regimen.

(d) The investigators were interested in whether the data suggest that “typical” (mean) rate[5 points]of change of total cholesterol for overweight patients who received the Standard regimen isdifferent from that for overweight patients who received the Combination regimen. From theoutput, cite the numerical values of a test statistic and associated p-value appropriate foraddressing this issue (you need not state formal hypotheses). State your conclusion regardingthe strength of the evidence in support of this hypothesis.

6

Page 662: Applied Longitudinal Data Analysis:Lecture Notes

proc mixed data=chol method=ml;class id;model chol = overwt month month*trt overwt*month overwt*month*trt / solution;random int month / type=un subject=id g gcorr;contrast ’A’ month 1 overwt*month 1 / chisq;contrast ’B’ month 1, overwt*month 1 /chisq;contrast ’C’ overwt*month 1 overwt*month*trt 1 / chisq;contrast ’D’ overwt*month 1, overwt*month*trt 1 / chisq;contrast ’E’ month*trt 1 overwt*month*trt 1 / chisq;contrast ’F’ month*trt 1, overwt*month*trt 1 / chisq;estimate ’A’ month 1 month*trt 1;estimate ’B’ month 1 overwt*month 1;estimate ’C’ month 1 overwt*month 1 month*trt 1;estimate ’D’ month 1 month*trt 1 overwt*month*trt 1;estimate ’E’ month 1 month*trt 1 overwt*month 1 overwt*month*trt 1;

run;

The Mixed Procedure

Solution for Fixed Effects

StandardEffect Estimate Error DF t Value Pr > |t|

Intercept 231.88 2.1458 118 108.07 <.0001overwt 17.3828 2.8700 349 6.06 <.0001month -5.4007 0.6732 115 -8.02 <.0001month*trt -4.8859 0.9504 349 -5.14 <.0001overwt*month 1.4418 0.9054 349 1.59 0.1122overwt*month*trt 2.9800 1.2728 349 2.34 0.0198

Type 3 Tests of Fixed Effects

Num DenEffect DF DF F Value Pr > F

overwt 1 349 36.68 <.0001month 1 115 64.36 <.0001month*trt 1 349 26.43 <.0001overwt*month 1 349 2.54 0.1122overwt*month*trt 1 349 5.48 0.0198

Estimates

StandardLabel Estimate Error DF t Value Pr > |t|

A -10.2866 0.6816 349 -15.09 <.0001B -3.9589 0.6055 349 -6.54 <.0001C -8.8448 1.1269 349 -7.85 <.0001D -7.3066 1.0816 349 -6.76 <.0001E -5.8648 0.5988 349 -9.79 <.0001

Contrasts

Num DenLabel DF DF Chi-Square F Value Pr > ChiSq Pr > F

A 1 349 42.75 42.75 <.0001 <.0001B 2 349 107.11 53.56 <.0001 <.0001C 1 349 23.75 23.75 <.0001 <.0001D 2 349 26.08 13.04 <.0001 <.0001E 1 349 5.07 5.07 0.0244 0.0250F 2 349 31.50 15.75 <.0001 <.0001

7

Page 663: Applied Longitudinal Data Analysis:Lecture Notes

3. Consider yet again the cholesterol study in Problem 1. On page 9 you will find some SAS

code that fits two different models to these data along with selected portions of the output.

Use this to answer the following questions.

(a) Based on each of “Fit (A)” and “Fit (B),” give a numerical expression characterizing the[5 points]“inherent” rate of change in total cholesterol for Patient 3 (this patient is in the Standardregimen group). Thus, you should give two expressions, one based on the results of each fit.

(b) One of the investigators was interested in determining which of the models assumed by[5 points]“Fit (A)” and “ Fit (B)” is better supported by the data. She constructed the numerical teststatistic 5392.3 − 5283.9 = 108.4, compared it to the critical value χ2

2,0.95 = 5.99, and wrotethe following statement: “Based on comparing this test statistic to the χ2

2,0.95 critical value of5.99, we may conclude at level of significance 0.05 that the data support adopting the modelof Fit (A).” Make any comments you feel are relevant about her statement.

8

Page 664: Applied Longitudinal Data Analysis:Lecture Notes

title ’Fit (A)’;proc mixed data=chol method=ml;class id;model chol = month trt*month / solution;random int month / type=un subject=id solution;

run;

The Mixed Procedure

Covariance Parameter Estimates

Cov Parm Subject Estimate

UN(1,1) id 200.85UN(2,1) id 20.7594UN(2,2) id 9.5769Residual 267.92

Fit Statistics

-2 Log Likelihood 5283.9AIC (smaller is better) 5297.9AICC (smaller is better) 5298.1BIC (smaller is better) 5317.5

Solution for Fixed Effects

StandardEffect Estimate Error DF t Value Pr > |t|

Intercept 241.42 1.6265 119 148.43 <.0001month -4.5444 0.5064 117 -8.97 <.0001month*trt -3.3218 0.7157 349 -4.64 <.0001

Solution for Random Effects

Std ErrEffect id Estimate Pred DF t Value Pr > |t|

Intercept 1 -2.6972 7.3854 349 -0.37 0.7152month 1 -2.2531 1.5818 349 -1.42 0.1552Intercept 2 -12.1262 7.7387 349 -1.57 0.1180month 2 -2.3330 1.9627 349 -1.19 0.2354Intercept 3 1.9129 7.2834 349 0.26 0.7930month 3 -0.2763 1.4967 349 -0.18 0.8537Intercept 4 -4.4688 7.8403 349 -0.57 0.5691month 4 0.5717 1.4956 349 0.38 0.7025

title ’Fit (B)’;proc mixed data=chol method=ml;class id;model chol = month trt*month / solution;random int / type=un subject=id solution;

run;

The Mixed Procedure

Covariance Parameter Estimates

Cov Parm Subject Estimate

UN(1,1) id 408.99Residual 390.17

Fit Statistics

-2 Log Likelihood 5392.3AIC (smaller is better) 5402.3AICC (smaller is better) 5402.5BIC (smaller is better) 5416.3

Solution for Fixed Effects

StandardEffect Estimate Error DF t Value Pr > |t|

Intercept 241.23 2.1954 119 109.88 <.0001month -4.6387 0.3452 466 -13.44 <.0001month*trt -3.1363 0.4685 466 -6.69 <.0001

Solution for Random Effects

Std ErrEffect id Estimate Pred DF t Value Pr > |t|

Intercept 1 -6.9307 9.0454 466 -0.77 0.4439Intercept 2 -16.0932 10.0625 466 -1.60 0.1104Intercept 3 1.8950 8.3088 466 0.23 0.8197Intercept 4 -3.0159 9.0678 466 -0.33 0.7396

9

Page 665: Applied Longitudinal Data Analysis:Lecture Notes

4. A study was conducted to examine factors associated with the development of bronchopul-monary dysplasia (BPD), a chronic lung disease, in pre-term infants weighing less than 1750grams (g) (1.75 kilograms, kg). Data were collected on 223 infants. For j = 1, . . . , 223, let

Yj = 0 if infant j did not develop BPD= 1 if infant j did develop BPD

wj = birthweight (kg) of infant j

aj = gestational age (weeks) of infant j

pj = 0 if the mother of infant j did not develop toxemia while pregnant= 1 if the mother of infant j developed toxemia while pregnant

Toxemia, also known as preeclampsia, is a condition potentially dangerous to the infant. Theinvestigators considered the following model:

P (Yj = 1) =exp(β0 + β1wj + β2aj + β3pj)

1 + exp(β0 + β1wj + β2aj + β3pj), (5)

On page 12, you will find some SAS code and selected portions of its output. Use this to

answer the following.

(a) One investigator was interested in whether the data have evidence to suggest that at least[5 points]one of birthweight, gestational age, or whether the mother developed toxemia is associatedwith whether or not infants in this population develop BPD. From the output, cite thenumerical values of a test statistic and associated p-value appropriate for addressing thisissue (you need not state formal hypotheses). State your conclusion regarding the strengthof the evidence in support of the contention that there is such an association.

10

Page 666: Applied Longitudinal Data Analysis:Lecture Notes

For convenience, here is the model again:

Yj = 0 if infant j did not develop BPD= 1 if infant j did develop BPD

wj = birthweight (kg) of infant j

aj = gestational age (weeks) of infant j

pj = 0 if the mother of infant j did not develop toxemia while pregnant= 1 if the mother of infant j developed toxemia while pregnant

P (Yj = 1) =exp(β0 + β1wj + β2aj + β3pj)

1 + exp(β0 + β1wj + β2aj + β3pj), (5)

(b) From the output, give a numerical expression for an estimate of the variance of BPD[5 points]responses in the population of infants with birthweight of 1 kg, gestational age of 30 weeks,and mother who developed toxemia while pregnant.

(c) From the output, provide a numerical estimate of the odds ratio comparing the odds of[5 points]an infant developing BPD if his/her mother had toxemia while pregnant to the odds if themother did not. Cite evidence in the output that either supports or does not support thecontention that having a mother with toxemia is associated with increased odds of an infantdeveloping BPD.

11

Page 667: Applied Longitudinal Data Analysis:Lecture Notes

data bpd; infile "bpd.dat"; input bpd weight gestage toxemia;weight=weight/1000; * put birthweight in units of kilograms (kg);

run;

proc print data=bpd(obs=4); run;

proc genmod data=bpd descending;model bpd = weight gestage toxemia / dist=binomial link=logit;contrast ’A’ weight 1 gestage 1 toxemia 1 / wald;contrast ’B’ weight 1, gestage 1, toxemia 1 / wald;contrast ’C’ weight 1 gestage 30 toxemia 1 / wald;estimate ’A’ int 0 weight 0 gestage 0 toxemia 1 / exp;estimate ’B’ int 1 weight 1 gestage 1 toxemia 1 /exp;estimate ’C’ int 1 weight 1 gestage 30 toxemia 1 / exp;estimate ’D’ weight 1 gestage 30 toxemia 1 /exp;

run;

Obs bpd weight gestage toxemia

1 1 0.85 27 02 0 1.50 33 03 1 1.36 32 04 0 0.96 35 1

The GENMOD Procedure

PROC GENMOD is modeling the probability that bpd=’1’.

Analysis Of Parameter Estimates

Standard Wald 95% Confidence Chi-Parameter DF Estimate Error Limits Square Pr > ChiSq

Intercept 1 13.9361 2.9826 8.0904 19.7818 21.83 <.0001weight 1 -2.6436 0.8123 -4.2357 -1.0515 10.59 0.0011gestage 1 -0.3885 0.1149 -0.6137 -0.1634 11.44 0.0007toxemia 1 -1.3438 0.6075 -2.5345 -0.1531 4.89 0.0270Scale 0 1.0000 0.0000 1.0000 1.0000

NOTE: The scale parameter was held fixed.

Contrast Estimate Results

Standard Chi-Label Estimate Error Alpha Confidence Limits Square Pr > ChiSq

A -1.3438 0.6075 0.05 -2.5345 -0.1531 4.89 0.0270Exp(A) 0.2609 0.1585 0.05 0.0793 0.8580B 9.5602 3.2670 0.05 3.1569 15.9635 8.56 0.0034Exp(B) 14188.44 46354.29 0.05 23.4973 8567423C -1.7074 0.5818 0.05 -2.8476 -0.5671 8.61 0.0033Exp(C) 0.1813 0.1055 0.05 0.0580 0.5671D -15.6434 3.1635 0.05 -21.8439 -9.4430 24.45 <.0001Exp(D) 0.0000 0.0000 0.05 0.0000 0.0001

Contrast Results

Chi-Contrast DF Square Pr > ChiSq Type

A 1 17.37 <.0001 WaldB 3 50.79 <.0001 WaldC 1 24.45 <.0001 Wald

12

Page 668: Applied Longitudinal Data Analysis:Lecture Notes

5. A study was conducted to compare three treatments for asthma. A total of m = 90 subjectssuffering from mild to moderate asthma were randomized into 3 groups:

• Treatment 1 (30 subjects)

• Treatment 2 (30 subjects)

• Treatment 3 (30 subjects)

In the 1-week period before starting his/her assigned treatment, each subject was asked torecord the number of asthmatic episodes s/he experienced during the period. This numberof episodes was taken as the baseline (week 0) response. All subjects were then started ontreatment. Each subject then recorded the number of episodes experienced in the first 1-weekperiod after starting treatment (week 1) and the number of episodes in the second 1-weekperiod (week 2). Luckily, episode responses were recorded for all 90 subjects for each timeperiod. Also collected for each subject was whether s/he lived in a rural or city environment.

The following table shows the mean number of episodes experienced across the 30 subjectsin each group during each 1-week period:

Treatment baseline (week 0) week 1 week 2

1 8.7 5.5 5.12 8.4 4.8 5.83 8.9 9.2 10.2

Let Yij be the number of episodes for subject i, i = 1, . . . , 90, in week tij = 0, 1, 2, and let

δ1i = 1 if subject i received Treatment 1, = 0 otherwiseδ2i = 1 if subject i received Treatment 2, = 0 otherwiseδ3i = 1 if subject i received Treatment 3, = 0 otherwise

si = 0 if tij = 0= 1 if tij > 0

The investigators considered initially the following model for the mean number of episodes:

E(Yij) = exp(β0 + β1siδ1i + β2siδ2i + β3siδ3i), (6)

On page 15, you will find some SAS code and selected portions of its output. Use this to

answer the following.

(a) From the output, provide a numerical estimate of the logarithm of the mean number[5 points]of episodes at baseline experienced by subjects who received Treatment 2. Also providethe numerical value (to 4 decimal places) of an associated standard error that provides areliable measure of uncertainty even if the investigators’ assumption about associations amongnumbers of episodes on the same subject is incorrect.

13

Page 669: Applied Longitudinal Data Analysis:Lecture Notes

For convenience, here is the model again:

δ1i = 1 if subject i received Treatment 1, = 0 otherwiseδ2i = 1 if subject i received Treatment 2, = 0 otherwiseδ3i = 1 if subject i received Treatment 3, = 0 otherwise

si = 0 if tij = 0= 1 if tij > 0

E(Yij) = exp(β0 + β1siδ1i + β2siδ2i + β3siδ3i), (6)

(b) The investigators wondered if the data contain evidence to suggest that at least one of[5 points]the 3 Treatments leads to a population mean number of episodes different from those forthe others. Cite the numerical values of a test statistic and associated p-value that addressthis issue (you need not state formal hypotheses), and state your conclusion regarding thestrength of the evidence.

(c) Based on the fit of (6), give a numerical estimate of the population mean number of[5 points]episodes after initiation of Treatment 1.

(d) Treatment 1 and 2 are thought to work by the same mechanism, so the investigators[5 points]expected similar results for both. The investigators thus wanted to know whether the datacontain evidence to suggest that these two treatments lead to different population meannumbers of episodes. Cite the numerical values of a test statistic and associated p-valuethat address this issue (you need not state the formal hypothesis). State your conclusionregarding the strength of the evidence that there is a difference in mean numbers of episodesfor Treatments 1 and 2.

14

Page 670: Applied Longitudinal Data Analysis:Lecture Notes

data asthma; infile "asthma.dat";input id episodes week trt city;s=1; if week=0 then s=0; run;

proc print data=asthma(obs=6); run;

proc genmod data=asthma;class id trt;model episodes = trt*s / dist=poisson link=log;repeated subject=id / type=cs corrw modelse;contrast ’A’ trt*s 1 -1 0, trt*s 1 0 -1 / wald;contrast ’B’ trt*s 1 0 0, trt*s 0 1 0, trt*s 0 0 1 / wald;contrast ’C’ trt*s 1 0 0, trt*s 0 1 0 / wald;contrast ’D’ trt*s 1 -1 0 / wald;estimate ’A’ int 1 trt*s 1 0 0 / exp;estimate ’B’ int 1 trt*s 0 0 0 / exp;estimate ’C’ int 1 trt*s 1 -1 0 / exp;estimate ’D’ trt*s 1 0 0 / exp;

run;

Obs id episodes week trt city s trt2

1 1 7 0 1 0 0 12 1 3 1 1 0 1 13 1 5 2 1 0 1 14 2 4 0 1 0 0 15 2 2 1 1 0 1 16 2 1 2 1 0 1 1

The GENMOD Procedure

Analysis Of Initial Parameter Estimates

Standard Wald 95% Confidence Chi-Parameter DF Estimate Error Limits Square Pr > ChiSq

Intercept 1 2.1608 0.0358 2.0906 2.2309 3646.42 <.0001s*trt 1 1 -0.4931 0.0665 -0.6234 -0.3627 54.94 <.0001s*trt 2 1 -0.4931 0.0665 -0.6234 -0.3627 54.94 <.0001s*trt 3 1 0.1096 0.0548 0.0023 0.2170 4.00 0.0454Scale 0 1.0000 0.0000 1.0000 1.0000

NOTE: The scale parameter was held fixed.

Working Correlation Matrix

Col1 Col2 Col3

Row1 1.0000 0.8265 0.8265Row2 0.8265 1.0000 0.8265Row3 0.8265 0.8265 1.0000

Analysis Of GEE Parameter EstimatesEmpirical Standard Error Estimates

Standard 95% ConfidenceParameter Estimate Error Limits Z Pr > |Z|

Intercept 2.1608 0.0951 1.9744 2.3472 22.72 <.0001s*trt 1 -0.4958 0.1020 -0.6956 -0.2959 -4.86 <.0001s*trt 2 -0.4592 0.0877 -0.6311 -0.2873 -5.24 <.0001s*trt 3 0.0866 0.0956 -0.1008 0.2740 0.91 0.3651

Analysis Of GEE Parameter EstimatesModel-Based Standard Error Estimates

Standard 95% ConfidenceParameter Estimate Error Limits Z Pr > |Z|

Intercept 2.1608 0.0905 1.9834 2.3381 23.88 <.0001s*trt 1 -0.4958 0.0965 -0.6849 -0.3067 -5.14 <.0001s*trt 2 -0.4592 0.0947 -0.6447 -0.2737 -4.85 <.0001s*trt 3 0.0866 0.0744 -0.0593 0.2325 1.16 0.2447Scale 2.5290 . . . . .

NOTE: The scale parameter for GEE estimation was computed as the square root of thenormalized Pearson’s chi-square.

Contrast Estimate Results

Standard Chi-Label Estimate Error Alpha Confidence Limits Square Pr > ChiSq

A 1.6650 0.1300 0.05 1.4103 1.9197 164.10 <.0001Exp(A) 5.2857 0.6870 0.05 4.0970 6.8192B 2.1608 0.0951 0.05 1.9744 2.3472 516.13 <.0001Exp(B) 8.6778 0.8253 0.05 7.2020 10.4560C 2.1242 0.1588 0.05 1.8129 2.4355 178.85 <.0001Exp(C) 8.3662 1.3289 0.05 6.1282 11.4217D -0.4958 0.1020 0.05 -0.6956 -0.2959 23.65 <.0001Exp(D) 0.6091 0.0621 0.05 0.4988 0.7438

Contrast Results for GEE Analysis

Chi-Contrast DF Square Pr > ChiSq Type

A 2 23.83 <.0001 WaldB 3 52.65 <.0001 WaldC 2 51.56 <.0001 WaldD 1 0.07 0.7867 Wald

15

Page 671: Applied Longitudinal Data Analysis:Lecture Notes

Continue to consider the asthma study data. For exploratory analyses, the investigatorsconsidered the following model. Define

ui = 0 if subject i received Treatment 3= 1 if subject i received Treatment 1 or Treatment 2

ci = 0 if subject i is from a rural area= 1 if subject i is from a city environment

si = 0 if tij = 0= 1 if tij > 0

and write the model as

E(Yij) = exp(β0 + β1ci + β2si + β3sici + β4siui + β5siciui) (7)

(e) Write down in terms of symbols in model (7) the factor by which the mean number of[5 points]episodes at baseline for subjects from rural areas should be multiplied to obtain the meannumber of episodes at baseline for subjects from a city environment.

(f) The investigators were interested in whether the the mean number of episodes 1 week after[5 points]starting Treatment 1 or 2 is different from that for Treatment 3 among subjects from a cityenvironment. In terms of symbols in model (7), write down a null and alternative hypothesisappropriate for addressing this issue.

16

Page 672: Applied Longitudinal Data Analysis:Lecture Notes

6. For each of the following, give a short answer.

(a) Two statisticians are planning to analyze data from a longitudinal study in which responses[5 points]in the form of counts were collected from each rat before and after the rats underwent asurgical procedure. For rat i, let Yij be the count at the jth time point, and let tij = 0 forthe first time point (before the procedure) and tij = 1 for all time points after the procedure.Statistician A proposes a model by writing

E(Yij) = exp(βtij) (8)

while Statistician B assumes that counts on individual rat i take on their values according toa Poisson distribution with mean

E(Yij |bi) = exp(βitij), where βi = β + bi and bi ∼ N (0, D) (9)

In terms of the symbols in the models above, write down explicit expressions of the formexp(stuff) for what each statistician is assuming about the population mean count at anytime tij . Are the two statisticians assuming the same model or different models for populationmean count? Explain.

Also, explain the interpretation of the parameter β under each of models (8) and (9).

17

Page 673: Applied Longitudinal Data Analysis:Lecture Notes

(b) A researcher is interested in the effect of amount of exercise on weight loss in middle-aged[5 points]men. He identifies a group of such men and asks them to return to his clinic once a monthfor 6 months. At month j, he records for man i Yij = weight of man (kg) and Zij = “exercisescore” based on the amount of exercise man i reports that he engaged in during the pastmonth, where higher scores mean more exercise. The researcher adopts the statistical model

Yij = β0i + β1iZij + eij , β0i = β0 + b0i, β1i = β1 + b1i.

At the end of the study, he fits this model to the data and carries out a test of H0 : β1 = 0vs. H1 : β1 < 0, which leads to a p-value of 0.03. In a research paper reporting the results,he writes “The data contain evidence at level of significance 0.05 to suggest that an increasein amount of exercise causes weight loss in this population of men.”

What would you tell this researcher?

18

Page 674: Applied Longitudinal Data Analysis:Lecture Notes

.

ST 732, TEST 2, SPRING 2005, SOLUTIONS

Please sign the following pledge certifying that the work on this test is your own:

“I have neither given nor received aid on this test.”

Signature:

Printed Name:

There are SIX questions, each with multiple parts. For each part of each question, please writeyour answers in the space provided. If you need more space, continue on the back of the page andindicate clearly where on the back you have continued your answer. Scratch paper will be provided.

You are allowed ONE (1) SHEET of HANDWRITTEN NOTES (FRONT ONLY). Calculators areNOT allowed (you will not need one). NOTHING should be on your desk but this test paper, yourone page of notes, and scratch paper given to you.

Points for each part of each problem are given in the left margin. TOTAL POINTS = 100.

In all problems, all symbols and notation are defined exactly as they are in the class notes.

If you are asked to provide a NUMERICAL ESTIMATE or EXPRESSION, and the ONLY WAYyou can see to do this involves some arithmetic (e.g., adding several numbers), YOU DO NOTHAVE TO DO THE ARITHMETIC. JUST GIVE THE EXPRESSION.

HOWEVER, if a numerical estimate IS AVAILABLE DIRECTLY from the output WITHOUThaving to do arithmetic, I will only give partial credit if you do not recognize this.

If you believe it is IMPOSSIBLE to provide a numerical estimate or expression from what is

provided, STATE THIS.

1

Page 675: Applied Longitudinal Data Analysis:Lecture Notes

1. A study was conducted to compare the effectiveness of two regimens for treating high totalcholesterol in patients with confirmed total cholesterol over 180 mg/dl who had never takencholesterol-lowering medication. (High cholesterol is thought to be associated with increasedrisk of cardiovascular disease.) m = 120 such subjects were randomized as follows:

• Treatment regimen 1: Standard (treat with Blipitor only) – 60 subjects

• Treatment regimen 2: Combination (treat with both Blipitor and Drocor) – 60 subjects

At baseline (month 0), immediately prior to starting his/her assigned regimen, each patientprovided a blood sample from which total cholesterol (mg/dl) was to be measured. Patientsthen started treatment and were to return to the clinic at 0.5, 1, 3, 6, and 9 months thereafterto provide blood samples from which total cholesterol was again to be ascertained.

Some baseline samples were contaminated, so that a baseline cholesterol measurement wasunavailable for some patients. Also, some cholesterol measurements after month 0 weredetermined to be subject to assay errors for some patients and were thrown out. Finally,some subjects were unable to appear at the clinic and provide samples for some scheduledvisits due to vacation, work-related travel, and other reasons determined to have nothing todo with the treatments or the health of the patients. Thus, not all patients have all intendedmeasurements. The data set contains 588 cholesterol measurements across the 120 patients.

Here are the data, along with the sample means for each regimen group:

0 2 4 6 8

100

150

200

250

300

Time on study (months)

Tot

al c

hole

ster

ol (

mg/

dl)

Standard treatment

0 2 4 6 8

100

150

200

250

300

Time on study (months)

Tot

al c

hole

ster

ol (

mg/

dl)

Combination treatment

0 2 4 6 8

100

150

200

250

300

Time on study (months)

Tot

al c

hole

ster

ol (

mg/

dl)

Sample means at each time (unbalanced data)

StandardCombination

Also recorded for each patient was an indicator of whether the patient was deemed to beoverweight at baseline (0 = not overweight, 1 = overweight).

The primary objective was to determine whether there is a difference in the pattern of changeof total cholesterol depending on whether patients received standard or combination therapy.A secondary objective was to conduct exploratory analyses of whether being overweight isassociated with high cholesterol before treatment and with changes in cholesterol after eithertreatment is initiated.

2

Page 676: Applied Longitudinal Data Analysis:Lecture Notes

To address the primary objective, the investigators adopted the following statistical model.Let Yij be the total cholesterol measurement for subject i, i = 1, . . . , m, at time tij , wherej = 1, . . . , ni and ni ≤ 6. Let

δi = 0 if patient i was assigned to the Standard regimen= 1 if patient i was assigned to the Combination regimen

The model isYij = β0i + β1itij + eij (1)

β0i = β00 + b0i, β1i = β10 + β11δi + b1i. (2)

(a) In the model given in (1), (2), write down the symbol that represents the “typical,” or[5 points]mean, inherent total cholesterol at baseline for patients in the Standard regimen group.

According to this random coefficient model, the “inherent” total cholesterol at baseline forsubject i is represented by β0i. We are interested in the “typical ”, or mean value of β0i

values (across the population). In the model, this “typical” (mean) inherent total cholesterolat baseline is assumed to be the same for each treatment regimen. The parameter representingthis assumed common inherent mean at baseline is β00; thus, β00 is the “typical” mean baselinetotal cholesterol for the Standard regimen.

On page 4, you will find some SAS code and selected portions of its output. Use this to

answer the next two parts of this problem.

(b) The investigators’ model assumes that the “typical” (mean) “inherent” rate of change of[5 points]total cholesterol is constant over time for each regimen. Thus, the primary study hypothesisis that this “typical” (mean) rate of change differs in the population of patients dependingon whether they follow the Standard or Combination regimen.

In terms of symbols in model (1), (2), give a set of null and alternative hypotheses H0 andH1 that address this issue. From the output, give the numerical values of a test statistic andassociated p-value appropriate for testing H0 against H1, and state your conclusion regardingthe strength of the evidence against H0.

In this model, the “typical” inherent rate of change is β10 for the Standard regimen (δi = 0)and β10 + β11 for the Combination regimen (δi = 1). These will be different if β11 6= 0. Thus,the hypotheses are H0 : β11 = 0 vs. H1 : β11 6= 0.

The month*trt effect gives the estimate of β11. The associated test statistic for testingwhether β11 = 0 is seen from the output to be −3.3218/0.7157 = −4.64. The p-value fortesting H0 vs. H1 is “< 0.0001.” Thus, at any reasonable level of significance, we wouldreject H0. The data have strong evidence to suggest that mean inherent rate of changein total cholesterol is different for the two regimens. (Alternatively, the Type 3 Tests of

Fixed Effects Table gives an F statistic for testing H0 associated with month*trt of 21.54≈ (−4.64)2.)

3

Page 677: Applied Longitudinal Data Analysis:Lecture Notes

Here is the model again for convenience:

δi = 0 if patient i was assigned to the Standard regimen= 1 if patient i was assigned to the Combination regimen

Yij = β0i + β1itij + eij (1)

β0i = β00 + b0i, β1i = β10 + β11δi + b1i. (2)

(c) The investigators were interested in whether the “typical” (mean) change in total choles-[5 points]terol per month that could be achieved if all patients in the high cholesterol population wereto follow the Combination regimen is different from 0. From the output, give the numeri-cal values of a test statistic and associated p-value appropriate for testing the relevant nullhypothesis H0, and state your conclusion regarding the strength of the evidence against H0

(you need not state H0).

The “typical” (mean) change per month is just the “typical” rate of change. For the Com-bination regimen, the model says that this rate of change is β10 + β11. The question is thuswhether this sum is equal to 0. Contrast A provides the correct test: the test statistic is241.60 with an associated p-value of “< 0.0001.” At any reasonable level of significance, thereis strong evidence to suggest that the mean inherent change in total cholesterol per monthunder the Combination regimen is different from 0.

data chol; infile "cholesterol.dat";input id overwt month chol trt; run;

proc print data=chol(obs=7); run;

proc mixed data=chol method=ml;class id;model chol = month trt*month / solution;random int month / type=un subject=id;contrast ’A’ month 1 trt*month 1 / chisq;contrast ’B’ month 1, trt*month 1 /chisq;

run;

Obs id overwt month chol trt

1 1 1 0 240.2 02 1 1 1 241.1 03 1 1 3 221.4 04 1 1 9 167.6 05 2 0 0 218.9 06 2 0 1 228.1 07 2 0 6 180.6 0

The Mixed Procedure

Solution for Fixed Effects

StandardEffect Estimate Error DF t Value Pr > |t|

Intercept 241.42 1.6265 119 148.43 <.0001month -4.5444 0.5064 117 -8.97 <.0001month*trt -3.3218 0.7157 349 -4.64 <.0001

Type 3 Tests of Fixed Effects

Num DenEffect DF DF F Value Pr > F

month 1 117 80.52 <.0001month*trt 1 349 21.54 <.0001

Contrasts

Num DenLabel DF DF Chi-Square F Value Pr > ChiSq Pr > F

A 1 349 241.60 241.60 <.0001 <.0001B 2 349 321.93 160.97 <.0001 <.0001

4

Page 678: Applied Longitudinal Data Analysis:Lecture Notes

2. Consider the cholesterol study in Problem 1. To conduct exploratory analyses regardingassociation between total cholesterol and whether patients are overweight at baseline, theinvestigators considered a modified model. Defining

δi = 0 if patient i was assigned to the Standard regimen= 1 if patient i was assigned to the Combination regimen

oi = 0 if patient i was not overweight at baseline= 1 if patient i was overweight at baseline

the model isYij = β0i + β1itij + eij (3)

β0i = β00 + β01oi + b0i, β1i = β10 + β11δi + β12oi + β13δioi + b1i. (4)

On page 7 you will find SAS code and selected portions of its output. Use this to answer the

following.

(a) One investigator was interested in whether the data support the contention that “typi-[5 points]cal” (mean) inherent total cholesterol in patients who have never taken cholesterol-loweringmedication is associated with whether the patient is overweight or not. From the output, citethe numerical values of a test statistic and associated p-value appropriate for addressing thisissue (you need not state formal hypotheses). State your conclusion regarding the strengthof the evidence in support of this contention.

None of the subjects in the study had taken cholesterol-lowering medication at baseline, sotheir cholesterol at baseline in this study reflects that of patients who have never taken suchmedication. Thus, we can address this question in terms of mean inherent total cholesterol atbaseline and whether it is associated with whether a patient is overweight. Under the model,for either treatment regimen, this mean inherent total cholesterol is β00 if the patient is notoverweight (oi = 0) and β00 + β01 if s/he is (oi = 1). Thus, the question is whether β01 = 0,in which case there is no association.

From the output, a test statistic for testing whether β01 = 0 is found from the overwt effectin the Solution table as 17.3828/2.87 = 6.06, with associated p-value “< 0.0001.” At anyreasonable level of significance, there is strong evidence to suggest that there is an associationbetween mean inherent total cholesterol and whether patients are overweight among patientswho have never had treatment. (Alternatively, the overwt effect in Type 3 Tests of Fixed

Effects Table gives an F statistic of 36.68 ≈ (6.06)2.)

(b) Another investigator wondered whether the data support the hypothesis that, among[5 points]patients taking the Combination regimen, there is an association of the “typical” (mean)rate of change of total cholesterol with whether a patient is overweight or not. From theoutput, cite the numerical values of a test statistic and associated p-value appropriate foraddressing this issue (you need not state formal hypotheses). State your conclusion regardingthe strength of the evidence in support of this hypothesis.

According to the model, the “typical” (mean) rate of change of total cholesterol is differentdepending on treatment and whether a patient is overweight. In particular, the rates ofchange are:

δi (trt) oi (overwt) rate of change

0 0 β10

0 1 β10 + β12

1 0 β10 + β11

1 1 β10 + β11 + β12 + β13

5

Page 679: Applied Longitudinal Data Analysis:Lecture Notes

From the table, the “typical” rate of change for patients taking Combination regimen differsbetween non-overweight and overweight patients by the amount β12 + β13. Thus, there is noassociation if this sum is = 0. In SAS, β12 is represented by the overwt*month effect andβ13 by the overwt*month*trt effect. Thus, this sum=0 is tested by by Contrast C, withtest statistic 23.75 and p-value “< 0.001.” At any reasonable level of significance, there isstrong evidence that the mean inherent rate of change for patients on Combination treatmentis associated with whether they are overweight at baseline or not.

Here is the model again for convenience:

δi = 0 if patient i was assigned to the Standard regimen= 1 if patient i was assigned to the Combination regimen

oi = 0 if patient i was not overweight at baseline= 1 if patient i was overweight at baseline

Yij = β0i + β1itij + eij (3)

β0i = β00 + β01oi + b0i, β1i = β10 + β11δi + β12oi + β13δioi + b1i. (4)

(c) Based on the output, provide a numerical estimate of the “typical” (mean) rate of change[5 points]of total cholesterol for overweight patients following the Standard regimen.

From the answer to (b), the quantity of interest here is β10 + β12. β10 is represented by themonth effect and β12 is represented by the overwt*month effect. Thus, Estimate B providesan estimate of −3.96 (with standard error 0.61).

(d) The investigators were interested in whether the data suggest that “typical” (mean) rate[5 points]of change of total cholesterol for overweight patients who received the Standard regimen isdifferent from that for overweight patients who received the Combination regimen. From theoutput, cite the numerical values of a test statistic and associated p-value appropriate foraddressing this issue (you need not state formal hypotheses). State your conclusion regardingthe strength of the evidence in support of this hypothesis.

Here, we are interested from (b) in the difference

β10 + β11 + β12 + β13 − (β10 + β12) = β11 + β13.

β11 and β13 are represented in SAS by the month*trt and overwt*month*trt effects, respec-tively. Thus, a test of whether or not this quantity is different from 0 is given by Contrast

E. The test statistic is 5.07 with a p-value of about 0.03. At level of significance 0.05, wemay conclude that there is evidence to suggest that the mean inherent rate of change of totalcholesterol for overweight patients on Standard treatment is different from that for overweightpatients who received the Combination regimen.

6

Page 680: Applied Longitudinal Data Analysis:Lecture Notes

proc mixed data=chol method=ml;class id;model chol = overwt month month*trt overwt*month overwt*month*trt / solution;random int month / type=un subject=id g gcorr;contrast ’A’ month 1 overwt*month 1 / chisq;contrast ’B’ month 1, overwt*month 1 /chisq;contrast ’C’ overwt*month 1 overwt*month*trt 1 / chisq;contrast ’D’ overwt*month 1, overwt*month*trt 1 / chisq;contrast ’E’ month*trt 1 overwt*month*trt 1 / chisq;contrast ’F’ month*trt 1, overwt*month*trt 1 / chisq;estimate ’A’ month 1 month*trt 1;estimate ’B’ month 1 overwt*month 1;estimate ’C’ month 1 overwt*month 1 month*trt 1;estimate ’D’ month 1 month*trt 1 overwt*month*trt 1;estimate ’E’ month 1 month*trt 1 overwt*month 1 overwt*month*trt 1;

run;

The Mixed Procedure

Solution for Fixed Effects

StandardEffect Estimate Error DF t Value Pr > |t|

Intercept 231.88 2.1458 118 108.07 <.0001overwt 17.3828 2.8700 349 6.06 <.0001month -5.4007 0.6732 115 -8.02 <.0001month*trt -4.8859 0.9504 349 -5.14 <.0001overwt*month 1.4418 0.9054 349 1.59 0.1122overwt*month*trt 2.9800 1.2728 349 2.34 0.0198

Type 3 Tests of Fixed Effects

Num DenEffect DF DF F Value Pr > F

overwt 1 349 36.68 <.0001month 1 115 64.36 <.0001month*trt 1 349 26.43 <.0001overwt*month 1 349 2.54 0.1122overwt*month*trt 1 349 5.48 0.0198

Estimates

StandardLabel Estimate Error DF t Value Pr > |t|

A -10.2866 0.6816 349 -15.09 <.0001B -3.9589 0.6055 349 -6.54 <.0001C -8.8448 1.1269 349 -7.85 <.0001D -7.3066 1.0816 349 -6.76 <.0001E -5.8648 0.5988 349 -9.79 <.0001

Contrasts

Num DenLabel DF DF Chi-Square F Value Pr > ChiSq Pr > F

A 1 349 42.75 42.75 <.0001 <.0001B 2 349 107.11 53.56 <.0001 <.0001C 1 349 23.75 23.75 <.0001 <.0001D 2 349 26.08 13.04 <.0001 <.0001E 1 349 5.07 5.07 0.0244 0.0250F 2 349 31.50 15.75 <.0001 <.0001

7

Page 681: Applied Longitudinal Data Analysis:Lecture Notes

3. Consider yet again the cholesterol study in Problem 1. On page 9 you will find some SAS

code that fits two different models to these data along with selected portions of the output.

Use this to answer the following questions.

(a) Based on each of “Fit (A)” and “Fit (B),” give a numerical expression characterizing the[5 points]“inherent” rate of change in total cholesterol for Patient 3 (this patient is in the Standardregimen group). Thus, you should give two expressions, one based on the results of each fit.

The model in Fit (A) is the one in Problem 1; here, the “inherent” rate of change for Patient3 is β1i for i = 3. Fit (A) assumes the model for β1i in (2), β1i = β10 + β11δi + b1i. So wewant the “estimated” BLUP for β1i for patient 3, who is in the Standard regimen group andhence has δi = 0, So we want the “estimated” BLUP for beta10 + δi + b1i. The BLUP basedon Fit (A) is thus β10 + b1i, where, from the output, have β10 = −4.54 and b1i = −0.28. Sothe desired estimated BLUP is −4.54 − 0.28.

Under Fit (B), β1i is assumed to be the same for all patients and when δi = 0 is equal to β11.Thus, based on this fit, the estimated BLUP is just β11 = −4.64.

(b) One of the investigators was interested in determining which of the models assumed by[5 points]“Fit (A)” and “ Fit (B)” is better supported by the data. She constructed the numerical teststatistic 5392.3 − 5283.9 = 108.4, compared it to the critical value χ2

2,0.95 = 5.99, and wrotethe following statement: “Based on comparing this test statistic to the χ2

2,0.95 critical value of5.99, we may conclude at level of significance 0.05 that the data support adopting the modelof Fit (A).” Make any comments you feel are relevant about her statement.

The question is whether we need to include a random effect associated with inherent rate ofchange of total cholesterol. The models for Fit (A) and Fit (B) thus differ according to whetherthey include such a random effect or not. As we know from Section 10.6 of the class notes, it isnot possible to use an ordinary likelihood ratio test to test whether there is evidence that the“full” model that includes such a random effect is needed over the “reduced” model that doesnot. This is because the likelihood ratio test statistic does not have an approximate χ2

2 (largesample) sampling distribution in this case because the null hypothesis is on the “boundary” ofthe parameter space. Instead, the test statistic has approximately a “mixture” of χ2 samplingdistribution. The investigator has fitted both models by maximum likelihood and computedthe likelihood ratio test statistic to be 108.4. She then compares it to the χ2

2,0.95 critical valueto conclude that the data support the “full” model. Thus, she is doing the usual likelihoodratio test. Of course, the test statistic is huge, so if she were to compare it to the correctcritical value from the mixture, there is no doubt that she would still come up with thesame conclusion. She could also arrive at this conclusion by comparing AIC or BIC values.However, the problem is that she should not be claiming there is evidence in support of themodel of Fit (A) based on the usual likelihood ratio test, which is what she is doing. Sheshould cite alternative evidence if she wants to make this claim.

8

Page 682: Applied Longitudinal Data Analysis:Lecture Notes

title ’Fit (A)’;proc mixed data=chol method=ml;class id;model chol = month trt*month / solution;random int month / type=un subject=id solution;

run;

The Mixed Procedure

Covariance Parameter Estimates

Cov Parm Subject Estimate

UN(1,1) id 200.85UN(2,1) id 20.7594UN(2,2) id 9.5769Residual 267.92

Fit Statistics

-2 Log Likelihood 5283.9AIC (smaller is better) 5297.9AICC (smaller is better) 5298.1BIC (smaller is better) 5317.5

Solution for Fixed Effects

StandardEffect Estimate Error DF t Value Pr > |t|

Intercept 241.42 1.6265 119 148.43 <.0001month -4.5444 0.5064 117 -8.97 <.0001month*trt -3.3218 0.7157 349 -4.64 <.0001

Solution for Random Effects

Std ErrEffect id Estimate Pred DF t Value Pr > |t|

Intercept 1 -2.6972 7.3854 349 -0.37 0.7152month 1 -2.2531 1.5818 349 -1.42 0.1552Intercept 2 -12.1262 7.7387 349 -1.57 0.1180month 2 -2.3330 1.9627 349 -1.19 0.2354Intercept 3 1.9129 7.2834 349 0.26 0.7930month 3 -0.2763 1.4967 349 -0.18 0.8537Intercept 4 -4.4688 7.8403 349 -0.57 0.5691month 4 0.5717 1.4956 349 0.38 0.7025

title ’Fit (B)’;proc mixed data=chol method=ml;class id;model chol = month trt*month / solution;random int / type=un subject=id solution;

run;

The Mixed Procedure

Covariance Parameter Estimates

Cov Parm Subject Estimate

UN(1,1) id 408.99Residual 390.17

Fit Statistics

-2 Log Likelihood 5392.3AIC (smaller is better) 5402.3AICC (smaller is better) 5402.5BIC (smaller is better) 5416.3

Solution for Fixed Effects

StandardEffect Estimate Error DF t Value Pr > |t|

Intercept 241.23 2.1954 119 109.88 <.0001month -4.6387 0.3452 466 -13.44 <.0001month*trt -3.1363 0.4685 466 -6.69 <.0001

Solution for Random Effects

Std ErrEffect id Estimate Pred DF t Value Pr > |t|

Intercept 1 -6.9307 9.0454 466 -0.77 0.4439Intercept 2 -16.0932 10.0625 466 -1.60 0.1104Intercept 3 1.8950 8.3088 466 0.23 0.8197Intercept 4 -3.0159 9.0678 466 -0.33 0.7396

9

Page 683: Applied Longitudinal Data Analysis:Lecture Notes

4. A study was conducted to examine factors associated with the development of bronchopul-monary dysplasia (BPD), a chronic lung disease, in pre-term infants weighing less than 1750grams (g) (1.75 kilograms, kg). Data were collected on 223 infants. For j = 1, . . . , 223, let

Yj = 0 if infant j did not develop BPD= 1 if infant j did develop BPD

wj = birthweight (kg) of infant j

aj = gestational age (weeks) of infant j

pj = 0 if the mother of infant j did not develop toxemia while pregnant= 1 if the mother of infant j developed toxemia while pregnant

Toxemia, also known as preeclampsia, is a condition potentially dangerous to the infant. Theinvestigators considered the following model:

P (Yj = 1) =exp(β0 + β1wj + β2aj + β3pj)

1 + exp(β0 + β1wj + β2aj + β3pj), (5)

On page 12, you will find some SAS code and selected portions of its output. Use this to

answer the following.

(a) One investigator was interested in whether the data have evidence to suggest that at least[5 points]one of birthweight, gestational age, or whether the mother developed toxemia is associatedwith whether or not infants in this population develop BPD. From the output, cite thenumerical values of a test statistic and associated p-value appropriate for addressing thisissue (you need not state formal hypotheses). State your conclusion regarding the strengthof the evidence in support of the contention that there is such an association.

The question is whether at least one of β1, β2, β3 is different from 0, the null being that theyall are 0 (and hence there are no associations between risk of BPD and any of these factors).Contrast B yields the relevant test statistic of 50.79 with p-value of “< 0.0001.” Thus, atany reasonable level of significance, there is strong evidence that at least one of birthweight,gestational age, and whether the mother developed toxemia is associated with developingBPD in this population of infants.

10

Page 684: Applied Longitudinal Data Analysis:Lecture Notes

For convenience, here is the model again:

Yj = 0 if infant j did not develop BPD= 1 if infant j did develop BPD

wj = birthweight (kg) of infant j

aj = gestational age (weeks) of infant j

pj = 0 if the mother of infant j did not develop toxemia while pregnant= 1 if the mother of infant j developed toxemia while pregnant

P (Yj = 1) =exp(β0 + β1wj + β2aj + β3pj)

1 + exp(β0 + β1wj + β2aj + β3pj), (5)

(b) From the output, give a numerical expression for an estimate of the variance of BPD[5 points]responses in the population of infants with birthweight of 1 kg, gestational age of 30 weeks,and mother who developed toxemia while pregnant.

The BPD response for any subject j is the binary random variable Yj , and we are interestedin var(Yj). According to the model, the probability of developing BPD for infants with thesecharacteristics [so having P (Yj = 1)] is

p =exp{β0 + β1 + β2(30) + β3}

1 + exp{β0 + β1 + β2(30) + β3}.

Because Yj follows a Bernoulli distribution, the variance is equal to p(1 − p).

So we want to estimate p(1−p). Note that Estimate C with the exp option provides directlyan estimate of exp{β0 + β1 + β2(30) + β3}; the estimate is 0.18. Thus, we may estimate p by

p =0.18

1 + 0.18=

0.18

1.18

and hence the estimate of variance is p(1 − p).

(c) From the output, provide a numerical estimate of the odds ratio comparing the odds of[5 points]an infant developing BPD if his/her mother had toxemia while pregnant to the odds if themother did not. Cite evidence in the output that either supports or does not support thecontention that having a mother with toxemia is associated with increased odds of an infantdeveloping BPD.

According to the model, the odds of an infant with birthweight wj , gestational age aj , andmother with toxemia (pj = 1) developing BPD is exp(β0 + β1wj + β2aj + β3). The odds ifthe mother does not have toxemia (pj = 0) is exp(β0 + β1wj + β2aj). Thus, taking the ratio,the odds ratio of interest is eβ3 . Estimate A with the exp option provides an estimate of thisodds ratio directly as 0.26. The associated 95% confidence interval for the true odds ratio is(0.08,0.86). This does not include 1, and in fact the upper endpoint is < 1. This representsevidence that the true odds ratio is less than 1, which says that the odds of developing BPDare less if the mother has toxemia than if the mother does not! I.e., the estimate correspondsto a decreased odds of developing BPD if the mother has toxemia relative to if the motherdoes not. Thus, the evidence does not support the contention that the odds increases if themother has toxemia.

This result seems counterintuitive, as one might expect a dangerous condition like toxemia tobe associated with higher odds of developing BPD than if not present. However, inspectionof the actual data shows that most of the infants in the study whose mothers had toxemiadid not develop BPD! Either toxemia has a counterintuitive protective effect, or this featureof the data is just a chance result of random sampling.

11

Page 685: Applied Longitudinal Data Analysis:Lecture Notes

data bpd; infile "bpd.dat"; input bpd weight gestage toxemia;weight=weight/1000; * put birthweight in units of kilograms (kg);

run;

proc print data=bpd(obs=4); run;

proc genmod data=bpd descending;model bpd = weight gestage toxemia / dist=binomial link=logit;contrast ’A’ weight 1 gestage 1 toxemia 1 / wald;contrast ’B’ weight 1, gestage 1, toxemia 1 / wald;contrast ’C’ weight 1 gestage 30 toxemia 1 / wald;estimate ’A’ int 0 weight 0 gestage 0 toxemia 1 / exp;estimate ’B’ int 1 weight 1 gestage 1 toxemia 1 /exp;estimate ’C’ int 1 weight 1 gestage 30 toxemia 1 / exp;estimate ’D’ weight 1 gestage 30 toxemia 1 /exp;

run;

Obs bpd weight gestage toxemia

1 1 0.85 27 02 0 1.50 33 03 1 1.36 32 04 0 0.96 35 1

The GENMOD Procedure

PROC GENMOD is modeling the probability that bpd=’1’.

Analysis Of Parameter Estimates

Standard Wald 95% Confidence Chi-Parameter DF Estimate Error Limits Square Pr > ChiSq

Intercept 1 13.9361 2.9826 8.0904 19.7818 21.83 <.0001weight 1 -2.6436 0.8123 -4.2357 -1.0515 10.59 0.0011gestage 1 -0.3885 0.1149 -0.6137 -0.1634 11.44 0.0007toxemia 1 -1.3438 0.6075 -2.5345 -0.1531 4.89 0.0270Scale 0 1.0000 0.0000 1.0000 1.0000

NOTE: The scale parameter was held fixed.

Contrast Estimate Results

Standard Chi-Label Estimate Error Alpha Confidence Limits Square Pr > ChiSq

A -1.3438 0.6075 0.05 -2.5345 -0.1531 4.89 0.0270Exp(A) 0.2609 0.1585 0.05 0.0793 0.8580B 9.5602 3.2670 0.05 3.1569 15.9635 8.56 0.0034Exp(B) 14188.44 46354.29 0.05 23.4973 8567423C -1.7074 0.5818 0.05 -2.8476 -0.5671 8.61 0.0033Exp(C) 0.1813 0.1055 0.05 0.0580 0.5671D -15.6434 3.1635 0.05 -21.8439 -9.4430 24.45 <.0001Exp(D) 0.0000 0.0000 0.05 0.0000 0.0001

Contrast Results

Chi-Contrast DF Square Pr > ChiSq Type

A 1 17.37 <.0001 WaldB 3 50.79 <.0001 WaldC 1 24.45 <.0001 Wald

12

Page 686: Applied Longitudinal Data Analysis:Lecture Notes

5. A study was conducted to compare three treatments for asthma. A total of m = 90 subjectssuffering from mild to moderate asthma were randomized into 3 groups:

• Treatment 1 (30 subjects)

• Treatment 2 (30 subjects)

• Treatment 3 (30 subjects)

In the 1-week period before starting his/her assigned treatment, each subject was asked torecord the number of asthmatic episodes s/he experienced during the period. This numberof episodes was taken as the baseline (week 0) response. All subjects were then started ontreatment. Each subject then recorded the number of episodes experienced in the first 1-weekperiod after starting treatment (week 1) and the number of episodes in the second 1-weekperiod (week 2). Luckily, episode responses were recorded for all 90 subjects for each timeperiod. Also collected for each subject was whether s/he lived in a rural or city environment.

The following table shows the mean number of episodes experienced across the 30 subjectsin each group during each 1-week period:

Treatment baseline (week 0) week 1 week 2

1 8.7 5.5 5.12 8.4 4.8 5.83 8.9 9.2 10.2

Let Yij be the number of episodes for subject i, i = 1, . . . , 90, in week tij = 0, 1, 2, and let

δ1i = 1 if subject i received Treatment 1, = 0 otherwiseδ2i = 1 if subject i received Treatment 2, = 0 otherwiseδ3i = 1 if subject i received Treatment 3, = 0 otherwise

si = 0 if tij = 0= 1 if tij > 0

The investigators considered initially the following model for the mean number of episodes:

E(Yij) = exp(β0 + β1siδ1i + β2siδ2i + β3siδ3i), (6)

On page 15, you will find some SAS code and selected portions of its output. Use this to

answer the following.

(a) From the output, provide a numerical estimate of the logarithm of the mean number[5 points]of episodes at baseline experienced by subjects who received Treatment 2. Also providethe numerical value (to 4 decimal places) of an associated standard error that provides areliable measure of uncertainty even if the investigators’ assumption about associations amongnumbers of episodes on the same subject is incorrect.

The logarithm of mean number of episodes at baseline under any of the treatments with thismodel is β0. Thus, an estimate of the mean number for Treatment 2 is, from the output,2.1608. The researchers assumed a compound symmetric working correlation model. To ob-tain standard errors that are reliable even if this assumption is wrong, we should obtain thesefrom the robust sandwich estimate of the sampling covariance matrix. These standard errorsare found in the output under the Empirical Standard Error Estimates – the standarderror here is 0.0951.

13

Page 687: Applied Longitudinal Data Analysis:Lecture Notes

For convenience, here is the model again:

δ1i = 1 if subject i received Treatment 1, = 0 otherwiseδ2i = 1 if subject i received Treatment 2, = 0 otherwiseδ3i = 1 if subject i received Treatment 3, = 0 otherwise

si = 0 if tij = 0= 1 if tij > 0

E(Yij) = exp(β0 + β1siδ1i + β2siδ2i + β3siδ3i), (6)

(b) The investigators wondered if the data contain evidence to suggest that at least one of[5 points]the 3 Treatments leads to a population mean number of episodes different from those forthe others. Cite the numerical values of a test statistic and associated p-value that addressthis issue (you need not state formal hypotheses), and state your conclusion regarding thestrength of the evidence.

Under this model, mean numbers of episodes in the populations after treatment are eβ0+β1

for Treatment 1, eβ0+β2 for Treatment 2, and eβ0+β3 for Treatment 3. These will be equalif β1 = β2 = β3; otherwise, at least one will be different from the others. The appropriatetest statistics is given by Contrast A and is equal to 23.83 with a p-value of “< 0.0001,”suggesting at any reasonable level of significance that there is strong evidence that the meansdiffer after treatment.

(c) Based on the fit of (6), give a numerical estimate of the population mean number of[5 points]episodes after initiation of Treatment 1.

We want to estimate eβ0+β1 . Estimate A with the exp option gives the estimate directly as5.29 episodes.

(d) Treatment 1 and 2 are thought to work by the same mechanism, so the investigators[5 points]expected similar results for both. The investigators thus wanted to know whether the datacontain evidence to suggest that these two treatments lead to different population meannumbers of episodes. Cite the numerical values of a test statistic and associated p-valuethat address this issue (you need not state the formal hypothesis). State your conclusionregarding the strength of the evidence that there is a difference in mean numbers of episodesfor Treatments 1 and 2.

We now are interested in whether eβ0+β1 = eβ0+β2 , which will hold if β1 = β2. Contrast D

provides the test statistic, which = 0.07 with a p-value of 0.79. At any reasonable level ofsignificance, we do not have enough evidence to suggest that the mean numbers of episodesfor Treatments 1 and 2 differ, which, while not saying that they do not differ, is consistentwith the expectations of the investigators.

14

Page 688: Applied Longitudinal Data Analysis:Lecture Notes

data asthma; infile "asthma.dat";input id episodes week trt city;s=1; if week=0 then s=0; run;

proc print data=asthma(obs=6); run;

proc genmod data=asthma;class id trt;model episodes = trt*s / dist=poisson link=log;repeated subject=id / type=cs corrw modelse;contrast ’A’ trt*s 1 -1 0, trt*s 1 0 -1 / wald;contrast ’B’ trt*s 1 0 0, trt*s 0 1 0, trt*s 0 0 1 / wald;contrast ’C’ trt*s 1 0 0, trt*s 0 1 0 / wald;contrast ’D’ trt*s 1 -1 0 / wald;estimate ’A’ int 1 trt*s 1 0 0 / exp;estimate ’B’ int 1 trt*s 0 0 0 / exp;estimate ’C’ int 1 trt*s 1 -1 0 / exp;estimate ’D’ trt*s 1 0 0 / exp;

run;

Obs id episodes week trt city s trt2

1 1 7 0 1 0 0 12 1 3 1 1 0 1 13 1 5 2 1 0 1 14 2 4 0 1 0 0 15 2 2 1 1 0 1 16 2 1 2 1 0 1 1

The GENMOD Procedure

Analysis Of Initial Parameter Estimates

Standard Wald 95% Confidence Chi-Parameter DF Estimate Error Limits Square Pr > ChiSq

Intercept 1 2.1608 0.0358 2.0906 2.2309 3646.42 <.0001s*trt 1 1 -0.4931 0.0665 -0.6234 -0.3627 54.94 <.0001s*trt 2 1 -0.4931 0.0665 -0.6234 -0.3627 54.94 <.0001s*trt 3 1 0.1096 0.0548 0.0023 0.2170 4.00 0.0454Scale 0 1.0000 0.0000 1.0000 1.0000

NOTE: The scale parameter was held fixed.

Working Correlation Matrix

Col1 Col2 Col3

Row1 1.0000 0.8265 0.8265Row2 0.8265 1.0000 0.8265Row3 0.8265 0.8265 1.0000

Analysis Of GEE Parameter EstimatesEmpirical Standard Error Estimates

Standard 95% ConfidenceParameter Estimate Error Limits Z Pr > |Z|

Intercept 2.1608 0.0951 1.9744 2.3472 22.72 <.0001s*trt 1 -0.4958 0.1020 -0.6956 -0.2959 -4.86 <.0001s*trt 2 -0.4592 0.0877 -0.6311 -0.2873 -5.24 <.0001s*trt 3 0.0866 0.0956 -0.1008 0.2740 0.91 0.3651

Analysis Of GEE Parameter EstimatesModel-Based Standard Error Estimates

Standard 95% ConfidenceParameter Estimate Error Limits Z Pr > |Z|

Intercept 2.1608 0.0905 1.9834 2.3381 23.88 <.0001s*trt 1 -0.4958 0.0965 -0.6849 -0.3067 -5.14 <.0001s*trt 2 -0.4592 0.0947 -0.6447 -0.2737 -4.85 <.0001s*trt 3 0.0866 0.0744 -0.0593 0.2325 1.16 0.2447Scale 2.5290 . . . . .

NOTE: The scale parameter for GEE estimation was computed as the square root of thenormalized Pearson’s chi-square.

Contrast Estimate Results

Standard Chi-Label Estimate Error Alpha Confidence Limits Square Pr > ChiSq

A 1.6650 0.1300 0.05 1.4103 1.9197 164.10 <.0001Exp(A) 5.2857 0.6870 0.05 4.0970 6.8192B 2.1608 0.0951 0.05 1.9744 2.3472 516.13 <.0001Exp(B) 8.6778 0.8253 0.05 7.2020 10.4560C 2.1242 0.1588 0.05 1.8129 2.4355 178.85 <.0001Exp(C) 8.3662 1.3289 0.05 6.1282 11.4217D -0.4958 0.1020 0.05 -0.6956 -0.2959 23.65 <.0001Exp(D) 0.6091 0.0621 0.05 0.4988 0.7438

Contrast Results for GEE Analysis

Chi-Contrast DF Square Pr > ChiSq Type

A 2 23.83 <.0001 WaldB 3 52.65 <.0001 WaldC 2 51.56 <.0001 WaldD 1 0.07 0.7867 Wald

15

Page 689: Applied Longitudinal Data Analysis:Lecture Notes

Continue to consider the asthma study data. For exploratory analyses, the investigatorsconsidered the following model. Define

ui = 0 if subject i received Treatment 3= 1 if subject i received Treatment 1 or Treatment 2

ci = 0 if subject i is from a rural area= 1 if subject i is from a city environment

si = 0 if tij = 0= 1 if tij > 0

and write the model as

E(Yij) = exp(β0 + β1ci + β2si + β3sici + β4siui + β5siciui) (7)

(e) Write down in terms of symbols in model (7) the factor by which the mean number of[5 points]episodes at baseline for subjects from rural areas should be multiplied to obtain the meannumber of episodes at baseline for subjects from a city environment.

Mean at baseline for rural subjects is eβ0 and mean at baseline for city subjects is eβ0+β1

(ci = 1). Thus, the multiplicative factor is eβ1 .

(f) The investigators were interested in whether the the mean number of episodes 1 week after[5 points]starting Treatment 1 or 2 is different from that for Treatment 3 among subjects from a cityenvironment. In terms of symbols in model (7), write down a null and alternative hypothesisappropriate for addressing this issue.

Under this model, the mean number of episodes at any time after starting treatment (socertainly at 1 week) under Treatments 1 or 2 for city subjects is eβ0+β1+β2+β3+β4+β5 whilethat for Treatment 3 is eβ0+β2+β3 . These will thus be the same if β4 + β5 = 0 and different ifthis sum differs from 0. Thus, we have H0 : β4 + β5 = 0 vs. H1 : β4 + β5 6= 0.

16

Page 690: Applied Longitudinal Data Analysis:Lecture Notes

6. For each of the following, give a short answer.

(a) Two statisticians are planning to analyze data from a longitudinal study in which responses[5 points]in the form of counts were collected from each rat before and after the rats underwent asurgical procedure. For rat i, let Yij be the count at the jth time point, and let tij = 0 forthe first time point (before the procedure) and tij = 1 for all time points after the procedure.Statistician A proposes a model by writing

E(Yij) = exp(βtij) (8)

while Statistician B assumes that counts on individual rat i take on their values according toa Poisson distribution with mean

E(Yij |bi) = exp(βitij), where βi = β + bi and bi ∼ N (0, D) (9)

In terms of the symbols in the models above, write down explicit expressions of the formexp(stuff) for what each statistician is assuming about the population mean count at anytime tij . Are the two statisticians assuming the same model or different models for populationmean count? Explain.

Also, explain the interpretation of the parameter β under each of models (8) and (9).

We discussed this in class the second-to-last day. Statistician A is assuming a model for thepopulation mean count at any time tij directly; that is, he is taking a population averaged

approach. His model isE(Yij) = exp(βtij),

as stated. In particular, her model says that, prior to the procedure, the population mean isexp β(0) = 1, and after the procedure, it is expβ.

Statistician B is instead taking a subject-specific approach. She is modeling the mean countif we only consider subject i in particular at any time tij as exp(βitij). To get an expressionfor the population mean count, we must average her expression across all subjects. Thus, werequire

E{exp(βitij)} − exp(βtij)E{exp(bitij),

where the first expectation averages across the normal distribution N (β, D) that representsthe population of βi values across all subjects and the second expectation is averaging acrossthe normal distribution N (0, D) of the population of all bi values. As we discussed in class,this expectation turns out to be

exp(βtij + Dt2ij/2).

Thus, we see that B models the population mean to be exp β(0) = 1 before the procedure, asdoes A, but after the procedure, it is expβ + D/2.

Thus, we see that the two assumptions for population mean count are different; Statistician B’smodel includes the extra multiplicative factor exp(Dt2ij/2), which depends on the variance ofβi values in the population! So her approach leads to a different description of the populationmean count after the procedure.

In Statistician A’s model, β directly determines the population mean count at any time. Inparticular, β determines the population mean count after procedure or, equivalently, β is thelogarithm of the population mean count after the procedure. In Statistician B’s model, onthe other hand, β has the interpretation as the “typical” value of the “slope” βi on the logcount scale in the population of subjects. In regard to the implied population mean model forB, β alone cannot describe the mean response (mean count) in the population at any time;to do this also requires D!

17

Page 691: Applied Longitudinal Data Analysis:Lecture Notes

(b) A researcher is interested in the effect of amount of exercise on weight loss in middle-aged[5 points]men. He identifies a group of such men and asks them to return to his clinic once a monthfor 6 months. At month j, he records for man i Yij = weight of man (kg) and Zij = “exercisescore” based on the amount of exercise man i reports that he engaged in during the pastmonth, where higher scores mean more exercise. The researcher adopts the statistical model

Yij = β0i + β1iZij + eij , β0i = β0 + b0i, β1i = β1 + b1i.

At the end of the study, he fits this model to the data and carries out a test of H0 : β1 = 0vs. H1 : β1 < 0, which leads to a p-value of 0.03. In a research paper reporting the results,he writes “The data contain evidence at level of significance 0.05 to suggest that an increasein amount of exercise causes weight loss in this population of men.”

What would you tell this researcher?

The investigator has lots of problems; you should have at least identified one of them.

First, he carried out an observational study; he did not assign men at random to differentpatterns of exercise. Rather, the men themselves decided how much to exercise. Thus, hisstatement that “an increase in exercise causes weight loss” cannot be justified. He cannothope to make a causal interpretation of the effect of exercise on weight loss, as it could wellbe that there is a common confounding factor or factors that lead men both to exercise moreand lose weight. The best he can hope to say is that there appears to be evidence of anassociation between increased exercise and weight loss.

His second problem is that, causality aside, he has assumed a model that says that givenknowledge of a man’s entire pattern of exercising over time, weight at month j is associatedonly with the exercise a man does in the month prior to the weighing. Thus, he is assuming,for example, that there is no cumulative effect of exercise such that weight at a certain monthis associated with all the exercise the man has done up to that point. If this not a correctassumption, the researcher’s inferences regarding the association between weight and exercisemay be flawed, as they are based on an incorrect description of the situation.

18