| hatvalues.fixest | R Documentation |
fixest objectsComputes the hat values for feols or feglm estimations.
## S3 method for class 'fixest'
hatvalues(model, exact = TRUE, boot.size = 1000, ...)
model |
A fixest object. For instance from feols or feglm. |
exact |
Logical scalar, default is |
boot.size |
Integer scalar or |
... |
Not currently used. |
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.
Returns a vector of the same length as the number of observations used in the estimation.
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.
est = feols(Petal.Length ~ Petal.Width + Sepal.Width, iris)
head(hatvalues(est))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.