# Testing for random effects if fixed effects regression is not possible

I have a panel of individuals indexed by $$i$$, observed at several times $$t$$. I want to estimate the effect of an individual specific variable, say gender, on an outcome $$y_{it}$$, either via OLS or random effects regression $$y_{it}=\alpha+\beta \text{Female}_i+\varepsilon_{it}, \text{or} \\ y_{it}=\alpha_i+\beta \text{Female}_i+\varepsilon_{it}.$$ Clearly, I cannot use a fixed effects regression, because that would absorb the gender effect and I could not estimate $$\beta$$. Now, how would I test if the random effects assumptions are fulfilled?

Normally, a Hausman test would compare $$\beta_{FE}$$ and $$\beta_{RE}$$, but as mentioned, I cannot estimate $$\beta_{FE}$$.

The Stata manual has implemented a general version of the Hausman test, which states "hausman is a general implementation of Hausman’s (1978) specification test, which compares an estimator $$\hat{\theta}_1$$ that is known to be consistent with an estimator $$\hat{\theta}_2$$ that is efficient under the assumption being tested."

So, in my case, since FE is not possible, could I use a simple OLS regression as the consistent estimator, which I can compare to the efficient RE estimator? (This, of course, is assuming OLS is consistent, in the sense there are no important omitted variables correlated with by explanatory variables.)

• Should you have $\alpha_i$ rather than $\alpha$? If not, then you can just use OLS and cluster your SEs by individual. Commented Feb 19, 2022 at 15:35
• $\alpha_i$ would be a fixed effect specification, where the constant differs by individual. This would not allow me to estimate $\beta$. Yes, I plan to cluster SEs by individual in any case. Commented Feb 19, 2022 at 15:44
• I think it's advisable to spend time specifying the correlation structure to model before asking these particular questions. This doesn't look like a natural spot for random effects, as opposed to generalized least squares with AR(1) correlation structure of a Markov process. Commented Feb 19, 2022 at 15:53
• But your equation does not have an i subscript for alpha, which means you don’t need to bother with fixed or random effects at all and can just use OLS. The subscript is not what makes it fixed. Random effects would be written the same way. It’s the assumption about correlation of the effect with x that makes it random or fixed. Commented Feb 19, 2022 at 15:53
• Fair enough, so the question is whether I should use OLS with $\alpha$ or random effects with $\alpha_i$, as written in the question. Is the Hausman test valid for that? Commented Feb 19, 2022 at 16:01

Another approach is to regress the estimated FE on the female dummy. But that assumes that $$\alpha_i$$ is uncorrelated with gender to get something unbiased, and you need many observations of the same person ($$T \rightarrow \infty$$) for consistency. That is equivalent to the assumptions you need for RE to work.