07-30-2012 09:15 AM
I am getting acquainted with the PHREG procedure (sas9.2). Before applying the procedure to my data, I am going through the examples.
I need to use time-dependant variable in my derivation. I thus looked at the example 64.6 (http://support.sas.com/documentation/cdl/en/statug/63033/HTML/default/viewer.htm#statug_phreg_sect03...)
I tried to re-write the code so that I could use the counting process style of input as the latter would more easily fit the data I have. I created the appropriate data-set as follow:
CREATE TABLE HEART2 AS
SELECT id, 0 AS TIME1,
WHEN WaitTime = . or Time < WaitTime THEN TIME ELSE WAITTIME AS TIME2, 0 AS XSTATUS FROM HEART)
SELECT ID, WAITTIME AS TIME1, TIME AS TIME2, STATUS, ACC_AGE, 1 AS XSTATUS FROM HEART WHERE WAITTIME NE . AND TIME>WAITTIME)
ORDER BY ID;
This way, every ID has an entry until death/censoring or transplant, whatever comes first. ID that received transplants have a second entry from the date of the transplant to death/censoring. It seems to me that it follows failry similarly the counting process example described in the guide
I then ran the proc phreg the way it is in the example and the way that would fit the "counting process style of input" of the new dataset:
proc phreg data= Heart;
model Time*Status(0)= XStatus Acc_Age;
if (WaitTime = . or Time < WaitTime) then XStatus=0.;
else XStatus= 1.0;
phreg data= Heart2;
model (Time1,Time2)*Status(0)= XStatus Acc_Age;
the result I get are, however, very different. I also tried to run both regressions with only acc_age as regressor, but, again, i got different results.
I could not quite understand how the two calculation methods vary, from the SAS guide.
Is there anyone who could shed some ligth on the matter?