* * Read in the stanford data set *; libname save 'sasdata'; options linesize=64; data temp; infile 'data.stanford'; input id @6 birth_dt mmddyy8. @16 entry_dt mmddyy8. @26 tx_dt mmddyy8. @37 fu_dt mmddyy8. fustat prior_sx ; format birth_dt entry_dt tx_dt fu_dt date7.; proc print; proc sort; by id; data save.stanford; set temp; drop fu_dt fustat birth_dt entry_dt tx_dt; age = (entry_dt - birth_dt)/365.25 - 48; year = (entry_dt - mdy(10,1,67))/ 365.25; *time since 1 Oct, 1967; wait = 1 + (tx_dt - entry_dt); if (id = 38) then wait = wait - .1; if (tx_dt =.) then do; rx = 0; * standard therapy; start = 0; stop = 1 + fu_dt - entry_dt; status= fustat; output; end; else do; rx =0; start = 0; stop = wait; status= 0; output; rx =1; start = stop; stop = 1 + fu_dt - entry_dt; status= fustat; output; end; proc print; id id; title "Stanford Heart Transplant data set";