Learn R Programming

gwer (version 2.1)

gwer.diag.plots: Diagnostic Plots for Geographically Weighted Elliptical Regression Models

Description

This function generate diagnostic measures plots for the fitted geographically weighted elliptical regression models.

Usage

gwer.diag.plots(
  object,
  gwerdiag = NULL,
  which,
  subset = NULL,
  iden = F,
  labels = NULL,
  ret = F,
  ...
)

Arguments

object

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

gwerdiag

objects containing the diagnostic measures. If is NULL (by default) is obtained from object.

which

an optional numeric value with the number of plot returned.

subset

an optional numeric vector specifying a subset of observations to be used in the fitting process.

iden

a logical value used to identify observations. If TRUE the observations are identified in the graphic window.

labels

a optinal string vector specifying a labels plots.

ret

a logical value to return the diagnostic measures computing. If FALSE (by default) not return the diagnostic measures.

...

graphics parameters to be passed to the plotting routines.

Value

Return an interactive menu with eleven options to make plots. This menu contains the follows graphics : 1: plot: All. 2: plot: Response residual against fitted values. 3: plot: Moran dispersion of the response residual. 4: plot: Standardized residual against fitted values. 5: plot: Moran dispersion of the standardized residual. 6: plot: QQ-plot of response residuals. 7: plot: QQ-plot of Standardized residuals. 8: plot: Generalized Leverage. 9: plot: Local influence on the response against index. 10: plot: Local influence on the scale against index. 11: plot: Local influence for case-weight against index. If which is provided return an unique graphic selected. If ret is TRUE returns a list of diagnostic arrays (see gwer.diag for more details).

References

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

elliptical, elliptical.diag

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))
gwer.fitn <- gwer(CRIME ~ INC, family = Normal(), bandwidth = gwer.bw, hatmatrix = TRUE,
                 spdisp = TRUE, parplot = FALSE, data=columbus, method = "gwer.fit",
                 coords=cbind(columbus$X, columbus$Y))
gwer.diag.plots(gwer.fitn, which=3)  
# }
# 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))
gwer.diag.plots(gwer.fitt, which=3)    
# }

Run the code above in your browser using DataLab