\begin{Schunk}
\begin{Sinput}
 mymod6 <- lm(y ~ rcs(x,parms=6), data=dat)
 predict6 <- mymod6$fitted.values
 plot(x,y,main="6 Knots! Using lm(y~rcs(x,parms=6))", pch=16)
 lines(dat$x, predict6)
 summary(mymod6)
\end{Sinput}
\begin{Soutput}
Call:
lm(formula = y ~ rcs(x, parms = 6), data = dat)

Residuals:
     Min       1Q   Median       3Q      Max 
-1.95760 -0.53960  0.01079  0.45889  2.68455 

Coefficients:
                        Estimate Std. Error t value Pr(>|t|)    
(Intercept)               0.2857     0.3996   0.715    0.476    
rcs(x, parms = 6)x        2.9812     0.2824  10.557  < 2e-16 ***
rcs(x, parms = 6)x'     -69.8659     4.4241 -15.792  < 2e-16 ***
rcs(x, parms = 6)x''    189.3519    13.8437  13.678  < 2e-16 ***
rcs(x, parms = 6)x'''  -119.1673    13.4232  -8.878 4.47e-14 ***
rcs(x, parms = 6)x''''  -90.1684     9.7010  -9.295 5.81e-15 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Residual standard error: 0.8538 on 94 degrees of freedom
Multiple R-squared:   0.93,	Adjusted R-squared:  0.9263 
F-statistic: 249.8 on 5 and 94 DF,  p-value: < 2.2e-16
\end{Soutput}
\end{Schunk}
