/* iowacorn2.sas */ options ls=72 ps=60; data iowacorn; infile 'iowacorn.dat'; input x1 x2 x3 x4 x5 x6 x7 x8 x9 y; /* coding x1 = year x2 = precip1 x3 = maytemp x4 = junerain x5 = junetemp x6 = julyrain x7 = julytemp x8 = augrain x9 = augtemp y = yield */ /* regression of yield on x1, x2, x3 */ proc glm data=iowacorn; model y = x1 x2 x3 / ss1 ss2 clparm; output out=new1 predicted=yhat residual=resid lcl=clpl ucl=clpu lclm=clml uclm=clmu; title 'regression of yield on x1, x2, x3'; proc print data=new1; var y x1 x2 x3 clml clmu clpl clpu yhat resid; proc plot data=new1; plot resid*yhat / vref=0; plot resid*x1 / vref=0; plot resid*x2 / vref=0; plot resid*x3 / vref=0; title 'residual plots: regression of y on x1, x2, and x3'; proc rank data=new1 normal=blom out=new1a; var resid; ranks nscore; proc plot data=new1a; plot nscore*resid; proc univariate data=new1 plot normal; var resid; /* use proc reg to get sequential regression coefficients */ proc reg data=iowacorn; model y = x1 x2 x3 / seqb ss1 ss2; title 'regressions with sequential coefficients'; run;