Fixed versus Random Effects
Fixed versus Random Effects: Which Levels, Which Population, Which Parameter
Two studies can produce the same ANOVA table and still be answering different questions. A fixed-effects fit treats the studied level effects as constants and focuses model-based conclusions on those levels; a random-effects fit treats them as draws from a population distribution.
How levels were selected informs whether population inference is justified, but does not by itself dictate the fit.
The defining question
Are the levels in this experiment the specific ones I care about, or are they a sample standing in for a larger population of levels?
- A fixed-effects fit treats the studied level effects as unknown constants, and its model-based conclusions focus on those levels: three drug doses the regulator asked about, two teaching methods being compared, the four machines on this production line. The levels may have been chosen deliberately or selected randomly; random selection does not prevent a fixed-effects analysis when inference is about those studied levels.
- A random-effects fit treats level effects as draws from a population of possible levels when the goal is to model variation across that population: eight laboratories sampled from a registry, twenty subjects sampled from a patient population, fifteen randomly chosen batches of raw material. Conceptual replication draws a fresh sample of levels from the population; some sampled levels may overlap with the original study.
Note what does not decide the matter. The number of levels does not: a factor with two levels can be random, and one with fifty can be fixed.
Randomly assigning units to treatments does not either; that is randomisation of the experimental units, which is about protecting against bias, not about how the treatment levels were selected.
Two models, two parameters of interest
Both write an observation as an overall mean plus a factor contribution plus error, yij=μ+τi+εij, with εij∼N(0,σ2). The difference is what τi is.
Fixed factor | Random factor | |
|---|---|---|
Meaning of τi | Unknown constants, one per level, with ∑iτi=0 | Random draws, τi∼N(0,σA2) |
What is estimated | The individual level means and their differences | The variance component σA2 |
Null hypothesis | τ1=⋯=τa=0, i.e. all level means equal | σA2=0 |
Model-based conclusions | Concern the levels actually studied | Describe the population the levels were drawn from |
Follow-up analysis | Contrasts and pairwise comparisons between levels | Variance components; ranking individual levels is usually beside the point |
Expected mean squares
For a balanced one-way design with a levels and n observations per level:
The displayed expected-mean-square formulas assume balance. In an unbalanced one-way design, both specifications still use the conventional MS_A/MS_E statistic under the null, although the alternative expected-mean-square expression is more complicated. With additional factors, random effects can change the appropriate denominator.
Reading a variance component
When the factor is random, the natural summary is how much of the total variation it accounts for, the intraclass correlation:
Worked example. A quality programme models production batch as a random factor and reports σ^batch2=12.0 and σ^2=4.0 (in squared units of the measurement). Then
so three-quarters of the total variance is between batches and one-quarter is within them. This high between-batch fraction motivates investigating how batch variation arises.
The fraction alone does not show which intervention would reduce total variation most or whether it is feasible and cost-effective.
Choosing an intervention also requires evidence about causes, expected effects, feasibility and cost; reducing within-batch variation could be the better action. Under the model, the estimate applies to the represented population of future batches, not only the ones measured.
Choosing, in practice
Ask what you would report. If the deliverable is "formulation B beat formulation A by 3.2 units", the factor is fixed. If it is "laboratories differ enough that a single measurement carries this much extra uncertainty", it is random.
Where a factor is arguably either, the honest course is to state the choice and its consequence for scope rather than to let the software decide.
One caution about scope. Modelling a factor as random licenses inference to a population only to the extent the levels really were sampled from it.
Eight laboratories chosen for convenience can be analysed with a random-effects model, but the resulting interval describes uncertainty under the assumed sampling scheme; it does not turn a convenience sample into a representative one.
To assess measurement consistency, investigators select 8 laboratories at random from a national registry of several hundred accredited laboratories. Each selected laboratory analyses aliquots of the same reference material. Laboratory is modelled as a random factor.
Which null hypothesis does the resulting F test address?
A multicentre study models clinic as a random factor, having enrolled patients at clinics sampled from a national list. The fitted model reports the variance-component estimates σ^clinic2=4.5 and σ^within2=13.5, both in squared units of the outcome.
What proportion of the total variance in the outcome lies between clinics? Give your answer as a decimal to two places.