Code
knitr::opts_chunk$set(
echo = FALSE,
message = FALSE,
warning = FALSE
)
#ELMR 11.5
library(sm)
library(faraway)
data('aatemp')
attach(aatemp)
par(mfrow=(c(2,3)))
plot(temp ~ year, aatemp,main="bandwidth=0.1",pch=".")
lines(ksmooth(year,temp,"normal",0.1))
plot(temp ~ year, aatemp,main="bandwidth=0.5",pch=".")
lines(ksmooth(year,temp,"normal",0.5))
plot(temp ~ year, aatemp,main="bandwidth=2",pch=".")
lines(ksmooth(year,temp,"normal",2))
plot(temp ~ year, aatemp,pch=".")
lines(smooth.spline(year,temp))
plot(temp ~ year, aatemp, pch=".")
lines(smooth.spline(year,temp),lty=2)
plot(temp ~ year, aatemp, pch=".")
lines(temp,year)
lines(smooth.spline(year,temp),lty=2)