gls  R Documentation 
This function fits a linear model using generalized least squares. The errors are allowed to be correlated and/or have unequal variances.
gls(model, data, correlation, weights, subset, method, na.action,
control, verbose)
## S3 method for class 'gls'
update(object, model., ..., evaluate = TRUE)
object 
an object inheriting from class 
model 
a twosided linear formula object describing the
model, with the response on the left of a 
model. 
Changes to the model – see 
data 
an optional data frame containing the variables named in

correlation 
an optional 
weights 
an optional 
subset 
an optional expression indicating which subset of the rows of

method 
a character string. If 
na.action 
a function that indicates what should happen when the
data contain 
control 
a list of control values for the estimation algorithm to
replace the default values returned by the function 
verbose 
an optional logical value. If 
... 
some methods for this generic require additional arguments. None are used in this method. 
evaluate 
If 
offset
terms in model
are an error since 3.1157
(202203): previously they were silently ignored.
an object of class "gls"
representing the linear model
fit. Generic functions such as print
, plot
, and
summary
have methods to show the results of the fit. See
glsObject
for the components of the fit. The functions
resid
, coef
and fitted
,
can be used to extract some of its components.
José Pinheiro and Douglas Bates bates@stat.wisc.edu
The different correlation structures available for the
correlation
argument are described in Box, G.E.P., Jenkins,
G.M., and Reinsel G.C. (1994), Littel, R.C., Milliken, G.A., Stroup,
W.W., and Wolfinger, R.D. (1996), and Venables, W.N. and Ripley,
B.D. (2002). The use of variance functions for linear
and nonlinear models is presented in detail in Carroll, R.J. and Ruppert,
D. (1988) and Davidian, M. and Giltinan, D.M. (1995).
Box, G.E.P., Jenkins, G.M., and Reinsel G.C. (1994) "Time Series Analysis: Forecasting and Control", 3rd Edition, HoldenDay.
Carroll, R.J. and Ruppert, D. (1988) "Transformation and Weighting in Regression", Chapman and Hall.
Davidian, M. and Giltinan, D.M. (1995) "Nonlinear Mixed Effects Models for Repeated Measurement Data", Chapman and Hall.
Littel, R.C., Milliken, G.A., Stroup, W.W., and Wolfinger, R.D. (1996) "SAS Systems for Mixed Models", SAS Institute.
Pinheiro, J.C., and Bates, D.M. (2000) "MixedEffects Models in S and SPLUS", Springer, esp. pp. 100, 461.
Venables, W.N. and Ripley, B.D. (2002) "Modern Applied Statistics with S", 4th Edition, SpringerVerlag.
corClasses
,
glsControl
,
glsObject
,
glsStruct
,
plot.gls
,
predict.gls
,
qqnorm.gls
,
residuals.gls
,
summary.gls
,
varClasses
,
varFunc
# AR(1) errors within each Mare
fm1 < gls(follicles ~ sin(2*pi*Time) + cos(2*pi*Time), Ovary,
correlation = corAR1(form = ~ 1  Mare))
# variance increases as a power of the absolute fitted values
fm2 < update(fm1, weights = varPower())
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.