![]() | ![]() | ![]() |
The dynamic processing of programming statements that involve time within PROC PHREG is quite different from the sequential processing of the DATA step, which operates on one record at a time. This "dynamic processing" of time-dependent covariates within PROC PHREG creates risk sets with the appropriate values of the time-dependent covariates. Using the same programming statements in a DATA step does not replicate the processing of time-dependent covariates that are used by PROC PHREG. Covariates that are defined in the DATA step are called "fixed" covariates.
The time variable in the MODEL statement represents the observed failure times of the subjects—either an event time or a censoring time. For each event time, t, there is a risk set Rt associated with t (that is, Rt is the subset of individuals whose observed failure times are greater than or equal to t). The time-dependent covariates for subjects in Rt are evaluated using the event time value. It is incorrect to think that the time-dependent covariates for a subject are evaluated by PROC PHREG only at the observed time of the observation, as in a DATA step.
Consider the following example:
data one;
input
subj t c x;
datalines;
1 100 0 .1
2 125 0 .2
3 150 1 .1
4 175 0 .4
;
proc phreg data=one;
model t*c(1) = x tx;
tx = t * x;
run;
In this example, the time variable T has four values—100; 125 and 175 are event times; and 150 is a censored time. The risk set that is associated with event time 100 consists of subjects 1 though 4, and their TX values are 100*.1=10, 100*.2=20, 100*.1=10, and 100*.4=40, respectively. The risk set that is associated with the event time 125 consists of subjects 2 through 4, and their TX values are 125*.2=25 and 125*1=12.5, and 125*.4=50, respectively. The risk set at event time 175 contains subject 4 with TX value 175*.4=70. Note that the value of the covariate TX for each subject varies dynamically with the risk set/event time.
Contrast this with defining TX=T*X; in a DATA step, which only reads in the values of the covariates for each event time:
SUBJ T C X TX
1 100 0 .1 10
2 125 0 .2 25
3 150 1 .1 15
4 175 0 .4 70
The risk sets contain the same subjects, but the value of TX comes in statically from the data set. Here, the risk set for T=100 consists of subjects 1 through 4, and their TX values are 10, 25, 15, and 70, respectively. The risk set for T=125 consists of subjects 2 through 4 with TX values 25, 15, and 70, respectively. The risk set for T=175 has subject 4 with TX=70. Note that the value of the covariate TX for subject 4, for example, does not change in each risk set.
Showing these risk sets side by side reveals the dynamic nature of the time-dependent covariates that are defined within PROC PHREG and the static nature of fixed covariates that are defined in a DATA step:
PROC PHREG DATA step
dynamic processing static processing
TX = T*X TX = T*X
re-evaluated at each event time evaluated only once at the observed time
t subjects in Rt TX t subjects in Rt TX
================================= ============================
100 1 100*.1=10 100 1 10
2 100*.2=20 2 25
3 100*.1=10 3 15
4 100*.4=40 4 70
-------------------------------- ------------------------------
125 2 125*.1=12.5 125 2 25
3 125*.2=25 3 15
4 125*.4=50 4 70
-------------------------------- ------------------------------
175 4 175*.4=70 175 4 70
With the dynamic processing in PROC PHREG, subject 4 has a time-dependent covariate TX that changes with time from 40 at t=100, to 50 at t=125, to 70 at t=175. If TX were a fixed covariate that was defined in the DATA step, then subject 4 would have TX evaluated only at the observed time of t=175 and this subject would possess TX=70 in every risk set.
| Product Family | Product | System | SAS Release | |
| Reported | Fixed* | |||
| SAS System | SAS/STAT | All | n/a | |
| Type: | Usage Note |
| Priority: | low |
| Topic: | SAS Reference ==> Procedures ==> PHREG |
| Date Modified: | 2016-06-01 17:27:15 |
| Date Created: | 2007-02-12 10:55:55 |


