This example illustrates how to request output tables with summary statistics in addition to the default output tables. Using the same data as in the section Getting Started: KDE Procedure, the following statements request univariate and bivariate summary statistics, percentiles, and levels of the kernel density estimate:
proc kde data=bivnormal; bivar x y / bivstats levels percentiles unistats; run;
The resulting output is shown in Output 54.4.1.
Output 54.4.1: Bivariate Kernel Density Estimate Tables
Levels | |||||
---|---|---|---|---|---|
Percent | Density | Lower for x | Upper for x | Lower for y | Upper for y |
1 | 0.001181 | -8.14 | 8.45 | -8.76 | 8.39 |
5 | 0.003031 | -7.10 | 7.07 | -7.14 | 6.77 |
10 | 0.004989 | -6.41 | 5.69 | -6.49 | 6.12 |
50 | 0.01591 | -3.64 | 3.96 | -3.58 | 3.86 |
90 | 0.02388 | -1.22 | 1.19 | -1.32 | 0.95 |
95 | 0.02525 | -0.88 | 0.50 | -0.99 | 0.62 |
99 | 0.02608 | -0.53 | 0.16 | -0.67 | 0.30 |
100 | 0.02629 | -0.19 | -0.19 | -0.35 | -0.35 |
The "Univariate Statistics" table contains standard univariate statistics for each variable, as well as statistics associated
with the density estimate. Note that the estimated variances for both x
and y
are fairly close to the true values of 10.
The "Bivariate Statistics" table lists the covariance and correlation between the two variables. Note that the estimated correlation is equal to its true value to two decimal places.
The "Percentiles" table lists percentiles for each variable.
The "Levels" table lists contours of the density corresponding to percentiles of the bivariate data, and the minimum and maximum
values of each variable on those contours. For example, 5% of the observed data have a density value less than 0.0030. The
minimum x
and y
values on this contour are –7.10 and –7.14, respectively (the Lower for x
and Lower for y
columns), and the maximum values are 7.07 and 6.77, respectively (the Upper for x
and Upper for y
columns).
You can also request "Percentiles" or "Levels" tables with specific percentiles:
proc kde data=bivnormal; bivar x y / levels=2.5, 50, 97.5 percentiles=2.5, 25, 50, 75, 97.5; run;
The resulting "Percentiles" and "Levels" tables are shown in Output 54.4.2.