Compute the leverage (hat) value for each observation from a fitted model object.
Arguments
- model
A fitted model object from
splm()
,spautor()
,spglm()
, orspgautor()
.- ...
Other arguments. Not used (needed for generic consistency).
Details
Leverage values measure how far an observation's explanatory variables are relative to the average of the explanatory variables. In other words, observations with high leverage are typically considered to have an extreme or unusual combination of explanatory variables. Leverage values are the diagonal of the hat (projection) matrix. The larger the hat value, the larger the leverage.
Examples
spmod <- splm(z ~ water + tarp,
data = caribou,
spcov_type = "exponential", xcoord = x, ycoord = y
)
hatvalues(spmod)
#> 1 2 3 4 5 6 7 8
#> 0.1156336 0.1367840 0.1367636 0.1736908 0.1525458 0.1473930 0.1559325 0.1218631
#> 9 10 11 12 13 14 15 16
#> 0.1194297 0.1309940 0.1096135 0.1292969 0.1234044 0.1272806 0.1193746 0.1096135
#> 17 18 19 20 21 22 23 24
#> 0.1292969 0.1234044 0.1272806 0.1193746 0.1473930 0.1559325 0.1218631 0.1194297
#> 25 26 27 28 29 30
#> 0.1309940 0.1156336 0.1367840 0.1367636 0.1736908 0.1525458