Tutorials › Generalized Linear Mixed Models (GLMM) › New-Group Prediction Under a Gaussian Random-Effects Model

Prediction of Random Effects · Tutorial 469 of 698

New-Group Prediction Under a Gaussian Random-Effects Model

Learn why a new group’s random intercept is predicted from the population distribution, and how to calculate its predictive mean and variance with or without parameter uncertainty.

Advanced 11 min read

What You'll Learn

  • State the Gaussian random-intercept model and its assumptions for a new group.
  • Derive the new group’s predictive mean and variance when model parameters are fixed.
  • Calculate prediction intervals and probabilities for a new group’s random intercept.
  • Distinguish a new-group prediction from an observed group’s data-updated posterior prediction.
  • Explain how uncertainty about the variance component changes the predictive distribution.
  • Identify assumptions and diagnostics relevant to new-group prediction.

Why a New Group Is Different

A prediction for a group already represented in the data can use that group’s outcomes. A prediction for a genuinely new group cannot: there is no group-specific evidence to update its random effect. Under a Gaussian random-intercept model, the new group’s prediction therefore comes from the model’s population distribution for random intercepts. Its mean is zero, but that does not mean the group is known to have exactly zero deviation.

The distinction matters when reporting group-specific predictions. Setting a new group’s random intercept to its predictive mean gives a useful point prediction, but it suppresses the variation expected among groups. For an interval or a probability about the group’s deviation, the predictive variance is essential.

Model and Assumptions

Suppose a continuous response \(Y_{ij}\) is measured for observation \(i\) in group \(j\). A Gaussian random-intercept model is

$$ Y_{ij} = \mathbf{x}_{ij}^{\mathsf T}\boldsymbol{\beta} + b_j + \varepsilon_{ij}. $$

Here \(\mathbf{x}_{ij}^{\mathsf T}\boldsymbol{\beta}\) is the fixed-effects mean, \(b_j\) is the group-specific random intercept, and \(\varepsilon_{ij}\) is the observation-level error. The assumptions relevant to the calculation are

$$ b_j \sim N(0,\tau^2), \qquad \varepsilon_{ij} \sim N(0,\sigma^2), $$

with random intercepts independent across groups, errors independent across observations, and all random intercepts independent of all errors. The fixed-effects structure and the zero-centered random-effects distribution are assumed to be correctly specified. The new group is assumed to come from the same group-generating population as the groups used to fit the model.

Definition: A new-group predictive distribution for \(b_{\mathrm{new}}\), conditional on fixed model parameters, describes the random intercept of a group with no group-specific response data. Under the Gaussian random-intercept model, \(b_{\mathrm{new}}\sim N(0,\tau^2)\), so its predictive mean is \(0\) and its predictive variance is \(\tau^2\).

The conditioning is important. This distribution is conditional on the fixed-effects parameters and the variance components being treated as known. In practice, those quantities are estimated, so a plug-in calculation uses their estimates and does not automatically include parameter-estimation uncertainty.

Why the Predictive Mean and Variance Have These Values

Let \(D\) denote the observed data from the groups used to fit the model. Conditional on the model parameters, the random intercept for a new group is independent of \(D\): the observed groups’ random intercepts and errors do not provide a group-specific observation of \(b_{\mathrm{new}}\). Thus the conditional distribution for the new group is still its model distribution.

The result follows directly from the assumed normal distribution. A normal random variable \(N(\mu,v)\) has mean \(\mu\) and variance \(v\); substituting \(\mu=0\) and \(v=\tau^2\) gives the new-group mean and variance. Equivalently, for any fixed parameters,

$$ E(b_{\mathrm{new}}\mid D,\boldsymbol{\beta},\tau^2,\sigma^2)=0, \qquad \operatorname{Var}(b_{\mathrm{new}}\mid D,\boldsymbol{\beta},\tau^2,\sigma^2)=\tau^2. $$

Notice that \(\sigma^2\) does not appear in the variance of the random intercept. It describes observation-level noise, not variation in the group intercepts. If the target were a future response rather than the random intercept itself, observation-level error would also contribute to predictive variance.

Worked Example: A New Group With a Known Random-Intercept Variance

Suppose a hypothetical Gaussian random-intercept model has \(\tau^2=25\) square points. Calculate the predictive mean, standard deviation, and central 95% predictive interval for the random intercept of a new group.

The new-group distribution is \(b_{\mathrm{new}}\sim N(0,25)\). Its mean is \(0\) points, and its standard deviation is

$$ \sqrt{\tau^2}=\sqrt{25}=5\text{ points}. $$

For a normal distribution, a central 95% interval is approximately the mean plus or minus \(1.96\) standard deviations:

$$ 0\pm 1.96(5)=0\pm 9.8, \qquad (-9.8,\ 9.8)\text{ points}. $$

Under the assumed model and fixed variance, this is a central 95% predictive interval for a randomly drawn new group’s intercept. It does not say that the group’s intercept is exactly zero; zero is the prediction that minimizes squared-error loss, while the interval represents the model’s spread of possible intercepts.

Using Estimated Variance Components

In an applied analysis, \(\tau^2\) is usually estimated from the observed groups. A simple plug-in predictive distribution replaces it with the fitted variance \(\hat{\tau}^2\):

$$ b_{\mathrm{new}}\ \dot{\sim}\ N(0,\hat{\tau}^2). $$

The dotted notation emphasizes that this is a plug-in approximation: it treats the estimated variance as if it were the true variance. Its predictive mean remains zero because the fitted random-effects distribution is centered at zero. Its predictive variance is \(\hat{\tau}^2\), not \(\hat{\tau}\); the latter is the estimated standard deviation.

Worked Example: Plug-In Prediction and a Tail Probability

Suppose a hypothetical fitted model estimates the random-intercept variance as \(\hat{\tau}^2=16\) square points. Using the plug-in distribution, calculate the probability that a new group’s intercept exceeds 6 points.

The estimated standard deviation is \(\sqrt{16}=4\) points, so the plug-in distribution is \(N(0,16)\). Standardizing the threshold gives

$$ P(b_{\mathrm{new}}>6) \approx P\left(Z>\frac{6-0}{4}\right) = P(Z>1.5) = 1-\Phi(1.5) \approx 0.0668, $$

where \(Z\sim N(0,1)\) and \(\Phi\) is its cumulative distribution function. The fitted model therefore assigns about a 6.68% probability to a randomly drawn new group having an intercept greater than 6 points, conditional on the plug-in variance estimate and the Gaussian random-effects assumption.

Contrast With an Observed Group

For an observed group, outcomes supply information about its random intercept. The earlier material on predicting a random effect for a new group motivates this distinction: a prediction for an observed group is data-updated, whereas a new group has no group-specific data to update its intercept. A short normal-normal calculation makes the contrast explicit.

Suppose the fixed-effects contribution has been removed from each response in an observed group, leaving residuals \(R_{ij}=Y_{ij}-\mathbf{x}_{ij}^{\mathsf T}\boldsymbol{\beta}\). For a group with \(n_j\) observations, their mean satisfies

$$ \bar{R}_j\mid b_j \sim N\left(b_j,\frac{\sigma^2}{n_j}\right), \qquad b_j\sim N(0,\tau^2). $$

The likelihood for \(b_j\), as a function of \(b_j\), is proportional to \(\exp\{-n_j(\bar{R}_j-b_j)^2/(2\sigma^2)\}\). Multiplying by the prior density, proportional to \(\exp\{-b_j^2/(2\tau^2)\}\), gives a posterior kernel whose quadratic terms in \(b_j\) are

$$ -\frac{1}{2} \left[ \left(\frac{n_j}{\sigma^2}+\frac{1}{\tau^2}\right)b_j^2 -2\frac{n_j\bar{R}_j}{\sigma^2}b_j \right]. $$

Completing the square shows that the posterior variance is the reciprocal of the coefficient of \(b_j^2\), and its mean is that variance times the coefficient multiplying \(b_j\):

$$ \operatorname{Var}(b_j\mid \bar{R}_j) = \left(\frac{1}{\tau^2}+\frac{n_j}{\sigma^2}\right)^{-1}, \qquad E(b_j\mid \bar{R}_j) = \frac{\tau^2}{\tau^2+\sigma^2/n_j}\bar{R}_j. $$

The observed group’s posterior mean is generally not zero: it uses that group’s residual mean and shrinks it toward zero. In contrast, the new group’s predictive mean is zero because no group-specific residual mean is available. The observed group’s posterior variance also depends on its sample size and on \(\sigma^2\); the new group’s random-intercept variance, conditional on parameters, is simply \(\tau^2\).

Worked Example: Observed-Group Posterior Versus New-Group Prediction

Consider hypothetical values \(\tau^2=9\) square points and \(\sigma^2=36\) square points. An observed group has \(n_j=4\) responses and a residual mean \(\bar{R}_j=6\) points. Compare its posterior prediction with the prediction for a new group.

For the observed group, \(\sigma^2/n_j=36/4=9\) square points. Its posterior mean is

$$ \frac{9}{9+9}(6)=\frac{1}{2}(6)=3\text{ points}. $$

Its posterior variance and standard deviation are

$$ \left(\frac{1}{9}+\frac{1}{9}\right)^{-1}=4.5 \text{ square points}, \qquad \sqrt{4.5}\approx 2.121\text{ points}. $$

For a new group, there is no residual mean to use. Its predictive mean is \(0\) points and its predictive variance is \(9\) square points, giving a standard deviation of \(3\) points. The observed group’s posterior mean is pulled toward zero from its residual mean of 6, and its uncertainty is smaller than the new-group uncertainty in this example because it has group-specific data. The two distributions answer different questions and should not be interchanged.

Parameter Uncertainty and Predictive Variance

A plug-in distribution leaves out uncertainty about the fitted variance component. If uncertainty about \(\tau^2\) is represented by a posterior distribution given \(D\), then the predictive distribution averages normal distributions over that uncertainty:

$$ p(b_{\mathrm{new}}\mid D) = \int N(b_{\mathrm{new}}\mid 0,\tau^2)\, p(\tau^2\mid D)\,d\tau^2. $$

When every conditional distribution is centered at zero, the integrated predictive mean remains zero. The law of total variance gives

$$ \operatorname{Var}(b_{\mathrm{new}}\mid D) = E\{\operatorname{Var}(b_{\mathrm{new}}\mid \tau^2,D)\mid D\} + \operatorname{Var}\{E(b_{\mathrm{new}}\mid \tau^2,D)\mid D\} = E(\tau^2\mid D). $$

The second term is zero because the conditional mean is zero for every value of \(\tau^2\). The resulting predictive distribution is generally a mixture of normal distributions, not necessarily a single normal distribution with variance \(E(\tau^2\mid D)\). That variance summarizes its spread, but a normal interval based on it need not have exactly the desired predictive coverage.

Worked Example: Averaging Over Variance-Component Uncertainty

For illustration, suppose a hypothetical posterior approximation assigns probabilities \(0.25\), \(0.50\), and \(0.25\) to \(\tau^2=4\), \(9\), and \(16\) square points, respectively. Calculate the predictive mean and variance of a new group’s intercept.

Each conditional normal distribution has mean zero, so the mixture mean is also zero. Its predictive variance is the posterior-weighted average of the conditional variances:

$$ E(\tau^2\mid D) = 0.25(4)+0.50(9)+0.25(16) = 1+4.5+4 = 9.5\text{ square points}. $$

The predictive standard deviation is \(\sqrt{9.5}\approx 3.082\) points. The exact predictive distribution is a mixture of three centered normal distributions with different variances, not \(N(0,9.5)\). Replacing that mixture by \(N(0,9.5)\) may be a convenient approximation, but it does not preserve every tail probability or quantile exactly.

Assumptions, Diagnostics, and Limitations

A new-group prediction is meaningful only if the new group is comparable to the population of groups represented in the model. In particular, the random intercepts are assumed to be exchangeable draws from a common zero-centered distribution. If groups enter the prediction set selectively, or if the new group comes from a different population, the assumed distribution may not describe it.

Diagnostics use the observed groups as evidence about the model’s assumptions. Residual plots can reveal patterns inconsistent with constant Gaussian observation-level variance, and distributions of fitted group effects can flag substantial departures from a Gaussian random-effects model. Such checks have limited power when there are few groups, and fitted effects are themselves data-updated rather than direct observations of the random intercepts. They cannot establish that a particular unseen group follows the model.

A fitted variance near zero deserves careful interpretation. A plug-in calculation with \(\hat{\tau}^2=0\) gives a degenerate new-group distribution at zero. That is the consequence of using the fitted variance as fixed; it does not by itself prove that the true population variation is exactly zero. Uncertainty about the variance component, the data, and the model should be considered separately.

The comparison with observed-group prediction also clarifies what the calculation does not provide. It does not use new-group outcomes to update \(b_{\mathrm{new}}\), and it does not include uncertainty in fixed-effect estimates when predicting a response. If the target is a future response for an individual in the new group, both the group intercept and observation-level error contribute to prediction. For one future observation with fixed covariates and parameters known, that conditional predictive variance is \(\tau^2+\sigma^2\), rather than \(\tau^2\).

Common Mistakes

  • Treating the new-group mean as a known intercept. The mean of zero is the best point prediction under squared-error loss, not a claim that every group has zero deviation. Use \(\tau^2\) to describe the spread.
  • Using the observed-group posterior formula without group data. That formula uses a group-specific residual mean. A genuinely new group has none, so its conditional prediction comes from the population random-effects distribution.
  • Adding \(\sigma^2\) to the variance of the random intercept. Observation-level error is not part of \(b_{\mathrm{new}}\). Add it only when the prediction target includes a future noisy response.
  • Calling a plug-in interval fully uncertainty-adjusted. An interval computed using \(\hat{\tau}^2\) treats the fitted variance as fixed. It does not automatically account for uncertainty in estimating that variance.
Key takeaway: With model parameters fixed, a new group’s Gaussian random intercept has predictive distribution \(N(0,\tau^2)\): predictive mean \(0\), predictive variance \(\tau^2\). An observed group’s prediction is different because its data update its random intercept.

Check Your Understanding

Answer each question, then compare with the solutions below.

  1. If \(\tau^2=25\) square points, what are the predictive standard deviation and approximate central 95% predictive interval for a new group’s intercept?
  2. If the plug-in distribution is \(N(0,16)\), what is the approximate probability that a new group’s intercept exceeds 6 points?
  3. For an observed group with \(\tau^2=9\), \(\sigma^2=36\), \(n_j=4\), and \(\bar{R}_j=6\), calculate its posterior mean and variance. How do these compare with a new group’s predictive mean and variance?
  4. Suppose the posterior distribution of \(\tau^2\) assigns probabilities \(0.25\), \(0.50\), and \(0.25\) to values \(4\), \(9\), and \(16\). What are the predictive mean and variance of \(b_{\mathrm{new}}\), and is the predictive distribution necessarily normal?

Solutions. (1) The standard deviation is \(\sqrt{25}=5\) points. The interval is \(0\pm1.96(5)=(-9.8,9.8)\) points. (2) Standardize to obtain \(P(Z>6/4)=P(Z>1.5)\approx0.0668\). (3) The observed-group posterior mean is \(\{9/(9+36/4)\}(6)=3\) points and its posterior variance is \((1/9+1/9)^{-1}=4.5\) square points. The new-group mean and variance are \(0\) points and \(9\) square points. (4) The mean is zero and the variance is \(0.25(4)+0.50(9)+0.25(16)=9.5\) square points. The predictive distribution is a mixture of normal distributions and is not necessarily normal.

Clinical Biostats