ODS Graphics: LSMEANS Statement

This section describes the use of ODS Graphics for creating graphics that are related to LS-means in procedures that support the common LSMEANS or SLICE statement. There are two groups of available plots: those that can be produced by all procedures that support these two statements, and those that can be produced only in association with the three procedures that can perform Bayesian analysis (PROC GENMOD, PROC LIFEREG, and PROC PHREG). Plots that are associated with the Bayesian analysis are available via these procedures directly, and also by using PROC PLM with an item store that was created by these procedures.

Plots in the first group depict the LS-means and their differences; when LS-mean comparisons are adjusted for multiplicity by using the ADJUST= option, the plots are adjusted accordingly. To request plots in this group, ODS Graphics must be enabled and you must request plots with the appropriate PLOTS= option in the LSMEANS or SLICE statement. Plots in the second group depict the posterior sample distribution of LS-means and their differences. To request plots in this group, you must also use a BAYES statement with PROC GENMOD, PROC PHREG, or PROC LIFEREG, or you must use PROC PLM to perform statistical analysis on an item store that was saved from a Bayesian analysis.

For more information about ODS Graphics, see Chapter 21: Statistical Graphics Using ODS. The available graphs are summarized in Table 19.23 and Table 19.24.

Table 19.23: Graphs Produced by All Procedures That Support the Common LSMEANS or SLICE Statement

ODS Graph Name

Plot Description

Required Option


Requests an analysis of means display in which least squares means are compared to an average least squares mean.



Requests a display in which least squares means are compared to a reference level.



Displays all pairwise least squares mean differences and their significance. This plot is also known as a mean-mean scatter plot when based on arithmetic means.



Displays least squares means.


Table 19.24: Graphs Produced by Procedures That Support the LSMEANS or SLICE Statement and Bayesian Analysis

ODS Graph Name

Plot Description

Required Option


Displays box plots of LS-means or LS-mean differences across a posterior sample.



Displays panels of histograms with kernel density curves overlaid. Each plot contains the results for the posterior sample of each LS-mean or LS-mean difference.



Displays a histogram with a kernel density curve overlaid. The plot contains the results for the posterior sample of the LS-mean or LS-mean difference.


You can supply the same plot-options to the SLICE statement to produce these graphs. For details about the plot-options of the LSMEANS or SLICE statement, see the PLOTS= option in the section LSMEANS Statement. For more details about the DIFFPLOT in particular, see the section Graphics for LS-Mean Comparisons in Chapter 41: The GLIMMIX Procedure.