| summary.dtrace {dtrace} | R Documentation |
This function gathers and returns useful information from density trace objects. A print method is defined so that the values computed by this function are printed nicely.
summary(object, ...)
print(x, digits = max(4, getOption("digits") - 4), ...)
object |
An object of class dtrace. |
x |
An object of class summary.dtrace. |
digits |
The number of significant digits to be used in printing. |
... |
Other arguments to be passed to print. |
The summary method for dtrace objects returns a
list with components:
xlim |
The range of x values covered by all the density estimates in the first argument. |
ylim |
The range of y values covered by all the density estimates in the first argument. |
names |
The names associated with each group for which a density estimate was obtained. |
nobs |
The number of observations in each group for which a density estimate was obtained. |
bw |
The bandwidth(s) of the kernel(s) used to compute the
density estimates (see dtrace). |
sd |
The standard deviation(s) of the kernel(s) used to compute
the density estimates (see dtrace). |
Ross Ihaka.
## Simple density estimation.
## Here we are using automatic bandwidth selection.
data(faithful)
d <- dtrace(faithful$eruptions, sd = "sj")
plot(d, xlab = paste("Kernel Bandwidth =",
signif(summary(d)$bw, 4)),
main = "Old Faithful Data")