\HeaderA{ridge}{Ridge regression}{ridge}
\keyword{survival}{ridge}
\begin{Description}\relax
When used in a \LinkA{coxph}{coxph} or \LinkA{survreg}{survreg} model formula,
specifies a ridge regression term.  The likelihood is penalised by
\code{theta}/2 time the sum of squared coefficients. If \code{scale=T}
the penalty is calculated for coefficients based on rescaling the
predictors to have unit variance. If \code{df} is specified then \code{theta} is chosen based on an approximate degrees of freedom.
\end{Description}
\begin{Usage}
\begin{verbatim}
ridge(..., theta, df=nvar/2, eps=0.1, scale=TRUE)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{...}] predictors to be ridged 
\item[\code{theta}] penalty is \code{theta}/2 time sum of squared coefficients 
\item[\code{df}] Approximate degrees of freedom 
\item[\code{eps}] Accuracy required for \code{df} 
\item[\code{scale}] Scale variables before applying penalty? 
\end{ldescription}
\end{Arguments}
\begin{Value}
An object of class \code{coxph.penalty} containing the data and
control functions.
\end{Value}
\begin{References}\relax
Gray (1992) "Flexible methods of analysing survival data using splines, with applications to breast cancer prognosis" JASA 87:942--951
\end{References}
\begin{SeeAlso}\relax
\code{\LinkA{coxph}{coxph}},\code{\LinkA{survreg}{survreg}},\code{\LinkA{pspline}{pspline}},\code{\LinkA{frailty}{frailty}}
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}

fit1 <- coxph(Surv(futime, fustat) ~ rx + ridge(age, ecog.ps, theta=1),
              ovarian)
fit1

lfit0 <- survreg(Surv(time, status) ~1, cancer)
lfit1 <- survreg(Surv(time, status) ~ age + ridge(ph.ecog, theta=5), cancer)
lfit2 <- survreg(Surv(time, status) ~ sex + ridge(age, ph.ecog, theta=1), cancer)
lfit3 <- survreg(Surv(time, status) ~ sex + age + ph.ecog, cancer)

lfit0
lfit1
lfit2
lfit3
\end{ExampleCode}
\end{Examples}


