Plot fitted model diagnostics such as residuals vs fitted values, quantile-quantile, scale-location, Cook's distance, residuals vs leverage, and Cook's distance vs leverage.

# S3 method for ssn_lm
plot(x, which, ...)

# S3 method for ssn_glm
plot(x, which, ...)

Arguments

x

A fitted model object from ssn_lm() or ssn_glm().

which

An integer vector taking on values between 1 and 6, 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 is which = c(1, 2)

...

Other arguments passed to other methods.

Value

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

See also

Examples

# Copy the mf04p .ssn data to a local directory and read it into R
# When modeling with your .ssn object, you will load it using the relevant
# path to the .ssn data on your machine
copy_lsn_to_temp()
temp_path <- paste0(tempdir(), "/MiddleFork04.ssn")
mf04p <- ssn_import(temp_path, overwrite = TRUE)

ssn_mod <- ssn_lm(
  formula = Summer_mn ~ ELEV_DEM,
  ssn.object = mf04p,
  tailup_type = "exponential",
  additive = "afvArea"
)
plot(ssn_mod, which = 1)