Data Structure

The LIFETEST, LIFEREG, and PHREG procedures all expect data with the same basic structure. Indeed, this structure is fairly standard across many different computer packages for survival analysis. For each case in the sample, there must be one variable (which I’ll call DUR) that contains either the time that an event occurred or, for censored cases, the last time at which that case was observed, both measured from the chosen origin. A second variable (which I’ll call STATUS) is necessary if some of the cases are censored or if you want to distinguish different kinds of events. The variable STATUS is assigned arbitrary values that indicate the status of the individual at the time recorded in the DUR variable. If there is only one kind of event, it is common to have STATUS=1 for uncensored cases and STATUS=0 for censored cases, but any two values will do as long as you remember which is which. For PROC LIFEREG and PROC PHREG, which estimate regression models, the record should also contain values of the covariates. This is straightforward if the covariates are constant over time. The more complex data structure needed for time-dependent covariates is discussed in Chapter 5.

The basic data structure is illustrated by Output 2.1 which gives survival times for 25 patients diagnosed with myelomatosis (Peto et al. 1977). These patients were randomly assigned to two drug treatments, as indicated by the TREAT variable. The DUR variable gives the time in days from the point of randomization to either death or censoring (which could occur either by loss to follow up or termination of the observation). The variable STATUS has a value of 1 for those who died and 0 for those who were censored. An additional covariate RENAL is an indicator variable for normal (1) versus impaired (0) renal functioning at the time of randomization. This data set is one of several that is analyzed in the remaining chapters.

Output 2.1. Myelomatosis Data
OBS    DUR    STATUS    TREAT    RENAL

 1       8       1        1        1
 2     180       1        2        0
 3     632       1        2        0
 4     852       0        1        0
 5      52       1        1        1
 6    2240       0        2        0
 7     220       1        1        0
 8      63       1        1        1
 9     195       1        2        0
10      76       1        2        0
11      70       1        2        0
12       8       1        1        0
13      13       1        2        1
14    1990       0        2        0
15    1976       0        1        0
16      18       1        2        1
17     700       1        2        0
18    1296       0        1        0
19    1460       0        1        0
20     210       1        2        0
21      63       1        1        1
22    1328       0        1        0
23    1296       1        2        0
24     365       0        1        0
25      23       1        2        1

Although the basic data structure for survival analysis is quite simple, it can often be an arduous task to get the data into this form, especially in complex life history studies that contain information on many different kinds of repeatable events. With its extremely flexible and powerful DATA step, SAS is well suited to perform the kinds of programming necessary to process such complex data sets. Of particular utility is the rich set of date and time functions available in the DATA step. For example, suppose the origin time for some event is contained in three numeric variables: ORMONTH, ORDAY, and ORYEAR. Similarly, the event time is contained in the variables EVMONTH, EVDAY and EVYEAR. To compute the number of days between origin and event time, you need only the statement

dur = mdy(evmonth,evday,evyear)–mdy(ormonth,orday,oryear);

The MDY function converts the month, day and year into a SAS date: the number of days since January 1, 1960. Once that conversion takes place, simple subtraction suffices to get the duration in days. Many other functions are also available to convert time data in various formats into SAS date values.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.133.134.17