summclust.lm {summclust} | R Documentation |
Compute Influence and Leverage Metrics for objects of type lm
Description
Compute influence and leverage metrics for clustered inference
based on the Cluster Jackknife as described in MacKinnon, Nielsen & Webb
(2022) for objects of type lm
.
Usage
## S3 method for class 'lm'
summclust(obj, cluster, params, type = "CRV3", ...)
Arguments
obj |
An object of type lm |
cluster |
A clustering vector |
params |
A character vector of variables for which leverage statistics should be computed. |
type |
"CRV3" or "CRV3J" following MacKinnon, Nielsen & Webb. CRV3 by default |
... |
other function arguments passed to 'vcov' |
Value
An object of type summclust
, including
a CRV3 variance-covariance estimate as described in
MacKinnon, Nielsen & Webb (2022)
coef_estimates |
The coefficient estimates of the linear model. |
vcov |
A CRV3 or CRV3J variance-covariance matrix estimate as described in MacKinnon, Nielsen & Webb (2022) |
leverage_g |
A vector of leverages. |
leverage_avg |
The cluster leverage. |
partial_leverage |
The partial leverages. |
beta_jack |
The jackknifed' leave-on-cluster-out regression coefficients. |
params |
The input parameter vector 'params'. |
N_G |
The number of clusters- |
call |
The |
cluster |
The names of the clusters. |
References
MacKinnon, James G., Morten Ørregaard Nielsen, and Matthew D. Webb. "Leverage, influence, and the jackknife in clustered regression models: Reliable inference using summclust." arXiv preprint arXiv:2205.03288 (2022).
Examples
library(summclust)
data(mtcars)
mtcars
fit <- lm(mpg ~ cyl + disp + hp, data = mtcars)
summ <- summclust(fit, params = ~cyl + disp, cluster = ~carb)
summary(summ)
tidy(summ)
plot(summ)