FILENAME goptions URL "http://192.38.117.59/~linearpredictors/datafiles/goptions.sas"; %include goptions; FILENAME url URL "http://192.38.117.59/~linearpredictors/datafiles/readVitaminD.sas"; %include url; DATA irpowomen; SET vitamind (WHERE = (country IN (4,6) and category=2)); lvitd=log10(vitd); RUN; PROC MEANS DATA=irpowomen; CLASS country; VAR bmi lvitd; OUTPUT OUT=averages MEAN=mbmi mlvitd; RUN; DATA averages; SET averages; /* type is used to separate the graphical parts */ /* that is, points, lines and averages */ KEEP bmi y type; bmi=mbmi; y=mlvitd; type=country; RUN; PROC GLM DATA=irpowomen; CLASS country; MODEL lvitd=country bmi / solution clparm; OUTPUT OUT=modelcontrol p=predicted r=residual; RUN; DATA model; SET modelcontrol; y=lvitd; type=10+country; output; y=predicted; type=20+country; output; RUN; DATA adjusted; SET model averages; PROC GPLOT DATA = adjusted; PLOT y*bmi=type / NOLEGEND HAXIS=AXIS1 VAXIS=AXIS2; AXIS1 ORDER=(15 to 45 by 5) MINOR = NONE OFFSET = (5 pct) LABEL = ('BMI'); AXIS2 MINOR = NONE LABEL = (A=90 R=0 "log10(vitamin D)"); SYMBOL1 VALUE = STAR I=NONE COLOR = red R=3; SYMBOL2 VALUE = DOT I=NONE COLOR = black R=1; SYMBOL3 VALUE = CIRCLE I=NONE COLOR = black R=1; SYMBOL4 VALUE = NONE I=join COLOR = black R=2; RUN;