\begin{Schunk}
\begin{Sinput}
 mymod5 <- lm(y ~ rcs(x, parms=5), data=dat)
 predict5 <- mymod5$fitted.values
 plot(dat$x, dat$y,main="Using lm(y~rcs(x,parms=5))", type="n")
 points(dat$x, dat$y, pch=16)
 lines(dat$x, predict5)
\end{Sinput}
\end{Schunk}
