FEM and REM for panel data
When data tracks multiple units (countries, firms, provinces) over multiple periods, the two most common estimators are FEM (Fixed Effects Model) and REM (Random Effects Model). Both control for unobserved unit-specific characteristics, but they differ in their assumption about the correlation between those characteristics and the explanatory variables.
In EcoLab, FEM/REM belong to the Panel Data group and generate reproducible code for Stata, R and Python. See Estimation & Modeling.
Core difference
- FEM assumes the unobserved unit-specific effect () may be correlated with the regressors. FEM removes through the within transformation (subtracting unit means), so it is consistent even under such correlation — but it cannot estimate time-invariant variables.
- REM assumes is uncorrelated with the regressors and treats it as a random component. REM is more efficient (smaller standard errors) when the assumption holds, and it can estimate time-invariant variables — but it is biased if the assumption is violated.
Which model should you use?
| Situation | Recommended |
|---|---|
| You suspect correlates with regressors (endogeneity from unit characteristics) | FEM |
| You care about coefficients of time-invariant variables (gender, fixed geography) | REM |
| The sample is a random draw from a large population; treated as random | REM |
| Uncertain | Run both and use the Hausman test |