Why the Reference Distribution Matters
A random-intercept variance test asks whether clusters have residual variation in their baseline response after accounting for the fixed effects. The variance cannot be negative, so the null value of zero lies on the boundary of the permitted parameter space. That boundary changes the large-sample reference distribution for the likelihood-ratio statistic. Using an ordinary chi-square reference can therefore give the wrong p-value.
This tutorial works through the calculation for one random-intercept variance component. The central steps are to compare the correct fitted models, form the likelihood-ratio statistic, and use the one-component boundary mixture to obtain its p-value.
For this GLMM comparison, use the marginal likelihood: the likelihood for the observed responses after integrating over the random effects. Fit the null and alternative with the same observations, fixed-effects specification, response distribution, and other model choices. The alternative allows \(\tau^2\geq 0\); the null fixes it at zero. The likelihood-ratio statistic is
where \(\ell_1\) and \(\ell_0\) are the maximized marginal log likelihoods under the alternative and null, respectively. With properly maximized nested models, \(T\geq 0\). The statistic measures the improvement in fit on a scale suitable for likelihood-ratio inference; it is not itself a variance estimate.
The One-Component Boundary Mixture
Under regularity conditions, the asymptotic null distribution for this single variance-component test is a mixture: with probability one-half the statistic is zero, and with probability one-half it follows a chi-square distribution with one degree of freedom. In shorthand, this is \(\tfrac12\chi^2_0+\tfrac12\chi^2_1\), where \(\chi^2_0\) denotes a point mass at zero.
The result is an asymptotic approximation. It is appropriate when clusters are independent, the random-intercept model is correctly specified, the variance is the single component being tested, and nuisance parameters are identifiable and estimable under the null. There must also be enough independent information for the likelihood’s local approximation to be credible. The response model and other fitted components must be treated consistently in both fits. If important parameters become unidentified under the null, or if data or model structure create a more complicated boundary problem, this simple mixture need not apply.
Why Half the Distribution Is at Zero
A short local-likelihood argument explains the mixture. Write \(v=\tau^2\), so that \(v\geq 0\). Near the null value \(v=0\), a regular one-parameter likelihood has the quadratic approximation
where \(S\) is the score at the null and \(I>0\) is the information. Under the null, after standardization, \(Z=S/\sqrt I\) is approximately standard normal. If \(S\leq 0\), the unconstrained quadratic would peak at a negative \(v\), which is not allowed. Its maximum over \(v\geq0\) is then at \(v=0\), producing \(T=0\). If \(S>0\), the constrained maximum is at \(v=S/I\). Substituting that value gives
A standard normal \(Z\) is negative with probability one-half, creating the point mass at zero. When \(Z>0\), \(Z^2\) has the \(\chi^2_1\) form, but only half of the null probability contributes that positive part. This yields the stated mixture. The argument relies on the regular local approximation; it does not guarantee good finite-sample calibration in every GLMM.
Worked Calculations
Worked Example: A Binary Response Across Clinics
Hypothetical data and fit. Suppose 216 patients, 12 in each of 18 clinics, have a binary outcome. A logistic random-intercept model includes the same treatment indicator in both fits. The clinic effects are modeled as independent normal random intercepts. Assume both models converge, and suppose the fitted marginal log likelihoods are \(\ell_0=-126.40\) and \(\ell_1=-123.98\); the alternative estimates \(\hat{\tau}^2=0.38\) log-odds-squared units. The comparison uses the same patients and fixed effects, and allows the variance to reach zero, so the models are nested.
Statistic. Substitute the fitted log likelihoods:
Mixture p-value. Since \(T>0\), use the positive-tail formula:
At significance level \(\alpha=0.05\), this p-value is smaller than \(\alpha\), so the test rejects \(H_0\) using the stated asymptotic reference. The result is evidence that the clinic-level intercept variance is greater than zero under this model; it is not proof that the model is correct or that clinic membership causes outcome differences. For comparison, the ordinary \(\chi^2_1\) upper-tail probability is about \(0.0278\), twice the boundary-mixture p-value.
Worked Example: A Result Near the Five-Percent Cutoff
Hypothetical data and fit. Consider a Poisson log-link random-intercept model fitted to counts from 24 wards, with the same fixed effects in both models and independent wards. Suppose the null and alternative marginal log likelihoods are \(-302.170\) and \(-300.817\), respectively. Both fits converge, and the alternative variance estimate is positive. The model comparison is nested and changes only whether the ward-intercept variance is fixed at zero or estimated.
Statistic.
Mixture p-value.
Using the rounded calculation, the p-value is approximately \(0.050\), so this result is essentially on the five-percent cutoff. A decision should use the unrounded fitted likelihoods and a clearly specified \(\alpha\); rounding must not be used to make a borderline result look decisive. Also, 24 independent wards may provide limited support for an asymptotic approximation. A carefully designed parametric bootstrap can be considered if finite-sample calibration is a concern.
Worked Example: No Likelihood Gain at the Boundary
Hypothetical data and fit. Suppose a Gaussian-response random-intercept model is fitted to measurements from 10 schools, with the same fixed-effects specification in both fits. The alternative optimizer returns a variance of zero, and both maximized log likelihoods are \(-48.62\) to the reported precision. The models use the same records, and the alternative includes the null as the boundary case \(\tau^2=0\).
Statistic and p-value.
There is no likelihood improvement at the reported precision, so this test does not provide evidence against a zero random-intercept variance. A p-value of 1 does not establish that the population variance is exactly zero. It says that the observed statistic is at the null distribution’s lower boundary; the data may also be insufficiently informative to distinguish a small positive variance from zero.
Checks, Alternatives, and Common Errors
Before interpreting the calculation, check that the fitted comparison really matches the test. The response observations and fixed effects should be identical; the only intended change is the tested variance restriction. Inspect convergence messages, the optimizer’s estimated variance, and whether the reported log likelihood is the marginal likelihood for the specified model. Numerical integration or approximation settings should be adequate and consistent between fits. A clearly negative \(T\) is incompatible with maximized nested likelihoods; investigate the fit, model specification, or likelihood computation rather than reporting a negative statistic. A tiny negative value due only to rounding can be reported as zero after verifying the underlying fits.
The principal alternative reference is the ordinary \(\chi^2_1\) distribution. It is not the appropriate asymptotic reference for this one-component variance test because it omits the point mass at zero; for a positive statistic it gives a p-value twice the mixture p-value. A Wald test based on an estimated variance and standard error is also not an interchangeable shortcut at the boundary. When asymptotic calibration is doubtful, a parametric bootstrap can assess the statistic under data generated from the fitted null, provided the simulation and refitting procedure represent the null model appropriately. Such calibration has its own Monte Carlo uncertainty and does not repair model misspecification.
A small number of independent clusters, weak information about the variance, or unstable likelihood optimization can make the asymptotic mixture inaccurate. A variance estimate at zero is a boundary estimate, not by itself a diagnostic of model failure. Conversely, a positive estimate does not guarantee that the variance is well identified. Interpret the test alongside the design, model fit, and the uncertainty in the variance estimate. The test addresses the specified random-intercept component only; it is not a general test of all possible cluster dependence.
Check Your Understanding
Answer each question, then compare your result with the solution provided.
-
A null model has log likelihood \(-80.0\), and the alternative has log likelihood \(-78.5\). Calculate \(T\) and the boundary-mixture p-value.
Solution: \(T=2\{(-78.5)-(-80.0)\}=3.0\). Thus \(p=1-\Phi(\sqrt{3})\approx1-\Phi(1.732)=0.0416\).
-
For a positive observed statistic, why is the one-component mixture p-value half the \(\chi^2_1\) upper-tail probability?
Solution: The asymptotic null distribution places probability one-half at zero and probability one-half in its \(\chi^2_1\) component. A positive statistic’s upper tail comes only from that component, so its tail probability is multiplied by one-half.
-
A fitted comparison produces \(T=1.00\). Give the mixture p-value and explain the decision at \(\alpha=0.05\).
Solution: \(p=1-\Phi(1)=0.1587\). Since \(0.1587>0.05\), do not reject \(H_0\) at the five-percent level. This is not proof that the variance is zero.
-
The alternative fit reports a larger log likelihood than the null, but the models use different fixed effects. Can their likelihood-ratio statistic be interpreted as the random-intercept variance test described here?
Solution: No. The comparison changes more than the variance restriction, so it does not isolate the random-intercept variance test. Refit the models with the same fixed-effects specification and observations before applying this reference distribution.
-
If the observed statistic is exactly zero, is the nonrandomized upper-tail p-value \(0.5\)?
Solution: No. The test p-value is \(P(T_{\text{null}}\geq0)=1\), since every possible value in the mixture is at least zero. The mixture has a CDF value of one-half at zero, but that is not the inclusive upper-tail probability used for this test.