R code used to produce the graph shown below.
matplot(lifeexpect$myear, cbind(lifeexpect$male, lifeexpect$female),
xlab="Year", ylab="Life expectancy",
pch=20, col=c("black", "blue"), cex=mycex)
lo <- loess(male ~ myear, span=.25, data=lifeexpect)
lo2 <- loess(male ~ myear, span=1, data=lifeexpect)
lines(lifeexpect$myear, predict(lo), lwd=3)
lines(lifeexpect$myear, predict(lo2), lty=2, lwd=3)
smo <- smooth.spline(lifeexpect$myear, lifeexpect$female, df=8)
lines(predict(smo), col="blue", lwd=3)
supersmooth <- supsmu(lifeexpect$myear, lifeexpect$female)
lines(supersmooth, col="blue", lty=3, lwd=3)