MerQuR+Statistics Glossary

Statistics Glossary → Random slope

Random slopeconcept

A random effect in mixed models that lets the effect (slope) of a predictor on the outcome vary from group to group.

A random-intercept model allows groups to differ in their average level but assumes that the predictor has the same effect in every group. Adding a random slope, written (1 + x | group), gives each group its own slope; the model estimates the average slope (the fixed effect), the between-group variance of the slopes and the covariance between intercepts and slopes.

If the effect really varies between groups, leaving out the random slope can understate the standard error of that predictor's fixed effect. On the other hand, estimating random slopes reliably requires enough groups and enough variation in the predictor within each group; otherwise the model may fail to converge or the variance may be estimated as zero (a singular fit). Whether a random slope is needed can be assessed with a likelihood-ratio test or information criteria.

An everyday example

In 20 schools, the relationship between pupils' study time and maths score is examined. In some schools each extra hour of study adds 5 points, in others only 1 point. The random-slope model estimates the average effect at 3 points and the between-school standard deviation of the slope at 1.2 points.

In MerQur

'Random slope (optional) and Additional random slopes' in Linear Mixed Models builds the (1 + x | g) structure; in Hierarchical Bayesian Regression, 'Random slopes (optional)' are estimated with a free intercept-slope covariance.

Analyses where this concept appears

Linear Mixed Models (LMM)Hierarchical Bayesian Regression

Related concepts

Fixed and random effectsCovariance (correlation) structure (UN, VC, AR(1), exchangeable)