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.