%macro grlog(a=0, b=.5, reset=yes, gif=no, fname=c:\grlog.gif); data test; do x = -10 to 10 by 1; logity = &a + x * &b; pgty = 1 - 1 / (1 + exp(logity)); oddsy = pgty / (1-pgty); output; end; run; %if &gif = yes %then %do; goptions reset=all; filename templog clear ; filename templog "&fname" ; goptions dev=gif373 gsfname=templog ; goptions ftext=swiss cback=white htext=1 colors=(black YELLOW GOLD BLUE MAGENTA DAGRAY BROWN) ; %end; goptions interpol=join; title1 h=2 "Graph of Logistic Regression"; title2 h=2 "Where a=&a and b=&b"; axis1 order=(0 to 1 by .1) label=(r=0 a=90 h=2) ; axis2 order=(-10 to 10 by 2) label=(h=2); proc gplot data=test; plot pgty*x /vaxis=axis1 haxis=axis2; label pgty="Probability of Y=1" ; label x="Value of Predictor, X"; run; quit; %if &reset ~= no %then goptions reset=all; %mend;