/* --------------------------------------------------------------- program: nickel-v92.sas input: nickelc.dat does: use counting process format for handling left truncation --------------------------------------------------------------- */; OPTIONS PS=68 LS=120 PAGENO=1 NODATE NOCENTER ERRORS=3; filename INF "H:\bios180\coursepack\SAS-unc-workshop-2008\nickelc.dat"; *******************************************************; data A; infile INF; input id icd exposure birthday afe enterage exitage; ** create variables; tl = enterage-afe; if exitage gt 85 then truncage = 85; else truncage = exitage; tr = truncage-afe; if icd=160 then delta = 1; else delta = 0; yfe = birthday + afe; logafe = log(afe-10); yfe10 = (yfe-1915)/10; yfe100 = (yfe-1915)**2 / 100; logexp = log(exposure+1); lable yfe ="Year of First Employment" tl ="Entering time"; run; proc phreg data=a; model (tl,tr)*delta(0)=logafe yfe10 yfe100 logexp; run;