R/cooks.distance.R
, R/cooks.distance_glm.R
cooks.distance.spmodel.Rd
Compute 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.208649163 0.046762066 0.075201299 0.002105977 0.015878743 0.043438339
#> 7 8 9 10 11 12
#> 0.009359609 0.013528476 0.064232283 0.026392006 0.002610611 0.005531740
#> 13 14 15 16 17 18
#> 0.011537116 0.031581324 0.002108886 0.153705116 0.071730500 0.054523415
#> 19 20 21 22 23 24
#> 0.009083242 0.010921707 0.009783614 0.039565388 0.019831572 0.031011542
#> 25 26 27 28 29 30
#> 0.028240763 0.005845866 0.053255250 0.002058093 0.003463498 0.007093867