<p>In general regression coefficients obtained from a regression on the entire sample need not be equal to the mean of the coefficients obtained from regressions on the subgroups of the sample. I will discuss the case of a benchmark linear regression but I guess the same should hold more general for IV estimators (although the maths may become a lot more complicated).</p>
<h3>Within group regressions</h3>
<p>Let <span class="math-container">$i$</span> be individual and <span class="math-container">$g$</span> be group. Consider the linear within group regressions on each group separately:</p>
<p><span class="math-container">$$
y_{i,g} = \alpha_g + \beta_g x_{i,g} + \varepsilon_{i,g},\\
$$</span></p>
<p>Here, as usual, we assume that <span class="math-container">$\mathbb{E}(\varepsilon_{i,g}|g ) = \mathbb{E}(\varepsilon_{i,g} x_{i,g}|g)  = 0$</span>.</p>
<p>Notice that <span class="math-container">$\alpha_g$</span> and <span class="math-container">$\beta_g$</span> both depend on <span class="math-container">$g$</span>, as we do the regression group by group.</p>
<p>To simplify the analysis, assume that we first normalized the values of <span class="math-container">$x_{i,g}$</span> such that <span class="math-container">$\mathbb{E}(x_{i,g}) = 0$</span>. This could change the estimate of the intercept but not of the slope (but will simplify the maths considerably).</p>
<h3>Pooled regression</h3>
<p>The pooled regression then estimates a common intercept <span class="math-container">$\alpha$</span> and a common slope <span class="math-container">$\beta$</span> over the entire sample. This then takes the form:
<span class="math-container">$$
y_{i,g} = \alpha + \beta x_{i,g} + \underset{\chi_{i,g}}{\underbrace{\varepsilon_{i,g} + (\alpha_g - \alpha) + (\beta_g - \beta)x_{i,g}}}
$$</span></p>
<h3>Computing the biases</h3>
<p>If you run such pooled regression of <span class="math-container">$y_{i,g}$</span> on <span class="math-container">$x_{i,g}$</span>, you will set the estimates <span class="math-container">$\alpha$</span> and <span class="math-container">$\beta$</span> such that the following moment conditions are satisfied:
<span class="math-container">$$
\mathbb{E}(\chi_{i,g} x_{i,g}) = 0 \text{ and } \mathbb{E}(\chi_{i,g}) = 0.
$$</span>
Using the definition of <span class="math-container">$\chi_{i,g}$</span> above this gives:
<span class="math-container">$$
\begin{align*}
&amp;\mathbb{E}(\varepsilon_{i,g}) + \mathbb{E}((\alpha_g - \alpha)) + \mathbb{E}((\beta_g - \beta) x_{i,g}) = 0,\\
&amp;\mathbb{E}(\varepsilon_{i,g} x_{i,g}) + \mathbb{E}((\alpha_g - \alpha) x_{i,g}) + \mathbb{E}((\beta_g - \beta)x_{i,g}^2) = 0.
\end{align*}
$$</span>
Simplifying and using <span class="math-container">$\mathbb{E}(\varepsilon_{i,g} x_{i,g}) = \mathbb{E}(\varepsilon_{i,g}) = \mathbb{E}(x_{i,g}) = 0$</span> (use the law of iterated expectations) gives:
<span class="math-container">$$
\begin{align*}
&amp;\mathbb{E}(\alpha_g) - \alpha + \mathbb{E}(\beta_g x_{i,g}) - \beta \mathbb{E}(x_{i,g}) = 0,\\
\to &amp;\mathbb{E}(\alpha_g) - \alpha + \mathbb{E}(\beta_g x_{i,g}) = 0,\\
&amp;\mathbb{E}(\alpha_g x_{i,g}) - \alpha \mathbb{E}(x_{i,g}) + \mathbb{E}(\beta_g x_{i,g}^2) - \beta \mathbb{E}(x_{i,g}^2) = 0,\\
\to &amp;\mathbb{E}(\alpha_g x_{i,g}) + \mathbb{E}(\beta_g x_{i,g}^2) - \beta \mathbb{E}(x_{i,g}^2) = 0
\end{align*}
$$</span>
Solving these two equations for <span class="math-container">$\alpha$</span> and <span class="math-container">$\beta$</span> gives:
<span class="math-container">$$
\begin{align*}
&amp;\alpha = \mathbb{E}(\alpha_g) + \mathbb{E}(\beta_g x_{i,g}),\\
&amp; \beta = \frac{\mathbb{E}(\alpha_g x_{i,g}) + \mathbb{E}(\beta_g x_{i,g}^2)}{\mathbb{E}(x_{i,g}^2)}
\end{align*}
$$</span>
Notice that <span class="math-container">$\mathbb{E}(\beta_g x_{i,g}^2) = cov( \beta_g, x_{i,g}^2 ) + \mathbb{E}(\beta_g) \mathbb{E}(x_{i,g}^2)$</span>, that  <span class="math-container">$\mathbb{E}(\beta_g x_{i,g}) = cov(\beta_g, x_{i,g})$</span>, that <span class="math-container">$\mathbb{E}(\alpha_g x_{i,g}) = cov(\alpha_g, x_{i,g})$</span> and that <span class="math-container">$\mathbb{E}(x_{i,g}^2) = var(x_{i,g})$</span>. As such:
<span class="math-container">$$
\begin{align*}
&amp;\alpha = \mathbb{E}(\alpha_g) + cov(\beta_g, x_{i,g}), \tag{1}\\
&amp;\beta = \mathbb{E}(\beta_g) + \frac{cov(\beta_g, x_{i,g}^2) + cov(\alpha_g, x_{i,g})}{var(x_{i,g})} \tag{2}
\end{align*}
$$</span>
This shows that <span class="math-container">$\alpha$</span> and <span class="math-container">$\beta$</span> are equal to the means of <span class="math-container">$\alpha_g$</span> and <span class="math-container">$\beta_g$</span> plus some terms (biases).</p>
<h3>Illustrations</h3>
<p>First let's focus on equation <span class="math-container">$(1)$</span> wich contains the bias for <span class="math-container">$\alpha$</span>. The value of <span class="math-container">$\alpha$</span> will be different from <span class="math-container">$\mathbb{E}(\alpha_g)$</span> if <span class="math-container">$cov(\beta_g, x_{i,g}) \ne 0$</span>, which requires higher or lower values of <span class="math-container">$x_{i,g}$</span> to produce  systematically higher or lower values of <span class="math-container">$\beta_g$</span>.</p>
<p>If <span class="math-container">$cov(\beta_{g}, x_{i,g}) &gt; 0$</span>, then <span class="math-container">$\alpha$</span> will be biased upwards. This is illustrated by the picture below. We have chosen 8 data points such that <span class="math-container">$\mathbb{E}(x_{i,g}) = 0$</span>. For simplicity, we set <span class="math-container">$\varepsilon_{i,g} = 0$</span>. The two subgroups are located on the two red lines. These are the within group regression lines.</p>
<p>One group has higher slope <span class="math-container">$(\beta_g)$</span> than the other group but both groups have the same value of <span class="math-container">$\alpha_g$</span>. Notice that points on the steeper red line have (on average) a larger <span class="math-container">$x_{i,g}$</span> value, so <span class="math-container">$cov(\beta_g, x_{i,g}) &gt; 0$</span>.</p>
<p>As for both lines <span class="math-container">$\alpha_g = 0$</span>, we have <span class="math-container">$\mathbb{E}(\alpha_g) = 0$</span>. However, the  regression line (in green) has a strictly positive intercept <span class="math-container">$\alpha$</span>.</p>
<p><a href="https://i.sstatic.net/Tpxur.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/Tpxur.png" alt="case1" /></a></p>
<p>Now, let's look at the biases of the <span class="math-container">$\beta$</span> term. First there is a bias if <span class="math-container">$cov(\beta_g, x_{i,g}^2)$</span> is positive. This will occur if more extreme values of <span class="math-container">$x_{i,g}$</span> are in groups with higher slope <span class="math-container">$\beta_g$</span>. An example is given in the figure below. It is clear that the pooled green regression line has a slope that is steeper than the mean of the withing group red regression lines.</p>
<p><a href="https://i.sstatic.net/peZjt.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/peZjt.png" alt="case2" /></a></p>
<p>Finally, there is a bias if <span class="math-container">$x_{i,g}$</span> is correlated with <span class="math-container">$\alpha_g$</span> which means that higher values of <span class="math-container">$x_{i,g}$</span> are on within group regression lines with higher intercepts. This is illustrated in the picture below: there are two lines with the same slope. We have that <span class="math-container">$cov(\beta_g, x_{i,g}^2) = 0$</span> as there is no variation in <span class="math-container">$\beta_g$</span>. However points on the higher within group regression have on average higher values of <span class="math-container">$x_{i,g}$</span>, which means that <span class="math-container">$cov(\alpha_g, x_{i,g}) &gt; 0$</span>.  So although <span class="math-container">$\alpha = \mathbb{E}(\alpha_g)$</span> we have that <span class="math-container">$\beta &gt; \mathbb{E}(\beta_g)$</span>: the green line has a steeper slope compared to the red lines.</p>
<p><a href="https://i.sstatic.net/HYpQi.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/HYpQi.png" alt="case3" /></a></p>

CC BY-SA 4.0
2021-06-15T23:38:02.860Z
Great thanks for the really thorough answer!
ThomasGuest
CC BY-SA 4.0
2021-06-15T07:39:32.423Z
2021-06-15T07:39:32.423Z
tdm
<p>I am using two-stage least squares to estimate a local average treatment effect, with 'treatment' being the endogenous variable and 'assignment to treatment' being the instrument. If I use my full sample, I get a LATE of about 31. But when I split my sample into two subsets and estimate a LATE for each subset, I get LATEs of about 27 and 24 for the two subsets. How can it be that the 2SLS estimate for the whole sample is larger than the 2SLS estimate for either subsample? I would have thought that it should be some sort of weighted average of the two subset estimates.</p>

<econometrics><instrumental-variable><treatment-effect>
IV estimate for entire sample is larger than IV estimates for subsets of sample?
ThomasGuest
# IV estimate for entire sample is larger than IV estimates for subsets of sample?

(Asked by: username_0 on 2021-06-15)

I am using two-stage least squares to estimate a local average treatment effect, with 'treatment' being the endogenous variable and 'assignment to treatment' being the instrument. If I use my full sample, I get a LATE of about 31. But when I split my sample into two subsets and estimate a LATE for each subset, I get LATEs of about 27 and 24 for the two subsets. How can it be that the 2SLS estimate for the whole sample is larger than the 2SLS estimate for either subsample? I would have thought that it should be some sort of weighted average of the two subset estimates.

**Tags:** econometrics, instrumental-variable, treatment-effect

---

## 1 answers

### Answer by username_1 on 2021-06-15. Score: 3

In general regression coefficients obtained from a regression on the entire sample need not be equal to the mean of the coefficients obtained from regressions on the subgroups of the sample. I will discuss the case of a benchmark linear regression but I guess the same should hold more general for IV estimators (although the maths may become a lot more complicated).

### Within group regressions

Let $i$ be individual and $g$ be group. Consider the linear within group regressions on each group separately:

$$
y\_{i,g} = \alpha\_g + \beta\_g x\_{i,g} + \varepsilon\_{i,g},\\
$$

Here, as usual, we assume that $\mathbb{E}(\varepsilon\_{i,g}|g ) = \mathbb{E}(\varepsilon\_{i,g} x\_{i,g}|g) = 0$.

Notice that $\alpha\_g$ and $\beta\_g$ both depend on $g$, as we do the regression group by group.

To simplify the analysis, assume that we first normalized the values of $x\_{i,g}$ such that $\mathbb{E}(x\_{i,g}) = 0$. This could change the estimate of the intercept but not of the slope (but will simplify the maths considerably).

### Pooled regression

The pooled regression then estimates a common intercept $\alpha$ and a common slope $\beta$ over the entire sample. This then takes the form:
$$
y\_{i,g} = \alpha + \beta x\_{i,g} + \underset{\chi\_{i,g}}{\underbrace{\varepsilon\_{i,g} + (\alpha\_g - \alpha) + (\beta\_g - \beta)x\_{i,g}}}
$$

### Computing the biases

If you run such pooled regression of $y\_{i,g}$ on $x\_{i,g}$, you will set the estimates $\alpha$ and $\beta$ such that the following moment conditions are satisfied:
$$
\mathbb{E}(\chi\_{i,g} x\_{i,g}) = 0 \text{ and } \mathbb{E}(\chi\_{i,g}) = 0.
$$
Using the definition of $\chi\_{i,g}$ above this gives:
$$
\begin{align\*}
&\mathbb{E}(\varepsilon\_{i,g}) + \mathbb{E}((\alpha\_g - \alpha)) + \mathbb{E}((\beta\_g - \beta) x\_{i,g}) = 0,\\
&\mathbb{E}(\varepsilon\_{i,g} x\_{i,g}) + \mathbb{E}((\alpha\_g - \alpha) x\_{i,g}) + \mathbb{E}((\beta\_g - \beta)x\_{i,g}^2) = 0.
\end{align\*}
$$
Simplifying and using $\mathbb{E}(\varepsilon\_{i,g} x\_{i,g}) = \mathbb{E}(\varepsilon\_{i,g}) = \mathbb{E}(x\_{i,g}) = 0$ (use the law of iterated expectations) gives:
$$
\begin{align\*}
&\mathbb{E}(\alpha\_g) - \alpha + \mathbb{E}(\beta\_g x\_{i,g}) - \beta \mathbb{E}(x\_{i,g}) = 0,\\
\to &\mathbb{E}(\alpha\_g) - \alpha + \mathbb{E}(\beta\_g x\_{i,g}) = 0,\\
&\mathbb{E}(\alpha\_g x\_{i,g}) - \alpha \mathbb{E}(x\_{i,g}) + \mathbb{E}(\beta\_g x\_{i,g}^2) - \beta \mathbb{E}(x\_{i,g}^2) = 0,\\
\to &\mathbb{E}(\alpha\_g x\_{i,g}) + \mathbb{E}(\beta\_g x\_{i,g}^2) - \beta \mathbb{E}(x\_{i,g}^2) = 0
\end{align\*}
$$
Solving these two equations for $\alpha$ and $\beta$ gives:
$$
\begin{align\*}
&\alpha = \mathbb{E}(\alpha\_g) + \mathbb{E}(\beta\_g x\_{i,g}),\\
& \beta = \frac{\mathbb{E}(\alpha\_g x\_{i,g}) + \mathbb{E}(\beta\_g x\_{i,g}^2)}{\mathbb{E}(x\_{i,g}^2)}
\end{align\*}
$$
Notice that $\mathbb{E}(\beta\_g x\_{i,g}^2) = cov( \beta\_g, x\_{i,g}^2 ) + \mathbb{E}(\beta\_g) \mathbb{E}(x\_{i,g}^2)$, that $\mathbb{E}(\beta\_g x\_{i,g}) = cov(\beta\_g, x\_{i,g})$, that $\mathbb{E}(\alpha\_g x\_{i,g}) = cov(\alpha\_g, x\_{i,g})$ and that $\mathbb{E}(x\_{i,g}^2) = var(x\_{i,g})$. As such:
$$
\begin{align\*}
&\alpha = \mathbb{E}(\alpha\_g) + cov(\beta\_g, x\_{i,g}), \tag{1}\\
&\beta = \mathbb{E}(\beta\_g) + \frac{cov(\beta\_g, x\_{i,g}^2) + cov(\alpha\_g, x\_{i,g})}{var(x\_{i,g})} \tag{2}
\end{align\*}
$$
This shows that $\alpha$ and $\beta$ are equal to the means of $\alpha\_g$ and $\beta\_g$ plus some terms (biases).

### Illustrations

First let's focus on equation $(1)$ wich contains the bias for $\alpha$. The value of $\alpha$ will be different from $\mathbb{E}(\alpha\_g)$ if $cov(\beta\_g, x\_{i,g}) \ne 0$, which requires higher or lower values of $x\_{i,g}$ to produce systematically higher or lower values of $\beta\_g$.

If $cov(\beta\_{g}, x\_{i,g}) > 0$, then $\alpha$ will be biased upwards. This is illustrated by the picture below. We have chosen 8 data points such that $\mathbb{E}(x\_{i,g}) = 0$. For simplicity, we set $\varepsilon\_{i,g} = 0$. The two subgroups are located on the two red lines. These are the within group regression lines.

One group has higher slope $(\beta\_g)$ than the other group but both groups have the same value of $\alpha\_g$. Notice that points on the steeper red line have (on average) a larger $x\_{i,g}$ value, so $cov(\beta\_g, x\_{i,g}) > 0$.

As for both lines $\alpha\_g = 0$, we have $\mathbb{E}(\alpha\_g) = 0$. However, the regression line (in green) has a strictly positive intercept $\alpha$.

[![case1](https://i.sstatic.net/Tpxur.png)](https://i.sstatic.net/Tpxur.png)

Now, let's look at the biases of the $\beta$ term. First there is a bias if $cov(\beta\_g, x\_{i,g}^2)$ is positive. This will occur if more extreme values of $x\_{i,g}$ are in groups with higher slope $\beta\_g$. An example is given in the figure below. It is clear that the pooled green regression line has a slope that is steeper than the mean of the withing group red regression lines.

[![case2](https://i.sstatic.net/peZjt.png)](https://i.sstatic.net/peZjt.png)

Finally, there is a bias if $x\_{i,g}$ is correlated with $\alpha\_g$ which means that higher values of $x\_{i,g}$ are on within group regression lines with higher intercepts. This is illustrated in the picture below: there are two lines with the same slope. We have that $cov(\beta\_g, x\_{i,g}^2) = 0$ as there is no variation in $\beta\_g$. However points on the higher within group regression have on average higher values of $x\_{i,g}$, which means that $cov(\alpha\_g, x\_{i,g}) > 0$. So although $\alpha = \mathbb{E}(\alpha\_g)$ we have that $\beta > \mathbb{E}(\beta\_g)$: the green line has a steeper slope compared to the red lines.

[![case3](https://i.sstatic.net/HYpQi.png)](https://i.sstatic.net/HYpQi.png)

> **Comments:**
> **username_0**: Great thanks for the really thorough answer!  

---

