Example 10.1: Linear Regression with Output Statistics DATA in_dat; do i= 1 to 25; rp12=ranuni(323829); x1=ranuni(272329); x2=ranuni(123329); x3=ranuni(222529); output; end; PROC IML; USE in_dat; READ all var {rp12} into y ; READ all var { x1 x2 x3 } into x; PRINT x, y; START reg(x,y); reset print; n=nrow(x); /* number of observations */ k=ncol(x); /* number of variables */ xpx=x`*x; /* cross-products */ xpy=x`*y; xpxi=inv(xpx); /* inverse crossproducts */ b=xpxi*xpy; /* parameter estimates */ yhat=x*b; /* predicted values */ resid=y-yhat; /* residuals */ sse=resid`*resid; /* sum of squared errors */ dfe=n-k; /* degrees of freedom error */ mse=sse/dfe; /* mean squared error */ rmse=sqrt(mse); /* root mean squared error */ covb=xpxi#mse; /* covariance of estimates */ stdb=sqrt(vecdiag(covb)); /* standard errors */ t=b/stdb; /* ttest for estimates=0 */ probt=1-probf(t#t,1,dfe); /* significance probability */ print b stdb t probt; FINISH; RUN reg(x,y); * The RUN statement executes the module called reg; QUIT;