Why do heteroscedasticity-robust standard errors in logistic regression?

Viewed 1548

I am following a course on R. At the moment, we are working with logistic regression. The basic form we are taught is this one:

model <- glm(
  formula = y ~ x1 + x2,
  data = df,
  family = quasibinomial(link = "logit"),
  weights = weight
)

This makes perfectly sense to me. However, then we are being recommended to use the following to get coefficients and heteroscedasticity-robust inference:

model_rob <- lmtest::coeftest(model, sandwich::vcovHC(model))

This confuses me bit. Reading about vcovHC is states that it creates a "heteroskedasticity-consistent estimation". Why would you do this when doing logistic regression? I taught it did not assume homoscedasticity? Also, I am not sure what the coeftest does?

Thank you!

1 Answers

You're right - homoscedasticity (residuals at each level of the predictor have the same variance), is not an assumption in logistic regression. However, the binary response in logistic regression is heteroscedastic (0 or 1) which is why a corresponding estimator should be consistent with it. I guess that is what is meant with "heteroscedasticity-consistent". As @MrFlick already pointed out, if you would like more information on that topic, Cross Validated is likely to be the place to be. The coeftest produces the Wald test statistic of the estimated coefficients. These tests give you some information on whether a predictor (independent variable) seems to be associated to the dependent variable according to your data.

Related