Fit Linear Models by Generalized Least Squares
Fit linear models by Generalized Least Squares
lm.gls(formula, data, W, subset, na.action, inverse = FALSE, method = "qr", model = FALSE, x = FALSE, y = FALSE, contrasts = NULL, …)
a formula expression as for regression models, of the form
response ~ predictors. See the documentation of
formulafor other details.
an optional data frame, list or environment in which to interpret the variables occurring in
a weight matrix.
expression saying which subset of the rows of the data should be used in the fit. All observations are included by default.
a function to filter missing data.
logical: if true
Wspecifies the inverse of the weight matrix: this is appropriate if a variance matrix is used.
method to be used by
should the model frame be returned?
should the design matrix be returned?
should the response be returned?
a list of contrasts to be used for some or all of
additional arguments to
The problem is transformed to uncorrelated form and passed to
An object of class
"lm.gls", which is similar to an
object. There is no
"weights" component, and only a few
methods will work correctly. As from version 7.1-22 the residuals and
fitted values refer to the untransformed problem.