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

Residuals:
    Min      1Q  Median      3Q     Max 
-5.9655 -2.5120  0.6321  2.3410  5.7627 

Coefficients:
                    Estimate Std. Error t value Pr(>|t|)    
(Intercept)           4.3022     0.8548   5.033 2.22e-06 ***
rcs(x, parms = 3)x   -1.0984     0.2900  -3.788 0.000263 ***
rcs(x, parms = 3)x'   1.3317     0.4049   3.289 0.001402 ** 
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Residual standard error: 2.958 on 97 degrees of freedom
Multiple R-squared:  0.1331,	Adjusted R-squared:  0.1152 
F-statistic: 7.447 on 2 and 97 DF,  p-value: 0.00098
\end{Soutput}
\end{Schunk}
