Learn R Programming

gwer (version 2.1)

residuals.gwer: Extract Residuals for Geographically Weighted Elliptical Regression Model Fits

Description

This function compute differents type of residuals to the fittedgeographically weighted elliptical regression model.

Usage

# S3 method for gwer
residuals(
  object,
  type = c("stand", "ordinal", "response", "pearson", "desvio"),
  ...
)

Arguments

object

an object with the result of the fitted geographically weighted elliptical regression model.

type

a character string that indicates the type of residuals. If is stand will be computed the standar residuals. If is ordinal will be computed the ordinal residuals. If is response will be computed the response residuals. If is pearson will be computed the pearson residuals. If is desvio will be computed the desviance residuals. By default is stand.

...

arguments to be used to form the default control argument if it is not supplied directly.

Value

Residuals of the specific type extracted from the object.

References

Brunsdon, C., Fotheringham, A. S. and Charlton, M. E. (1996). Geographically weighted regression: a method for exploring spatial nonstationarity. Geographical analysis, 28(4), 281-298. https://doi.org/10.1111/j.1538-4632.1996.tb00936.x

Galea, M., Paula, G. A., and Cysneiros, F. J. A. (2005). On diagnostics in symmetrical nonlinear models. Statistics & Probability Letters, 73(4), 459-467. https://doi.org/10.1016/j.spl.2005.04.033

See Also

residuals, gwer, family.elliptical

Examples

Run this code
# NOT RUN {
data(columbus, package="spData")
fit.lm <- lm(CRIME ~ INC, data=columbus)
summary(fit.lm)
gwer.bw <- gwer.sel(CRIME ~ INC, data=columbus, family = Normal(),
                 coords=cbind(columbus$X, columbus$Y))
fit.gwer <- gwer(CRIME ~ INC, family = Normal(), bandwidth = gwer.bw, 
                 spdisp = TRUE, parplot = TRUE, data=columbus, method = "gwer.fit",
                 coords=cbind(columbus$X, columbus$Y))
residuals(fit.gwer, type = "stand")
# }
# NOT RUN {
data(columbus, package="spData")
fit.elliptical <- elliptical(CRIME ~ INC, family = Student(df=4), data=columbus)
summary(fit.elliptical)
gwer.bw <- gwer.sel(CRIME ~ INC, data=columbus, family = Student(df=4),
                 coords=cbind(columbus$X, columbus$Y), method = 'aic')
gwer.fitt <- gwer(CRIME ~ INC, family = Student(df=4), bandwidth = gwer.bw, hatmatrix = TRUE,
                 spdisp = TRUE, parplot = TRUE, data=columbus, method = "gwer.fit",
                 coords=cbind(columbus$X, columbus$Y))
residuals(gwer.fitt)  
# }

Run the code above in your browser using DataLab