The KDE Procedure

Example 66.5 Univariate KDE Graphics

This example uses data from the section Getting Started: KDE Procedure to illustrate the use of ODS Graphics. The following statements request the available univariate plots in PROC KDE:

ods graphics on;
proc kde data=bivnormal;
   univar x / plots=(density histogram histdensity);
   univar x y / plots=densityoverlay;
ods graphics off;

Graphs are requested by specifying the PLOTS= option in the UNIVAR statement with ODS Graphics enabled. Output 66.5.1, Output 66.5.2, and Output 66.5.3 show the kernel density estimate, histogram, and histogram with kernel density estimate overlaid, respectively, produced by the first UNIVAR statement.

Output 66.5.1: Kernel Density Estimate

 Kernel Density Estimate

Output 66.5.2: Histogram


Output 66.5.3: Histogram with Overlaid Kernel Density Estimate

 Histogram with Overlaid Kernel Density Estimate

Output 66.5.4 shows the plot produced by the second UNIVAR statement, in which the kernel density estimates for x and y are overlaid.

Output 66.5.4: Overlaid Kernel Density Estimates

 Overlaid Kernel Density Estimates

For general information about ODS Graphics, see ChapterĀ 21: Statistical Graphics Using ODS. For specific information about the graphics available in the KDE procedure, see the section ODS Graphics.