- Introduced by
- Baltagi (textbook treatment); classical random-effects panel estimator
- Year
- 2021
- Type
- Panel data regression
What does it do?
The Random Effects model is a panel-data regression that treats unobserved unit-specific heterogeneity as a random component drawn from a common distribution, rather than estimating a separate intercept for each unit.
It is covered in standard panel-econometrics texts such as Baltagi (2021). Its estimates are consistent only if that heterogeneity is uncorrelated with the predictors.
The intuition behind the method
Suppose you follow many firms over several years. Each firm has a baseline level of the outcome that you cannot observe directly. The Random Effects view treats these baselines as draws from a shared distribution rather than as fixed numbers to be estimated one by one. If that assumption holds, the model can use variation both within and between firms, keep time-invariant characteristics such as sector or region in the regression, and produce more efficient coefficients than an approach that removes each firm's baseline. The cost is the assumption itself: if firms with high baselines also have systematically different predictor values, the estimates are biased.
History
The random-effects specification is treated in standard panel-econometrics references, including the sixth edition of Baltagi's Econometric Analysis of Panel Data (2021), where it is discussed alongside the fixed effects estimator and GLS estimation. In practice, the Hausman test is the conventional tool for comparing the random-effects and fixed effects estimators.
When to use it
Choose the Random Effects model when your data are a panel, meaning the same units are observed across several time periods, and the number of units is reasonably large, since few units make the variance estimates behind the GLS weights imprecise. It fits when you have a substantive reason to believe the unit-specific effects are uncorrelated with the predictors, and when you need coefficients on time-invariant characteristics, which the fixed effects estimator cannot identify. Treat exogeneity as something to test, not assume. A Hausman comparison with the fixed effects estimator that rejects (p < 0.05) indicates that the random-effects estimates are inconsistent, and a fixed effects model should be used. Because the classical Hausman test maintains the full set of random-effects assumptions under the null, a robust variable-addition test with a robust covariance matrix is the more defensible exogeneity check. Do not use this model for a single cross-section, where the unit effect and the idiosyncratic error cannot be separated. The formulas and guidance on this page apply to continuous outcomes. Binary and count outcomes call for nonlinear panel models rather than the estimator described here.
Limitations and considerations
- Consistency depends entirely on the exogeneity of μᵢ. If the unit effects are correlated with X, the coefficients are biased, and the estimates themselves give no direct signal of this beyond the exogeneity tests described above.
- The GLS weights rely on estimated variance components. With few units these estimates are imprecise, so the weighting can be unreliable.
- With a single time period (T = 1), the unit effect and the idiosyncratic error cannot be separated, so the panel advantage disappears and a cross-sectional OLS model is the appropriate baseline.
- The model's central assumption is restrictive. When unit effects may correlate with the regressors but time-invariant coefficients are still needed, Mundlak's approach extends the random effects model by adding the unit means of the time-varying regressors. This allows correlation between the unit effects and the regressors while keeping time-invariant coefficients estimable, and it is a common middle ground between the standard random effects and fixed effects estimators.
Source conditions do not replace independent scientific review or validation by an analysis engine.
Strengths
- Under exogeneity, it uses both within-unit and between-unit variation, which is why it is typically more efficient than fixed effects.
- It can estimate coefficients on time-invariant predictors, such as a unit's sector or location, which the within transformation used by fixed effects removes.
- GLS weighting accounts for the within-unit correlation of the composite error, so it avoids the efficiency loss that plain OLS suffers on repeated observations of the same units.
Applications
- Modelling firm-level outcomes observed over several years when time-invariant firm characteristics, such as sector or region, are part of the research question.
- Longitudinal survey analysis in which individual baselines are plausibly unrelated to the regressors and coefficients on stable personal characteristics are needed.
- Country-level panels where the effects of time-invariant country features must be estimated rather than absorbed into unit intercepts.
How it works
How it works
The outcome for unit i at time t is a linear function of the predictors X plus two error components: a unit-specific effect μᵢ, which is the random individual heterogeneity, and an idiosyncratic error νᵢₜ that varies across both units and time. The identifying assumption is that μᵢ is uncorrelated with the regressors X, and this is where that assumption enters the model.
Formula
y_{it} = X_{it}\beta + \mu_i + \nu_{it}The composite error μᵢ + νᵢₜ is correlated across the repeated observations of each unit. Under the exogeneity assumption, ordinary least squares remains consistent but is no longer efficient. The estimator therefore applies generalised least squares, weighting observations by Ω, the covariance matrix of the composite error. Ω depends on the variance of the unit effect and the variance of the idiosyncratic error. Because these variance components are unknown, they must be estimated from the data, which makes the procedure feasible GLS rather than GLS with a known Ω. Random-effects models can also be estimated by maximum likelihood; the feasible GLS procedure described above is the one this page covers.
Formula
\hat{\beta}_{RE} = (X^{\top}\Omega^{-1}X)^{-1}X^{\top}\Omega^{-1}yCommon pitfalls
- Running the Hausman test and then ignoring a rejection (p < 0.05). The random-effects estimates remain inconsistent even when they look precise.
- Reading a failure to reject as proof of exogeneity. A non-significant test means the data do not show a correlation between the unit effects and the predictors, not that the correlation is absent.
- Relying on the classical Hausman test as the only exogeneity check. It maintains the full random-effects assumptions under the null, so a robust variable-addition test should be run alongside it.
- Applying the model to a single cross-section (T = 1), where the unit effect cannot be separated from the error.
- Trusting coefficients estimated from a small number of units, where the variance components used for the GLS weights are imprecise.
- Assuming the unit effects are exogenous without argument, for example when unobserved unit characteristics such as management quality plausibly correlate with the predictors.
Frequently asked questions
How do I choose between random effects and fixed effects?
Run a Hausman test as the conventional comparison. If it rejects (p < 0.05), the individual effects are correlated with the predictors, the random-effects estimates are inconsistent, and a fixed effects model should be used. Because the classical Hausman test assumes the random-effects model holds under the null, a robust variable-addition test is the more reliable check of exogeneity. If neither test indicates correlation, random effects are usually preferred because they are more efficient, but a non-rejection does not prove that the effects are exogenous.
What is the key assumption behind random effects?
That the unit-specific effect μᵢ is exogenous, meaning uncorrelated with the regressors. This is what allows the estimator to be consistent while remaining more efficient than fixed effects.
Why use GLS instead of plain OLS here?
Because each unit's composite error is correlated across its repeated observations. Under exogeneity OLS stays consistent but is no longer efficient. Feasible GLS weights observations by an estimated error covariance structure to recover efficient coefficient estimates.
How many units do I need?
The more units are available, the more reliable the variance estimates that drive the GLS weights become, and few units make those estimates imprecise. With only one time period the panel structure offers no advantage, and OLS is the better choice.
Related methods
Sources
Baltagi, B. H. (2021). Econometric Analysis of Panel Data (6th ed.). Springer.
Open DOI referenceEconometric analysis, 7th Edition, Sections 11.5.5–11.5.6, pp. 420–421
Econometrics in Theory and Practice: Analysis of Cross Section, Time Series and Panel Data with Stata 15.1 (2019), one-way error component summary, p. ? (page not recorded in library extract)