### ODS Graphics

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.

When ODS Graphics is enabled, then for particular models the GLM procedure will produce default graphics.

• If you specify a one-way analysis of variance model, with just one CLASS variable, the GLM procedure will produce a grouped box plot of the response values versus the CLASS levels. For an example of the box plot, see the section One-Way Layout with Means Comparisons.

• If you specify a two-way analysis of variance model, with just two CLASS variables, the GLM procedure will produce an interaction plot of the response values, with horizontal position representing one CLASS variable and marker style representing the other; and with predicted response values connected by lines representing the two-way analysis. For an example of the interaction plot, see the section PROC GLM for Unbalanced ANOVA.

• If you specify a model with a single continuous predictor, the GLM procedure will produce a fit plot of the response values versus the covariate values, with a curve representing the fitted relationship. For an example of the fit plot, see the section PROC GLM for Quadratic Least Squares Regression.

• If you specify a model with a two continuous predictors and no CLASS variables, the GLM procedure will produce a panel of fit plots as in the single predictor case, with a plot of the response values versus one of the covariates at each of several values of the other covariate.

• If you specify an analysis of covariance model, with one or two CLASS variables and one continuous variable, the GLM procedure will produce an analysis of covariance plot of the response values versus the covariate values, with lines representing the fitted relationship within each classification level. For an example of the analysis of covariance plot, see Example 42.4.

• If you specify an LSMEANS statement with the PDIFF option, the GLM procedure will produce a plot appropriate for the type of LS-means comparison. For PDIFF=ALL (which is the default if you specify only PDIFF), the procedure produces a diffogram, which displays all pairwise LS-means differences and their significance. The display is also known as a mean-mean scatter plot (Hsu, 1996). For PDIFF=CONTROL, the procedure produces a display of each noncontrol LS-mean compared to the control LS-mean, with two-sided confidence intervals for the comparison. For PDIFF=CONTROLL and PDIFF=CONTROLU a similar display is produced, but with one-sided confidence intervals. Finally, for the PDIFF=ANOM option, the procedure produces an analysis of means plot, comparing each LS-mean to the average LS-mean.

• If you specify a MEANS statement, the GLM procedure will produce a grouped box plot of the response values versus the effect for which means are being calculated.

In addition to the default graphics mentioned previously, you can request plots that help you diagnose the quality of the fitted model.

• The PLOTS=DIAGNOSTICS option in the PROC GLM statement requests that a panel of summary diagnostics for the fit be displayed. The panel displays scatter plots of residuals, absolute residuals, studentized residuals, and observed responses by predicted values; studentized residuals by leverage; Cook’s D by observation; a Q-Q plot of residuals; a residual histogram; and a residual-fit spread plot.

• The PLOTS=RESIDUALS option in the PROC GLM statement requests scatter plots of the residuals against each continuous covariate.

#### ODS Graph Names

PROC GLM assigns a name to each graph it creates using ODS. You can use these names to reference the graphs when using ODS. The names are listed in Table 42.14.

ODS Graphics must be enabled before requesting plots. For more information about ODS Graphics, see Chapter 21: Statistical Graphics Using ODS.

Table 42.14: Graphs Produced by PROC GLM

ODS Graph Name

Plot Description

Option

ANCOVAPlot

Analysis of covariance plot

Analysis of covariance model

ANOMPlot

Plot of LS-mean differences against average LS-mean

LSMEANS / PDIFF=ANOM

BoxPlot

Box plot of group means

One-way ANOVA model or MEANS statement

ContourFit

Plot of predicted response surface

Two-predictor response surface model

ControlPlot

Plot of LS-mean differences against a control level

LSMEANS / PDIFF=CONTROL

DiagnosticsPanel

Panel of summary diagnostics for the fit

PLOTS=DIAGNOSTICS

CooksDPlot

Cook’s D plot

PLOTS=DIAGNOSTICS(UNPACK)

ObservedByPredicted

Observed by predicted

PLOTS=DIAGNOSTICS(UNPACK)

QQPlot

Residual Q-Q plot

PLOTS=DIAGNOSTICS(UNPACK)

ResidualByPredicted

Residual by predicted values

PLOTS=DIAGNOSTICS(UNPACK)

ResidualHistogram

Residual histogram

PLOTS=DIAGNOSTICS(UNPACK)

RFPlot

RF plot

PLOTS=DIAGNOSTICS(UNPACK)

RStudentByPredicted

Studentized residuals by predicted

PLOTS=DIAGNOSTICS(UNPACK)

RStudentByLeverage

RStudent by hat diagonals

PLOTS=DIAGNOSTICS(UNPACK)

DiffPlot

Plot of LS-mean pairwise differences

IntPlot

Interaction plot

Two-way ANOVA model

FitPlot

Plot of predicted response by predictor

Model with one continuous predictor

ResidualPlots

Plots of the residuals against each continuous covariate

PLOTS=RESIDUALS