georob (version 0.3-19)

georobS3methods: Common S3 Methods for Class georob

Description

This page documents the methods coef, fixef, fixed.effects, model.frame, model.matrix, nobs, print, ranef, random.effects, resid, residuals, rstandard, summary and vcov for the class georob which extract the respective components or summarize a georob object.

Usage

# S3 method for georob
coef(object, what = c("trend", "variogram"), ...)

# S3 method for georob fixef(object, ...)

# S3 method for georob fixed.effects(object, ...)

# S3 method for georob model.frame(formula, ...)

# S3 method for georob model.matrix(object, ...)

# S3 method for georob nobs(object, ...)

# S3 method for georob print(x, digits = max(3, getOption("digits") - 3), ...)

# S3 method for georob ranef(object, standard = FALSE, ...)

# S3 method for georob random.effects(object, standard = FALSE, ...)

# S3 method for georob resid(object, type = c("working", "response", "deviance", "pearson", "partial"), terms = NULL, level = 1, ...)

# S3 method for georob residuals(object, type = c("working", "response", "deviance", "pearson", "partial"), terms = NULL, level = 1, ...)

# S3 method for georob rstandard(model, level = 1, ...)

# S3 method for georob summary(object, correlation = FALSE, signif = 0.95, ...)

# S3 method for georob vcov(object, ...)

Value

The methods fixef.georob and fixed.effects.georob return the numeric vector of estimated fixed-effects regression coefficients, and

vcov.georob returns the covariance matrix of the estimated regression coefficients.

The method coef.georob returns an object of class

coef.georob which is a numeric vector with estimated fixed-effects regression coefficients or variogram and anisotropy parameters. There is a print method for objects of class coef.georob which returns invisibly the object unchanged.

The methods resid.georob, residuals.georob and

rstandard.georob return numeric vectors of (standardized) residuals, and ranef.georob and random.effects.georob the numeric vector of (standardized) spatial random effects, see

Details.

The methods model.frame.georob and model.matrix.georob

return a model frame and the fixed-effects model matrix, respectively, and nobs.georob returns the number of observations used to fit a spatial linear model.

The method summary.georob generates an object of class

summary.georob which is a list with components extracted directly from object (call, residuals, bhat,

rweights, converged, convergence.code, iter,

loglik, variogram.object, gradient,

tuning.psi, df.residual, control, terms) and complemented by the following components:

scale

the square root of the estimated nugget effect \(\tau^2\).

coefficients

a 4-column matrix with estimated regression coefficients, their standard errors, t-statistics and corresponding (two-sided) p-values.

correlation

an optional compressed lower-triagonal matrix with the Pearson correlation coefficients of the estimated regression coefficients.

param.aniso

either a vector (robust REML) or a 3-column matrix (Gaussian REML) with estimated variogram and anisotropy parameters, complemented for Gaussian REML with confidence limits, see Details.

cor.tf.param

an optional compressed lower-triagonal matrix with the Pearson correlation coefficients of estimated transformed variogram and anisotropy parameters, see Details.

se.residuals

a vector with the standard errors of the estimated \(\varepsilon\).

There is a print methods for class summary.georob which invisibly returns the object unchanged.

The method print.georob invisibly returns the object unchanged.

Arguments

object, model, x

an object of class georob, see georobObject.

formula

a model formula or terms object or an object of class georob, see georobObject.

correlation

a logical scalar controlling whether the correlation matrix of the estimated regression coefficients and of the fitted variogram parameters (only for non-robust fits) is computed (default FALSE).

digits

a positive integer indicating the number of decimal digits to print.

level

an optional integer giving the level for extracting the residuals from object. level = 0 extracts the regression residuals \(\widehat{B}(\boldsymbol{s}) + \widehat{\varepsilon}(\boldsymbol{s})\) and level = 1 (default) only the estimated errors \(\widehat{\varepsilon}(\boldsymbol{s})\).

signif

a numeric with the confidence level for computing confidence intervals for variogram parameters (default 0.95).

standard

a logical scalar controlling whether the spatial random effects \(\boldsymbol{B}\) should be standardized (default FALSE).

type

a character keyword indicating the type of residuals to compute, see residuals.lm. type = "huber" computes `huberized' residuals \(\widehat{\sigma} / \gamma_1\psi(\widehat{\varepsilon}(\boldsymbol{s}) / \widehat{\sigma})\).

terms

If type = "terms", which terms (default is all terms).

what

If what = "trend" (default) the function coef extracts the coefficients of the trend model and for what = "variogram" the variogram parameters.

...

additional arguments passed to methods.

Author

Andreas Papritz papritz@retired.ethz.ch.

Details

For robust REML fits deviance returns (possibly with a warning) the deviance of the Gaussian REML fit of the equivalent Gaussian spatial linear model with heteroscedastic nugget.

The methods model.frame, model.matrix and nobs extract the model frame, model matrix and the number of observations, see help pages of respective generic functions.

The methods residuals (and resid) extract either the estimated independent errors \(\widehat{\varepsilon}(\boldsymbol{s})\) or the sum of the latter quantities and the spatial random effects \(\widehat{B}(\boldsymbol{s})\). rstandard does the same but standardizes the residuals to unit variance. ranef (random.effects) extracts the spatial random effects with the option to standardize them as well, and fixef (fixed.effects) extracts the fitted fixed-effects regression coefficients, which may of course also be obtained by coef.

For Gaussian REML the method summary computes confidence intervals of the estimated variogram and anisotropy parameters from the Hessian matrix of the (restricted) log-likelihood (= observed Fisher information), based on the asymptotic normal distribution of (RE)ML estimates. Note that the Hessian matrix with respect to the transformed variogram and anisotropy parameters is used for this. Hence the inverse Hessian matrix is the covariance matrix of the transformed parameters, confidence intervals are first computed for the transformed parameters and the limits of these intervals are transformed back to the orginal scale of the parameters. Optionally, summary reports the correlation matrix of the transformed parameters, also computed from the Hessian matrix.

Note that the methods coef and summary generate objects of class coef.georob and summary.georob, respectively, for which only print methods are available.

Besides, the default methods of the generic functions confint, df.residual, fitted, formula, termplot and update can be used for objects of class georob.

See Also

georobPackage for a description of the model and a brief summary of the algorithms;

georob for (robust) fitting of spatial linear models;

georobObject for a description of the class georob;

profilelogLik for computing profiles of Gaussian likelihoods;

plot.georob for display of RE(ML) variogram estimates;

control.georob for controlling the behaviour of georob;

georobModelBuilding for stepwise building models of class georob;

cv.georob for assessing the goodness of a fit by georob;

predict.georob for computing robust Kriging predictions;

lgnpp for unbiased back-transformation of Kriging prediction of log-transformed data;

georobSimulation for simulating realizations of a Gaussian process from model fitted by georob; and finally

sample.variogram and fit.variogram.model for robust estimation and modelling of sample variograms.

Examples

Run this code
data(meuse)

## Gaussian REML fit
r.logzn.reml <- georob(log(zinc) ~ sqrt(dist), data = meuse, locations = ~ x + y,
    variogram.model = "RMexp",
    param = c(variance = 0.15, nugget = 0.05, scale = 200),
    tuning.psi = 1000)
summary(r.logzn.reml, correlation = TRUE)

## robust REML fit
r.logzn.rob <- update(r.logzn.reml, tuning.psi = 1)

summary(r.logzn.rob, correlation = TRUE)

## residual diagnostics
old.par <- par(mfrow = c(2,3))

plot(fitted(r.logzn.reml), rstandard(r.logzn.reml))
abline(h = 0, lty = "dotted")
qqnorm(rstandard(r.logzn.reml))
abline(0, 1)
qqnorm(ranef(r.logzn.reml, standard = TRUE))
abline(0, 1)
plot(fitted(r.logzn.rob), rstandard(r.logzn.rob))
abline(h = 0, lty = "dotted")
qqnorm(rstandard(r.logzn.rob))
abline(0, 1)
qqnorm(ranef(r.logzn.rob, standard = TRUE))
abline(0, 1)

par(old.par)

Run the code above in your browser using DataLab