filename regr 'h:\HAL\Courses\Stat210\Kutner5th\univadmit.txt'; options linesize=80; data regdata; infile regr firstobs=1; input id gpa rank act year; proc gplot; plot gpa*rank gpa*act; proc means; var gpa rank act; proc corr; var gpa rank act; ** **; ** Note the output command in the regression procedure **; ** below identifies a new data file (out = resids) **; ** that will contain all current variables plus new variables specified **; ** on the command. p is code for predicted values and yhat is the name **; ** that I am assigning. r is code for ordinary residuals and resid is **; ** the name that I am assigning. etc. The options for the output line **; ** and other reg commands can be found in the PROC REG manual page on **; ** the course web site **; ** **; proc reg; model gpa = act / p r cli clm; output out = resids p = yhat r = resid student = studres; ** **; ** next two procedures produce residual plots **; ** **; proc rank normal=blom data = resids out = norm; var studres; ranks nrm; proc gplot data=norm; plot studres*nrm studres*yhat; run;