FILENAME goptions URL "http://192.38.117.59/~linearpredictors/datafiles/goptions.sas"; %include goptions; FILENAME url URL "http://192.38.117.59/~linearpredictors/datafiles/readFever.sas"; %INCLUDE url; proc genmod data=fever; class parity; model episodes=parity mage / dist=poisson link=log type3; output out=fit reschi=reschi; run; %begin_multilayout(1,2); proc gplot gout=plots data=fit; plot reschi*mage=parity / haxis=axis1 vaxis=axis2 frame; axis1 order=(15 to 45 by 5) minor=NONE label=('Age at conception'); axis2 order=(-5 to 25 by 5) minor=NONE label=(A=90 R=0 'Residuals'); symbol1 v=circle i=none c=blue l=33 w=2 r=1; symbol2 v=star i=none c=red l=1 w=2 r=1; run; PROC SORT DATA=fit; BY parity; RUN; PROC LOESS DATA = fit; BY parity; ODS OUTPUT OUTPUTSTATISTICS = results; MODEL reschi = mage / DEGREE=1; /* SMOOTH=0.7 fitting lines using 70% nearest points */ RUN; proc gplot gout=plots data=results; plot Pred*mage=parity / haxis=axis1 vaxis=axis2 frame; axis1 order=(15 to 45 by 5) minor=NONE label=('Age at conception'); axis2 order=(-0.4 to 0.4 by 0.2) minor=NONE label=(A=90 R=0 'Smoothed Pearson residual'); symbol1 v=none i=sm50s c=blue l=33 w=2 r=1; symbol2 v=none i=sm50s c=red l=1 w=2 r=1; run; %end_multilayout(1,2);