\Header{lm.gls}{Fit Linear Models by Generalized Least Squares}
\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{\Link{lm.fit}}.

\end{ldescription}
\end{Arguments}
\begin{Details}\relax
The problem is transformed to uncorrelated form and passed to
\code{\Link{lm.fit}}.
\end{Details}
\begin{Value}
An object of class \code{"lm"}, with additional class \code{"lm.gls"}
\end{Value}
\begin{SeeAlso}\relax
\code{\Link{gls}}, \code{\Link{lm}}, \code{\Link{lm.ridge}}
\end{SeeAlso}

