Suppose I wanted to explore the relationship between smoking (X; yes/no) and an disease outcome (Y; eg. visual analogue scale of depression from 0 to 10). But, I know that irrespective of X, Y is different between men and women.

I then hypothesise that the effect of smoking on depression (coefficient of X) will be different between males and females.

I can test this either by running the regression model for each gender, or by adding a gender-by-X interaction term (Y=b0 + b1\*X + b2\*gender + b3\*(X\*gender))

Conceptually they are the same, except I can compare regression coefficients in the latter (significance of the difference signified by b3) and only eye-ball the former.

However, the coefficients from these two models are (similar but) not the same! Is there an error in my intuition?

To complicate things further, I have previously seen comparisons of coefficients for each gender being tested using Y=b0 + b1\*X + b2\*(X\*gender). Would I be correct in saying that this method is fine when the intercepts are the same for gender stratified models, but not if they are not (as is in my example)?