The GENMOD Procedure

Example 45.8 Model Assessment of Multiple Regression Using Aggregates of Residuals

(View the complete code for this example.)

This example illustrates the use of cumulative residuals to assess the adequacy of a normal linear regression model.

Neter et al. (1996, Section 8.2) describe a study of 54 patients undergoing a certain kind of liver operation in a surgical unit. The data consist of the survival time and certain covariates. After a model selection procedure, they arrived at the following model:

where Y is the logarithm (base 10) of the survival time; , , are blood-clotting score, prognostic index, and enzyme function, respectively; and is a normal error term. A listing of the SAS data set containing the data is shown in Output 45.8.1. The variables Y, X1, X2, and X3 correspond to Y, , , and , and LogX1 is log(). The PROC GENMOD fit of the model is shown in Output 45.8.2. The analysis first focuses on the adequacy of the functional form of , blood-clotting score.

Output 45.8.1: Surgical Unit Example Data

ObsYX1X2X3LogX1
12.30106.762810.82607
22.00435.159660.70757
32.30967.457830.86923
42.00436.573410.81291
52.70677.8651150.89209
61.90315.838720.76343
71.90315.746630.75587
82.10383.768810.56820
92.30546.067930.77815
102.30753.776940.56820
112.51726.384830.79934
121.81296.751430.82607
132.91915.8961140.76343
142.51855.883880.76343
152.22537.762670.88649
162.33657.474680.86923
171.93956.085280.77815
181.53153.751410.56820
192.33247.368740.86332
202.23555.657870.74819
212.03745.252760.71600
222.13353.483530.53148
231.84516.726680.82607
242.34245.867860.76343
252.44096.3591000.79934
262.15845.861730.76343
272.25775.252860.71600
282.758911.276901.04922
291.85735.254560.71600
302.25045.876590.76343
311.85133.264650.50515
321.76348.745230.93952
332.06455.059730.69897
342.46985.872930.76343
352.06075.458700.73239
362.26485.351990.72428
372.07192.674860.41497
382.07924.381190.63347
392.17904.861760.68124
402.17035.452880.73239
411.97775.249720.71600
421.87513.628990.55630
432.68408.886880.94448
442.18476.556770.81291
452.28103.477930.53148
462.08996.540840.81291
472.49284.5731060.65321
482.59994.8861010.68124
492.19875.167770.70757
502.49143.9821030.59106
512.09346.677460.81954
522.09696.485400.80618
532.29676.459850.80618
542.49558.878720.94448


In order to assess the adequacy of the fitted multiple regression model, the ASSESS statement in the following SAS statements is used to create the plots of cumulative residuals against X1 shown in Output 45.8.3 and Output 45.8.4 and the summary table in Output 45.8.5:

ods graphics on;

proc genmod data=Surg;
   model Y = X1 X2 X3 / scale=Pearson;
   assess var=(X1) / resample=10000
                     seed=603708000
                     crpanel;
run;

Output 45.8.2: Regression Model for Linear X1

The GENMOD Procedure

Analysis Of Maximum Likelihood Parameter Estimates
ParameterDFEstimateStandard
Error
Wald 95% Confidence LimitsWald Chi-SquarePr > ChiSq
Intercept10.48360.04260.40010.5672128.71<.0001
X110.06920.00410.06120.0772288.17<.0001
X210.00930.00040.00850.0100590.45<.0001
X310.00950.00030.00890.0101966.07<.0001
Scale00.04690.00000.04690.0469  

Note:The scale parameter was estimated by the square root of Pearson's Chi-Square/DOF.



See Lin, Wei, and Ying (2002) for details about model assessment that uses cumulative residual plots. The RESAMPLE= keyword specifies that a p-value be computed based on a sample of 10,000 simulated residual paths. A random number seed is specified by the SEED= keyword for reproducibility. If you do not specify the seed, one is derived from the time of day. The keyword CRPANEL specifies that the panel of four cumulative residual plots shown in Output 45.8.4 be created, each with two simulated paths. The single residual plot with 20 simulated paths in Output 45.8.3 is created by default.

To request these graphs, ODS Graphics must be enabled and you must specify the ASSESS statement. For general information about ODS Graphics, see Chapter 21: Statistical Graphics Using ODS. For specific information about the graphics available in the GENMOD procedure, see the section ODS Graphics.

Output 45.8.3: Cumulative Residual Plot for Linear X1 Fit

 Cumulative Residual Plot for Linear X1 Fit


Output 45.8.4: Cumulative Residual Panel Plot for Linear X1 Fit

 Cumulative Residual Panel Plot for Linear X1 Fit


Output 45.8.5: Summary of Model Assessment

Assessment Summary
Assessment
Variable
Maximum Absolute
Value
ReplicationsSeedPr >
MaxAbsVal
X10.0380100006037080000.1084


The p-value of 0.1084 reported on Output 45.8.3 and Output 45.8.5 suggests that a more adequate model might be possible. The observed cumulative residuals in Output 45.8.3 and Output 45.8.4, represented by the heavy lines, seem atypical of the simulated curves, represented by the light lines, reinforcing the conclusion that a more appropriate functional form for X1 is possible.

The cumulative residual plots in Output 45.8.6 provide guidance in determining a more appropriate functional form. The four curves were created from simple forms of model misspecification by using simulated data. The mean models of the data and the fitted model are shown in Table 45.19.

Output 45.8.6: Typical Cumulative Residual Patterns

 Typical Cumulative Residual Patterns


Table 45.19: Model Misspecifications

Plot

Data E(Y)

Fitted Model E(Y)

(a)

log(X)

X

(b)

X

(c)

(d)

X


The observed cumulative residual pattern in Output 45.8.3 and Output 45.8.4 most resembles the behavior of the curve in plot (a) of Output 45.8.6, indicating that log() might be a more appropriate term in the model than .

The following SAS statements fit a model with LogX1 in place of X1 and request a model assessment:

proc genmod data=Surg;
   model Y = LogX1 X2 X3 / scale=Pearson;
   assess var=(LogX1) / resample=10000
                        seed=603708000;
run;

The revised model fit is shown in Output 45.8.7, the p-value from the simulation is 0.4777, and the cumulative residuals plotted in Output 45.8.8 show no systematic trend. The log transformation for X1 is more appropriate. Under the revised model, the p-values for testing the functional forms of X2 and X3 are 0.20 and 0.63, respectively; and the p-value for testing the linearity of the model is 0.65. Thus, the revised model seems reasonable.

Output 45.8.7: Multiple Regression Model with Log(X1)

The GENMOD Procedure

Analysis Of Maximum Likelihood Parameter Estimates
ParameterDFEstimateStandard
Error
Wald 95% Confidence LimitsWald Chi-SquarePr > ChiSq
Intercept10.18440.05040.08570.283213.410.0003
LogX110.91210.04910.81581.0083345.05<.0001
X210.00950.00040.00880.0102728.62<.0001
X310.00960.00030.00900.01011139.73<.0001
Scale00.04340.00000.04340.0434  

Note:The scale parameter was estimated by the square root of Pearson's Chi-Square/DOF.



Output 45.8.8: Cumulative Residual Plot with Log(X1)

 Cumulative Residual Plot with Log(X1)