nkreg {funfits}R Documentation

Normal kernel regression estimate

Usage

nkreg(data.x, data.y, bandwidth, n.points, grid)

Arguments

data.x Vector or matrix of independent variables.
data.y Vector of the dependent variable
bandwidth Vector of bandwidths
n.points Number of equally spaced points to evaluate a univariate density estimate.
grid A vector or matrix of values to evaluate the estimate.The defautl is to use the data.

Value

A list where x is the points used for evaluation, y the density estimates at these points and bandwidths and h the vector of bandwidths. If more than one bandwidth is given then the estimates are arranged as columns in the matrix y.

See Also

nkden, nkden.cv, ksmooth

Examples

nkreg( auto.paint$thick, auto.paint$DOI, 5.0)-> look
plot( auto.paint$thick, auto.paint$DOI)
lines( look$x, look$y)
plot( look$y, auto.paint$DOI- look$y, xlab="Predicted", ylab="Residuals")


[Package Contents]