I'm running a model without an intercept, and I only have categorical predictors. I have also included an interaction term between my main predictor and another covariate. But the output shows that for the interaction terms it has a reference group, even though I suppress the intercept. Therefore, I was wondering if R has a function equivalent to Statas .ibn function?
Asked
Active
Viewed 229 times
1
BB1234
- 15
- 3
1 Answers
1
The ibn. factor-variable operator in Stata enables that all levels of the factor variable are included in the model (the factor variable "loses" its base).
In R you can achieve this by resetting the contrasts for the factor variables. Here how to do this is described by fabians : All Levels of a Factor in a Model Matrix in R