\HeaderA{lm.gls}{Fit Linear Models by Generalized Least Squares}{lm.gls}
\keyword{models}{lm.gls}
\begin{Description}\relax
Fit linear models by Generalized Least Squares
\end{Description}
\begin{Usage}
\begin{verbatim}
lm.gls(formula, data, W, subset, na.action, inverse = FALSE,
       method = "qr", 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{W}] a weight matrix.

\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{inverse}] logical: if true \code{W} specifies the inverse of the weight matrix: this
is appropriate if a variance matrix is used.

\item[\code{method}] method to be used by \code{lm.fit}.

\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{\LinkA{lm.fit}{lm.fit}}.

\end{ldescription}
\end{Arguments}
\begin{Details}\relax
The problem is transformed to uncorrelated form and passed to
\code{\LinkA{lm.fit}{lm.fit}}.
\end{Details}
\begin{Value}
An object of class \code{"lm.gls"}, which is similar to an \code{"lm"}
object.  There is no \code{"weights"} component, and only a few \code{"lm"}
methods will work correctly.  As from version 7.1-22 the residuals and
fitted values refer to the untransformed problem.
\end{Value}
\begin{SeeAlso}\relax
\code{\LinkA{gls}{gls}}, \code{\LinkA{lm}{lm}}, \code{\LinkA{lm.ridge}{lm.ridge}}
\end{SeeAlso}

