<p>I guess this follows from the Frish-Waugh Lovell theorem.</p>
<p>If you have <span class="math-container">$K$</span> dummies and say <span class="math-container">$n$</span> observations, so <span class="math-container">$F$</span> is <span class="math-container">$n \times K$</span>, you need to regress every dummy in <span class="math-container">$F$</span> on all variables in <span class="math-container">$X$</span> separately (<span class="math-container">$K$</span> regressions). The residuals make up the matrix <span class="math-container">$\bar F$</span> which is again of dimension <span class="math-container">$n \times K$</span>.</p>

CC BY-SA 4.0
2021-10-04T11:44:16.557Z
2021-10-04T11:44:16.557Z
tdm
<p>I want to do a linear regression: <span class="math-container">$y_{i}=\psi_{j(i)}+X_{i}^{\prime} \xi+\varepsilon_{i}$</span>, where <span class="math-container">$\psi_{j(i)}$</span> is a high dimensional fixed effect on group <span class="math-container">$j$</span>, <span class="math-container">$X_i$</span> are the covariables of each observation <span class="math-container">$i$</span>, and <span class="math-container">$\varepsilon_{i}$</span> is error assumed to be exogenous.</p>
<p>This linear regression can be done by many statistic packages through LSMR method avoids inverting the regressor matrix.</p>
<p>However after this regression I want to calculate the size weighted variance of the fixed effects <span class="math-container">$$\theta_{\psi}=\sum_{j=1}^{J} s_{j}\left(\psi_{j}-\bar{\psi}\right)^{2}$$</span>, where <span class="math-container">$s_j$</span> is the share of the group. However the simple &quot;plug-in&quot; estimates <span class="math-container">$$\begin{aligned}
\hat{\theta}_{\psi} =\sum_{j=1}^{J} s_{j}\left(\hat{\psi}_{j}-\hat{\bar{\psi}}\right)^{2} =\sum_{j=1}^{J} s_{j}\left(\hat{\psi}_{j}\right)^{2}-(\hat{\bar{\psi}})^{2}
\end{aligned}$$</span> is upward biased because <span class="math-container">$$\begin{aligned}
\mathbb{E}\left[\hat{\theta}_{\psi}\right] &amp;=\sum_{j=1}^{J} s_{j} \mathbb{E}\left[\left(\hat{\psi}_{j}\right)^{2}\right]-\mathbb{E}\left[(\hat{\psi})^{2}\right] \\
&amp;=\sum_{j=1}^{J} s_{j}\left\{\psi_{j}^{2}+\mathbb{V}\left[\hat{\psi}_{j}\right]\right\}-(\bar{\psi})^{2}-\mathbb{V}[\hat{\bar{\psi}}] \\
&amp;=\theta_{\psi}+\underbrace{\sum_{j=1}^{J} s_{j} \mathbb{V}\left[\hat{\psi}_{j}\right]-\mathbb{V}[\hat{\bar{\psi}}]}_{\text {bias }}
\end{aligned}$$</span>.</p>
<p>A simple correction is to use the conventional HC standard error: <span class="math-container">$$\theta_{\psi} \approx \hat{\theta}_{\psi} - \sum_{j=1}^{J} s_{j} \hat{\mathbb{V}}_{H C}\left[\hat{\psi}_{j}\right]$$</span>.</p>
<p>However the high dimensional effects estimated from LSMR method does not provide std errors. And thus I have no idea how to do this correction.</p>
<p>Another way to do correction is to assume  <span class="math-container">$\mathbb{V}[\varepsilon]=I \sigma^{2}$</span> and then direct calculate <span class="math-container">$$\mathbb{V}[\hat{\psi}]=\left(\tilde{F}^{\prime} \tilde{F}\right)^{-1} \sigma^{2}$$</span>, where <span class="math-container">$\tilde{F}$</span> is residualized version of <span class="math-container">$F$</span>, and <span class="math-container">$F$</span> is the dummy matrix of <span class="math-container">${\psi}_{j(i)}$</span>.</p>
<p>However I have no idea how to regress <span class="math-container">$F$</span> on <span class="math-container">$X$</span> to get the residual <span class="math-container">$\tilde{F}$</span> (how can I regress a dummy matrix on ?) and also how to inverse the <span class="math-container">$\left(\tilde{F}^{\prime} \tilde{F}\right)$</span>.</p>

<econometrics><fixed-effects>
How to get the bias-adjusted variance estimates for high-dimensional fixed effects in a linear model?
Alalalalaki
# How to get the bias-adjusted variance estimates for high-dimensional fixed effects in a linear model?

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

I want to do a linear regression: $y\_{i}=\psi\_{j(i)}+X\_{i}^{\prime} \xi+\varepsilon\_{i}$, where $\psi\_{j(i)}$ is a high dimensional fixed effect on group $j$, $X\_i$ are the covariables of each observation $i$, and $\varepsilon\_{i}$ is error assumed to be exogenous.

This linear regression can be done by many statistic packages through LSMR method avoids inverting the regressor matrix.

However after this regression I want to calculate the size weighted variance of the fixed effects $$\theta\_{\psi}=\sum\_{j=1}^{J} s\_{j}\left(\psi\_{j}-\bar{\psi}\right)^{2}$$, where $s\_j$ is the share of the group. However the simple "plug-in" estimates $$\begin{aligned}
\hat{\theta}\_{\psi} =\sum\_{j=1}^{J} s\_{j}\left(\hat{\psi}\_{j}-\hat{\bar{\psi}}\right)^{2} =\sum\_{j=1}^{J} s\_{j}\left(\hat{\psi}\_{j}\right)^{2}-(\hat{\bar{\psi}})^{2}
\end{aligned}$$ is upward biased because $$\begin{aligned}
\mathbb{E}\left[\hat{\theta}\_{\psi}\right] &=\sum\_{j=1}^{J} s\_{j} \mathbb{E}\left[\left(\hat{\psi}\_{j}\right)^{2}\right]-\mathbb{E}\left[(\hat{\psi})^{2}\right] \\
&=\sum\_{j=1}^{J} s\_{j}\left\{\psi\_{j}^{2}+\mathbb{V}\left[\hat{\psi}\_{j}\right]\right\}-(\bar{\psi})^{2}-\mathbb{V}[\hat{\bar{\psi}}] \\
&=\theta\_{\psi}+\underbrace{\sum\_{j=1}^{J} s\_{j} \mathbb{V}\left[\hat{\psi}\_{j}\right]-\mathbb{V}[\hat{\bar{\psi}}]}\_{\text {bias }}
\end{aligned}$$.

A simple correction is to use the conventional HC standard error: $$\theta\_{\psi} \approx \hat{\theta}\_{\psi} - \sum\_{j=1}^{J} s\_{j} \hat{\mathbb{V}}\_{H C}\left[\hat{\psi}\_{j}\right]$$.

However the high dimensional effects estimated from LSMR method does not provide std errors. And thus I have no idea how to do this correction.

Another way to do correction is to assume $\mathbb{V}[\varepsilon]=I \sigma^{2}$ and then direct calculate $$\mathbb{V}[\hat{\psi}]=\left(\tilde{F}^{\prime} \tilde{F}\right)^{-1} \sigma^{2}$$, where $\tilde{F}$ is residualized version of $F$, and $F$ is the dummy matrix of ${\psi}\_{j(i)}$.

However I have no idea how to regress $F$ on $X$ to get the residual $\tilde{F}$ (how can I regress a dummy matrix on ?) and also how to inverse the $\left(\tilde{F}^{\prime} \tilde{F}\right)$.

**Tags:** econometrics, fixed-effects


---

## 1 answers

### Answer by username_1 on 2021-10-04. Score: 3

I guess this follows from the Frish-Waugh Lovell theorem.

If you have $K$ dummies and say $n$ observations, so $F$ is $n \times K$, you need to regress every dummy in $F$ on all variables in $X$ separately ($K$ regressions). The residuals make up the matrix $\bar F$ which is again of dimension $n \times K$.


---

