Provides basic quantities which are used in forming a wide variety of diagnostics for checking the quality of fitted model objects.

# S3 method for ssn_lm
influence(model, ...)

# S3 method for ssn_glm
influence(model, ...)

Arguments

model

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

...

Other arguments. Not used (needed for generic consistency).

Value

A tibble with residuals (.resid), leverage values (.hat), cook's distance (.cooksd), and standardized residuals (.std.resid).

Details

This function calls residuals.SSN2(), hatvalues.SSN2(), and cooks.distance.SSN2() and puts the results into a tibble. It is primarily used when calling augment.SSN2().

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"
)
influence(ssn_mod)
#> # A tibble: 45 × 4
#>     .resid    .hat   .cooksd .std.resid
#>      <dbl>   <dbl>     <dbl>      <dbl>
#>  1  0.503  0.111   0.0165         0.545
#>  2  0.473  0.0557  0.00173        0.249
#>  3  0.568  0.0337  0.00658        0.625
#>  4 -0.0164 0.0744  0.00893        0.490
#>  5 -0.439  0.0202  0.0158        -1.25 
#>  6  0.634  0.00569 0.000970       0.584
#>  7  0.414  0.00162 0.0000507     -0.250
#>  8  0.454  0.0574  0.0143        -0.706
#>  9  0.607  0.0739  0.00666        0.425
#> 10  0.705  0.0581  0.0196         0.821
#> # ℹ 35 more rows