Usage
# S3 method for class 'fixest'
hatvalues(model, exact = TRUE, boot.size = 1000, ...)
Arguments
- model
A fixest object. For instance from feols or feglm.
- exact
Logical scalar, default is
TRUE
. Whether the diagonals of the projection matrix should be calculated exactly. IfFALSE
, then it will be approximated using a JLA algorithm. See details. Unless you have a very large number of observations, it is recommended to keep the default value.- boot.size
Integer scalar or
NULL
, default is 1000. This is only used whenexact == FALSE
. This determines the number of bootstrap samples used to estimate the projection matrix. If equal toNULL
, it falls back to the default value of 1000.- ...
Not currently used.
Details
Hat values are not available for fenegbin
, femlm
and feNmlm
estimations.
Hat values for generalized linear model are disussed in Belsley, Kuh and Welsch (1980), Cook and Weisberg (1982), etc.
When exact == FALSE
, the Johnson-Lindenstrauss approximation (JLA) algorithm is used which approximates the diagonals of the projection matrix. For more precision (but longer time), increase the value of boot.size
. See Kline, Saggio, and Sølvsten (2020) for details.
References
Belsley, D. A., Kuh, E. and Welsch, R. E. (1980). Regression Diagnostics. New York: Wiley. Cook, R. D. and Weisberg, S. (1982). Residuals and Influence in Regression. London: Chapman and Hall. Kline, P., Saggio R., and Sølvsten, M. (2020). Leave‐Out Estimation of Variance Components. Econometrica.