| alpaca_vcovSandwich | R Documentation |
Wraps summary(mod, type = "sandwich") and returns a diagonal
variance-covariance matrix that stargazer recognises and
labels as "heteroskedasticity-robust standard errors".
alpaca_vcovSandwich(mod)
mod |
A fitted |
A square diagonal matrix of class "vcovAlpacaSandwich" with
squared sandwich standard errors on the diagonal.
if (requireNamespace("alpaca", quietly = TRUE)) {
d <- data.frame(
y = rbinom(200, 1, 0.5),
x1 = rnorm(200),
grp = factor(rep(1:10, 20))
)
mod <- alpaca::feglm(y ~ x1 | grp, d, binomial("logit"))
V <- alpaca_vcovSandwich(mod)
stargazer(mod, vcov = list(V), type = "text")
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.