The UNIVARIATE Procedure
Creating Graphical Output
You can use the CDFPLOT, HISTOGRAM, PPPLOT, PROBPLOT, and QQPLOT statements to create graphs.
The CDFPLOT statement plots the observed cumulative distribution function of a variable. You can optionally superimpose a fitted theoretical distribution on the plot.
The HISTOGRAM statement creates histograms that enable you to examine the data distribution. You can optionally fit families of density curves and superimpose kernel density estimates on the histograms. For additional information about the fitted distributions and kernel density estimates, see the sections Formulas for Fitted Continuous Distributions and Kernel Density Estimates.
The PPPLOT statement creates a probability-probability (P-P) plot, which compares the empirical cumulative distribution function (ECDF) of a variable with a specified theoretical cumulative distribution function. You can use a P-P plot to determine how well a theoretical distribution models a set of measurements.
The PROBPLOT statement creates a probability plot, which compares ordered values of a variable with percentiles of a specified theoretical distribution. Probability plots are useful for graphical estimation of percentiles.
The QQPLOT statement creates a quantile-quantile plot, which compares ordered values of a variable with quantiles of a specified theoretical distribution. Q-Q plots are useful for graphical estimation of distribution parameters.
Note: You can use the CLASS statement with any of these plot statements to produce comparative versions of the plots.
Alternatives for Producing Graphics
The UNIVARIATE procedure supports two kinds of graphical output.
ODS Statistical Graphics output is produced if ODS Graphics is enabled, for example by specifying the ODS GRAPHICS ON statement prior to the PROC statement.
Otherwise, traditional graphics are produced if SAS/GRAPH is licensed.
The default appearance of both ODS Graphics output and traditional graphics is governed by the prevailing ODS style, which automatically produces attractive, consistent output.
Traditional graphics are saved in graphics catalogs. You can control their appearance by using SAS/GRAPH GOPTIONS, AXIS, and SYMBOL statements (as described in SAS/GRAPH: Reference) and numerous specialized plot statement options. The attributes that you specify with these options are drawn "on top of" the defaults that are determined by the ODS style.
ODS Statistical Graphics (or ODS Graphics for short) is an extension to the Output Delivery System (ODS) that can be enabled by specifying the ODS GRAPHICS statement prior to your procedure statements. An ODS graph is produced in ODS output (not a graphics catalog), and the details of its appearance and layout are controlled entirely by ODS styles; SAS/GRAPH statements and procedure options that are used to control traditional graphics have no effect. See Chapter 24, Statistical Graphics Using ODS (SAS/STAT User's Guide), for a thorough discussion of ODS Graphics.
The traditional graphics system enables you to control every detail of a graph through convenient procedure syntax. ODS Graphics provides the highest quality output with minimal syntax and full compatibility with graphics produced by SAS/STAT and SAS/ETS procedures.
Note: Some features that are available with traditional graphics are not supported in ODS Graphics.
The following code produces a histogram with a fitted lognormal distribution of the LoanToValueRatio data introduced in the section Summarizing a Data Distribution:
options;
ods graphics off;
proc univariate data=HomeLoans noprint;
histogram LoanToValueRatio / lognormal;
inset lognormal(theta sigma zeta) / position=ne;
run;
The NOGSTYLE system option keeps the ODS style from influencing the output, and no SAS/GRAPH statements or procedure options affecting the appearance of the plot are specified. Figure 8 shows the resulting histogram.
Figure 8: Traditional Graph with NOGSTYLE

Figure 9 shows the result of executing the same code with the GSTYLE system option turned on (the default). Note the influence of the ODS style on the histogram’s appearance. For example, the quality of the text is improved and histogram bars are filled by default.
Figure 9: Traditional Graph with GSTYLE

Figure 10 shows the same histogram produced using ODS Graphics. The histogram’s appearance is governed by the same style elements as in Figure 9, but the plots are not identical. Note, for example, the title incorporated in the ODS Graphics output and the smoother appearance of the fitted curve.
Figure 10: ODS Graphics Output
