title " "; data xtrans; keep Y X sqrtx; do obs = 1 to 100; X = 100*ranuni(123); sqrtx=round(sqrt(x),.1); Y = 2 + 3*sqrt(x) + 2*normal(123); Y = round(Y,.1); output; end; *************************** Throw in outlier ***************************; Y = 20; X=169; sqrtx=13; output; ****************************/; proc sort; by x; proc reg; model Y = sqrtx; output out=out1 p=ps r=rs; proc reg; model Y = x; output out=out2 predicted=px r=rx; proc means css; var rs rx; where Y<19; run; *** Graphics ***; goptions reset=all; proc gplot data=out2; plot Y*x/legend; proc gplot data=out2; where X<99; plot (Y ps px)*x/overlay; symbol1 v=dot i=none c=black; symbol2 v=circle i=join c=red; symbol3 v=circle i=join c = green; run; proc gplot data=out2; where X < 99; plot (rs rx)*x/overlay vref=0; symbol1 v=dot i=needle c=red; symbol2 v=circle i=needle c=green h=1.2; run;