Why Test a Categorical Predictor as a Block?
A categorical predictor with \(K\) levels generally requires more than one fixed-effect coefficient. For example, a four-level exposure group represented using one reference level has three coefficients. Testing those coefficients one at a time answers separate questions about each level relative to the reference. It does not directly answer the broader question: does the predictor, considered as a whole, contribute to the model?
An omnibus test answers that broader question by testing all estimable contrasts for the categorical predictor jointly. In a GLMM, the test is conditional on the other fixed effects and is conducted while retaining the same random-effects structure in the models being compared. The result concerns the specified model and outcome scale; it is not by itself evidence of a causal effect.
Model and Hypothesis
Write a GLMM for observation \(i\) as
Here \(Y_i\) is the response, \(g\) is the chosen link, \(x_i\) and \(z_i\) are the fixed- and random-effect design vectors, \(\beta\) is the fixed-effect parameter vector, and \(b\) is the vector of random effects. The exact response distribution and link depend on the analysis. The categorical predictor is represented in \(x_i\); the random effects account for the specified dependence among observations.
Under reference-level coding, suppose the levels are \(A,B,\ldots\), with \(A\) as reference. For a \(K\)-level predictor that has no interaction terms in the model, its coefficients may be written \(\gamma_2,\ldots,\gamma_K\). The omnibus null is
In a binary-outcome GLMM with a logit link, each \(\gamma_j\) is a conditional log-odds contrast relative to level \(A\), for observations with the same values of the other fixed effects and the same random effect. In other GLMMs, the coefficient interpretation follows the chosen link and response distribution. The omnibus null is not tied to reference coding: a different full-rank coding describes the same hypothesis that the factor contributes no fixed-effect contrasts.
Likelihood-Ratio Test for the Factor
The likelihood-ratio test (LRT) compares a reduced model, which excludes the categorical predictor, with a full model, which includes it. Both models must use the same observations, response specification, offsets, other fixed effects, and random-effects structure. The reduced model is nested in the full model: it is obtained by setting the factor's \(q\) coefficients to zero.
Here \(\ell_{\text{full}}\) and \(\ell_{\text{reduced}}\) are the maximized log likelihoods. Under the null, regularity conditions, and a sufficiently informative sample, \(D\) is compared approximately with a chi-square distribution with \(q\) degrees of freedom. The reference degrees of freedom count the independent restrictions being tested, not the total number of parameters in either model.
The approximation relies on identifiable parameters, an interior null value for the fixed-effect contrasts, and adequate model fitting. The response distribution, link, random-effects distribution, and conditional-independence assumptions must be reasonable for both models. In practice, the numerical likelihood must also be computed accurately enough that the difference between fits is meaningful. The earlier material on likelihood-ratio tests and small-sample disagreement between Wald and likelihood-ratio tests is relevant when these approximations are doubtful.
Worked Example: An Omnibus Likelihood-Ratio Test
Suppose a hypothetical binary-outcome GLMM has a three-level care-category predictor \(G\), with levels A, B, and C. Both the full and reduced models include the same age fixed effect and the same clinic random intercept. Assume the models converged, used the same observations and likelihood specification, and the clinic random-intercept model is an adequate working model. The fitted log likelihoods are \(-121.40\) for the full model and \(-125.30\) for the reduced model.
With A as the reference, the full model adds two coefficients, one for B versus A and one for C versus A. Thus \(q=3-1=2\). The test statistic is
For a chi-square distribution with 2 degrees of freedom, the upper-tail probability is \(P(\chi^2_2\ge 7.80)=e^{-7.80/2}=0.0202\). At \(\alpha=0.05\), reject \(H_0\). The data provide evidence that care category is associated with the conditional outcome in this model, after accounting for age and the clinic random intercept. This omnibus result does not identify which categories differ; that requires appropriately specified follow-up contrasts.
Joint Wald Test
A joint Wald test uses the estimated coefficient block and its estimated covariance matrix. Let \(\hat{\gamma}\) be the \(q\)-vector of estimated factor contrasts, and let \(\widehat V\) be their estimated covariance matrix, taken from the fitted full model. If \(\widehat V\) is nonsingular, the Wald statistic is
Under the null and the corresponding large-sample approximation, \(W\) is compared with a chi-square distribution with \(q\) degrees of freedom. The covariance terms matter: when coefficient estimates are correlated, adding their separate squared \(z\)-statistics is generally not the joint test. Equivalently, for a general set of linear restrictions \(R\beta=0\), the statistic is \((R\hat{\beta})^{\mathsf T}\{R\widehat{\operatorname{Var}}(\hat{\beta})R^{\mathsf T}\}^{-1}(R\hat{\beta})\), with degrees of freedom equal to the rank of \(R\).
Worked Example: A Joint Wald Test for Four Levels
Consider a hypothetical GLMM with a four-level predictor and level A as the reference. Suppose the estimated factor coefficients for B, C, and D are \(\hat{\gamma}=(0.40,-0.20,0.30)^{\mathsf T}\), measured in log-odds, and their estimated covariance matrix is
Assume the model has converged, the covariance matrix is positive definite, and the large-sample Wald approximation is suitable for this illustration. There are three contrasts, so the omnibus null has \(q=3\) restrictions. Since this example's covariance matrix is diagonal, the statistic is
The chi-square upper-tail probability with 3 degrees of freedom is approximately 0.0824. At \(\alpha=0.05\), this test does not reject \(H_0\). This is not proof that all four levels have identical effects; it means this joint Wald test does not provide sufficiently strong evidence against the all-contrasts-zero hypothesis at the chosen significance level. The coefficients are log-odds contrasts, but the omnibus test combines their estimates and uncertainty rather than interpreting any one coefficient alone.
Why the Degrees of Freedom Equal the Number of Contrasts
The degrees of freedom follow from the number of independent restrictions, not from the labels used to code the factor. With \(K\) levels and a reference level, the factor contributes \(K-1\) indicator columns. The null sets each of those \(K-1\) coefficients to zero. More generally, if the model design makes some contrasts redundant or non-estimable, count the rank of the restrictions that can actually be estimated.
For a short justification, write the full parameter vector as \(\beta=(\eta^{\mathsf T},\gamma^{\mathsf T})^{\mathsf T}\), where \(\eta\) contains all other fixed effects and \(\gamma\) contains the \(q\) factor contrasts. The reduced model is precisely the submodel \(\gamma=0\), leaving \(\eta\) and the random-effects parameters available for estimation. Under the null, the log likelihood is locally approximated by a quadratic function of the parameter deviations. The \(q\) independent directions added by \(\gamma\) contribute the likelihood-ratio statistic; standard regularity conditions yield its asymptotic \(\chi^2_q\) reference distribution. The same \(q\) restrictions determine the joint Wald reference degrees of freedom. Thus, for ordinary full-rank coding, changing the reference category changes the coefficient coordinates but not the omnibus hypothesis or its \(K-1\) degrees of freedom.
Worked Example: Degrees of Freedom Under a Different Coding
Suppose a hypothetical model has a three-level predictor with levels A, B, and C. In reference coding, the full model adds \(\gamma_B\) and \(\gamma_C\), so the null is \(\gamma_B=\gamma_C=0\), with 2 degrees of freedom. Instead, suppose the factor is coded using two independent contrasts, say \(c_1\) and \(c_2\). The numerical coefficient estimates will generally differ from the reference-coded estimates, but the fitted values can represent the same model.
The omnibus test under the contrast coding is \(H_0:c_1=c_2=0\). It still imposes two independent restrictions, so its reference distribution is \(\chi^2_2\). For example, if its fitted likelihoods were \(-88.10\) for the full model and \(-91.25\) for the reduced model, then
The upper-tail probability is \(P(\chi^2_2\ge6.30)=e^{-6.30/2}=0.0429\). At the 0.05 level, the omnibus test rejects the all-contrasts-zero null. Provided both codings define the same full and reduced models and are fitted to the same data, changing the coding does not change the likelihood-ratio statistic. It changes the parameter representation, not the question being tested.
Choosing and Checking the Test
The LRT and joint Wald test target the same omnibus null but use different approximations. The LRT compares maximized likelihoods across nested models; the Wald test evaluates the estimated coefficient block relative to its estimated covariance. In finite samples they can differ, particularly when estimates are imprecise, the likelihood is asymmetric, or the model is near a problematic boundary. Do not choose whichever gives the preferred conclusion. State the test used, check its assumptions and fit, and interpret the result accordingly.
Before reporting either test, check the following:
- Model comparability: For the LRT, confirm that the reduced model is nested in the full model and that both fits use the same observations, response, offsets, and random-effects structure.
- Estimability: Check that the factor contrasts are identifiable. Empty or very sparse categories, redundant design columns, or separation in a binary outcome can make estimates unstable or non-finite.
- Fit and computation: Investigate convergence warnings and the accuracy of likelihood calculations. A poor numerical fit can distort either the likelihood difference or the coefficient covariance matrix.
- Approximation: The chi-square reference is asymptotic, not an exact finite-sample distribution. With limited information, especially for some factor levels, the reported p-value may be unreliable.
- Interpretation: The test concerns the factor as included in this particular model. It does not establish that every pair of levels differs, nor does it establish a causal relationship.
The omnibus test is distinct from a collection of individual coefficient tests. A significant omnibus result says that at least one estimable contrast is inconsistent with zero under the model; it does not reveal which contrast. A non-significant result likewise does not demonstrate equivalence. Specific pairwise or planned contrasts address narrower questions and require attention to their own inferential scope.
Check Your Understanding
Answer each question, then compare your reasoning with the brief solutions below.
- A five-level factor is represented by four full-rank contrasts. What is the omnibus null and how many degrees of freedom are used?
- A nested-model comparison gives \(\ell_{\text{full}}=-70.8\) and \(\ell_{\text{reduced}}=-74.0\) for a three-level factor. Calculate the LRT statistic and its degrees of freedom.
- Why is the sum of the individual coefficient \(z\)-statistics not generally a joint Wald test?
- A joint test fails to reject the null. Is it correct to conclude that all levels have identical effects? Explain.
Solutions. (1) The null is that all four estimable contrasts are zero; use 4 degrees of freedom. (2) \(D=2\{(-70.8)-(-74.0)\}=6.4\), and \(df=3-1=2\). (3) A joint Wald test uses the coefficient estimates and their full covariance matrix in a quadratic form; summing individual \(z\)-statistics does not generally account for their dependence or produce the required statistic. (4) No. Failure to reject is insufficient evidence against the all-zero-contrasts null, not proof of identical effects or equivalence.