FILENAME goptions URL "http://192.38.117.59/~linearpredictors/datafiles/goptions.sas"; %include goptions; FILENAME url URL "http://192.38.117.59/~linearpredictors/datafiles/readMelanoma.sas"; %include url; DATA melanoma; SET melanoma; age=age/10; RUN; DATA pois3; SET melanoma; pyrs=min(years,2.5); lpyrs=log(pyrs); case=(dc ne 2)*(years le 2.5); time=1; OUTPUT; IF years>2.5 THEN DO pyrs=min(years-2.5,2.5); lpyrs=log(pyrs); case=(dc ne 2)*(years le 5); time=2; OUTPUT; END; IF years>5 THEN DO pyrs=years-5; lpyrs=log(pyrs); case=(dc ne 2); time=3; OUTPUT; END; RUN; /* NB effect of thick slightly different than in Table 7.5.3 */ PROC GENMOD DATA=pois3; CLASS time; MODEL case=time sex ulc thick age/DIST=POI OFFSET=lpyrs NOINT; RUN; DATA pois2; SET melanoma; years=days/365.25; pyrs=min(years,4); lpyrs=log(pyrs); case=(dc ne 2)*(years le 4); time=1; OUTPUT; IF years>4 THEN DO pyrs=years-4; lpyrs=log(pyrs); case=(dc ne 2); time=2; OUTPUT; END; RUN; PROC GENMOD DATA=pois2; CLASS time; MODEL case=time sex ulc thick age/DIST=POI OFFSET=lpyrs NOINT; RUN;