Help using Base SAS procedures

PROC PHREG with time dependent covariate

Reply
Contributor
Posts: 25

PROC PHREG with time dependent covariate

Hi,

I 'd like to know how is the time depedent covariate used in porc phreg.

The example SAS code is as follows.

proc phreg data=data;

model X*EVENT(0)=X_VAR;

array X_VAR_[5] X_VAR_1 - X_VAR_5;

array X_TW[5]  X_TM1 - X_TM5;

do i=1 to 4;

      if  X < X_TW[i+1] then goto exit;

end;

exit:

  X_VAR=X_VAR_ ;

run;

And, the data used for this analysis is as follows.

(This is just an example data, so it has only 5 records for simplicity.)

data data;

input id event  X  X_TM1 - X_TM5 X_VAR_1 - X_VAR_5 ; 

datalines;

  1 1 5 0 6 12 18 24   101 102 103 104 105

  2 1 10 0 6 12 18 24  201 202 203 204 205

  3 0 15 0 6 12 18 24  301 302 303 304 305

  4 1 20 0 6 12 18 24  401 402 403 404 405

  5 1 25 0 6 12 18 24  501 502 503 504 505  ;

run;

My question is why X_VAR will be 505 for id=5 when X=25.

When X=25, the condition "if  X < X_TW[i+1] " is not true for any i(1,2,3,4), and exit statement is not supposed to work.

If so, how is X_VAR determined when X=25?

I'm sorry for my poor writing, but I'd really appreceiate it if somneone help me.

Thanks in advance.

Yasu

Ask a Question
Discussion stats
  • 0 replies
  • 163 views
  • 0 likes
  • 1 in conversation