260 likes | 383 Views
Survival Models in SAS. Learning Objectives What type of data merits these? What tools does SAS have? How do I do descriptive analysis? How do I do modelling? Is the model appropriate? A.Pope - Essay on Criticism Part ii Line 15. My Data Stops in the Middle.
E N D
Survival Models in SAS Learning Objectives What type of data merits these? What tools does SAS have? How do I do descriptive analysis? How do I do modelling? Is the model appropriate? A.Pope - Essay on Criticism Part ii Line 15
My Data Stops in the Middle • Outcome is typically a time duration until an event • Outcome is not observed for some proportion of the population • Often the outcome is death of a patient • Other examples • Failure of an electronic component • Divorce • Change cell phone provider
SAS to the rescue • Exploratory • FREQ • UNIVARIATE • MEANS/SUMMARY • GPLOT • Time-to-event most commonly analysed using • LIFETEST • PHREG
Baby’s First Dataset • NSAPD: Mum’s and babes since 1980 • All NS births since 1988 • Comprehensive clinical and demographic data • Includes gestational age at birth/delivery • Spontaneous / Induced / No Labour • Question: What factors associated with premature birth?
How is this ‘time-to-event’? • Birth is the event • When birth would have happened is censored • Induced labour • Straight to Caesarean Section • Measured in weeks since LMP • A (large) set of known risk factors • Many captured in Atlee
The Usual Suspects • Previous preterm delivery • Multiples • < 6 mos since last preg • Surgery on cervix • IVF • Uterine abnormalities • Smoking
A Long Line-Up • Chorioamnionitis • Weight Gain • UTI • BP • (G)DM • Maternal Weight • Previous Loss • Antepartum Trauma • A/P Bleeding • Polyhydramnios
This LIFE is a TESTThis life is a test-it is only a test.If it had been an actual life, you would have received furtherinstructions on where to go and what to do.Remember, this life is only a test. • proclifetest • data = Work.ForSHRUG • plots = (s,ls,lls) • maxtime = 45; • time GA_Best * Spontaneous_Labour ( 0 ); • id Labour /* censoring = Induced / None */; • strata DLNumFet; • test Prev_PTD Overweight AdmitSmk; • /* latter two most interesting from population health perspective */ • run;
The LIFETEST ProcedureStratum 4: # of Foetuses = TwinsProduct-Limit Survival Estimates
Lots of Data = Tiny p-values Rank Tests for the Association of GA_BEST with Covariates Pooled over Strata
Smoking and weight matter … how much? • Hazards – not just for golf any more • Proportional Hazards REGression • Doesn’t assume functional form for baseline hazard • Does assume that effect of covariate proportional over time • Manifests itself as, e.g., parallel lines on plot
Deciphering the code • procphreg • data = Work.ForSHRUG • plots ( overlay timerange = 24, 44 )= • ( cumhaz survival ) /* interesting weeks */ • simple /* compare healthy/unhealthy */; • where Weighted_Ran > 0.9; • /* 10% of 'healthy' + 55% w/ 1 risk factor + */
Modelling – not just for the young and beautiful ! • model GA_Best * Spontaneous_Labour ( 0 ) = • Prev_PTDDLNumFetAdmitSmkChorioamnionitisGest_HTPrexHTPre_Existing_Diabetes GDM DLAborts Overweight Underweight ; • assess var = ( Prev_PTDDLNumFetAdmitSmkChorioamnionitisGest_HTPrexHTGDM DLAbortsPre_Existing_Diabetes Overweight Underweight ) • ph;/* / resample seed = 19 */ /* takes 8 hours to run! */
Odious? NO – ODS – Yes! • ODS GRAPHICS ON; ODS GRAPHICS OFF;
Criticism A little learning is a dangerous thing; Drink deep, or taste not the Pierian spring: There shallow draughts intoxicate the brain, And drinking largely sobers us again. Two of 372 rhyming couplets
Competing Risks • Censoring must be non-informative • Here some covariates are associated with • Induction • No Labour • Need different models • Look at cumulative probability of 3 outcomes
One last tidbit • %CIF macro • http://support.sas.com/kb/45/addl/fusion_45997_13_fusion_45997_12_cif.txt • Crude cumulative incidence function • No covariates • Endpoints (time to spontaneous labour, e.g.) subject to competing risks • Induction for reason associated with length of pregnancy • No Labour for … • Comes with confidence limits • Needs Base & IML ( in 9.2 also GRAPH ) • No recommendation
Questions? • SHRUG.President@gmail.com • Ron.Dewar@HowDidIGetInvolved?ca • http://www.ats.ucla.edu/stat/examples/asa/test_proportionality.htm • http://www4.stat.ncsu.edu/~lu/ST790/homework/Biometrika-1993-LIN-557-72.pdf • http://escarela.com/archivo/anahuac/03o/residuals.pdf • SAS is a registered trademark or trademark of SAS Institute Inc. in Canada, the USA and other countries with dysfunctional political institutions.