statable Statistics for study and research

Fixed or random effects? (Hausman test, F test for unit effects)

In brief

Two questions come first with panel data. First: do the units differ at all? The F test for unit effects checks this: it compares the model that treats every unit alike (pooled) with the fixed-effects model. Second: are random effects enough, or are fixed ones needed? Random effects are more precise but hold only if the differences between the units have nothing to do with the features. The Hausman test compares the two estimates: if they lie far apart, the assumption of random effects is doubtful and you take fixed effects.

An example with real data

Grunfeld data (ten firms, 20 years): the F test for firm effects gives F(9, 188) = 49.18, p < .001: the firms differ clearly, the pooled model is not appropriate. The Hausman test gives χ²(2) = 2.33, p = .312: fixed and random effects lie close together (value 0.1101 against 0.1098; capital 0.3101 against 0.3081), the test finds no clear difference.

When do I use it?

When you have to choose between fixed and random effects. In practice: whoever wants to estimate a cause and did not draw the units at random from a large set (all large US firms, all EU countries) usually takes fixed effects without waiting for the test.

Requirements

How it works in Statable

  1. Open Examples > "Investment of ten firms (Grunfeld)" (economics) and run the regression "investment from market value and capital stock".
  2. Under the result, at "Calculate differently", open the block "The same units over time? (panel data, fixed and random effects)" (Ctrl+K: "panel data"); group identifier "firma", target "investition", features "marktwert" and "kapitalstock"; "Calculate panel".

In the block the F test and the Hausman test appear as sentences below the table.

Reading and reporting the result

The F test for firm effects was clear, F(9, 188) = 49.18, p < .001; the Hausman test showed no clear difference between fixed and random effects, χ²(2) = 2.33, p = .312.

Limits

What is often misunderstood

Sources

Cameron, A. C. & Miller, D. L. (2015). A Practitioner's Guide to Cluster-Robust Inference. Journal of Human Resources, 50(2), 317-372. Croissant, Y. & Millo, G. (2008). Panel Data Econometrics in R: the plm Package. Journal of Statistical Software, 27(2) (open access). Cunningham, S. Causal Inference: The Mixtape (mixtape.scunning.com, open access). Data: Grunfeld, Y. (1958), prepared in the R packages plm and AER (GPL).

Take away

  • F test for unit effects: do the units differ? If yes, a model without unit effects is not appropriate.
  • Hausman test: do fixed and random effects differ strongly? Then fixed effects.
  • A non-significant Hausman test is no proof for random effects.

Related

Open in Statable