1

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?

Roy Pardee
  • 196
  • 2
  • 12
  • Well, all the obs are censored by definition in tx/death so ergo the flat curve. Censor usually used to indicate loss to followup. It looks like you just want a CDF, so maybe PROC UNIVARIATE instead? – Reeza Mar 22 '18 at 20:58
  • I can get PROC UNIVARIATE to work with 'real' data but something in your pretend data structure doesn't work for this type of analysis. – Reeza Mar 22 '18 at 21:04

0 Answers0