The REG Procedure

Predicted and Residual Values

The display of the predicted values and residuals is controlled by the P, R, CLM, and CLI options in the MODEL statement. The P option causes PROC REG to display the observation number, the ID value (if an ID statement is used), the actual value, the predicted value, and the residual. The R, CLI, and CLM options also produce the items under the P option. Thus, P is unnecessary if you use one of the other options.

The R option requests more detail, especially about the residuals. The standard errors of the mean predicted value and the residual are displayed. The studentized residual, which is the residual divided by its standard error, is both displayed and plotted. A measure of influence, Cook’s D, is displayed and plotted. Cook’s D measures the change to the estimates that results from deleting each observation (Cook 1977, 1979). This statistic is very similar to DFFITS.

The CLM option requests that PROC REG display the % lower and upper confidence limits for the mean predicted values. This accounts for the variation due to estimating the parameters only. If you want a % confidence interval for observed values, then you can use the CLI option, which adds in the variability of the error term. The level can be specified with the ALPHA= option in the PROC REG or MODEL statement.

You can use these statistics in PLOT and PAINT statements. This is useful in performing a variety of regression diagnostics. For definitions of the statistics produced by these options, see Chapter 4: Introduction to Regression Procedures.

The following statements use the U.S. population data found in the section Polynomial Regression. The results are shown in Figure 99.33 and Figure 99.34.

ods graphics on;

data USPop2;
   input Year @@;
   YearSq=Year*Year;
   datalines;
2010 2020 2030
;

data USPop2;
   set USPopulation USPop2;
run;

proc reg data=USPop2;
   id Year;
   model Population=Year YearSq / r cli clm;
run;

Figure 99.33: Regression Using the R, CLI, and CLM Options

The REG Procedure
Model: MODEL1
Dependent Variable: Population

Analysis of Variance
SourceDFSum of
Squares
Mean
Square
F ValuePr > F
Model2159529797658864.19<.0001
Error19170.971938.99852  
Corrected Total21159700   

Root MSE2.99975R-Square0.9989
Dependent Mean94.64800Adj R-Sq0.9988
Coeff Var3.16938  

Parameter Estimates
VariableDFParameter
Estimate
Standard
Error
t ValuePr > |t|
Intercept121631639.5018133.82<.0001
Year1-24.045810.67547-35.60<.0001
YearSq10.006680.0001782037.51<.0001


Figure 99.34: Regression Using the R, CLI, and CLM Options

The REG Procedure
Model: MODEL1
Dependent Variable: Population

Output Statistics
ObsYearDependent
Variable
Predicted
Value
Std
Error
Mean
Predict
95% CL Mean95% CL PredictResidualStd Error
Residual
Student
Residual
Cook's D
117903.936.21271.75652.53629.8892-1.063113.4884-2.28372.432-0.9390.153
218005.315.72261.45602.67518.7701-1.256512.7017-0.41462.623-0.1580.003
318107.246.56941.21184.03319.1057-0.202113.34090.66962.7440.2440.004
418209.648.75311.03056.596310.91002.114415.39180.88492.8170.3140.004
5183012.8712.27370.916310.355814.19165.708718.83860.59232.8560.2070.001
6184017.0717.13110.865015.320718.941510.596823.6655-0.06212.872-0.0220.000
7185023.1923.32540.861321.522725.128116.793229.8576-0.13442.873-0.0470.000
8186031.4430.85660.884629.005132.708024.310737.40240.58642.8660.2050.001
9187039.8239.72460.916337.806741.642533.159746.28960.09342.8560.0330.000
10188050.1649.92950.943647.954551.904643.347656.51140.22552.8470.0790.000
11189062.9561.47130.959059.464163.478554.879768.06291.47572.8420.5190.010
12190075.9974.34990.959072.342776.357167.758380.94151.64412.8420.5780.013
13191091.9788.56550.943686.590490.540581.983695.14733.40652.8471.1960.052
141920105.71104.11780.9163102.2000106.035797.5529110.68281.59222.8560.5570.011
151930122.78121.00710.8846119.1556122.8585114.4612127.55291.76792.8660.6170.012
161940131.67139.23320.8613137.4305141.0359132.7010145.7654-7.56422.873-2.6320.208
171950151.33158.79620.8650156.9858160.6066152.2618165.3306-7.47122.872-2.6010.205
181960179.32179.69610.9163177.7782181.6139173.1311186.2610-0.37312.856-0.1310.001
191970203.21201.93281.0305199.7759204.0896195.2941208.57151.27822.8170.4540.009
201980226.54225.50641.2118222.9701228.0427218.7349232.27791.03562.7440.3770.009
211990248.71250.41681.4560247.3693253.4644243.4378257.3959-1.70682.623-0.6510.044
222000281.42276.66421.7565272.9877280.3407269.3884283.94004.75782.4321.9570.666
232010.304.24842.1073299.8377308.6591296.5754311.9214....
242020.333.16952.5040327.9285338.4104324.9910341.3479....
252030.363.42742.9435357.2665369.5883354.6310372.2238....


Figure 99.35: Studentized Residuals and Cook’s D

Studentized Residuals and Cook’s


After producing the usual analysis of variance and parameter estimates tables (Figure 99.33), the procedure displays the results of requesting the options for predicted and residual values (Figure 99.34). For each observation, the requested information is shown. Note that the ID variable is used to identify each observation. Also note that, for observations with missing dependent variables, the predicted value, standard error of the predicted value, and confidence intervals for the predicted value are still available.

The studentized residuals and Cook’s D statistics in Figure 99.34 and Figure 99.35 are displayed as a result of specifying the R option. The large absolute studentized residuals for 1940 and 1950 (best seen in Figure 99.35) indicate that the overall model is inadequate for explaining the population in these two years. You can use ODS Graphics to obtain plots of studentized residuals by predicted values or leverage; see Example 99.1 for a similar example.