# Comparing coefficients in logistic regression, with different samples

I have a problem comparing the coefficients of my logistic regression models, in Stata.

I have a dependent variable (DV) 'being an entrepreneur' and multiple independent variables (IV) such as age, gender, education, parental occupation and entrepreneurial education. Except for the IV age, all the IVs are dummy variables.

When running the logistic regression model (logit D1A expl_age expl_gen expl_edu expl_par expl_ent), I wanted to check how the model would look like for individuals who had entrepreneurial education (expl_ent=1) and who didn't had this education (expl_ent=0) by running the command:

logit D1A expl_age i.expl_gen i.expl_edu i.expl_par if expl_ent==1
logit D1A expl_age i.expl_gen i.expl_edu i.expl_par if expl_ent==0


This gives me two different models, with two different sample sizes. Now, I want to check if the $β$ for the dummy variable expl_par in the model with only individuals who had entrepreneurship education is significantly different from the $β$ for the same variable but in the model with only individuals who didn't had entrepreneurship education.

More formally: How can I check whether the coefficient of variable x in model A, is significantly different from the coefficient of variable x in model B? As far as I'm concerned a t-test would do the job, but I can't get my head around on how to do just that.

• Welcome to the site, @Duuuusty. Please don't phrase your posts like a Nigerian email scam. – gung - Reinstate Monica Jan 6 '14 at 17:12
• Excuse me for my phrasing, I will try to be more like a Chinese philosopher instead. – Duuuusty Jan 6 '14 at 17:34

If you are only interested in allowing that one variable to changed based on education, you can use an interaction term between expl_par and expl_ent in a single model. Then you can just see if the p-value for the interaction term is significant. This method constrains all other variables to take the same value for each level of education, but you can add additional interaction terms if you have enough data/believe other variables should differ. I don't know Stata very well so I'm not sure of the code. Depending on the software, typically either you create a new variable that equals expl_par*expl_ent and then include that variable in the model, or you can just do the multiplication right in the model statement.

• Standard error for interaction terms doesn't mean what you're suggesting. See here: unc.edu/~enorton/NortonWangAi.pdf – Manoel Galdino Jan 6 '14 at 17:30
• @ManoelGaldino Could you give a quick summary of your objection? The link isn't working for me. – Ellie Jan 6 '14 at 19:04
• I just executed the suggestions of the first answer from Azula R., and it worked well! Thanks. Though, I can see how this could be invalidated when the SE for the interaction terms wouldn't be applicable for this matter, so what do you suggest @ManoelGaldino ? – Duuuusty Jan 6 '14 at 20:49
• And @AzulaR. wouldn't it be problematic to compose an interaction term between two dummy variables, since it would only give value 1 dummy x*value 1 dummy y as value 1 against the rest. Hence, I wouldn't be able to state whether the interaction between the variables is significant? – Duuuusty Jan 6 '14 at 21:37
• @Duuuusty I assumed by dummy variables you meant that they were (0,1) variables based on your description. So, your model should have expl_par+expl_ent+expl_parexpl_ent + other variables. In this case, coefficient for expl_par tells you how much more likely people with this variable are to have the DV than people without, independent of their education (on the logit scale); and similarly for expl_ent. The interaction term gives you the multiplicative change in the effect for people who have both variables (expl_entexpl_par=1) compared to people who have only one (expl_ent*expl_par=0). – Ellie Jan 7 '14 at 3:26

A few years ago, I asked a question about computing Bayesian credible intervals (roughly speaking, the Bayesian equivalent of confidence intervals) for interaction terms in logistic regressions.

The answer is directed to a Bayesian setting, but I think the reasoning is valid for a frequentist analysis. The reference I provided was Computing interaction effects and standard errors in logit and probit models. You can also take a look at a similar paper by the same authors at Economic Letters.

I'd take a look at a paper by Gelman on the subject and also this blog post. Unfortunately, I don't have time right now to explain in detail my view on the matter. I'll try to update my answer later if I find some time (though I doubt that!).