vector of x data. Missing values are not accepted.
OPTIONAL ARGUMENTS:
data
an optional data frame in which to interpret
x and
y.
y
vector of y data. This must be the same length as
x,
and missing values are not accepted.
kernel
character string which determines the smoothing kernel. The possible values are
"box",
"triangle",
"parzen", and
"normal".
bandwidth
the kernel bandwidth smoothing parameter.
min.x
the minimum value of
x at which to compute the estimate. The default is
the minimum of
x.
min.x can not be given if
x.points is supplied.
max.x
the maximum value of
x at which to compute the estimate. The default is
the maximum of
x.
max.x can not be given if
x.points is supplied.
n.points
number of points to smooth in the interval [
min.x,
max.x]. The default
is the length of
x.
n.points can not be given if
x.points is supplied.
s.xpts
if
TRUE, indicates that the vector
x.points is specified.
x.points
vector specifying where the kernel estimate is computed.
plot.curve
if
TRUE, the data is plotted with the kernel smooth.
VALUE:
If
y is specified, a kernel regression estimate of E[Y|X] is computed. If
y is missing, a density estimate of
x is computed. A list containing the following components:
x, a vector of sorted x values at which the kernel estimate was computed;
y, a vector of smoothed estimates for either the density or the regression at the corresponding
x.