gls
fit. The semi-variogram values are calculated for
pairs of residuals within the same group level, if a grouping factor
is present. If collapse
is different from "none"
, the
individual semi-variogram values are collapsed using either a robust
estimator (robust = TRUE
) defined in Cressie (1993), or the
average of the values within the same distance interval. The
semi-variogram is useful for modeling the error term correlation
structure.## S3 method for class 'gls':
Variogram(object, distance, form, resType, data,
na.action, maxDist, length.out, collapse, nint, breaks,
robust, metric, \dots)
gls
, representing
a generalized least squares fitted model.|
ope"response"
, the "raw" residuals
(observed - fitted) are used; else, if "pearson"
, the
standardized residuals (raw residuals divided by the cform
. By default, the same data used to fit object
is used.NA
s. The default action (na.fail
) causes
an error message to be printed and the function to terminate, if there
are any incomplete observations.object
includes a corSpatial
element, its semi-variogram values are
calculated and this argument is used as the length.out
argument to the corresponding Variogram
"quantiles"
, the semi-variogram values are split
according to quantiles of the distance distribution20
.TRUE
the robust estimator is
used. Defaults to FALSE
.collapse
is
ignored."euclidean"
for the root sum-of-squares of distances;
"maximum"
for the maximum difference; and "manhat
variog
and dist
representing,
respectively, the semi-variogram values and the corresponding
distances. If the semi-variogram values are collapsed, an extra
column, n.pairs
, with the number of residual pairs used in each
semi-variogram calculation, is included in the returned data frame. If
object
includes a corSpatial
element, a data frame with
its corresponding semi-variogram is included in the returned value, as
an attribute "modelVariog"
. The returned value inherits from
class Variogram
.gls
, Variogram.default
,
Variogram.lme
, plot.Variogram
fm1 <- gls(weight ~ Time * Diet, BodyWeight)
Variogram(fm1, form = ~ Time | Rat)[1:10,]
Run the code above in your browser using DataLab