/*------------------------------------------------------------------* | MACRO NAME : comprisk | SHORT DESC : Compute cumulative incidence in the presence | of competing risks *------------------------------------------------------------------* | CREATED BY : Bergstralh, Erik (03/25/2004 17:31) *------------------------------------------------------------------* | PURPOSE | | Macro for cumulative incidence(CI) | in presence of competing risks. | | date written= 7/17/2000 | *------------------------------------------------------------------* | MODIFIED BY : Bergstralh, Erik (08/29/2008 14:55) | | Added labels to output dataset. Modified printed output. | Perform input checks, made GROUP optional, and restored user footnotes. *------------------------------------------------------------------* | OPERATING SYSTEM COMPATIBILITY | | UNIX SAS v8 : YES | UNIX SAS v9 : YES | MVS SAS v8 : | MVS SAS v9 : | PC SAS v8 : | PC SAS v9 : *------------------------------------------------------------------* | MACRO CALL | | %comprisk( | data= , | time= , | event= , | group=_all, | print=N, | outdata=_crisk | ); *------------------------------------------------------------------* | REQUIRED PARAMETERS | | Name : data | Default : | Type : Dataset Name | Purpose : SAS data set to use for competing risk analysis | | Name : time | Default : | Type : Variable Name (Single) | Purpose : follow-up time to event, pts can have only one event as | defined below. Time must be >=0. | | Name : event | Default : | Type : Variable Name (Single) | Purpose : 0 if no event | 1 if event of type 1, typically event of interest | 2 if event of type 2, competing risk | 3 if event of type 3, competing risk | *------------------------------------------------------------------* | OPTIONAL PARAMETERS | | Name : group | Default : _all | Type : Variable Name (Single) | Purpose : variable for doing by-group processing | | Name : print | Default : N | Type : Text | Purpose : N or Y to suppress or print final results | | Name : outdata | Default : _crisk | Type : Dataset Name | Purpose : Name of output dataset, default is _crisk. | CI1, CI2 and CI3 are the CI estimates for | causes 1, 2 and 3 respectively. | *------------------------------------------------------------------* | EXAMPLES | | Example located at bottom of code. | *------------------------------------------------------------------* | REFERENCES | | REFERENCE: Gooley, et al. Estimation of failure probabilities in | the presence of competing risks. Statist. Med. 18, 695-706(1999). | *------------------------------------------------------------------* | Copyright 2008 Mayo Clinic College of Medicine. | | This program is free software; you can redistribute it and/or | modify it under the terms of the GNU General Public License as | published by the Free Software Foundation; either version 2 of | the License, or (at your option) any later version. | | This program is distributed in the hope that it will be useful, | but WITHOUT ANY WARRANTY; without even the implied warranty of | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | General Public License for more details. *------------------------------------------------------------------*/ %macro comprisk(data=,time=,event=,group=_all,print=NO,outdata=_crisk); *** Input checks ***; %let errorflg=0; %if &time= %then %do; %put ERROR - Variable