Dear all,

I want to drop collinear variables from my list of independent variables in the case of factor variables and interactions.

I am working with confidential data for which I can only access a small sample and can let my do-files run over a larger sample by the Statistical Office. Since I am using the margins command, which does not work with collinear variables, after my regressions, I cannot rely on Stata omitting the collinear variables. And as I am not running the do-files myself, I cannot check which variables are collinear and drop them manually.

I know that there is the option forcedrop for the _rmcoll command. However, this option is not allowed for factor variables and interactions, which I do have in my regression:

Code:
reg y i.post_reform##ib999.Event i.DFAge* i.DYear*, r
I regress the dependent variable y on the interaction of a post-reform dummy and an event variable (= 998 two years before event year, = 999 one year before event year, = 1000 in event year, =1001 one year after event year, = 1002 two years after event year). In addition, I include age and year dummies. Some of these age and year dummies are collinear.

Ideally, I would like to use _rmcoll to identify collinear variables and omit these collinear variables from r(varlist) I obtain from the command. I would then run the regression only with non-collinear independent variables.

Code:
_rmcoll i.post_reform##ib999.Event i.DFAge* i.DYear*
I suspect that I have these collinearity problems because of the small sample size and relatively many independent variables. This might not be the case for my larger sample. Still, I was wondering if any of you know a clever way of omitting the collinear variables in case of factor variables and interactions?

Thank you very much!
Leonie