# R code for Nonparametric Curve Smoothing autos91 <- read.table("c:/cjdata/stat514/autos91.txt",header=T) # This value for the bandwidth argument to the ksmooth function # creates a smoother that looks like the one in the text plot(autos91$HP,autos91$MPG) lines(ksmooth(autos91$HP,autos91$MPG,"normal",bandwidth=65)) # This value for the span argument to the loess.smooth function # creates a smoother that looks like the one in the text plot(autos91$HP,autos91$MPG) lines(loess.smooth(autos91$HP,autos91$MPG,span=.5))