Given data with a number-of-days-to-event, and an outcome, like so:
data pretend ;
do subject = 1 to 1000 ;
fup_time = round(uniform(83386)*500, 1) ;
select(round(uniform(778523)*5, 1)) ;
when(1) outcome = 'cholys' ;
when(2) outcome = 'death' ;
when(3) outcome = 'tx end' ;
when(4) outcome = 'vascul' ;
otherwise outcome = 'reop' ;
end ;
output ;
end ;
label
fup_time = "The day on which ::outcome:: occurred"
outcome = "What the subject's last observed event was"
;
run ;
What's the easiest way to generate curves for each outcome that show what proportion of the sample was still being observed on day X, broken out by outcome?
I tried:
proc lifetest data = pretend plots = all notable ;
strata outcome ;
time fup_time*censored(1) ;
run ;
Where 'censored' is set to 1 whenever outcome is 'tx end' or 'death'. I quite like the product-limit survival curves that produces, except that the lines for death & tx end are completely flat, at y = 1.0.
I'm not actually looking to do any inference here at all--just want the pretty pictures. Is there an easy way?