Why Random-Slope Scales Need Their Own Calibration
A random-intercept scale describes how much groups differ in their baseline linear predictors. A random-slope scale instead describes how much the effect of a predictor varies across groups. The two scales answer different scientific questions: a small baseline difference does not imply that predictor effects are similar across groups, and vice versa. A prior for the random-slope scale should therefore be calibrated from plausible between-group variation in effects, in the units of the predictor actually used in the model.
This distinction is especially important in a generalized linear mixed model (GLMM). A slope is measured on the model’s linear-predictor scale, not generally in outcome units. For a logistic model, for example, it is measured in log odds per predictor unit. A scale that looks numerically small can still imply substantial variation in odds ratios, particularly over a wide predictor range.
Model, Parameter, and Scale
For group \(j\) and observation \(i\), write a random-slope GLMM as
Here \(g\) is the link function, \(x_{ij}\) is the predictor in its chosen units, \(\beta_1\) is the population-average slope on the linear-predictor scale, and \(b_{1j}\) is group \(j\)'s deviation from that slope. The marginal distribution for the random-slope deviation is
The quantity \(\tau_1\) is the random-slope standard deviation. It measures the spread of group-specific slopes around \(\beta_1\); it is not itself a slope deviation and it is not a variance. In this model, the slope for group \(j\) is \(\beta_1+b_{1j}\). The scale \(\tau_1\) has units of linear-predictor units per unit of \(x\). For a logistic link, those are log-odds units per unit of \(x\).
The usual calibration assumes that the groups can reasonably be treated as exchangeable draws from a common population and that their random-slope deviations have mean zero with a common standard deviation. The Gaussian distribution for \(b_{1j}\) is a modeling assumption, not a consequence of choosing a prior for \(\tau_1\). A prior on \(\tau_1\) does not by itself specify the joint dependence between random intercepts and slopes; here the target is the marginal slope scale.
Before assigning a prior, make the predictor’s origin and units meaningful. Centering changes the interpretation of the intercept and can affect how intercept-slope dependence is represented, although it does not change the slope units. Rescaling changes the slope units and therefore requires a corresponding change to the prior. A prior calibrated per one day cannot simply be reused for a predictor measured per week.
Calibrating a Half-Normal Prior
One direct approach is to specify a half-normal prior, \(\tau_1\sim |N(0,s^2)|\), and choose \(s\) from a statement about plausible values of the scale. The half-normal is nonnegative and has a single scale parameter. It is useful to turn a scientific statement about an upper quantile into that parameter rather than choosing \(s\) by numerical convention.
If \(Z\sim N(0,1)\), then a half-normal variable with scale \(s\) has the same distribution as \(s|Z|\). Thus, for a chosen probability \(r\),
where \(z_q\) is the \(q\)-quantile of the standard normal distribution. This is a calibration of the prior on the scale \(\tau_1\). Conditional on a particular \(\tau_1\), an individual group’s slope deviation \(b_{1j}\) has a different distribution. Keeping those two levels distinct prevents a common overstatement of what a prior quantile means.
Worked Example: A Half-Normal Scale for a Logistic Slope
Suppose \(x\) is centered and measured in 10-hour increments, and the link is the logit. Subject-matter judgment suggests that values of the random-slope scale above \(0.40\) log-odds units per 10-hour increment should be unusual. Use a half-normal prior with 95% of its mass below \(0.40\).
For \(r=0.95\), \(z_{(1+r)/2}=z_{0.975}\approx1.96\). The calibration equation gives
So the specified prior is \(\tau_1\sim |N(0,0.2041^2)|\), with \(\tau_1\) measured in log-odds units per 10-hour increment. By construction, \(P(\tau_1\leq0.40)=0.95\). It does not say that 95% of group slope deviations lie between \(-0.40\) and \(0.40\); that would concern \(b_{1j}\), conditional on \(\tau_1\), rather than the prior distribution of \(\tau_1\).
To interpret a plausible scale value, suppose \(\tau_1=0.20\). For a change of two \(x\)-units (20 hours), the standard deviation of the group-specific change in log odds is \(2(0.20)=0.40\). A one-standard-deviation increase in that change corresponds to an odds multiplier of \(\exp(0.40)=1.492\), relative to the change associated with the population slope. This interpretation is conditional on \(\tau_1=0.20\); the prior allows other scale values as well.
Calibrating an Exponential Prior From a Tail Statement
An alternative is an exponential prior on the nonnegative scale, with rate \(\lambda>0\). Its survival probability is \(P(\tau_1>U)=\exp(-\lambda U)\). Therefore, if a chosen upper bound \(U\) should be exceeded with prior probability \(q\), solve the survival equation for the rate:
The rate has reciprocal units to \(\tau_1\). This prior has positive density at zero and decreases exponentially as the scale grows. The tail statement makes the calibration transparent, but the exponential prior and the half-normal prior have different shapes; matching one tail probability does not make the priors equivalent.
Worked Example: An Exponential Tail Calibration
For a logistic random slope measured in log-odds units per 10-hour increment, suppose a scale above \(U=0.30\) should have prior probability \(q=0.05\). Under an exponential prior, the required rate is
Thus \(\tau_1\sim\text{Exponential}(9.986)\) has \(P(\tau_1>0.30)=\exp(-9.986\times0.30)\approx0.0500\). Its median is \(\log(2)/9.986=0.0694\) in the same slope-scale units. That median is much smaller than \(0.30\), as expected when only 5% of prior mass lies above \(0.30\). The calibration is appropriate only if both the upper-tail judgment and the resulting concentration near smaller scales are scientifically reasonable.
Predictor Units Must Travel With the Prior
Let \(x^*=c x\), where \(c>0\). To leave the linear predictor unchanged, the associated slope coefficient and random slope must satisfy \(\beta_1^*=\beta_1/c\) and \(b_{1j}^*=b_{1j}/c\). Consequently, \(\tau_1^*=\tau_1/c\). If the original prior is half-normal with scale \(s\), its equivalent prior after this rescaling is half-normal with scale \(s/c\). This is a change of parameter units, not a change in prior beliefs about the underlying fitted relationships.
Worked Example: Converting a Slope Prior From Days to Weeks
Suppose a continuous predictor is measured in days and a half-normal prior has scale \(s_{\text{day}}=0.08\) log-odds units per day. Now represent the same predictor in weeks: \(x_{\text{week}}=x_{\text{day}}/7\). Since \(x_{\text{day}}=7x_{\text{week}}\), equality of the linear predictors requires
The equivalent half-normal scale is therefore \(s_{\text{week}}=7(0.08)=0.56\) log-odds units per week. Conversely, retaining a scale of \(0.08\) after switching to weeks would imply a much tighter prior on the effect over a seven-day interval. The arithmetic follows directly from the change of units; the prior must be changed with them to preserve the same prior belief.
Prior Predictive Checks and Failure Modes
A plausible value of \(\tau_1\) should be translated into variation in predicted effects over the range of \(x\) that matters. Conditional on a given scale, the random part of the linear predictor contributed by the slope at predictor value \(x\) is \(b_{1j}x\), whose standard deviation is \(|x|\tau_1\). More generally, across a change \(\Delta x\), the group-specific difference in linear predictor due to the random slope is \(b_{1j}\Delta x\), with conditional standard deviation \(|\Delta x|\tau_1\). On a nonlinear response scale, such as probability under a logit link, the resulting variation depends also on the intercept, fixed effects, and covariate values. It should be checked by simulating plausible parameter values and outcomes from the prior model.
A useful prior predictive check asks whether simulated group-specific slopes and outcome patterns are credible over the observed predictor range. For a logistic model, inspect whether simulated probabilities are routinely driven extremely close to zero or one, or whether group effects imply implausibly large changes in odds. These outcomes are warnings to revisit the prior and model together, not automatic proof that either is wrong.
Check the following before accepting a random-slope prior:
- Units: State explicitly whether the slope is per day, per 10 units, or per standard deviation of the predictor.
- Range: Evaluate the implications over meaningful predictor changes, not only for a one-unit change that may be rare.
- Scale versus deviation: Do not interpret a quantile for \(\tau_1\) as the same quantile for \(b_{1j}\).
- Support and tail: Confirm that the prior is proper, nonnegative, and has a tail compatible with plausible extreme group variation.
- Information in the design: If groups have little predictor variation or few observations, the data may weakly identify slope variation. A prior can then matter substantially, so compare scientifically defensible calibrations.
When slope variation is poorly identified, a very broad prior is not automatically more neutral: it can permit extreme group-specific effects and yield predictions dominated by implausible regions. Conversely, a prior that is too concentrated near zero can suppress meaningful heterogeneity. Sensitivity analysis across reasonable prior scales and prior predictive checking address these risks. They do not repair a design with no within-group information about slopes, and they do not establish that the assumed Gaussian random-slope distribution is correct.
Choosing a Calibration Strategy
The half-normal quantile approach is convenient when investigators can state that a particular upper quantile of the scale should lie below a meaningful bound. The exponential approach is convenient when it is easier to state a tail probability above a bound. Either can be reasonable if the resulting full distribution—not only the calibration statement—has sensible implications. Other scale priors may also be appropriate, but the same core task remains: express the prior in the slope’s units, connect it to plausible group heterogeneity, and inspect the implied predictions.
Do not try to solve an inconvenient scale by changing parameterization without tracking the implied prior. A prior on a variance \(\tau_1^2\) induces a prior on its standard deviation through a transformation; it is not generally the same distribution as a directly chosen prior on \(\tau_1\). For calibration in terms of the standard deviation, specify the prior on \(\tau_1\) explicitly and ensure that the computational model uses the corresponding distribution.
Check Your Understanding
Answer each question, then compare with the brief solutions.
- A half-normal prior should place 95% of its mass below \(0.30\). What is its scale parameter?
- Under a logit link, a random-slope scale is \(0.10\) log-odds units per predictor unit. For a change of three predictor units, what is the conditional standard deviation of the random-slope contribution to the change in linear predictor?
- A predictor is changed from meters to centimeters, so \(x_{\text{cm}}=100x_{\text{m}}\). How must the random-slope scale change to preserve the same linear predictor?
- An exponential prior is chosen so that \(P(\tau_1>0.20)=0.10\). Find its rate.
Solutions. (1) \(s=0.30/1.96=0.1531\). (2) The standard deviation is \(|3|(0.10)=0.30\) log-odds units. (3) Since \(x_{\text{cm}}=100x_{\text{m}}\), the coefficient per centimeter is one hundredth the coefficient per meter, so \(\tau_{1,\text{cm}}=\tau_{1,\text{m}}/100\). (4) \(\lambda=-\log(0.10)/0.20=11.51\) in reciprocal scale units.