ksmooth(x, y=NULL, kernel="box", bandwidth=0.5, range.x=range(x), n.points=length(x), x.points=<<see below>>)
a list containing the following components:
Watson, G. S. (1966). Smooth regression analysis. Sankha, Ser. A 26, 359-378.
The chapter "Regression and Smoothing for Continous Response Data" in the S-PLUS Guide to Statistical and Mathematical Analysis.
x <- rnorm(100) ; eps <- rnorm(100,0,.1) y <- sin(x) + eps plot(x,y) # get a density estimate for x, and add it to the plot. ks1 <- ksmooth(x,ker="parzen",bandwidth=1,n.points=50) lines(ks1) # Get a regression estimate for y vs. x. ks2 <- ksmooth(x,y,"normal",ban=.5,n=50) lines(ks2,lty=2)