# Combining two linear regression model into a single linear model using covariates

Let's say we have two very similar models:

$Y_{i}$ = $\beta_{0}+$ $\beta_{1}X_{1,i} +\beta_{2}X_{2,i}+e_{i}$

and

$Y_{i}$ = $\alpha_{0}$ + $\alpha_{1}X_{1,i} +\alpha_{2}X_{2,i}+e_{i}$

Let's say the first model is for men, and the second for women.

Mathematically, how do I combine the two linear regression models together? Do I multiply or add?

Additional information: The data sets are derived from Hamermesh & Biddle's (1994) paper of "Beauty and the labor market". And we divide the dummary variables into

$X_{1,i} = {above average looking}$

$X_{2,i} = {below average looking}$

$X_{3,i} = {female}$

• What's the practicality of this? Wouldn't this be a LMM or hierarchical linear model?
– Jon
Oct 31, 2016 at 16:58
• How informative do you want the men data to be for the women model and vice versa? Not at all? Completely? Have the model learn it? Oct 31, 2016 at 17:01
• @Jon I am trying to write the model in a Matrix form so I can find the observations given in a table I have. Oct 31, 2016 at 17:13
• @TrynnaDoStat Just very general, and it doesn't need to be very informative. Oct 31, 2016 at 17:13

It sounds like you want a fully interacted model.

In which case, you interact all the terms with the dummy variable:

$Y_i = \beta_0 + \beta_1 X_{1,i} + \beta_2 X_{2,i} + \beta_3 X_{3,i} + \beta_4 (X_{1,i}*X_{3,i}) + \beta_5 (X_{2,i}*X_{3,i}) + \epsilon_i$

$\beta_1$ and $\beta_2$ are the effects of $X_1$ and $X_2$ when $X_{3,i} = 0$

$\beta_1 + \beta_4$ is the effect of $X_1$ when $X_{3,i} = 1$

$\beta_2 + \beta_5$ is the effect of $X_2$ when $X_{3,i} = 1$

• @pagma thanks! Could you explain me more how you derived that model? How did you set it up to end up with that? Oct 31, 2016 at 18:05
• For $X_3 = 0$, $Y_i = \beta_0 + \beta_1 X_{1,i} + \beta_1 X_{2,i}$. For $X_3 = 1$, $Y_i = (\beta_0 * \beta_3) + (\beta_1 + \beta_4) * X_{1,i} + (\beta_2 + \beta_5) * X_{2,i}$. So in this case, $a_0 = (\beta_0 * \beta_3)$, $a_1 X_{1,i} = (\beta_1 + \beta_4) * X_{1,i}$, and $a_2 X_{2,i} = (\beta_2 + \beta_5) * X_{2,i}$. Oct 31, 2016 at 18:23
• @paqma Hey again! What does is "the effect of" mean? (referring back to your first post) Nov 4, 2016 at 16:45
• The unique variation of X associated with $Y$ (net of other variables). Standard interpretation of regression coefficients. How much of an increase in $Y$ is associated with a unit increase in $X$. Nov 4, 2016 at 17:01