Tutorials › Generalized Linear Mixed Models (GLMM) › Refitting After Random-Effects Simplification

Convergence, Singular Fits and Boundary Estimates · Tutorial 314 of 698

Refitting After Random-Effects Simplification

Refit a GLMM after targeted random-effects simplification, and judge what changed in both numerical stability and statistical interpretation.

Advanced 13 min read

What You'll Learn

  • Specify what must remain fixed when comparing refits.
  • Distinguish removing a random slope from constraining a covariance.
  • Compare convergence warnings, gradients, and covariance estimates across fits.
  • Quantify changes in fixed effects and their uncertainty.
  • Recognize when likelihood comparisons are limited by boundary parameters.
  • Report simplification as a modeling decision, not proof that the original structure was unnecessary.

Why Refit After Simplification?

A GLMM can be difficult to estimate when its random-effects structure asks the data to support more variation or covariance parameters than the design can inform reliably. A fit may report a convergence warning, an estimated variance near zero, or a covariance matrix close to singular. Simplifying that structure and refitting can show whether a less complex model is estimable and how the reported results depend on the change.

A refit is informative only if the comparison is controlled. Change one random-effects component at a time while holding the outcome, fixed-effects formula, link, observations, and estimation settings constant. Then record not only whether the optimizer reports convergence, but also what happened to the random-effects estimates and to the fixed effects. A warning disappearing is useful evidence about numerical behavior; it is not, by itself, evidence that the simplified model is scientifically adequate.

Definition: A targeted random-effects simplification changes one specified part of the random-effects structure while keeping the rest of the model and the analysis data fixed. Examples include removing one random slope, or constraining a random-intercept/random-slope correlation to zero while retaining both random effects.

Model and Comparison Conditions

For observations \(Y_{ij}\) in group \(j\), a GLMM specifies a conditional response distribution given group-level random effects \(b_j\). A common form is

$$ g\{E(Y_{ij}\mid b_j)\}=x_{ij}^{\mathsf T}\beta+z_{ij}^{\mathsf T}b_j, \qquad b_j\sim N(0,\Sigma). $$

Here \(g\) is the link function, \(x_{ij}\) and \(z_{ij}\) are the fixed- and random-effects design vectors, \(\beta\) is the fixed-effects coefficient vector, and \(\Sigma\) is the random-effects covariance matrix. The conditional response distribution and the random-effects distribution must be appropriate for the outcome and design. Observations are conditionally independent given the random effects under the specified model, and groups are typically modeled as independent. These assumptions are not made true merely by simplifying the random-effects structure.

A comparison intended to isolate a random-effects change should use the same observations, response distribution, link, fixed-effects terms, and offsets. If any of these also changes, a difference in estimates or fit diagnostics cannot be attributed specifically to the random-effects simplification. For likelihood-based comparisons, use compatible likelihoods and estimation procedures; do not compare likelihood values from different data sets or from fits defined with different fixed-effects structures as though only the random effects had changed.

A Controlled Refitting Procedure

Begin with the fitted structure and the specific problem it exhibits. Choose one component related to that problem, write down the reduced structure explicitly, and refit it. For instance, removing a random slope leaves its random intercept in place; setting an intercept-slope correlation to zero retains both variances but imposes an independence restriction under the Gaussian random-effects distribution. These are different changes and answer different questions.

1
Record the starting fit.
Save the formula, estimation method, convergence code or warning, gradient information if available, covariance estimates, fixed-effect estimates, standard errors, and log likelihood or other fit summary.
2
Make one structural change.
Name the component removed or constrained. Do not simultaneously remove several slopes, alter fixed effects, and change the response distribution.
3
Refit and check the new fit.
Assess convergence and inspect the estimates; a reduced model can still be poorly identified or numerically unstable.
4
Compare estimates and diagnostics.
Report both the numerical behavior and the inferential consequences, with the model change made explicit.

Why a Better-Converged Refit Is Not Automatically Better

If two models are nested and both likelihoods have been maximized successfully using the same observations and fixed-effects structure, the larger model cannot have a lower maximized likelihood than the smaller model. The smaller model is a restricted member of the larger model's parameter space. If \(\Theta_R\) is the restricted parameter space and \(\Theta_F\) the full one, then \(\Theta_R\subseteq\Theta_F\), so

$$ \max_{\theta\in\Theta_F}\ell(\theta)\ \geq\ \max_{\theta\in\Theta_R}\ell(\theta). $$

This gives a useful check, not a guarantee that the larger model is practically estimable. A failed or incomplete optimization may not find the full model's maximum, so its reported likelihood can be lower than the reduced model's. Conversely, a higher likelihood for the more complex model does not by itself justify the extra parameters. If the simplification places a variance on the boundary at zero or removes a covariance parameter under a boundary condition, the usual likelihood-ratio reference distribution may not apply. A naive chi-square test with the usual parameter-count difference can therefore give an unreliable p-value. Interpret likelihood comparisons in light of the boundary and convergence conditions, rather than treating them as automatic tests.

Worked Example: Removing a Weakly Supported Random Slope

Suppose a hypothetical binary-outcome study records eight patients in each of 24 clinics. The model uses a logit link, a treatment indicator as a fixed effect, and clinic-specific random intercepts and treatment slopes. The random-slope variance is estimated near zero, and the optimizer reports a convergence warning. The analyst refits after removing only the random treatment slope; the random intercept, fixed effect, data, and link remain unchanged.

The original fit reports treatment coefficient \(0.42\), standard error \(0.31\), random-slope standard deviation \(0.06\), and log likelihood \(-92.1\). Its scaled maximum-gradient diagnostic is \(0.018\), above the software's stated tolerance of \(0.001\). The refit reports treatment coefficient \(0.35\), standard error \(0.24\), log likelihood \(-92.6\), and maximum gradient \(0.0004\), with no convergence warning.

The absolute coefficient change is \(0.42-0.35=0.07\) log-odds units. Relative to the refitted coefficient, the change is \(0.07/0.35=0.20\), or 20%. That comparison is descriptive, not a universal stability threshold. The reduced fit has a smaller gradient and no warning, while the full fit's slope standard deviation of \(0.06\) suggests little estimated between-clinic slope variation. However, because the full optimization did not meet its stated tolerance, its likelihood and coefficient are not reliable benchmarks for the maximum-likelihood fit.

The reduced-model treatment odds ratio is \(\exp(0.35)=1.42\): under that model, the conditional odds of the outcome are estimated to be 1.42 times as high for treatment as for control, holding the clinic random intercept fixed. This is an association on the model's conditional scale, not a causal conclusion. The example supports reporting the simpler model's improved numerical behavior while clearly noting that the estimated treatment association changed.

Distinguish Removing a Slope From Restricting a Correlation

A random intercept and slope have covariance matrix

$$ \Sigma= \begin{pmatrix} \sigma_0^2 & \rho\sigma_0\sigma_1\\ \rho\sigma_0\sigma_1 & \sigma_1^2 \end{pmatrix}. $$

Removing the slope sets its variance to zero and removes its covariance with the intercept. Constraining the correlation \(\rho\) to zero instead retains both variance components but assumes the random intercept and slope are independent. The latter can be a useful targeted restriction when the correlation estimate is near \(+1\) or \(-1\), but it is not equivalent to removing the slope and is not justified solely by a desire to make an optimizer converge.

Worked Example: Constraining a Near-Boundary Correlation

In a hypothetical log-link model with a random intercept and random time slope for 30 wards, the fitted standard deviations are \(0.50\) and \(0.20\), and the estimated correlation is \(0.98\). The covariance is therefore

$$ \widehat{\operatorname{Cov}}(b_{0j},b_{1j}) =0.98(0.50)(0.20)=0.098. $$

The estimated covariance matrix is

$$ \widehat{\Sigma}= \begin{pmatrix} 0.25 & 0.098\\ 0.098 & 0.04 \end{pmatrix}. $$

Its determinant is \(0.25(0.04)-(0.098)^2=0.0100-0.009604=0.000396\), close to zero. This is consistent with a covariance matrix close to singular. The analyst fits a second model with the same random intercept and slope variances allowed, but with their correlation fixed at zero. Suppose that refit converges with a maximum gradient of \(0.0006\), estimates standard deviations \(0.48\) and \(0.18\), and has log likelihood \(-146.3\), compared with \(-145.8\) for the original reported fit.

The restricted model has a log likelihood lower by \((-145.8)-(-146.3)=0.5\), as expected if the original likelihood was successfully maximized and the models are nested. Its improved gradient is evidence of more satisfactory numerical convergence, not proof that zero correlation is the true structure. Because the original correlation estimate was near a boundary and may itself be unstable, the small likelihood difference should be presented cautiously; an ordinary chi-square likelihood-ratio calibration is not automatically valid in this setting.

Compare the Fixed-Effect Consequences

Random-effects simplification can change fixed-effect estimates and standard errors because the model changes how variation among groups is represented. Compare estimates on their original scale and, when useful, on an interpretable transformed scale. For a logit link, exponentiating a fixed-effect coefficient gives a conditional odds ratio; it does not turn a conditional GLMM coefficient into a population-averaged effect.

Worked Example: Reporting a Fixed-Effect Change

A hypothetical study has 18 clinics and three observations per clinic. A logit GLMM estimates the effect of a one-hour increase in a continuous exposure. With a clinic random intercept and random exposure slope, the estimated coefficient is \(0.31\), with standard error \(0.15\). After removing only the random slope, the coefficient is \(0.28\), with standard error \(0.11\). Assume for this illustration that the reduced fit converged and that a Wald interval is being reported.

For the refitted model, the approximate 95% interval for the log-odds coefficient is

$$ 0.28\pm1.96(0.11) =0.28\pm0.2156 =(0.0644,\ 0.4956). $$

Exponentiating the endpoints gives \((\exp(0.0644),\exp(0.4956))=(1.07,\ 1.64)\), to three significant figures. Thus the refitted model estimates that each additional hour of exposure is associated with conditional odds between 1.07 and 1.64 times as high, holding the clinic random intercept fixed, under the model and its assumptions. The interval is an approximate 95% confidence interval, not a statement that there is a 95% probability the fixed parameter lies in this realized interval.

The coefficient changed by \(0.31-0.28=0.03\) log-odds units, and its standard error changed by \(0.15-0.11=0.04\). The smaller standard error does not establish that the reduced model is preferable: it may reflect an assumption that clinic-specific exposure effects do not vary. The analyst should report the assumption and the numerical change, rather than selecting whichever estimate is more precise.

Diagnostics, Alternatives, and Limitations

After each refit, check whether the optimizer reports successful convergence and inspect the gradient or other available convergence diagnostics. Also inspect variance estimates, correlations, and whether the covariance matrix remains singular or nearly singular. Compare fixed-effect estimates and standard errors, and check whether any changes are large enough to alter the substantive interpretation. A successful optimizer status cannot repair weak design information, an inappropriate response distribution, omitted structure, or an incorrect link.

The main alternatives to deleting a random effect are to retain the original structure and investigate the numerical problem; to impose a targeted covariance restriction, such as zero correlation; or to use a method with different regularization or inferential assumptions. Each changes what is being estimated or assumed. In particular, setting a correlation to zero is a substantive constraint, not a neutral computational trick. AIC or another information criterion can summarize a complexity-fit tradeoff for comparable fits, but it does not certify convergence or resolve boundary-based inferential issues.

Common warning signs include repeated warnings after simplification, a variance estimate that remains near zero, a correlation still close to a boundary, or large shifts in fixed effects across modest structural changes. These indicate that the refit has not settled the modeling question. Keep the sequence of models and diagnostics, identify the exact component changed at each step, and avoid presenting a simpler converged fit as definitive solely because its software output is cleaner.

Key takeaway: Simplify one random-effects component at a time, refit under otherwise matched conditions, and compare both numerical diagnostics and estimates. Better convergence is valuable evidence about computation; it is not, on its own, evidence that the removed variation or covariance was scientifically irrelevant.

Check Your Understanding

Answer each question, then compare your reasoning with the solutions.

  1. A random-intercept/random-slope model has an estimated slope variance near zero. What changes when the slope is removed, and what should remain fixed for a targeted comparison?
  2. A model with both random effects has a correlation estimate of \(0.99\). Explain why setting that correlation to zero is not the same as removing the slope.
  3. A simplified model has a smaller maximum gradient and no convergence warning. What does this establish, and what does it not establish?
  4. Two successfully maximized nested fits use the same data and fixed effects. Why should the full model's maximized log likelihood be at least as large as the reduced model's?

Solutions. (1) Removing the slope sets its variance and its covariance with the intercept to zero; keep the data, response distribution, link, fixed effects, and remaining random effects unchanged. (2) Setting correlation to zero retains both random-effect variances and imposes independence; removing the slope eliminates its variance and covariance. (3) It supports improved numerical convergence for that fit, but does not prove the simplified structure is scientifically adequate or that the original model's assumptions were wrong. (4) The reduced parameter space is contained in the full one, so maximizing the likelihood over the larger space cannot give a lower maximum: \(\max_{\theta\in\Theta_F}\ell(\theta)\geq\max_{\theta\in\Theta_R}\ell(\theta)\).

Clinical Biostats