<p>Usually, the conditional mean and the conditional variance of a random variable are independent (of course there are exceptions).<br />
While the fixed effects introduce flexibility in the specification of the conditional mean, clustering introduce flexibility in the specification of the conditional variance.</p>

CC BY-SA 4.0
2021-10-07T18:07:56.633Z
2021-10-07T18:07:56.633Z
Bertrand
<p>Consider the following specification:
<span class="math-container">$$
Y_{i,g} = X_{i,g}\beta + u_{i,g}
$$</span>
Where the residuals have different mean across groups and have within group correlation:
<span class="math-container">$$
\begin{align*}
&amp;\mathbb{E}(u_{i,g}) = \alpha_g,\\
&amp;cov(u_{i,g} u_{j,g}) = \rho_{i,j},\\
&amp;cov(u_{i,g}, u_{j,g'}) = 0 \text{ for } g \ne g'
\end{align*}
$$</span>
Taking means gives:
<span class="math-container">$$
\mathbb{E}(Y_{i,g}) = \mathbb{E}(X_{i,g}) \beta + \alpha_g
$$</span>
Now use notation <span class="math-container">$\widehat{Z} = Z - \mathbb{E}(Z)$</span> for the de-meaned variable. Then:
<span class="math-container">$$
\widehat{Y_{i,g}} = \widehat{X_{i,g}} \beta + \widehat{u_{i,g}}
$$</span>
Now the mean of <span class="math-container">$\widehat{u_{i,g}}$</span> has become zero but there is still correlation within each group:
<span class="math-container">$$
\begin{align*}
&amp;cov(u_{i,g}, u_{j,g}) = \mathbb{E}(\widehat{u_{i,g}},\,\ \widehat{u_{j,g}}) = \rho_{i,j},\\
&amp;cov(u_{i,g}, u_{j,g'}) = \mathbb{E}(\widehat{u_{i,g}},\,\ \widehat{u_{j,g'}}) = 0 \text{ for } g \ne g'
\end{align*}
$$</span>
So de-meaning does not get rid of the within-group correlation.</p>

CC BY-SA 4.0
2021-10-07T18:16:19.567Z
2021-10-07T18:16:19.567Z
tdm
<p>Why is there still a block structure in the covariance-variance matrix, and consequently a need for clustering of standard errors in fixed-effects models? Shouldn't demeaning solve the serial correlation issue? Derivations and intuitive explanations are both appreciated!</p>

CC BY-SA 4.0
2021-10-08T23:40:40.000Z
If serial correlation in the error term ($u_i + v_{it}$) solely comes from the time invariant part ($u_i$), you are right. But serial correlation may exist in $v_{it}$ (the time-varying part), which is not dealt with by the within-group transformation.
chan1142
<econometrics><paneldata><fixed-effects>
Clustering of standard errors in Fixed Effects models
cc88
# Clustering of standard errors in Fixed Effects models

(Asked by: username_0 on 2021-10-07)

Why is there still a block structure in the covariance-variance matrix, and consequently a need for clustering of standard errors in fixed-effects models? Shouldn't demeaning solve the serial correlation issue? Derivations and intuitive explanations are both appreciated!

**Tags:** econometrics, paneldata, fixed-effects

> **Comments:**
> **username_1**: If serial correlation in the error term ($u_i + v_{it}$) solely comes from the time invariant part ($u_i$), you are right. But serial correlation may exist in $v_{it}$ (the time-varying part), which is not dealt with by the within-group transformation.  

---

## 2 answers

### Answer by username_3 on 2021-10-07. Score: 3 | Accepted answer

Consider the following specification:
$$
Y\_{i,g} = X\_{i,g}\beta + u\_{i,g}
$$
Where the residuals have different mean across groups and have within group correlation:
$$
\begin{align\*}
&\mathbb{E}(u\_{i,g}) = \alpha\_g,\\
&cov(u\_{i,g} u\_{j,g}) = \rho\_{i,j},\\
&cov(u\_{i,g}, u\_{j,g'}) = 0 \text{ for } g \ne g'
\end{align\*}
$$
Taking means gives:
$$
\mathbb{E}(Y\_{i,g}) = \mathbb{E}(X\_{i,g}) \beta + \alpha\_g
$$
Now use notation $\widehat{Z} = Z - \mathbb{E}(Z)$ for the de-meaned variable. Then:
$$
\widehat{Y\_{i,g}} = \widehat{X\_{i,g}} \beta + \widehat{u\_{i,g}}
$$
Now the mean of $\widehat{u\_{i,g}}$ has become zero but there is still correlation within each group:
$$
\begin{align\*}
&cov(u\_{i,g}, u\_{j,g}) = \mathbb{E}(\widehat{u\_{i,g}},\,\ \widehat{u\_{j,g}}) = \rho\_{i,j},\\
&cov(u\_{i,g}, u\_{j,g'}) = \mathbb{E}(\widehat{u\_{i,g}},\,\ \widehat{u\_{j,g'}}) = 0 \text{ for } g \ne g'
\end{align\*}
$$
So de-meaning does not get rid of the within-group correlation.


---

### Answer by username_2 on 2021-10-07. Score: 2

Usually, the conditional mean and the conditional variance of a random variable are independent (of course there are exceptions).  
While the fixed effects introduce flexibility in the specification of the conditional mean, clustering introduce flexibility in the specification of the conditional variance.


---

