plot.spmodel function

Plot fitted model diagnostics

Plot fitted model diagnostics

Plot fitted model diagnostics such as residuals vs fitted values, quantile-quantile, scale-location, Cook's distance, residuals vs leverage, Cook's distance vs leverage, a fitted spatial covariance function, and a fitted anisotropic level curve of equal correlation.

## S3 method for class 'splm' plot(x, which, ...) ## S3 method for class 'spautor' plot(x, which, ...) ## S3 method for class 'spglm' plot(x, which, ...) ## S3 method for class 'spgautor' plot(x, which, ...)

Arguments

  • x: A fitted model object from splm(), spautor(), spglm(), or spgautor().

  • which: An integer vector taking on values between 1 and 7, which indicates the plots to return. Available plots are described in Details. If which

    has length greater than one, additional plots are stepped through in order using <Return>. The default for splm() and spglm() fitted model objects is which = c(1, 2, 7). The default for spautor() and spgautor() fitted model objects is which = c(1, 2).

  • ...: Other arguments passed to other methods.

Returns

No return value. Function called for plotting side effects.

Details

For all fitted model objects,, the values of which make the corresponding plot:

  • 1: Standardized residuals vs fitted values (of the response)
  • 2: Normal quantile-quantile plot of standardized residuals
  • 3: Scale-location plot of standardized residuals
  • 4: Cook's distance
  • 5: Standardized residuals vs leverage
  • 6: Cook's distance vs leverage

For splm() and spglm() fitted model objects, there are two additional values of which:

  • 7: Fitted spatial covariance function vs distance
  • 8: Fitted anisotropic (or isotropic) level curve of equal correlation

Examples

spmod <- splm(z ~ water + tarp, data = caribou, spcov_type = "exponential", xcoord = x, ycoord = y ) plot(spmod) plot(spmod, which = c(1, 2, 4, 6))
  • Maintainer: Michael Dumelle
  • License: GPL-3
  • Last published: 2025-03-12