Replacing Standard Errors in a GLM Model in R [Follow-up]

49 Views Asked by At

My post is a follow-up question to this one: Replacing Standard Errors in a Reg Model in R

I am in search of a way to directly replace the standard errors in a regression model with my own standard errors in order to use the robust model in another R package that does not come with its own robust option and can only be fed particular types of models and not coeftest formats.

Lets say I have a logistic regression model with an interaction term in it:

model <- glm(Y ~ X1 + X2 + X3 + X2*X3, 
         data = data, family = "binomial")

I then want robust standard errors based on a clustering factor:

model_crse <- coeftest(model , 
                   vcov = vcovCL, 
                   type = "HC1",
                   cluster = ~X4)

Now, I need to calculate the linear combination of the regression parameters so that I can estimate the effects of X2 at different levels of X3. But the functions I've looked at (glht from the multcomp package, or the lincom function from the biostat3 package) do not seem to accept my model_crse object as an input. Is there I way I can update the output from my GLM to just include the robust standard errors?

When I've tried to do the followig:

 biostat3::lincom(result_interact_crse, c("X2:X3"), eform=TRUE)

I receive the following error:

Error in UseMethod("vcov") : no applicable method for 'vcov' applied to an object of class "coeftest"

0

There are 0 best solutions below