# Robust standard errors (sandwich estimator)

Dear DataSHIELD community,

I fitted regression models with ds.glm and ds.SLMA, and I also inspected the residual plots, where I found heteroskedasticity. Therefore, we would like to calculate robust standard errors. Is there a way to do this in DataSHIELD? I thought of using functions coeftest from package lmtest and vcovHC from package sandwich (How to Calculate Robust Standard Errors in R - Statology) on the ds.glm output, but since it is a different type of object than that of glm(), it is not so straightforward.

Has anybody done this in DataSHIELD or could give me some advice as to how to calculate them based on the ds.glm output?

Thanks a lot!

Carolina

Hi Carolina,

I looked on the formulas on how the robust standard errors are calculated (see here: Understanding Robust Standard Errors | University of Virginia Library Research Data Services + Sciences) and I managed to calculate them for a specific regression model. It looks that you can calculate them for the outcome of SLMA because for the pooled regression you have to create a combined matrix with all the predictors from all studies together and this is not possible in DataSHIELD.

I did the calculations using a linear model (with no interactions) and with a continuous outcome. We might be able to do it also for logistic regressions but i have to look on how to do this. Also I did it with HC1 but it looks that we can do it with HC3 and other formulas. The calculations give me correct robust standard errors for all predictors except for the intercept, I have to look on this too, but i think that is OK because you most probably interested for the meta-analysis of the coefficient of the main exposure and not for the intercept.

If you like we can have a call to discuss what you want to calculate and see if it is possible in DataSHIELD.

Best wishes, Demetris

Hi Demetris,

thanks a lot for your help with this! It would be great to meet and discuss how we can obtain the robust standard errors for the models we need. I’ll send you some schedule suggestions per email.

Best regards, Carolina