Random effects model

In statistics, a random effect(s) model, also called a variance components model is a kind of hierarchical linear model. It assumes that the data describe a hierarchy of different populations whose differences are constrained by the hierarchy. The fixed effects model is a special case.

Simple example
Suppose m elementary large schools are chosen randomly from among millions in a large country. Then n pupils are chosen randomly from among those at each such school. Their scores on a standard aptitude test are ascertained. Let Yij be the score of the jth pupil at the ith school. Then


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

where &mu; is the average of all scores in the whole population, Ui is the deviation of the average of all scores at the ith school from the average in the whole population, and Wij is the deviation of the jth pupil's score from the average score at the ith school.

Variance components
The variance of Yij is the sum of the variances &tau;2 and &sigma;2 of Ui and Wij respectively.

Let


 * $$\overline{Y}_{i\bullet} = \frac{1}{n}\sum_{j=1}^n Y_{ij}$$

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


 * $$\overline{Y}_{\bullet\bullet} = \frac{1}{mn}\sum_{i=1}^m\sum_{j=1}^n Y_{ij}$$

be the "grand average".

Let


 * $$SSW = \sum_{i=1}^m\sum_{j=1}^n (Y_{ij} - \overline{Y}_{i\bullet})^2 \, $$


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

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


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

and


 * $$ \frac{1}{n}E(SSB) = \frac{\sigma^2}{n} + \tau^2.$$

These "expected mean squares" can be used as the basis for estimation of the "variance components" &sigma;2 and &tau;2.