\HeaderA{pspline}{Penalised smoothing splines}{pspline}
\keyword{survival}{pspline}
\begin{Description}\relax
Specifies a penalised spline basis for the predictor.  This is done by fitting a comparatively small set of splines and penalising the integrated second derivative. Results are similar to smoothing splines with a knot at each data point but computationally simpler.
\end{Description}
\begin{Usage}
\begin{verbatim}
pspline(x, df=4, theta, nterm=2.5 * df, degree=3, eps=0.1, method, ...)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{x}] predictor 
\item[\code{df}] approximate degrees of freedom. \code{df=0} means use AIC 
\item[\code{theta}] roughness penalty 
\item[\code{nterm}] number of splines in the basis 
\item[\code{degree}] degree of splines 
\item[\code{eps}] accuracy for \code{df} 
\item[\code{method}] Method for automatic choice of \code{theta}
\item[\code{...}] I don't know what this does 
\end{ldescription}
\end{Arguments}
\begin{Value}
Object of class \code{coxph.penalty} containing the spline basis with 
attributes specifying control functions.
\end{Value}
\begin{SeeAlso}\relax
\code{\LinkA{coxph}{coxph}},\code{\LinkA{survreg}{survreg}},\code{\LinkA{ridge}{ridge}},\code{\LinkA{frailty}{frailty}}
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
lfit6 <- survreg(Surv(time, status)~pspline(age, df=2), cancer)
plot(cancer$age, predict(lfit6), xlab='Age', ylab="Spline prediction")
title("Cancer Data")
fit0 <- coxph(Surv(time, status) ~ ph.ecog + age, cancer)
fit1 <- coxph(Surv(time, status) ~ ph.ecog + pspline(age,3), cancer)
fit3 <- coxph(Surv(time, status) ~ ph.ecog + pspline(age,8), cancer)
fit0
fit1
fit3
\end{ExampleCode}
\end{Examples}


