\Header{lm.ridge}{Ridge Regression}
\alias{plot.ridgelm}{lm.ridge}
\alias{print.ridgelm}{lm.ridge}
\alias{select}{lm.ridge}
\methalias{select.ridgelm}{lm.ridge}
\keyword{models}{lm.ridge}
\begin{Description}\relax
Fit a linear model by ridge regression.\end{Description}
\begin{Usage}
\begin{verbatim}
lm.ridge(formula, data, subset, na.action, lambda = 0, model = FALSE,
         x = FALSE, y = FALSE, contrasts = NULL, ...)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{formula}] a formula expression as for regression models, of the form
\code{response \textasciitilde{} predictors}.
See the documentation of \code{formula} for other details.

\item[\code{data}] an optional data frame in which to interpret the variables occurring
in \code{formula}.

\item[\code{subset}] expression saying which subset of the rows of the data should  be used
in the fit.  All observations are included by default.

\item[\code{na.action}] a function to filter missing data.

\item[\code{lambda}] A scalar or vector of ridge constants.

\item[\code{model}] should the model frame be returned?

\item[\code{x}] should the design matrix be returned?

\item[\code{y}] should the response be returned?

\item[\code{contrasts}] a list of contrasts to be used for some or all of

\item[\code{...}] additional arguments to \code{\Link{lm.fit}}.

\end{ldescription}
\end{Arguments}
\begin{Value}
A list with components

\begin{ldescription}
\item[\code{coef}] matrix of coefficients, one row for each value of \code{lambda}.

\item[\code{scales}] scalings used on the X matrix.

\item[\code{Inter}] was intercept included?

\item[\code{lambda}] vector of lambda values

\item[\code{ym}] mean of \code{y}

\item[\code{xm}] column means of \code{x} matrix

\item[\code{GCV}] vector of GCV values

\item[\code{kHKB}] HKB estimate of the ridge constant.

\item[\code{kLW}] L-W estimate of the ridge constant.

\end{ldescription}
\end{Value}
\begin{References}\relax
Brown, P. J. (1994)
\emph{Measurement, Regression and Calibration}
Oxford.\end{References}
\begin{SeeAlso}\relax
\code{\Link{lm}}\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
data(longley)
names(longley)[1] <- "y"
lm.ridge(y ~ ., longley)
plot(lm.ridge(y ~ ., longley,
              lambda = seq(0,0.1,0.001)))
select(lm.ridge(y ~ ., longley,
               lambda = seq(0,0.1,0.0001)))
# modified HKB estimator is 0.0042754
# modified L-W estimator is 0.032295
# smallest value of GCV  at 0.0028
\end{ExampleCode}
\end{Examples}

