title " "; data A; do x1 = -10 to 10 ; do x2 = -10 to 10 ; Y = 25 + .1*X1 + .3*X2 - .05*X1 *X2 + 2*normal(5431875); output; end; end; proc g3d; scatter x2*x1=y / shape = "balloon" size=0.5 noneedle rotate=15; run; proc reg data=a; model Y = x1 x2; output out=out1 residual=r; run; proc gplot; plot r*x1 r*x2/vref=0; symbol1 v=dot i=none; Title "3-D Residuals"; run; data out1; set out1; color="gray "; shape="balloon"; size=0.5; if r<0 then do; color="red"; shape="diamond"; size=0.8; end; output; r=-10; x1=x1+.00001*(ranuni(12345)-.5); output; proc g3d; scatter x2*x1=r / shape = shape size=0.5 color=color tilt=85 noneedle rotate=15 size=size; run;