Robust standard error

Hi new here. Got this question for a brief to complete:
Run a regression of datsetX on b , c , d , e , and f . Report the estimated regression with robust standard errors.

I run the regression as normal assigning lm variable and running it, i get the call, the residuals, the coefficients but its specifically asking to report a robust standard error.

Any idea what i need to do or add to the

lm1 <- lm(formula = dataset~a+b+c+d+e+f, dataset)

You want the sandwich package.

Hi, did that:
"
Library(Sandwich)
"

Do i then just run sandwich(regression) for the robust standard error? This returns me with the variables being the same in both rows and columns and showing me the intercept.

Any help appreciated

What you're getting is the matrix of the robust variances and covariances of the coefficient estimates. If you want the standard errors, take the square root of the diagonal elements. By default you're getting heteroskedasticity and autocorrelation robust standard errors. You may want to be robust only to the former. In that case use vcovHC(). Or try

library(lmtest)
> library(sandwich)
> coeftest(regression, vcov = vcovHC(regression, type="HC1"))

Ok done this. Got the t-test with the standard errors.

I assume now (report the robust standard errors) that the answer would be just giving the standard errors of that for each variable. If so, done and thank you.

I've been looking everywhere and just couldn't understand this heteroskedasticity concept.

Glad to help.

In the standard regression model, we assume the error terms all have the same variance. Heteroskedasticity just means the errors have differing variances.

This topic was automatically closed 42 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.