### Random effect

This article needs attention from an expert in statistics. (January 2011) |

In statistics, a **random effect(s) model**, also called a **variance components model**, is a kind of hierarchical linear model. It assumes that the dataset being analysed consists of a hierarchy of different populations whose differences relate to that hierarchy. In econometrics, random effects models are used in the analysis of hierarchical or panel data when one assumes no fixed effects (i.e. no individual effects). The random effects model is a special case of the fixed effects model. Contrast this to the biostatistics definitions,^{[1]}^{[2]}^{[3]} as biostatisticians use "fixed" and "random" effects to respectively refer to the population-average and subject-specific effects (and where the latter are generally assumed to be unknown, latent variables).

## Contents

## Qualitative description

Such models assist in controlling for unobserved heterogeneity when this heterogeneity is constant over time and correlated with independent variables. This constant can be removed from the data through differencing, for example by taking a first difference which will remove any time invariant components of the model.

There are two common assumptions made about the individual specific effect, the random effects assumption and the fixed effects assumption. The random effects assumption (made in a **random effects model**) is that the individual specific effects are uncorrelated with the independent variables. The fixed effect assumption is that the individual specific effect is correlated with the independent variables. If the random effects assumption holds, the random effects model is more efficient than the fixed effects model. However, if this assumption does not hold (i.e., if the Durbin–Watson test fails), the random effects model is not consistent.

## Simple example

Suppose *m* large elementary schools are chosen randomly from among thousands in a large country. Suppose also that *n* pupils of the same age are chosen randomly at each selected school. Their scores on a standard aptitude test are ascertained. Let *Y*_{ij} be the score of the *j*th pupil at the *i*th school. A simple way to model the relationships of these quantities is

- $$

Y_{ij} = \mu + U_i + W_{ij},\,

where *μ* is the average test score for the entire population. In this model *U _{i}* is the school-specific

**random effect**: it measures the difference between the average score at school

*i*and the average score in the entire country and it is "random" because the school has been randomly selected from a larger population of schools. The term,

*W*is the individual-specific error. That is, it is the deviation of the

_{ij}*j*-th pupil’s score from the average for the

*i*-th school. Again this is regarded as random because of the random selection of pupils within the school, even though it is a fixed quantity for any given pupil.

The model can be augmented by including additional explanatory variables, which would capture differences in scores among different groups. For example:

- $$

Y_{ij} = \mu + \beta_1 \mathrm{Sex}_{ij} + \beta_2 \mathrm{Race}_{ij} + \beta_3 \mathrm{ParentsEduc}_{ij} + U_i + W_{ij},\,

where Sex_{ij} is the dummy variable for boys/girls, Race_{ij} is the dummy variable for white/black pupils, and ParentsEduc_{ij} records the average education level of child’s parents. This is a mixed model, not a purely random effects model.^{[dubious – discuss]}

## Variance components

The variance of *Y*_{ij} is the sum of the variances τ^{2} and σ^{2} of *U*_{i} and *W*_{ij} respectively.

Let

- $\backslash overline\{Y\}\_\{i\backslash bullet\}\; =\; \backslash frac\{1\}\{n\}\backslash sum\_\{j=1\}^n\; Y\_\{ij\}$

be the average, not of all scores at the *i*th school, but of those at the *i*th school that are included in the random sample. Let

- $\backslash overline\{Y\}\_\{\backslash bullet\backslash bullet\}\; =\; \backslash frac\{1\}\{mn\}\backslash sum\_\{i=1\}^m\backslash sum\_\{j=1\}^n\; Y\_\{ij\}$

be the "grand average".

Let

- $SSW\; =\; \backslash sum\_\{i=1\}^m\backslash sum\_\{j=1\}^n\; (Y\_\{ij\}\; -\; \backslash overline\{Y\}\_\{i\backslash bullet\})^2\; \backslash ,$

- $SSB\; =\; n\backslash sum\_\{i=1\}^m\; (\backslash overline\{Y\}\_\{i\backslash bullet\}\; -\; \backslash overline\{Y\}\_\{\backslash bullet\backslash bullet\})^2\; \backslash ,$

be respectively the sum of squares due to differences *within* groups and the sum of squares due to difference *between* groups. Then it can be shown that

- $\backslash frac\{1\}\{m(n\; -\; 1)\}E(SSW)\; =\; \backslash sigma^2$

and

- $\backslash frac\{1\}\{(m\; -\; 1)n\}E(SSB)\; =\; \backslash frac\{\backslash sigma^2\}\{n\}\; +\; \backslash tau^2.$

These "expected mean squares" can be used as the basis for estimation of the "variance components" σ^{2} and τ^{2}.

## Unbiasedness

In general, random effects is efficient, and should be used (over fixed effects) if the assumptions underlying it are believed to be satisfied. For RE to work in the school example it is necessary that the school-specific effects be orthogonal to the other covariates of the model. This can be tested by running random effects, then fixed effects, and doing a Hausman specification test. If the test rejects, then random effects is biased and fixed effects is the correct estimation procedure.

## See also

## Notes

## References

- Fixed and random effects models
- Distinguishing Between Random and Fixed: Variables, Effects, and Coefficients
- How to Conduct a Meta-Analysis: Fixed and Random Effect Models