supsmu(x, y, wt=rep(1,length(y)), span="cv", periodic=F, bass=0)
The chapter "Regression and Smoothing for Continous Response Data" in the S-PLUS Guide to Statistical and Mathematical Analysis.
plot(lottery.number, lottery.payoff, main="supsmu example") fit <- supsmu(lottery.number, lottery.payoff) lines(fit) # draw the smooth on the scatter plot residuals <- lottery.payoff-approx(fit, lottery.number)$y plot(lottery.number, residuals) # residuals from smooth