<p>Let us rewrite the two equations in your question like this to avoid using the same symbols for different parameters:</p>
<p><span class="math-container">$income = \beta_0 + \beta_1 edu + \beta_2 age + \epsilon$</span>, if male = 0</p>
<p><span class="math-container">$income = \gamma_0 + \gamma_1 edu + \gamma_2 age + \epsilon$</span>, if male = 1</p>
<p>You can account for the possibility of different coefficients by adding interaction terms for education and sex, and age and sex, and then running a single regression. So you can do this:</p>
<p><span class="math-container">$income = \beta_0 + \beta_1 edu + \beta_2 age + \beta_3 male + \beta_4 (edu * male) + \beta_5 (age * male) +\epsilon$</span></p>
<p>The equation with interaction terms can cover both the cases, and also account for different slope coefficients.</p>
<p>If male = 0, we have,</p>
<p><span class="math-container">$income = \beta_0 + \beta_1 edu + \beta_2 age +\epsilon$</span></p>
<p>This is exactly your first case, where sex <span class="math-container">$\neq$</span> male, or male = 0.</p>
<p>Now, if male = 1, we have, from the equation with interaction terms,</p>
<p><span class="math-container">$income = (\beta_0 + \beta_3) + (\beta_1 + \beta_4) edu + (\beta_2 + \beta_5) age + \epsilon$</span></p>
<p>Here, <span class="math-container">$\beta_0 + \beta_3 = \gamma_0, \beta_1 + \beta_4 = \gamma_1, \beta_2 + \beta_5 = \gamma_2$</span></p>
<p>So this coincides with your second case where sex = male, or male = 1. In this case you just need to do the additions as indicated to find the coefficients.</p>
<p>In conclusion, your plan is equivalent to running the regression with interaction terms outlined above. You can calculate your coefficients of interest by just doing the necessary additions. As an example, suppose you ran the regression and your results are like this:</p>
<p><span class="math-container">$income = 0.1 + 0.2 edu + 0.3 age + 0.4 male + 0.5 (edu * male) + 0.6 (age * male) +\epsilon$</span></p>
<p>Then we have, <span class="math-container">$\beta_0 = 0.1, \beta_1 = 0.2, \beta_2 = 0.3, \gamma_0 = 0.1 + 0.4 = 0.5, \gamma_1 = 0.2 + 0.5 = 0.7, \gamma_2 = 0.3 + 0.6 = 0.9$</span></p>
<p>Furthermore, as pointed out by @Giskard in the comments, you can test whether including the interaction terms (and thus, allowing for different slopes) is even worthwhile. There are multiple ways to do this. You can take a look at <a href="https://www.google.com/url?sa=t&amp;source=web&amp;rct=j&amp;url=https://www.rose-hulman.edu/class/ma/inlow/Math485/ftests.pdf&amp;ved=2ahUKEwion5aDlpX1AhWDHrkGHccoDKkQFnoECCEQAQ&amp;sqi=2&amp;usg=AOvVaw2KNxDC5i8RQI1Co4x9BVhW" rel="noreferrer">this</a> for an example, as this is a case of nested models.</p>

CC BY-SA 4.0
2022-01-03T08:42:50.650Z
Thanks for the suggestions. Done!
Ishan Kashyap Hazarika
CC BY-SA 4.0
2022-01-03T19:25:54.463Z
*In conclusion, your plan is equivalent to running the regression with interaction terms outlined above*: is it? A single model with interaction terms assumes error variance is the same across sexes. A separate model for each sex allows for different error variances across sexes.
Richard Hardy
CC BY-SA 4.0
2022-01-03T06:51:35.053Z
2022-01-03T08:42:27.777Z
2022-01-03T08:42:27.777Z
Ishan Kashyap Hazarika
<p>There's an easier way to do this than what's shown above. You can include indicator variables for both male and female. Be warned, however, that since the indicator variables for both of them are in linear combination a unit vector (that is, a vector of all ones), you have to force the constant vector (i.e., <span class="math-container">$\beta_0$</span> in your first equation: <span class="math-container">$income = \beta_0 + \beta_1 * education + \beta_2 * age + \beta_3 * male + \epsilon$</span>) to equal zero.</p>

CC BY-SA 4.0
2022-01-04T09:03:01.370Z
2022-01-04T09:03:01.370Z
JD Montgomery
<p>Say I want to look at the impact of education on earnings:</p>
<p>income = β0 + β1<em>education + β2</em>age + β3*<strong>male</strong> + e</p>
<p>Could I also run this regression two more times, splitting the sample into &quot;male&quot; and &quot;female&quot;:</p>
<p>income = β0 + β1<em>education + β2</em>age + e   <strong>if sex=male</strong></p>
<p>income = β0 + β1<em>education + β2</em>age + e   <strong>if sex=female</strong></p>
<p><strong>The purpose:</strong> I want to see if the coefficient on education is different in magnitude for the two gender groups.</p>
<p>I just used the education/earnings model because it's easy to explain. This is not something I have seen in papers, so I'm wondering if it's illogical in some way. It seems like it would be a good way to see how the coefficient changes on your variable of interest for groups that may differ (men/woman, urban/rural, young/old, etc.)</p>

<econometrics>
Can I run a regression splitting the sample into "female" and "male" cohorts, instead of just including "sex" as a control variable?
amess
# Can I run a regression splitting the sample into "female" and "male" cohorts, instead of just including "sex" as a control variable?

(Asked by: username_0 on 2022-01-03)

Say I want to look at the impact of education on earnings:

income = β0 + β1*education + β2*age + β3\***male** + e

Could I also run this regression two more times, splitting the sample into "male" and "female":

income = β0 + β1*education + β2*age + e **if sex=male**

income = β0 + β1*education + β2*age + e **if sex=female**

**The purpose:** I want to see if the coefficient on education is different in magnitude for the two gender groups.

I just used the education/earnings model because it's easy to explain. This is not something I have seen in papers, so I'm wondering if it's illogical in some way. It seems like it would be a good way to see how the coefficient changes on your variable of interest for groups that may differ (men/woman, urban/rural, young/old, etc.)

**Tags:** econometrics


---

## 2 answers

### Answer by username_1 on 2022-01-03. Score: 7

Let us rewrite the two equations in your question like this to avoid using the same symbols for different parameters:

$income = \beta\_0 + \beta\_1 edu + \beta\_2 age + \epsilon$, if male = 0

$income = \gamma\_0 + \gamma\_1 edu + \gamma\_2 age + \epsilon$, if male = 1

You can account for the possibility of different coefficients by adding interaction terms for education and sex, and age and sex, and then running a single regression. So you can do this:

$income = \beta\_0 + \beta\_1 edu + \beta\_2 age + \beta\_3 male + \beta\_4 (edu \* male) + \beta\_5 (age \* male) +\epsilon$

The equation with interaction terms can cover both the cases, and also account for different slope coefficients.

If male = 0, we have,

$income = \beta\_0 + \beta\_1 edu + \beta\_2 age +\epsilon$

This is exactly your first case, where sex $\neq$ male, or male = 0.

Now, if male = 1, we have, from the equation with interaction terms,

$income = (\beta\_0 + \beta\_3) + (\beta\_1 + \beta\_4) edu + (\beta\_2 + \beta\_5) age + \epsilon$

Here, $\beta\_0 + \beta\_3 = \gamma\_0, \beta\_1 + \beta\_4 = \gamma\_1, \beta\_2 + \beta\_5 = \gamma\_2$

So this coincides with your second case where sex = male, or male = 1. In this case you just need to do the additions as indicated to find the coefficients.

In conclusion, your plan is equivalent to running the regression with interaction terms outlined above. You can calculate your coefficients of interest by just doing the necessary additions. As an example, suppose you ran the regression and your results are like this:

$income = 0.1 + 0.2 edu + 0.3 age + 0.4 male + 0.5 (edu \* male) + 0.6 (age \* male) +\epsilon$

Then we have, $\beta\_0 = 0.1, \beta\_1 = 0.2, \beta\_2 = 0.3, \gamma\_0 = 0.1 + 0.4 = 0.5, \gamma\_1 = 0.2 + 0.5 = 0.7, \gamma\_2 = 0.3 + 0.6 = 0.9$

Furthermore, as pointed out by @Giskard in the comments, you can test whether including the interaction terms (and thus, allowing for different slopes) is even worthwhile. There are multiple ways to do this. You can take a look at [this](https://www.google.com/url?sa=t&source=web&rct=j&url=https://www.rose-hulman.edu/class/ma/inlow/Math485/ftests.pdf&ved=2ahUKEwion5aDlpX1AhWDHrkGHccoDKkQFnoECCEQAQ&sqi=2&usg=AOvVaw2KNxDC5i8RQI1Co4x9BVhW) for an example, as this is a case of nested models.

> **Comments:**
> **username_1**: Thanks for the suggestions. Done!  
> **username_2**: *In conclusion, your plan is equivalent to running the regression with interaction terms outlined above*: is it? A single model with interaction terms assumes error variance is the same across sexes. A separate model for each sex allows for different error variances across sexes.  

---

### Answer by username_3 on 2022-01-04. Score: 0

There's an easier way to do this than what's shown above. You can include indicator variables for both male and female. Be warned, however, that since the indicator variables for both of them are in linear combination a unit vector (that is, a vector of all ones), you have to force the constant vector (i.e., $\beta\_0$ in your first equation: $income = \beta\_0 + \beta\_1 \* education + \beta\_2 \* age + \beta\_3 \* male + \epsilon$) to equal zero.


---

