options ls=80; data toluca; input x y; label x=Lot Size y=Work Hours; cards; 80 399 30 121 50 221 90 376 70 361 60 224 120 546 80 352 100 353 50 157 40 160 70 252 90 389 20 113 110 435 100 420 30 212 50 268 90 377 110 421 30 273 90 468 40 244 80 342 70 323 ; proc sort data=toluca;by x; proc reg data=toluca; model y=x; output out=new p=predict r=residual; data new1;set new; if x>75 then delete; data new2;set new; if x<75 then delete; proc univariate data=new1; var residual; proc univariate data=new2; var residual; /* use the medians from univariate for the following code*/ data new1;set new1; d1=abs(residual-(-19.876)); data new2;set new2; d2=abs(residual-(-2.864)); proc print data=new1; proc print data=new2; proc means data=new1; var d1; proc means data=new2; var d2; /* Now complete the calculations by hand You can calculate s**2 in equation (3.9a) using the standard deviations of d1 and d2 from proc means output. s**2={12(32.36)**2 + 11(28.45)**2}/(25-2)=964.21 s=31.05 d1bar=44.815 d2bar=28.450 t=(44.815-28.450)/[31.05*sqrt{(1/13)+(1/12)}] =1.32 */