R/cooks.distance.R, R/cooks.distance_glm.R
cooks.distance.spmodel.RdCompute the Cook's distance for each observation from a fitted model object.
# S3 method for splm
cooks.distance(model, ...)
# S3 method for spautor
cooks.distance(model, ...)
# S3 method for spglm
cooks.distance(model, ...)
# S3 method for spgautor
cooks.distance(model, ...)A fitted model object from splm(), spautor(), spglm(), or spgautor().
Other arguments. Not used (needed for generic consistency).
A vector of Cook's distance values for each observation from the fitted model object.
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.
spmod <- splm(z ~ water + tarp,
data = caribou,
spcov_type = "exponential", xcoord = x, ycoord = y
)
cooks.distance(spmod)
#> 1 2 3 4 5 6
#> 0.208608375 0.046460188 0.075576782 0.002129049 0.015758372 0.043079116
#> 7 8 9 10 11 12
#> 0.009220773 0.013428090 0.064210592 0.026459735 0.002623186 0.005529800
#> 13 14 15 16 17 18
#> 0.011428764 0.031631605 0.002148983 0.153959429 0.071738793 0.054423033
#> 19 20 21 22 23 24
#> 0.009003549 0.010924729 0.009767577 0.039836978 0.019766380 0.031036779
#> 25 26 27 28 29 30
#> 0.028272882 0.005815073 0.053725694 0.002061691 0.003454316 0.007215281