Tutorials › Statistical Genetics › Wald, Score, and Likelihood-Ratio Tests for Fixed Effects

Linear Mixed Models in Genetics · Tutorial 507 of 989

Wald, Score, and Likelihood-Ratio Tests for Fixed Effects

Understand how to test one or more fixed effects in a genetic mixed model and when the Wald, score, and likelihood-ratio approaches agree or differ.

Intermediate 10 min read

What You'll Learn

  • State a fixed-effect null hypothesis as a linear restriction on the model coefficients.
  • Calculate a Wald test using generalized least-squares estimates and their covariance.
  • Construct a score test from a model fitted under the null hypothesis.
  • Compare nested models with a likelihood-ratio test using maximum likelihood.
  • Choose the appropriate chi-square reference distribution and interpret the result in context.

Why Test Fixed Effects in a Genetic Mixed Model?

A genetic mixed model can account for covariance among individuals while estimating the effects of measured predictors. For example, a model may include age, sex, or a clinical covariate as fixed effects and represent genetic similarity through a random polygenic effect. A test of a fixed effect asks whether its coefficient, or a specified set of coefficients, is compatible with a null value after the other modeled terms are accounted for. It tests a model parameter; it does not establish that the predictor causes the outcome.

Three standard approaches are the Wald test, the score test, and the likelihood-ratio test. They use different features of the likelihood: the Wald test uses the unrestricted estimate, the score test uses the slope of the likelihood at the null fit, and the likelihood-ratio test compares the best fits under the null and alternative. Under regularity conditions they have the same large-sample reference distribution, but they need not give identical statistics in finite samples.

Model and Fixed-Effect Hypothesis

Definition: Consider the Gaussian genetic mixed model \(y=X\beta+u+\varepsilon\), where \(y\) is an \(n\)-vector of outcomes, \(X\) is a fixed-effect design matrix, and \(\beta\) is its coefficient vector. The polygenic effect \(u\) and residual \(\varepsilon\) are independent, with \(u\sim N(0,\sigma_g^2K)\) and \(\varepsilon\sim N(0,\sigma_e^2I)\). Thus \(y\sim N(X\beta,V)\), where \(V=\sigma_g^2K+\sigma_e^2I\). Here \(K\) is a specified genetic relationship matrix, and the variance components are nonnegative.

The tests below assume the mean and covariance model are correctly specified, the fixed-effect design has the required full rank, and the tested restrictions are identifiable. For a standard test of \(q\) fixed-effect restrictions, write \(H_0:C\beta=d\) against the unrestricted alternative, where \(C\) has rank \(q\). A common special case partitions \(\beta=(\beta_0,\beta_1)\) and tests \(H_0:\beta_1=0\); the remaining coefficients are nuisance fixed effects and are allowed to vary.

If \(V\) is known, generalized least squares gives \(\hat{\beta}=(X'V^{-1}X)^{-1}X'V^{-1}y\), with covariance \((X'V^{-1}X)^{-1}\). In practice, the variance components in \(V\) are usually estimated. The usual tests then plug in an estimate of \(V\); their chi-square calibration is generally an asymptotic result, not an exact finite-sample guarantee.

The Wald Test

The Wald test measures how far the unrestricted estimate is from the null restriction relative to its estimated uncertainty. Let \(\widehat{\operatorname{Var}}(\hat{\beta})\) be the estimated covariance matrix of the fixed-effect estimates. Then the Wald statistic is

$$ W=(C\hat{\beta}-d)' \left[C\widehat{\operatorname{Var}}(\hat{\beta})C'\right]^{-1} (C\hat{\beta}-d). $$

Under \(H_0\), and with regularity conditions and sufficiently large information, \(W\) is approximately distributed as \(\chi^2_q\), a chi-square distribution with \(q\) degrees of freedom. For one restriction, \(W\) is the squared Wald \(z\)-statistic. The multivariate form accounts for covariance among the tested coefficient estimates.

Worked Example: A Joint Wald Test of Two Covariates

Suppose a fitted genetic mixed model tests whether two ancestry covariates have coefficients zero jointly. The estimated coefficient vector for these covariates is \(\hat{\beta}_1=(0.30,-0.20)'\), and its estimated covariance matrix is

$$ \widehat{\operatorname{Var}}(\hat{\beta}_1)= \begin{pmatrix}0.04&0.01\\0.01&0.09\end{pmatrix}. $$

The null is \(H_0:\beta_1=(0,0)'\), so \(q=2\). The determinant of the covariance matrix is \(0.04(0.09)-0.01^2=0.0035\), giving its inverse as approximately

$$ \begin{pmatrix}0.04&0.01\\0.01&0.09\end{pmatrix}^{-1} = \begin{pmatrix}25.714&-2.857\\-2.857&11.429\end{pmatrix}. $$

Therefore,

$$ W=(0.30,-0.20) \begin{pmatrix}25.714&-2.857\\-2.857&11.429\end{pmatrix} \begin{pmatrix}0.30\\-0.20\end{pmatrix} \approx 3.114. $$

Against \(\chi^2_2\), this gives \(p\approx 0.211\). At significance level \(\alpha=0.05\), the data do not provide sufficient evidence to reject the joint zero-coefficient null. This is a test of the two covariates together, not evidence that each coefficient is individually zero.

The Score Test

The score test evaluates how strongly the likelihood would initially increase if the null restriction were relaxed. It requires fitting the model under \(H_0\), but not fitting the unrestricted model. For fixed \(V\), consider \(H_0:\beta_1=0\) in the partition \(X=(X_0,X_1)\), where \(X_0\) contains nuisance fixed effects and \(X_1\) contains the \(q\) tested columns. Define the residual precision matrix after fitting the null fixed effects as

$$ P_0=V^{-1}-V^{-1}X_0(X_0'V^{-1}X_0)^{-1}X_0'V^{-1}. $$

The score for \(\beta_1\), evaluated at its null value and with the nuisance coefficients fitted, is \(U_1=X_1'P_0y\). Its information matrix is \(I_{11}=X_1'P_0X_1\). The score statistic is

$$ S=U_1'I_{11}^{-1}U_1. $$

When \(V\) is estimated, the null fit includes estimating the covariance parameters under the null. In a Gaussian model parameterized separately by its mean and covariance, the expected information between mean and covariance parameters is zero. This supports the usual fixed-effect score calculation using the null covariance fit; more generally, nuisance-parameter uncertainty must be handled in the score's information calculation. Under regularity conditions, \(S\) is approximately \(\chi^2_q\) under \(H_0\).

Worked Example: Score Test for a Covariate with Genetic Covariance

Consider four hypothetical individuals and the model \(y=\beta_0\mathbf{1}+\beta_1x+u+\varepsilon\). The outcome values are \(y=(1,3,2,5)'\), and the covariate values are \(x=(0,1,0,1)'\). Suppose the covariance is treated as known for this illustration, with residual variance and genetic variance both equal to 1 and

$$ K=\begin{pmatrix}1&1&0&0\\1&1&0&0\\0&0&1&1\\0&0&1&1\end{pmatrix}, \qquad V=I+K. $$

This is a valid covariance matrix because it is the sum of the identity matrix and a positive-semidefinite relationship matrix. Its inverse has two identical diagonal blocks, each equal to \(\frac{1}{3}\begin{pmatrix}2&-1\\-1&2\end{pmatrix}\). We test \(H_0:\beta_1=0\), with the intercept as the nuisance fixed effect. Direct multiplication gives \(\mathbf{1}'V^{-1}\mathbf{1}=4/3\), \(\mathbf{1}'V^{-1}y=11/3\), \(x'V^{-1}x=4/3\), \(x'V^{-1}\mathbf{1}=2/3\), and \(x'V^{-1}y=13/3\).

Under the null, the fitted intercept is \(\hat{\beta}_0=(11/3)/(4/3)=11/4=2.75\). The score for the covariate and its information after accounting for the intercept are

$$ U_1=x'V^{-1}y- \frac{x'V^{-1}\mathbf{1}}{\mathbf{1}'V^{-1}\mathbf{1}}\mathbf{1}'V^{-1}y =\frac{13}{3}-\frac{(2/3)(11/3)}{4/3}=2.5, $$
$$ I_{11}=x'V^{-1}x- \frac{(x'V^{-1}\mathbf{1})^2}{\mathbf{1}'V^{-1}\mathbf{1}} =\frac{4}{3}-\frac{(2/3)^2}{4/3}=1. $$

Thus \(S=2.5^2/1=6.25\). The \(\chi^2_1\) reference distribution gives \(p\approx0.0124\). With known \(V\), this is an exact chi-square test in the Gaussian model; with estimated covariance parameters, the usual interpretation is asymptotic. The test provides evidence of association between this covariate and the outcome in the specified model, not evidence of causation.

The Likelihood-Ratio Test

The likelihood-ratio test compares the maximum likelihood under the null with the maximum likelihood under the alternative. Let \(\ell_0\) and \(\ell_1\) denote the maximized log-likelihoods for the null and alternative, respectively. For nested models, the statistic is

$$ \Lambda=2(\ell_1-\ell_0). $$

The null model must be nested within the alternative, and both fits must use the same outcome data and compatible likelihood specifications. If covariance parameters are unknown, they are optimized separately under each model. Under regularity conditions, \(\Lambda\) has an asymptotic \(\chi^2_q\) distribution under \(H_0\), where \(q\) is the number of independent restrictions. To compare models that differ in their fixed effects, use maximum likelihood: restricted maximum likelihood likelihoods are based on error contrasts and generally are not directly comparable when the fixed-effect design changes.

Worked Example: Likelihood-Ratio Test for an Age Effect

Suppose a hypothetical genetic mixed-model analysis tests whether age predicts a quantitative trait, adjusting for sex. The null model contains an intercept and sex; the alternative adds age, so the models differ by one fixed-effect coefficient. After maximizing each model's likelihood over its own fixed effects and covariance parameters, suppose the log-likelihoods are \(\ell_0=-23.10\) and \(\ell_1=-20.40\). The null model is nested in the alternative, and the same observations and covariance structure are used.

The likelihood-ratio statistic is

$$ \Lambda=2[-20.40-(-23.10)]=2(2.70)=5.40. $$

With \(q=1\), the reference distribution is approximately \(\chi^2_1\), giving \(p\approx0.0201\). At \(\alpha=0.05\), the analysis provides evidence against a zero age coefficient, conditional on the other modeled terms. The test alone does not report the direction or size of the age association; those require examining the estimated coefficient and its units.

Why the Three Tests Can Agree—and Differ

For known \(V\) in the Gaussian linear mixed model, the three tests of the same fixed-effect restrictions coincide. This can be seen for \(H_0:\beta_1=0\). Let \(P\) be the residual precision matrix after fitting all columns in \((X_0,X_1)\). The unrestricted estimate of the tested coefficients is \(\hat{\beta}_1=I_{11}^{-1}U_1\), and its covariance is \(I_{11}^{-1}\). Hence the Wald statistic is \(U_1'I_{11}^{-1}U_1\), exactly the score statistic.

The log-likelihood for known \(V\), after maximizing over the fixed effects in a given model, differs between the null and alternative only through the residual quadratic forms. The matrix identity

$$ P_0-P=P_0X_1(X_1'P_0X_1)^{-1}X_1'P_0 $$

shows that the reduction in the quadratic form is \(y'(P_0-P)y=U_1'I_{11}^{-1}U_1\). Therefore \(\Lambda=2(\ell_1-\ell_0)=U_1'I_{11}^{-1}U_1\) as well. All three statistics then have an exact \(\chi^2_q\) null distribution when \(V\) is known and the stated Gaussian model holds.

When covariance parameters are estimated, the fits and plug-in covariance estimates can differ, so the three statistics need not be numerically identical. Their chi-square reference distributions are typically large-sample approximations. The Wald test is convenient after a full fit; the score test can avoid fitting the alternative; the likelihood-ratio test compares the two fitted likelihoods directly. These practical differences matter especially when information is limited or estimates are near parameter constraints.

TestWhat it usesTypical fitting requirementReference under regular conditions
WaldUnrestricted coefficient estimate and its covarianceFit the alternative modelApproximately \(\chi^2_q\)
ScoreLikelihood slope and information at the null fitFit the null modelApproximately \(\chi^2_q\)
Likelihood ratioDifference between maximized log-likelihoodsFit null and alternative modelsApproximately \(\chi^2_q\)

Common Pitfall and Practical Interpretation

  • Comparing restricted likelihoods across fixed-effect designs. REML likelihoods from models with different fixed-effect design matrices are not generally on a common scale for a likelihood-ratio test. Use maximum likelihood for this comparison.
  • Giving the test statistic the wrong degrees of freedom. The chi-square degrees of freedom equal the number \(q\) of independent restrictions, not the number of individuals or all coefficients in the model.
  • Calling a nonsignificant result proof of no effect. A large p-value means the data do not provide strong evidence against the stated null at the chosen threshold; it does not establish that the effect is exactly zero.
  • Interpreting a joint test one coefficient at a time. A joint test evaluates the full restriction. Its result does not say which coefficient is responsible for a departure from the null.

In a genetic mixed model, covariance adjustment can change both coefficient precision and the evidence against a fixed-effect null. Report the tested restriction, the test and statistic, its degrees of freedom, the p-value, and—when interpreting an effect—its estimated coefficient with units and uncertainty. The test concerns the fixed-effect mean structure conditional on the specified genetic covariance model.

Check Your Understanding

Use the definitions, formulas, and examples above to answer these questions.

  1. For a test of three independent fixed-effect restrictions, what is the usual chi-square degrees of freedom?
  2. Which fitted model does the score test require, and what feature of the likelihood does it use?
  3. Why are maximum-likelihood fits generally used rather than REML fits to compare models with different fixed-effect designs?
  4. In the covariate score example, what does the result \(S=6.25\) say, and what does it not establish?
  5. Under what condition do the Wald, score, and likelihood-ratio statistics coincide exactly in the Gaussian model described here?
Clinical Biostats