Solved – How accurate is F test in panel data

fixed-effects-modelhausmanpanel dataregressiontime series

I heard that the F-test is to advice you whether to use fixed effects or pooled OLS. However, I didn't find any details about it in books. Only in a very few studies. What is the hypothesis of the test? After I run my fixed model I got

F test that all u_i=0:     F(100, 389) =     2.98            
Prob > F = 0.0000

As I understand u_i=0 means I shall use fixed effect (am I right?), in general how accurate is this F-test compared to the Hausman test and LM test given the fact that we will end to knowing whether to use fixed effects or pooled OLS?

Best Answer

The null hypothesis of the F-test following xtreg, fe is that in your model $$y_{it} = X'_{it}\beta + u_i + e_{it}$$ the observed and unobserved fixed effects $u_i$ are equal to zero, i.e. they are equal across all units. Rejecting this hypothesis means that the fixed effects are non-zero. Something similar is tested when you apply the LM-test by Breusch and Pagan after the random effects regression where the null hypothesis is that $\text{Var}(u_i) = 0$.

In your case, a significant F-test means that the fixed effects are non-zero and therefore pooled OLS and random effects will be biased if $\text{Cov}(X_{it},u_i)\neq 0$. The latter condition is something that the F-test does not tell you. For this purpose you need the Hausman test because it might be that the fixed effects are non-zero but that they are yet uncorrelated with your time-varying explanatory variables, though this is a rare case in practice as far as I know.

If you apply all tests you should typically arrive at similar conclusions. Here is a reproducible example to see it for yourself:

webuse nlswork.dta
xtset idcode year

// Fixed effects regression
xtreg ln_wage age hours i.year, fe
est store fe

// Pooled OLS regression
reg ln_wage age hours i.year
est store pols

// Hausman test comparing FE and pooled OLS
hausman fe pols, sigmamore

// Random effects regression with LM test
xtreg ln_wage age hours i.year, re
est store re
xttest0

// Hausman test comparing FE and RE
hausman fe re, sigmamore

You should find that the F-test rejects equal fixed effects across units, the LM test rejects a zero variance of the fixed effects, and that the Hausman test prefers the fixed effects regression to both pooled OLS and the random effects regression.