/* SAS code to for premutation tests to compare two survival functions. Applied to data from the VA lung cancer trial of 137 male patient with inoperable lung cancer. This code is posted as va.perm.sas */ /* Variables Treatment: 1=standard, 2=test (chemotherapy) Celltype: 1=squamous, 2=smallcell, 3=adeno, 4=large Survival in days Status: 1=dead, 0=censored Karnofsky score Months from Diagnosis Age in years Prior therapy: 0=no, 10=yes */ data va; infile 'c:\mydocuments\courses\st565\data\va.dat'; input rx cellt time status karno months age prior_rx; prior_rx = prior_rx/10; if (cellt=1) then celltype= 'squamous'; if (cellt=2) then celltype= 'smallcell'; if (cellt=3) then celltype= 'adeno'; if (cellt=4) then celltype= 'large'; proc lifetest method=KM plots=(s) graphics outs=su data=va; time time*status(0); strata rx; symbol1 v=none color=black line=1 w=3; symbol2 v=none color=black line=2 w=3; run; %include "c:\mydocuments\courses\st565\sas\randgen.macro.sas"; %include "c:\mydocuments\courses\st565\sas\test.macro.sas"; %RAND_GEN(indata=va, time=time, cens=status, numreps=1000, group=rx, seed=0); %TEST(time=time, cens=status, censval=0, test=logrank, group=rx, type=rand); %TEST(time=time, cens=status, censval=0, test=gehan, group=rx, type=rand);