BB1234
BB1234

Reputation: 15

R: Is there an equivalent of Stata's ibn. function?

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?

Upvotes: 1

Views: 289

Answers (1)

TarJae
TarJae

Reputation: 78907

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

Upvotes: 1

Related Questions