<p>This is a special case of Hausman and Taylor (1981). See Appendix A.1 Special Cases.</p>
<p>Consider the model <span class="math-container">$y_{it} = \alpha + x_{it}\beta + z_i \gamma + \eta_i + e_{it}$</span>, where <span class="math-container">$x_{it}$</span> contains <code>control1</code> and <code>control2</code>, and <span class="math-container">$z_i$</span> is <code>ISfemale</code>.</p>
<p><em>Case 1: fixed effects</em></p>
<p>If <span class="math-container">$x_{it}$</span> and <span class="math-container">$z_i$</span> are arbitrarily correlated with <span class="math-container">$\eta_i$</span>, you cannot identify <span class="math-container">$\gamma$</span>. This is natural. We cannot identify the gender effect separated from individual effects. It's impossible because <span class="math-container">$z_i$</span> is correlated with the error term (<span class="math-container">$\eta_i + e_{it}$</span>) unless you have external instruments.</p>
<p><em>Case 2: <span class="math-container">$z$</span> is exogenous</em></p>
<p>If <span class="math-container">$x_{it}$</span> is arbitrarily correlated with <span class="math-container">$\eta_i$</span> but <span class="math-container">$z_i$</span> is assumed to be uncorrelated with <span class="math-container">$\eta_i$</span> (<span class="math-container">$x$</span> is HT's <span class="math-container">$X_2$</span> and <span class="math-container">$z$</span> is HT's <span class="math-container">$Z_1$</span>), then no problems. You can use <span class="math-container">$x_{it} - \bar{x}_i$</span> and <span class="math-container">$z_i$</span> as instruments. For example, you can run an IV regression using <span class="math-container">$x_{it}-\bar{x}_i$</span> and <span class="math-container">$z_i$</span>:</p>
<pre><code>xtset id year
by id: egen x1bar = mean(x1)
by id: egen x2bar = mean(x2)
gen x1d = x1 - x1bar
gen x2d = x2 - x2bar
ivregress 2sls y (x1 x2 = x1d x2d) z, vce(r) /* cluster se */
</code></pre>
<p>The point here is: <span class="math-container">$\beta$</span> is identified whether or not <span class="math-container">$x_{it}$</span> is correlated with <span class="math-container">$\eta_i$</span>. Then <span class="math-container">$\gamma$</span> can be consistently estimated by regressing <span class="math-container">$y_{it} - x_{it} \hat\beta$</span> on <span class="math-container">$z_i$</span>. And this is OP's approach:</p>
<blockquote>
<p>Also, is it scientific to just take the FIXED effect coefficient of female analyst and just average them ? How can i test if it is significantly greater or less than male analysts ?</p>
</blockquote>
<p><em>Case 3 (unrealistic): <span class="math-container">$x$</span> is exogenous, <span class="math-container">$z$</span> is correlated with <span class="math-container">$\eta_i$</span></em></p>
<p>See HT. But Stata's <code>xthtaylor</code> will fail. It's a bug. Edit <code>xthtaylor.ado</code> if you want.</p>

CC BY-SA 4.0
2022-06-16T13:13:06.427Z
Thank you so much for the comments. I might be able to have data that fufill case 3.  On case3, may i know why did you call it unrealistic ?   I googled around but did not find much about the bug.  Any reference is greatly appreciated. And should i do a ivtest following this to confirm validity of HT model ?
JSS
CC BY-SA 4.0
2022-06-16T13:25:52.440Z
Case 3 means that you want to identify the gender effect separately from other time-invariant unobservable characteristics (using x1bar as instruments). That seems too much to me. The instruments would be weak, and HT doesn't do any magic. I would rather include time-invariant control variables that I want to control for like what we do with cross-sectional data. That means that the time-invariant regressors are exogenous. But of course you can do whatever you want. `xthtaylor` used to be coded strangely so it fails if "Z1" is empty. I don't know what it is like in a recent version.
chan1142
CC BY-SA 4.0
2022-06-16T05:39:00.623Z
2022-06-16T05:39:00.623Z
chan1142
<p>i need help with an econometric question.
I have a panel data of stock analysts and their associated investment returns by following their investment recommendations of buy/hold/sell. The data is at the time,analyst level.</p>
<p>I have the following setup:</p>
<p>Returns ~ control1+control2+ISfemale</p>
<p>My variable of interest is on female analysts. However, it is not possible to estimate female as it is time-invariant and clashes with the analyst fixed effect.</p>
<p>In this setup, how do i estimate the coefficient of ISfemale without going to more sophisticated model such as hausman taylor models that requires instruments (it is hard to theoretically find them).</p>
<p>Also, is it scientific to just take the FIXED effect coefficient of female analyst and just average them ? How can i test if it is significantly greater or less than male analysts ?</p>
<p>Any suggestions would be greatly appreciated !</p>

<econometrics><applied-econometrics><regression><fixed-effects>
How to estimate a subclass effect of fixed effect model?
JSS
# How to estimate a subclass effect of fixed effect model?

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

i need help with an econometric question.
I have a panel data of stock analysts and their associated investment returns by following their investment recommendations of buy/hold/sell. The data is at the time,analyst level.

I have the following setup:

Returns ~ control1+control2+ISfemale

My variable of interest is on female analysts. However, it is not possible to estimate female as it is time-invariant and clashes with the analyst fixed effect.

In this setup, how do i estimate the coefficient of ISfemale without going to more sophisticated model such as hausman taylor models that requires instruments (it is hard to theoretically find them).

Also, is it scientific to just take the FIXED effect coefficient of female analyst and just average them ? How can i test if it is significantly greater or less than male analysts ?

Any suggestions would be greatly appreciated !

**Tags:** econometrics, applied-econometrics, regression, fixed-effects


---

## 1 answers

### Answer by username_1 on 2022-06-16. Score: 1 | Accepted answer

This is a special case of Hausman and Taylor (1981). See Appendix A.1 Special Cases.

Consider the model $y\_{it} = \alpha + x\_{it}\beta + z\_i \gamma + \eta\_i + e\_{it}$, where $x\_{it}$ contains `control1` and `control2`, and $z\_i$ is `ISfemale`.

*Case 1: fixed effects*

If $x\_{it}$ and $z\_i$ are arbitrarily correlated with $\eta\_i$, you cannot identify $\gamma$. This is natural. We cannot identify the gender effect separated from individual effects. It's impossible because $z\_i$ is correlated with the error term ($\eta\_i + e\_{it}$) unless you have external instruments.

*Case 2: $z$ is exogenous*

If $x\_{it}$ is arbitrarily correlated with $\eta\_i$ but $z\_i$ is assumed to be uncorrelated with $\eta\_i$ ($x$ is HT's $X\_2$ and $z$ is HT's $Z\_1$), then no problems. You can use $x\_{it} - \bar{x}\_i$ and $z\_i$ as instruments. For example, you can run an IV regression using $x\_{it}-\bar{x}\_i$ and $z\_i$:

```
xtset id year
by id: egen x1bar = mean(x1)
by id: egen x2bar = mean(x2)
gen x1d = x1 - x1bar
gen x2d = x2 - x2bar
ivregress 2sls y (x1 x2 = x1d x2d) z, vce(r) /* cluster se */

```

The point here is: $\beta$ is identified whether or not $x\_{it}$ is correlated with $\eta\_i$. Then $\gamma$ can be consistently estimated by regressing $y\_{it} - x\_{it} \hat\beta$ on $z\_i$. And this is OP's approach:

> Also, is it scientific to just take the FIXED effect coefficient of female analyst and just average them ? How can i test if it is significantly greater or less than male analysts ?

*Case 3 (unrealistic): $x$ is exogenous, $z$ is correlated with $\eta\_i$*

See HT. But Stata's `xthtaylor` will fail. It's a bug. Edit `xthtaylor.ado` if you want.

> **Comments:**
> **username_0**: Thank you so much for the comments. I might be able to have data that fufill case 3.  On case3, may i know why did you call it unrealistic ?   I googled around but did not find much about the bug.  Any reference is greatly appreciated. And should i do a ivtest following this to confirm validity of HT model ?  
> **username_1**: Case 3 means that you want to identify the gender effect separately from other time-invariant unobservable characteristics (using x1bar as instruments). That seems too much to me. The instruments would be weak, and HT doesn't do any magic. I would rather include time-invariant control variables that I want to control for like what we do with cross-sectional data. That means that the time-invariant regressors are exogenous. But of course you can do whatever you want. `xthtaylor` used to be coded strangely so it fails if "Z1" is empty. I don't know what it is like in a recent version.  

---

