Statistical procedures use ODS Graphics to create graphs as part of their output. ODS Graphics is described in detail in Chapter 21: Statistical Graphics Using ODS.

Before you create graphs, ODS Graphics must be enabled (for example, by specifying the ODS GRAPHICS ON statement). For more information about enabling and disabling ODS Graphics, see the section Enabling and Disabling ODS Graphics in Chapter 21: Statistical Graphics Using ODS.

The overall appearance of graphs is controlled by ODS styles. Styles and other aspects of using ODS Graphics are discussed in the section A Primer on ODS Statistical Graphics in Chapter 21: Statistical Graphics Using ODS.

If the model includes a single continuous independent variable, a plot of robust fit against this variable (FITPLOT) is provided by default. Two plots are particularly useful in revealing outliers and leverage points. The first is a scatter plot of the standardized robust residuals against the robust distances (RDPLOT). The second is a scatter plot of the robust distances against the classical Mahalanobis distances (DDPLOT). In addition to these two plots, a histogram and a quantile-quantile plot of the standardized robust residuals are also helpful.

PROC ROBUSTREG assigns a name to each graph it creates using ODS. You can use these names to refer to the graphs when using ODS. The names and PLOTS= options are listed in Table 80.12.

Table 80.12: Graphs Produced by PROC ROBUSTREG

ODS Graph Name |
Plot Description |
Statement |
PLOTS= Option |
---|---|---|---|

DDPlot |
Robust distance versus Mahalanobis distance (or projected robust distance versus Projected Mahalanobis distance) |
PROC |
DDPLOT |

FitPlot |
Robust fit versus independent variable |
PROC |
FITPLOT |

Histogram |
Histogram of standardized robust residuals |
PROC |
HISTOGRAM |

QQPlot |
Q-Q plot of standardized robust residuals |
PROC |
QQPLOT |

RDPlot |
Standardized robust residual versus robust distance (or projected robust distance) |
PROC |
RDPLOT |

When the model has a single independent continuous variable (with or without the intercept), the ROBUSTREG procedure automatically creates a plot of robust fit against this independent variable.

The following simple example shows the fit plot. The data, from Rousseeuw and Leroy (1987, Table 3), include the logarithm of surface temperature and the logarithm of light intensity for 47 stars in the direction of the constellation Cygnus.

data star; input index x y @@; label x = 'Log Temperature' y = 'Log Light Intensity'; datalines; 1 4.37 5.23 2 4.56 5.74 3 4.26 4.93 4 4.56 5.74 5 4.30 5.19 6 4.46 5.46 7 3.84 4.65 8 4.57 5.27 9 4.26 5.57 10 4.37 5.12 11 3.49 5.73 12 4.43 5.45 13 4.48 5.42 14 4.01 4.05 15 4.29 4.26 16 4.42 4.58 17 4.23 3.94 18 4.42 4.18 19 4.23 4.18 20 3.49 5.89 21 4.29 4.38 22 4.29 4.22 23 4.42 4.42 24 4.49 4.85 25 4.38 5.02 26 4.42 4.66 27 4.29 4.66 28 4.38 4.90 29 4.22 4.39 30 3.48 6.05 31 4.38 4.42 32 4.56 5.10 33 4.45 5.22 34 3.49 6.29 35 4.23 4.34 36 4.62 5.62 37 4.53 5.10 38 4.45 5.22 39 4.53 5.18 40 4.43 5.57 41 4.38 4.62 42 4.45 5.06 43 4.50 5.34 44 4.45 5.34 45 4.55 5.54 46 4.45 4.98 47 4.42 4.50 ;

The following statements plot the robust fit of the logarithm of light intensity with the MM method against the logarithm of the surface temperature.

ods graphics on; proc robustreg data=star method=mm; model y = x; run;

Figure 80.22 shows the fit plot. Confidence limits are added on the plot by default.

Figure 80.22: Robust Fit

You can suppress the confidence limits with the NOLIMITS option, as shown in the following statements:

proc robustreg data=star method=mm plot=fitplot(nolimits); model y = x; run;

The distance-distance plot (DDPLOT) is mainly used for leverage-point diagnostics. It is a scatter plot of the robust distances (or projected robust distances) against the classical Mahalanobis distances (or projected classical Mahalanobis distances) for the independent variables. See the section Leverage Point and Outlier Detection for details about the robust distance.

You can use the PLOT=DDPLOT option to request this plot. The following statements use the `stack`

data set in the section M Estimation to create the single plot shown in Figure 80.5.

proc robustreg data=stack plot=ddplot; model y = x1 x2 x3; run;

The reference lines represent the cutoff values. The diagonal line is also drawn to show the distribution of the distances. By default, all outliers and leverage points are labeled with observation numbers. To change the default, you can use the LABEL= option as described in Table 80.2.

If you specify ID variables in the ID statement, the values of the first ID variable instead of observation numbers are used as labels.

The residual-distance plot (RDPLOT) is used for both outlier and leverage-point diagnostics. It is a scatter plot of the standardized robust residuals against the robust distances. See the section Leverage Point and Outlier Detection for details about the robust distance.

You can use the PLOT=RDPLOT option to request this plot. The following statements use the `stack`

data set in the section M Estimation to create the plot shown in Figure 80.4.

proc robustreg data=stack plot=rdplot; model y = x1 x2 x3; run;

The reference lines represent the cutoff values. By default, all outliers and leverage points are labeled with observation numbers. To change the default, you can use the LABEL= option as described in Table 80.2.

If you specify ID variables in the ID statement, the values of the first ID variable instead of observation numbers are used as labels.

PROC ROBUSTREG produces a histogram and a Q-Q plot for the standardized robust residuals. The histogram is superimposed with
a normal density curve and a kernel density curve. Using the `stack`

data set in the section M Estimation, the following statements create the plots in Figure 80.6 and Figure 80.7.

proc robustreg data=stack plots=(histogram qqplot); model y = x1 x2 x3; run;