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 spmod
influence(model, ...)

Arguments

model

A fitted model object from splm() or spautor().

...

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.spmod(), hatvalues.spmod(), and cooks.distance.spmod() and puts the results into a tibble. It is primarily used when calling augment.spmod().

Examples

spmod <- splm(z ~ water + tarp,
  data = caribou,
  spcov_type = "exponential", xcoord = x, ycoord = y
)
influence(spmod)
#> # A tibble: 30 x 4
#>     .resid   .hat   .cooksd .std.resid
#>      <dbl>  <dbl>     <dbl>      <dbl>
#>  1  0.454  0.724  1.02          2.37  
#>  2  0.190  0.179  0.0306       -0.827 
#>  3 -0.237  0.128  0.195        -2.47  
#>  4 -0.0838 0.182  0.0109       -0.490 
#>  5  0.0407 0.121  0.00444       0.383 
#>  6  0.177  0.0936 0.0000222    -0.0308
#>  7  0.0512 0.154  0.00542      -0.376 
#>  8 -0.163  0.0778 0.0221       -1.07  
#>  9 -0.290  0.110  0.0546       -1.41  
#> 10  0.0522 0.136  0.0236        0.835 
#> # ... with 20 more rows