Skip to contents

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

Usage

# 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  -2.96 0.157   0.135         -1.31  
#>  2  -3.42 0.0924  0.0184        -0.631 
#>  3  -3.45 0.0301  0.0103        -0.827 
#>  4  -3.35 0.00798 0.000239      -0.245 
#>  5  -3.30 0.0105  0.00000674     0.0359
#>  6  -3.52 0.00350 0.00285       -1.28  
#>  7  -3.26 0.0179  0.0000144      0.0401
#>  8  -3.25 0.0169  0.0000741      0.0935
#>  9  -3.40 0.00831 0.000891      -0.463 
#> 10  -1.45 0.0561  0.0290        -1.02  
#> # ℹ 35 more rows