Is there a way to change the default contrast for some of the main effects in an interaction model in R?

70 Views Asked by At

I am fitting a logistic model using GEE with an interaction term in R:

geeglm(outcome ~ gender*race, family=binomial(link="logit"),data=df, id=cluster, corstr = "exchangeable", std.err="san.se")

... where gender = 1 if female, 0 if male, and race = 1 if Black, 2 if Hispanic, 0 if white. I am fitting this model to obtain a main effects estimate for gender (i.e., OR for the outcome for white women vs. white men), a main effects estimate for race (i.e., ORs for the outcome for Black men vs. white men and Hispanic men vs. white man), and interaction effects between gender and both levels of race. However, the Hispanic men group is small and has homogenous responses (i.e., all have outcome=0). When I fit this model in Stata, this is remedied by changing the main effect for race = 2 to give the OR for Hispanic women versus white women and then not estimating an interaction effect for gender*race=2. However, when I fit the model in R as written above, it does not appear as if this happens and instead I get effect estimates for all parameters that are tiny (e.g., ORs of 1.04e+15).

My question is, is there any way to change the default contrast for some of the main effects so that I get the same results in R that I do in Stata? Thank you!

0

There are 0 best solutions below