Tutorials › Generalized Linear Mixed Models (GLMM) › Testing Multiple Random Effects in One Block

Testing Fixed and Random Effects · Tutorial 393 of 698

Testing Multiple Random Effects in One Block

Learn to compare GLMMs that jointly add random-effect terms and choose a defensible boundary-aware test for the block.

Advanced 12 min read

What You'll Learn

  • Define the joint null hypothesis for adding multiple random-effect terms.
  • Construct a likelihood-ratio statistic using comparable fitted models.
  • Derive the chi-bar-square mixture for orthogonal independent variance components.
  • Distinguish orthant-mixture cases from tests involving correlated covariance blocks.
  • Use a parametric bootstrap when simple mixture weights are not justified.
  • Interpret a block test without claiming which individual component is responsible.

Why Test a Block of Random Effects?

A GLMM may include several random-effect terms to represent distinct sources of variation. The scientific question may be whether a whole prespecified set of terms is needed, rather than whether each term should be assessed one at a time. A block test addresses that joint question: its null states that every variance component in the block is zero. Because zero is on the boundary of the allowable variance-parameter space, the usual likelihood-ratio reference distribution is generally not appropriate.

The key is to match the test to the geometry of the null. A particularly simple mixture distribution applies when the block consists of independent variance components with locally orthogonal information. More general covariance structures can have different boundary geometry and unidentified parameters under the null; there, a standard mixture formula should not be assumed. The block hypothesis, model comparison, and calibration method should all be specified together.

Model and Joint Hypothesis

Let \(Y_i\) denote the response data for observational unit or cluster \(i\), and let \(b_i\) collect the random effects. A GLMM specifies a conditional response distribution given the random effects and covariates, together with a linear predictor such as \(\eta_i=X_i\beta+Z_i b_i\). The marginal likelihood used for model comparison integrates over the random effects. Suppose a candidate block has \(q\) independent random-effect terms, with variance parameters \(\tau_1,\ldots,\tau_q\), each constrained to be nonnegative.

Definition: A block test of random effects compares a reduced GLMM, in which all terms in a prespecified random-effect block are absent, with a full GLMM containing the entire block. For independent variance components the joint null is \(H_0:\tau_1=\cdots=\tau_q=0\), against the alternative that at least one \(\tau_j>0\). The alternative is a union of possibilities; rejecting the block null does not identify which component is nonzero.

The fixed-effects structure, response data, and likelihood convention must be the same in both models. Otherwise the comparison may attribute a likelihood improvement to changes other than the random-effect block. For a standard marginal-likelihood GLMM comparison, fit both models by maximum likelihood. The random-effect distributions and conditional response model must also be correctly specified for the likelihood-based calibration to have its intended interpretation. The component variances must be identifiable under the alternative, and the asymptotic mixture results require enough information for likelihood-based large-sample approximations to be reasonable.

Write \(\ell_F\) and \(\ell_R\) for the maximized log likelihoods of the full and reduced models. The likelihood-ratio statistic is

$$ D=2(\ell_F-\ell_R). $$

The full model includes the reduced model as the special case where the added variances are zero, so its maximized likelihood cannot be smaller; ordinarily \(D\geq 0\), apart from numerical error. Under regular interior-point null hypotheses, \(D\) is often compared with a chi-square distribution whose degrees of freedom equal the number of added parameters. Here that rule fails: under \(H_0\), the variances sit at a boundary, and standard regularity conditions for that reference distribution do not hold.

When the Orthant Mixture Applies

A useful case is a block of \(q\) independent variance components, with no estimated covariances among them. In addition to the general likelihood assumptions above, the simple formula below requires the local information for their variance parameters to be orthogonal (or a setting in which the relevant local problem has the orthant geometry and equal mixture weights). Nuisance parameters must be estimable under the null, and the number of independent clusters or other information units must support the asymptotic approximation. These conditions are substantive; merely counting \(q\) terms does not establish them.

The boundary-aware reference distribution is then a chi-bar-square mixture:

$$ D \ \overset{approx}{\sim}\ \sum_{k=0}^{q} w_k\chi_k^2, \qquad w_k=\frac{\binom{q}{k}}{2^q}. $$

Here \(\chi_k^2\) denotes a chi-square distribution with \(k\) degrees of freedom, and \(\chi_0^2\) is a point mass at zero. The mixture weights sum to one. They are not the same as choosing a single chi-square distribution with \(q\) degrees of freedom.

A short local argument explains the weights. After standardization under the null, suppose the \(q\) score coordinates for the variance components are independent standard normal variables \(Z_1,\ldots,Z_q\). The local alternative allows each coordinate to move only in its nonnegative direction. Maximizing the local quadratic likelihood in coordinate \(j\) retains \(Z_j\) when it is positive and contributes \(Z_j^2\); when it is negative, the constrained maximum occurs at zero and contributes nothing. Thus the limiting statistic has the form \(\sum_{j=1}^q \max(Z_j,0)^2\). Each \(Z_j\) is positive with probability \(1/2\), independently, so the number \(K\) of positive coordinates has \(P(K=k)=\binom{q}{k}/2^q\). Conditional on \(K=k\), the sum of the retained squared standardized coordinates has the \(\chi_k^2\) reference distribution. This yields the stated mixture, including the point mass when \(K=0\).

Worked Example: Testing Two Independent Variance Components

Suppose a hypothetical GLMM adds two independent random intercepts, one for clinic and one for clinician, to a reduced model. The covariance between these terms is fixed at zero. Assume the model is correctly specified, the two variance parameters are identifiable under the alternative, and the design supports the orthogonal-information approximation. The fixed-effects structure is unchanged. The reduced and full maximized log likelihoods are \(\ell_R=-514.7\) and \(\ell_F=-512.6\), respectively.

The observed likelihood-ratio statistic is

$$ D=2\{\ell_F-\ell_R\} =2\{-512.6-(-514.7)\} =2(2.1)=4.20. $$

For \(q=2\), the mixture weights are \(1/4,1/2,1/4\) on \(\chi_0^2,\chi_1^2,\chi_2^2\). Since the observed statistic is positive, the point mass at zero contributes no upper-tail probability. Therefore

$$ p =\frac14P(\chi_0^2\geq4.20) +\frac12P(\chi_1^2\geq4.20) +\frac14P(\chi_2^2\geq4.20) \approx 0+\frac12(0.0404)+\frac14(0.1225) =0.0508. $$

At significance level \(\alpha=0.05\), this is just above the threshold, so the block null is not rejected at the 5% level. This is not evidence that both variances are zero; it means the test does not provide sufficient evidence against their joint zero hypothesis at this threshold. A conventional \(\chi_2^2\) reference would give an upper-tail probability of about \(0.1225\), a different conclusion about the strength of evidence. The boundary-aware reference is justified here by the stated independent, orthogonal setup, not simply because two terms were added.

Worked Example: A Three-Component Orthogonal Block

Consider a hypothetical block of three independent random-intercept variance components, for example for sites, practitioners, and devices. Assume the fixed effects are unchanged, the variance parameters satisfy the orthant and orthogonality conditions, and the likelihood fits are numerically stable. Suppose \(\ell_R=-820.0\) and \(\ell_F=-817.5\). Then

$$ D=2\{-817.5-(-820.0)\}=2(2.5)=5.00. $$

For \(q=3\), the weights on \(\chi_0^2,\chi_1^2,\chi_2^2,\chi_3^2\) are \(1/8,3/8,3/8,1/8\). Using upper-tail probabilities at \(5.00\), approximately \(0\), \(0.0253\), \(0.0821\), and \(0.1718\), respectively, gives

$$ p =\frac18(0)+\frac38(0.0253)+\frac38(0.0821)+\frac18(0.1718) \approx 0.0618. $$

At \(\alpha=0.05\), the block null is not rejected. The result is a single joint assessment of the three terms. It does not establish that each variance is zero, and it does not say which term would matter most in a different, component-specific analysis.

When Simple Mixture Weights Do Not Apply

A block may instead add a correlated random-effect vector with an unrestricted covariance matrix. Testing that the whole covariance matrix is zero is not just a test of several independent nonnegative variances: the matrix must remain positive semidefinite, and covariance or correlation parameters may be unidentified when all associated variances are zero. The null geometry and nuisance-parameter behavior can change the mixture weights. In particular, the binomial weights above cannot be selected merely by counting the diagonal variances.

For such a block, use a boundary-aware calibration appropriate to the covariance structure. One option is a parametric bootstrap under the reduced model, as covered in the earlier material on parametric bootstrap for random-effect likelihood-ratio tests. Fit the reduced model, simulate responses under it while keeping the observed design fixed, refit both models to each simulated data set, and recompute \(D\). The proportion of simulated statistics at least as large as the observed statistic estimates the null upper-tail probability. For simpler cones, a justified chi-bar-square calculation may be available, but its weights must match the design and covariance restrictions. A generic \(\chi_q^2\) test is not a substitute for either calibration.

Worked Example: Bootstrap Calibration for a Correlated Block

Suppose a hypothetical GLMM adds a correlated random intercept-and-slope covariance block. The null sets the entire block to zero, so the slope-intercept covariance is not separately estimable under that null. Assume the block is prespecified, the fixed-effects structure is identical in both models, and a parametric bootstrap is used because the orthant-mixture conditions have not been established. The observed statistic is \(D_{\mathrm{obs}}=3.60\). In \(B=999\) simulations from the fitted reduced model, the full-versus-reduced statistic is at least \(3.60\) in 73 simulations.

Using the plus-one estimate, the bootstrap p-value is

$$ \hat p_{\mathrm{boot}} =\frac{1+\#\{D_b\geq D_{\mathrm{obs}}\}}{B+1} =\frac{1+73}{999+1} =\frac{74}{1000} =0.0740. $$

At \(\alpha=0.05\), the block null is not rejected. The estimated p-value has Monte Carlo standard error approximately \(\sqrt{0.0740(1-0.0740)/1000}=0.00828\), so its simulation error is not negligible near a decision threshold. More simulations would improve the precision of the estimated tail probability. This calculation is valid as a bootstrap approximation only insofar as the reduced model is an adequate null-generating model and both models can be reliably refitted in the simulated data.

Diagnostics, Alternatives, and Limitations

A boundary-aware formula cannot repair a poorly fitted or weakly identified model. Before interpreting a block test, check that both optimizations converged, the full-model likelihood is not materially below the reduced-model likelihood, and numerical tolerances or different starting values do not produce substantially different results. A singular fit or variance estimates pinned at zero may be expected under the null, but can also signal that the data contain little information to distinguish the proposed components. For bootstrap calibration, failed fits, boundary estimates, or a few extreme simulated statistics can make the estimated tail unstable; report the number of simulations and assess Monte Carlo precision.

The main alternatives answer different questions or rely on different assumptions:

ApproachWhat it assessesMain caution
One block likelihood-ratio test with a justified chi-bar-square referenceWhether the prespecified block improves fit jointlyWeights depend on the boundary geometry and information assumptions
Parametric bootstrap under the reduced modelThe block statistic's null distribution for the specified design and fitted null modelRequires reliable simulation and refitting; has Monte Carlo error
Ordinary chi-square likelihood-ratio testA regular interior-parameter comparisonGenerally miscalibrated when added variances are on a boundary
Separate tests for individual termsComponent-specific hypothesesNot the same joint hypothesis; interpreting several results raises additional selection and multiplicity issues

A block test is useful when the scientific question concerns the contribution of the random-effect structure as a whole, or when a joint test is prespecified before examining the data. Its limitations are equally important: rejection does not identify the responsible component, while nonrejection does not demonstrate that every component is negligible. A test can also have low power when the number of independent clusters is small or when variance components are weakly identified; finite-sample calibration is a separate concern, not something the asymptotic mixture automatically resolves.

Common Mistake

Common mistake: “Three random-effect terms were added, so the likelihood-ratio statistic has a \(\chi_3^2\) distribution.” The number of terms alone does not justify this reference distribution. Added variance parameters are constrained to be nonnegative and are tested at zero, a boundary point. First determine whether the block has the orthant geometry and orthogonal-information conditions for the binomial chi-bar-square weights. If the block has correlated covariance parameters or other nonstandard geometry, use a justified alternative calibration, such as a parametric bootstrap.
1
Specify the block and null.
State exactly which random-effect terms are added together and what setting all of them to zero means.
2
Fit comparable models.
Keep the fixed-effects structure, data, and likelihood convention the same; verify that the full model contains the reduced model.
3
Choose the null reference.
Use the orthant mixture only when its assumptions hold; otherwise identify a suitable boundary-aware calibration.
4
Report the joint result.
Give the statistic, reference distribution or bootstrap method, p-value, and a conclusion about the block—not an unsupported claim about individual terms.

Check Your Understanding

Answer each question, then compare with the brief solutions.

  1. Why is the usual regular \(\chi_q^2\) reference generally inappropriate for testing \(q\) added variance components at zero?
  2. Under the orthogonal independent-component conditions, what are the mixture weights for a block of two variance components?
  3. A test of a prespecified block gives \(p=0.032\) at \(\alpha=0.05\). What can be concluded, and what cannot be concluded?
  4. Why might a correlated random intercept-and-slope block require bootstrap calibration rather than the binomial mixture formula?

Solutions. (1) Each added variance is constrained to be nonnegative and its null value is on the parameter-space boundary, so the regular interior-point chi-square result does not apply. (2) The weights on \(\chi_0^2,\chi_1^2,\chi_2^2\) are \(1/4,1/2,1/4\). (3) Reject the joint zero-block null at the 5% level; this does not identify which component is nonzero or prove a particular component is individually important. (4) The covariance matrix has positive-semidefinite constraints, and covariance or correlation parameters may be unidentified under the zero-block null, changing the boundary geometry and mixture weights.

Clinical Biostats