FILENAME goptions URL "http://192.38.117.59/~linearpredictors/datafiles/goptions.sas"; %include goptions; FILENAME url URL "http://192.38.117.59/~linearpredictors/datafiles/readPbc3.sas"; %include url; /******************************************* We group bili into quantilegroups (5 groups) and merge the data set containing the quintiles onto the main data set. ********************************************/ PROC RANK DATA = pbc3 TIES = LOW GROUPS = 5 OUT = quint(KEEP=ptno biligroup); VAR bili; RANKS biligroup; RUN; DATA pbc3; MERGE pbc3 quint; BY ptno; RUN; /****************************************** Table showing quintile groups, and the groupwise mean of bilirubin level. *******************************************/ PROC MEANS DATA = pbc3 MEAN MIN MAX; CLASS biligroup; VAR bili; RUN; /***************************************** Creating 0-1 variables according to quintile groups of bilirubin. ******************************************/ DATA pbc3; SET pbc3; ARRAY q {*} bq1 - bq5; DO i = 0 TO 4; q(i+1) = (biligroup=i); END; RUN; PROC LIFETEST DATA = pbc3 NOTABLE; TIME followup*status(0); STRATA bq1-bq5; RUN;