/* SAS code for fitting a proportional hazards model to data from the VA lung cancer trial of 137 male patients with inoperable lung cancer */ /* 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: Measures patient performance of activities of daily living. SCORE FUNCTION 100 Normal, no evidence of disease 90 Able to perform normal activity with only minor symptoms 80 Able to perform normal activity with effort, some symptoms 70 Able to care for self but unable to do normal activities 60 Requires occasional assistance 50 Requires considerable assistance 40 Disabled, requires special assistance 30 Severely disabled 20 Very sick, requires supportive treatment 10 Moribund Months from Diagnosis Age in years Prior therapy: 0=no, 10=yes */ data va; infile 'c:\stat565\data\va.dat'; input rx cellt time status karno months age prior_rx; prior_rx = prior_rx/10; rx=rx-1; /* Recode rx=0 for standard */ ct2=0; if(cellt=2) then ct2=1; ct3=0; if(cellt=3) then ct3=1; ct4=0; if(cellt=4) then ct4=1; rxt=rx*log(time); karnot=karno*time; run; proc format; value celltype 1 = 'squamous' 2 = 'smallcell' 3 = 'adeno' 4 = 'large'; proc phreg data=va; model time*status(0)= rx rxt ct2 ct3 ct4 karno months age prior_rx / ties=efron; title "Incorrect check for proportional hazards"; run; proc phreg data=va; model time*status(0)= rx rxtime ct2 ct3 ct4 karno months age prior_rx / ties=efron; rxtime=rx*log(time); title "Correct Check for proportional hazards"; run;