Survival Analyses

KM and Life Table Estimation

/* Survival Analysis: K-M & Life-Table estimation */

data leukemia;
input weeks status drug $;
if drug='1' then drug='6-MP';
else drug='placebo';
datalines;
6 0 1
6 1 1
6 1 1
6 1 1
7 1 1
9 0 1
10 0 1
...
1 1 0
1 1 0
2 1 0
2 1 0
....
;
run;
/* KM estimation */

ods pdf file='\\psf\Home\Desktop\km_lifetable.pdf' style=SASdocprinter;
options nodate;
title KM and Lifetable for Leukemia Pts: '6-MP' vs Placebo;
proc lifetest data=leukemia method=km conftype=loglog 
plots=survival(cl)
plots=(s,ls,lls) graphics outsurv=a;
time weeks*status(0);
strata drug;
symbol1 v=none color=black line=1;
symbol2 v=none color=black line=2;
run

01 02

03

04

05 06  07

proc print data=a;
run;

print_a

/* Life Table estimation */ 
proc lifetest data=leukemia method=act intervals=10,20,30,40 
plots=(s,ls,lls) graphics outsurv=b; 
time weeks*status(0); 
strata drug; 
symbol1 v=none color=black line=1; 
symbol2 v=none color=black line=2; 
run;

08 09

10

11

12 13 14

proc print data=b;
run;

print_b

title;
ods pdf close;

Full data set:

data leukemia;
input weeks status drug $;
if drug='1' then drug='6-MP';
else drug='placebo';
datalines;
6 0 1
6 1 1
6 1 1
6 1 1
7 1 1
9 0 1
10 0 1
10 1 1
11 0 1
13 1 1
16 1 1
17 0 1
19 0 1
20 0 1
22 1 1
23 1 1
25 0 1
32 0 1
32 0 1
34 0 1
35 0 1
1 1 0
1 1 0
2 1 0
2 1 0
3 1 0
4 1 0
4 1 0
5 1 0
5 1 0
8 1 0
8 1 0
8 1 0
8 1 0
11 1 0
11 1 0
12 1 0
12 1 0
15 1 0
17 1 0
22 1 0
23 1 0
;
run;