* * Example 1 from pp 193-196 * open data cigarett.prn data(format=prn,org=columns) 1 47 obs lnc lnp lny linreg lnc # constant lnp lny * * Computes the fitted values, the leverage series x(i) (X'X)**-1 x(i)' and the standard * errors of projection from the regression. * prj(xvx=h,stderrs=sfit) fitted * * These are the internally studentized residuals * set istudent = %resids/sqrt(%seesq*(1-h)) * * These are the external estimates of the variance (that is, the estimates * using all data but the current data point). * set ssqi = %seesq*(%ndf-istudent**2)/(%ndf-1) * * These are the externally studentized residuals * set xstudent = %resids/sqrt(ssqi*(1-h)) * * Cook's D * set cookd = %resids**2/(%nreg*%seesq)*h/(1-h)**2 * * The differential fit measure, that is, the difference between y-hat with and * without the observation. * set dffits = sqrt(h/(1-h))*xstudent * * The ratio of determinants of the covariance matrix of coefficients with and * without the observation * set covratio = (ssqi/%seesq)**%nreg/(1-h) print(window="Diagnostic Statistics") / lnc fitted %resids istudent xstudent cookd dffits covratio