/* wheatear example */ data wheatear; input mass tcell; cards; 3.33 .252 4.62 .263 5.43 .251 5.73 .251 6.12 .183 6.29 .213 6.45 .332 6.51 .203 6.65 .252 6.75 .342 6.81 .471 7.56 .431 7.83 .312 8.02 .304 8.06 .37 8.18 .381 9.08 .43 9.15 .43 9.35 .213 9.42 .508 9.95 .411 ; /* determine X-bar the tcell mean */ proc univariate data=wheatear noprint; var tcell; output out=new0 mean=tcellmean; proc print data=new0; title 'wheatear regression example'; title2 'tcell mean for input into estimate command in proc glm'; /* -------------------------------------------------- */ proc sgscatter data=wheatear; plot mass*tcell; title2 'regression of stone mass on tcell response'; proc glm data=wheatear plots = (residuals); model mass = tcell / ss1 ss2 p clm clparm ; output out=new predicted=yhat residual=resid lcl=clpl ucl=clpu lclm=clml uclm=clmu; estimate 'intercept' intercept 1; estimate 'slope' tcell 1; estimate 'mean' intercept 1 tcell .32395; proc print data=new; var mass tcell clml clmu clpl clpu yhat resid; proc univariate data=new normal nextrval=5; var resid; QQplot resid; ods select BasicMeasures TestsForNormality ExtremeValues Quantiles QQPlot; title2 'descriptive statistics for residuals'; run;