/************************************************ * Making spin-plot varing the coefficient * * for variable x1x1x2 only * * (the higher level of interaction) * * In the process, only one parameter is varing, * * that is the bx1x1x2 term. The corresponding * * fixed string length parameter is called bf. * * You can use it in your title statement. * ************************************************/ %macro sp_plotbx1x1x2(outfile="c:\sp_plotbx1x1x2.gif", data=_spinplt , x1lo=-10, x1hi=10, x1by=1, x2lo=-10, x2hi=10, x2by=1, cons=0, bx1=0, bx2=0, bx1x2=0, bx1x1=0, bx2x2=0, bx1x2x2=0, title=Spin plot, plot=, gopt=, slen=6, angle=100, bx1x1x2_lo=-.25, bx1x1x2_hi=.25, bx1x1x2_by=.05, cmd=plot); * reset graph settings ; goptions reset=all; filename out clear ; filename out &outfile ; /* assign graphics options for the animation */ goptions gsfname=out dev=gifanim gcopies=0 iteration=0 delay=50 &gopt; %let bx1x1x2_lo_ = %sysevalf(&bx1x1x2_lo*100); %let bx1x1x2_hi_ = %sysevalf(&bx1x1x2_hi*100); %let bx1x1x2_by_ = %sysevalf(&bx1x1x2_by*100); * make graph going forward from bx1x2lo to bx1x2hi ; %do bx1x1x2_ = &bx1x1x2_lo_ %to &bx1x1x2_hi_ %by &bx1x1x2_by_ ; %let bx1x1x2 = %sysevalf(&bx1x1x2_ / 100); %if &bx1x1x2_ = &bx1x1x2_lo_ %then %do; goptions gsfmode=replace; %end; %if &bx1x1x2_ > &bx1x1x2_lo_ %then %do; goptions gsfmode=append; %end; /* %if &bx1x2_ >= &bx1x2_hi_ %then %do; goptions gepilog='3B'x; %end; */ %local bstring; %fixlen(&bx1x1x2, &slen); %let title =&title; %let title2=%str(y=&cons+&bx1*x1+&bx2*x2+&bx1x2*x1*x2+&bx1x1*x1x1+&bx2x2*x2x2+&bx1x2x2*x1x2x2)%str(&bstring*x1x1x2); %sp_plot(angle=&angle, data=&data , x1lo=&x1lo, x1hi=&x1hi, x1by=&x1by, x2lo=&x2lo, x2hi=&x2hi, x2by=&x2by, cons=&cons, bx1=&bx1, bx2=&bx2, bx1x2=&bx1x2, bx1x1=&bx1x1, bx2x2=&bx2x2, bx1x1x2=&bx1x1x2, bx1x2x2=&bx1x2x2, title=&title, title2=&title2, plot=&plot, gopt=&gopt, cmd=&cmd, reset=no); %end; * make graph going backward from bx1x2hi to bx1x2lo ; %do bx1x1x2_ = &bx1x1x2_hi_ %to &bx1x1x2_lo_ %by -&bx1x1x2_by_ ; %let bx1x1x2 = %sysevalf(&bx1x1x2_ / 100); /* %if &bx1x2_ = &bx1x2_hi_ %then %do; goptions gsfmode=replace; %end; */ /* %if &bx1x2_ > &bx1x2_hi_ %then %do; goptions gsfmode=append; %end; */ %if &bx1x1x2_ <= &bx1x1x2_lo_ %then %do; goptions gepilog='3B'x; %end; %local bstring; %fixlen(&bx1x1x2, &slen); %let title =&title; %let title2=%str(y=&cons+&bx1*x1+&bx2*x2+&bx1x2*x1*x2+&bx1x1*x1x1+&bx2x2*x2x2+&bx1x2x2*x1x2x2)%str(&bstring*x1x1x2); %sp_plot(angle=&angle, data=&data , x1lo=&x1lo, x1hi=&x1hi, x1by=&x1by, x2lo=&x2lo, x2hi=&x2hi, x2by=&x2by, cons=&cons, bx1=&bx1, bx2=&bx2, bx1x2=&bx1x2, bx1x1=&bx1x1, bx2x2=&bx2x2, bx1x1x2=&bx1x1x2, bx1x2x2=&bx1x2x2, title=&title, title2=&title2, plot=&plot, gopt=&gopt,cmd=&cmd, reset=no); %end; filename out clear ; goptions reset = all; %mend sp_plotbx1x1x2;