<p>The <span class="math-container">$E(u_i|X_i) = 0$</span> can hold even without having simple random sample or random assignment. However, random assignment <em>guarantees</em> this will hold (in expectations). A violation of <span class="math-container">$E(u_i|X_i) \neq 0$</span> is typically consequence of omitted variable bias. For example, in regression of education on wages reason why <span class="math-container">$E(u_i|X_i) \neq 0$</span> can be that experience also affects wages and if people with different education have different experience this will result in <span class="math-container">$E(u_i|X_i) \neq 0$</span>.</p>
<p>Random assignment of <span class="math-container">$X$</span> solves this issue. For example, lets consider <span class="math-container">$X_i$</span> to be treatment status <span class="math-container">$X_i = \{0,1\}$</span> following Angrist and Pischke Mostly Harmless Econometrics. Now let <span class="math-container">$Y_{i}$</span> be potential outcome based on <span class="math-container">$X_i$</span> so that we have:</p>
<p><span class="math-container">$$ Y_i \begin{cases}
Y_{1i} \text{ if } X_i=1 \\[2ex] 
Y_{0i} \text{ if } X_i=0
\end{cases} $$</span></p>
<p>As a consequence observed outcomes will be given by:</p>
<p><span class="math-container">$$Y_{i} = \underbrace{Y_{0i}}_{\beta_0 } + \underbrace{(Y_{1i}-Y_{0i})}_{\beta_1}X_i\tag{1} $$</span></p>
<p>Now the above in expectation notation implies that:</p>
<p><span class="math-container">$$\underbrace{E[Y_i | X_i = 1] - E[Y_i | X_i = 0]}_{\text{observed difference}} = \underbrace{E[Y_{1i} | X_{i} = 1] - E[Y_{0i} | X_i = 0]}_{\text{Average treatment Effect on Treated}} + \underbrace{E[Y_{0i} | X_{i} = 1] - E[Y_{0i} | X_i = 0]}_{\text{Selection Bias}} \tag{2}$$</span></p>
<p>Presence of selection bias would cause <span class="math-container">$E(u_i|X_i) \neq 0$</span>.</p>
<p>However, note if we use random assignment of <span class="math-container">$X_i$</span> it eliminates the problem as it makes  <span class="math-container">$X_i$</span> independent of potential outcomes. If they are independent then <span class="math-container">$E[Y_{0i} | X_i = 1] = E[Y_{0i} | X_i = 1]$</span>. Substituting this back to the 2 we get:</p>
<p><span class="math-container">$$E[Y_i | X_i = 1] - E[Y_i | X_i = 1]= E[Y_{1i} | X_{i} = 1] - E[Y_{0i} | X_i = 1] \\ 
= E[Y_{1i}- Y_{0i}  | X_{i} = 1] \\ = E[Y_{1i}- Y_{0i}] .$$</span></p>
<p>This eliminates selection bias and ensures <span class="math-container">$E(u_i|X_i) = 0$</span> (although note random assignment is no silver bullet,  there could be various different issues that are still).</p>

CC BY-SA 4.0
2021-03-13T15:01:03.573Z
Very nice exposition. Mostly Harmless Econometrics chapter 2 explain exactly this in a little more detail and with examples. Pdf available here: https://jonnyphillips.github.io/FLS6415/Class_3/Angrist%20&%20Pischke.pdf
Papayapap
CC BY-SA 4.0
2021-03-13T14:30:01.427Z
2021-03-13T14:30:01.427Z
1muflon1
<p>In the lecture notes of my development economics class, it says that</p>
<p>&quot; In the regression model : Yi = β0 + β1Xi + ui,</p>
<p>if Xi is randomly assigned, then Xi
is independent of ui, i.e., E(ui|Xi) = 0, so OLS yields an unbiased estimator of β1.&quot;</p>
<p>And the professor says the same thing in his lecture recording.</p>
<p>I really don't understand this statement, because in econometrics (linear regression part)
I thought random sampling and zero conditional mean (E(ui|Xi) = 0) were <strong>two separate assumptions</strong> which led to the OLS unbiased estimator theory, not one affecting the other.</p>
<p>But the lecture note is saying that random sampling <strong>causes</strong> zero conditional mean, instead of my
previous notion that the two are separate assumptions which are used together to derive the unbiasedness.</p>
<p>Is the lecture note correct in that random sampling actually <strong>causes</strong> zero conditional mean? If it is, could anyone explain to me why this is the case instead of them being two separate assumptions as stated in a
standard econometrics textbook?</p>
<p>random sampling causes the sample <strong>Xi</strong>s to be iid but that still doesn't have anything to do with <strong>ui</strong>, and I thought that was why the additional assumption of zero conditional mean was added to ensure the unbiasedness of the OLS. I would appreciate it if someone could tell me what the lecture note is trying to say here.</p>

CC BY-SA 4.0
2021-03-13T14:02:29.080Z
The assumptions of the classical regression model include actually that the $X$-matrix is nonstochastic. Can you be a bit more explicit about how things were written down in the courses? And please use MathJax, it makes the question easier to read.
Michael Greinecker
CC BY-SA 4.0
2021-03-13T15:03:27.990Z
The confusion comes from the difference between random sampling (randomness of being included in the sample) and random assignment (randomness of being assigned into treatment)
Papayapap
<econometrics><regression><statistics>
Does random sampling cause zero conditional mean?
Robin311
# Does random sampling cause zero conditional mean?

(Asked by: username_0 on 2021-03-13)

In the lecture notes of my development economics class, it says that

" In the regression model : Yi = β0 + β1Xi + ui,

if Xi is randomly assigned, then Xi
is independent of ui, i.e., E(ui|Xi) = 0, so OLS yields an unbiased estimator of β1."

And the professor says the same thing in his lecture recording.

I really don't understand this statement, because in econometrics (linear regression part)
I thought random sampling and zero conditional mean (E(ui|Xi) = 0) were **two separate assumptions** which led to the OLS unbiased estimator theory, not one affecting the other.

But the lecture note is saying that random sampling **causes** zero conditional mean, instead of my
previous notion that the two are separate assumptions which are used together to derive the unbiasedness.

Is the lecture note correct in that random sampling actually **causes** zero conditional mean? If it is, could anyone explain to me why this is the case instead of them being two separate assumptions as stated in a
standard econometrics textbook?

random sampling causes the sample **Xi**s to be iid but that still doesn't have anything to do with **ui**, and I thought that was why the additional assumption of zero conditional mean was added to ensure the unbiasedness of the OLS. I would appreciate it if someone could tell me what the lecture note is trying to say here.

**Tags:** econometrics, regression, statistics
> **Comments:**
> **username_1**: The assumptions of the classical regression model include actually that the $X$-matrix is nonstochastic. Can you be a bit more explicit about how things were written down in the courses? And please use MathJax, it makes the question easier to read.  
> **username_2**: The confusion comes from the difference between random sampling (randomness of being included in the sample) and random assignment (randomness of being assigned into treatment)  

---

## 1 answers

### Answer by username_3 on 2021-03-13. Score: 3 | Accepted answer

The $E(u\_i|X\_i) = 0$ can hold even without having simple random sample or random assignment. However, random assignment *guarantees* this will hold (in expectations). A violation of $E(u\_i|X\_i) \neq 0$ is typically consequence of omitted variable bias. For example, in regression of education on wages reason why $E(u\_i|X\_i) \neq 0$ can be that experience also affects wages and if people with different education have different experience this will result in $E(u\_i|X\_i) \neq 0$.

Random assignment of $X$ solves this issue. For example, lets consider $X\_i$ to be treatment status $X\_i = \{0,1\}$ following Angrist and Pischke Mostly Harmless Econometrics. Now let $Y\_{i}$ be potential outcome based on $X\_i$ so that we have:

$$ Y\_i \begin{cases}
Y\_{1i} \text{ if } X\_i=1 \\[2ex]
Y\_{0i} \text{ if } X\_i=0
\end{cases} $$

As a consequence observed outcomes will be given by:

$$Y\_{i} = \underbrace{Y\_{0i}}\_{\beta\_0 } + \underbrace{(Y\_{1i}-Y\_{0i})}\_{\beta\_1}X\_i\tag{1} $$

Now the above in expectation notation implies that:

$$\underbrace{E[Y\_i | X\_i = 1] - E[Y\_i | X\_i = 0]}\_{\text{observed difference}} = \underbrace{E[Y\_{1i} | X\_{i} = 1] - E[Y\_{0i} | X\_i = 0]}\_{\text{Average treatment Effect on Treated}} + \underbrace{E[Y\_{0i} | X\_{i} = 1] - E[Y\_{0i} | X\_i = 0]}\_{\text{Selection Bias}} \tag{2}$$

Presence of selection bias would cause $E(u\_i|X\_i) \neq 0$.

However, note if we use random assignment of $X\_i$ it eliminates the problem as it makes $X\_i$ independent of potential outcomes. If they are independent then $E[Y\_{0i} | X\_i = 1] = E[Y\_{0i} | X\_i = 1]$. Substituting this back to the 2 we get:

$$E[Y\_i | X\_i = 1] - E[Y\_i | X\_i = 1]= E[Y\_{1i} | X\_{i} = 1] - E[Y\_{0i} | X\_i = 1] \\
= E[Y\_{1i}- Y\_{0i} | X\_{i} = 1] \\ = E[Y\_{1i}- Y\_{0i}] .$$

This eliminates selection bias and ensures $E(u\_i|X\_i) = 0$ (although note random assignment is no silver bullet, there could be various different issues that are still).

> **Comments:**
> **username_2**: Very nice exposition. Mostly Harmless Econometrics chapter 2 explain exactly this in a little more detail and with examples. Pdf available here: https://jonnyphillips.github.io/FLS6415/Class_3/Angrist%20&%20Pischke.pdf  

---

