I am running a logistic regression model and I want to fit an interaction term between a dummy (female) and a categorical variable (risk level; 0/1/2). I was wondering whether creating my variable rather than fitting an interaction term gives me the same results. I have created my variable as follows:

Combination = 0 if female==0 & risk_level==0 combination = 1 if female==1 & risk_level==0 Combination = 2 if female==0 & risk_level==1 combination = 3 if female==1 & risk_level==1 Combination = 4 if female==0 & risk_level==2 combination = 5 if female==1 & risk_level==2

Therefore, my Stata code for the two logistic regressions would be

logistic outcome i.female##i.risk_level age i.income_quintile


logistic outcome i.combination age i.income_quintile

I decided to create it manually as I do not want to fit lincom or margins after but double-checking if this is correct.


  • 1
    $\begingroup$ Why not try it and see? $\endgroup$ – mdewey Jul 30 '18 at 17:39
  • 1
    $\begingroup$ Note that the two regressions might choose different base levels for the dummies, which could lead to different coefficients for otherwise equivalent models. $\endgroup$ – Matthijs Aug 1 '18 at 8:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.