I use two methods to do time-dependent using proc phreg, the first one is counting process, the second one programing statement, there is a little bit difference from two results, basically they are same. I would like to know if I do correctly these two methods should generate exactly same results Icu_1 is time-dependent, it's value is 0 if patient is not admitted to ICU or before icu_admission date if icu admitted icu_admission, provenance2, age_catn, sex are all numeric variables but with 2 or 3 distinct value. My two method code is: data co2;
set co1;
start=0;
if icu_admission = 0 then do;
stop = time_to_death; icu_1 = icu_admission;status_death1=status_death; output;
end;
else if icu_admission = 1 and time_to_icu < time_to_death then do;
stop = time_to_icu; icu_1 =0; status_death1=0; output;
start=time_to_icu; icu_1=1; stop=time_to_death; status_death1=status_death; output;
end;
else if icu_admission = 1 and time_to_icu = time_to_death then do;
stop=time_to_death; icu_1=1;status_death1=status_death;output;
end;
run;
proc phreg data = co2;
class Provenance2 (ref=first) age_cat3n (ref=first) sex (ref=first) comorbidity_catn (ref=first) ;
model (start,stop)*status_death1(0) =age_cat3n sex comorbidity_catn provenance2 icu_1 /rl ;
run;
proc phreg data = co1;
class Provenance2 (ref=first) age_cat3n (ref=first) sex (ref=first) comorbidity_catn (ref=first) ;
model time_to_death*status_death(0) =age_cat3n sex comorbidity_catn provenance2 icu_1 /rl;
if icu_admission = 0 then icu_1 = 0;
else if icu_admission=1 and time_to_death < time_to_icu then icu_1 =0;
else if icu_admission=1 and time_to_death >= time_to_icu then icu_1=1;
run;
... View more