Skip to contents

Compute the Cook's distance for each observation from a fitted model object.

Usage

# S3 method for spmod
cooks.distance(model, ...)

Arguments

model

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

...

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

Value

A vector of Cook's distance values for each observation from the fitted model object.

Details

Cook's distance measures the influence of an observation on a fitted model object. If an observation is influential, its omission from the data noticeably impacts parameter estimates. The larger the Cook's distance, the larger the influence.

Examples

spmod <- splm(z ~ water + tarp,
  data = caribou,
  spcov_type = "exponential", xcoord = x, ycoord = y
)
cooks.distance(spmod)
#>  [1] 1.016241e+00 3.064627e-02 1.954807e-01 1.092909e-02 4.444837e-03
#>  [6] 2.218109e-05 5.423136e-03 2.211478e-02 5.459135e-02 2.361714e-02
#> [11] 1.167901e-02 1.109657e-02 7.173811e-03 2.695452e-02 4.967631e-03
#> [16] 1.348117e-01 6.689116e-02 3.341628e-02 5.329329e-03 3.289214e-03
#> [21] 1.259527e-02 3.339470e-02 1.482779e-02 1.001503e-02 1.819966e-02
#> [26] 1.204877e-03 3.262340e-02 3.378349e-03 8.683320e-04 2.541905e-03