Why Wald Tests Use Standard Errors
A negative binomial generalized linear model (GLM) estimates how expected RNA-seq counts relate to experimental conditions and other covariates. For a gene, the fitted coefficient describes an effect on the log-mean scale. A Wald test asks whether that estimate is far from a specified null value relative to its estimated uncertainty. Thus, the same estimated effect can provide stronger or weaker evidence depending on its standard error.
The test is useful for a single model coefficient, such as a treatment effect, and for a linear contrast, such as a treatment effect in a particular group. The interpretation depends on the design and contrast: a coefficient is not automatically the comparison of interest in every model.
Model, Assumptions, and Test Definition
For one gene, let \(Y_j\) be the observed count in sample \(j\), and let \(s_j\) be its known normalization or library-size factor. A commonly used negative binomial GLM specifies independent counts with mean \(\mu_j\) and dispersion \(\alpha\):
Here \(\log(s_j)\) is an offset, \(\mathbf{x}_j\) is the row of the design matrix for sample \(j\), and \(\boldsymbol{\beta}\) is the vector of regression coefficients. The dispersion allows the count variance to exceed the mean. The log link ensures positive fitted means. In this tutorial, effects are on the natural-log scale unless stated otherwise.
Wald inference relies on an adequate model and a large-sample approximation. In particular, samples are assumed independent conditional on the design, the design must identify the coefficients being tested, and the negative binomial mean and variance structure must be reasonable. The fitted coefficient estimator should be away from problematic boundaries and have an approximately normal sampling distribution. The standard error is usually computed from the inverse fitted information matrix; when dispersion is estimated, this calculation commonly treats the fitted dispersion as fixed. Earlier material on dispersion estimation addresses how the dispersion is obtained.
Under \(H_0\), and when the model and large-sample conditions are adequate, \(Z_W\) is approximately standard normal. For a two-sided test, the approximate p-value is \(2\{1-\Phi(|Z_W|)\}\), where \(\Phi\) is the standard normal cumulative distribution function. Equivalently, \(Z_W^2\) is approximately chi-squared with 1 degree of freedom. For a one-sided alternative, the tail used must match the direction specified in \(H_a\).
A coefficient test is the special case in which \(c\) selects one coefficient. For example, testing a treatment coefficient against no treatment effect uses \(c\) with a 1 in the treatment position and 0 elsewhere, and \(r=0\). A contrast can combine several coefficients; its variance must include their covariances. Ignoring covariance generally gives the wrong standard error.
Why the Wald Statistic Has This Form
The calculation follows from the approximate sampling distribution of the fitted coefficients. Under the model’s regularity conditions, the maximum-likelihood estimator is approximately multivariate normal, with covariance estimated by the inverse information matrix. A linear combination of a multivariate normal vector is normal, and its variance is obtained by multiplying the covariance matrix on both sides by the contrast vector.
Under \(H_0:c^{T}\boldsymbol{\beta}=r\), subtracting \(r\) centers this approximate distribution at zero. Dividing by its standard deviation, \(\sqrt{c^{T}\widehat Vc}\), standardizes it to approximately \(N(0,1)\). This yields \(Z_W\). The argument also explains the test’s limitation: if the estimator’s normal approximation is poor or its estimated covariance is unreliable, the resulting p-value may also be unreliable.
A corresponding approximate \(100(1-\alpha)\%\) confidence interval for the contrast is
where \(z_{1-\alpha/2}\) is the standard normal quantile. For a two-sided test of \(r\), the interval excludes \(r\) exactly when the Wald test rejects at level \(\alpha\), apart from rounding.
Worked Example: Testing a Treatment Coefficient
Suppose a hypothetical experiment has three control samples with counts 48, 55 and 61, and three treated samples with counts 92, 104 and 99. A negative binomial GLM with a treatment indicator and library-size offsets is fitted for one gene. Assume the model is appropriate, the samples are independent, and the fitted coefficient is sufficiently well estimated for the normal approximation to be reasonable. Suppose the fit reports a treatment coefficient of \(0.80\) natural-log units and standard error \(0.30\) natural-log units.
Test \(H_0:\beta_{\text{treatment}}=0\) against the two-sided alternative. The Wald statistic is
The two-sided p-value is approximately \(2\{1-\Phi(2.667)\}=0.0077\). At the 0.05 level, this provides evidence against a zero treatment coefficient for this gene, under the model and approximation. It is not the probability that the null hypothesis is true.
The estimated fold change is \(\exp(0.80)=2.226\): the fitted treated mean is about 2.23 times the fitted control mean, conditional on the model. A 95% Wald interval on the log scale is \(0.80\pm1.96(0.30)=(0.212,1.388)\) natural-log units. Exponentiating its endpoints gives approximately \((1.236,4.007)\) for the fold change. The interval excludes a fold change of 1, consistent with the two-sided test.
Contrasts Require the Full Covariance
In a model with interactions, the effect of a condition can depend on another variable. The relevant contrast is formed from the coefficients that define that effect. Its standard error is not found by simply adding coefficient standard errors: the covariance between estimates contributes to the variance of their sum or difference.
Worked Example: Treatment Effect Within a Group
Consider a hypothetical model with binary treatment \(T\), binary subgroup indicator \(S\), and linear predictor \(\log(\mu_j)=\log(s_j)+\beta_0+\beta_TT_j+\beta_SS_j+\beta_{TS}T_jS_j\). For \(S=1\), the treatment effect is \(\beta_T+\beta_{TS}\). Suppose a fitted model, with suitable independent samples in each design group and an estimable design, reports \(\hat{\beta}_T=0.45\), \(\hat{\beta}_{TS}=0.35\), variances \(0.04\) and \(0.09\), and covariance \(-0.02\). These are hypothetical fitted quantities on the natural-log scale.
The contrast vector selects the sum of the treatment and interaction coefficients. Its estimate is \(0.45+0.35=0.80\). Its estimated variance includes twice the covariance:
Thus, \(SE=\sqrt{0.09}=0.30\), and for \(H_0:\beta_T+\beta_{TS}=0\), \(Z_W=0.80/0.30=2.667\). The two-sided p-value is approximately 0.0077. The estimated treatment fold change in subgroup \(S=1\) is \(\exp(0.80)=2.226\). Using \(1.96\) standard errors, the log-scale interval is \((0.212,1.388)\), or approximately \((1.236,4.007)\) as a fold change. This inference concerns the treatment effect in the specified subgroup, not the treatment effect in every subgroup.
What Changes When the Standard Error Changes?
For a fixed null value, the absolute Wald statistic is the distance between the estimate and the null, measured in standard-error units. A smaller standard error makes the same estimated difference more statistically distinguishable from the null; a larger standard error makes it less distinguishable. Neither result alone says whether the effect is important in practice. The effect estimate and its interval must also be considered.
Worked Example: Same Estimate, Different Precision
Suppose a hypothetical, well-specified negative binomial GLM gives a treatment coefficient of \(0.40\) natural-log units. First suppose its standard error is \(0.25\), with independent samples and a usable normal approximation. For \(H_0:\beta=0\), the statistic is \(Z_W=0.40/0.25=1.60\), giving a two-sided p-value of about 0.110. The 95% interval is \(0.40\pm1.96(0.25)=(-0.090,0.890)\), which includes zero.
Now hold the estimate fixed but suppose a more precise fit has standard error \(0.12\). Then \(Z_W=0.40/0.12=3.333\), and the two-sided p-value is about 0.00086. The interval is \(0.40\pm1.96(0.12)=(0.165,0.635)\), which excludes zero. The estimated fold change is \(\exp(0.40)=1.492\) in both cases; the evidence differs because uncertainty differs, not because the estimated effect changed.
Diagnostics, Alternatives, and Limitations
Before interpreting a Wald result, check that the tested coefficient or contrast is identifiable from the design and that its reported standard error is finite. A very large standard error, a nearly singular covariance matrix, or a coefficient that changes markedly under small modeling changes can indicate weak information or unstable estimation. Sparse counts and small sample sizes can make the normal approximation questionable. A small p-value cannot repair a misspecified mean, an unsuitable dispersion, dependence between samples that the model ignores, or an inappropriate design.
The Wald test is one way to test a model effect. A likelihood-ratio test compares fitted likelihoods for nested models, while exact tests are an alternative for particular two-group count settings. Quasi-likelihood methods provide another approach to inference when the variance modeling and uncertainty treatment differ. These methods have different assumptions and targets; their p-values need not agree exactly with a Wald result. The Wald approach is especially direct for a prespecified coefficient or linear contrast, but can be sensitive to the estimate and standard error when the likelihood is asymmetric or the estimate is poorly determined.
For RNA-seq, a per-gene Wald p-value is evidence about that gene under its fitted model; by itself it does not control the error rate across thousands of tested genes. Also, the usual standard error often conditions on the estimated dispersion. If dispersion uncertainty is substantial, reported coefficient uncertainty may not capture every source of uncertainty.
Common mistake: “The coefficient is 0.8, so the evidence is strong because 0.8 is a large number.” The scale alone does not determine the Wald evidence. For a null value of zero, the statistic is \(0.8/SE\); without the standard error, the test cannot be evaluated. A second mistake is to add standard errors when combining coefficients. For a sum, use the variance formula including covariance, then take its square root.
Check Your Understanding
Try each question, then check the solution immediately below it.
- A hypothetical coefficient estimate is \(-0.60\) with standard error \(0.20\). Test a zero null using a two-sided Wald test. What is the statistic, approximate p-value, and direction of the estimated effect?
- A contrast is the sum of two coefficient estimates, \(0.30\) and \(0.20\). Their variances are \(0.04\) and \(0.09\), and their covariance is \(0.01\). Find the contrast estimate and standard error.
- For an estimate of \(0.50\) with standard error \(0.40\), is the approximate 95% Wald interval consistent with rejecting a two-sided zero null at 0.05? Show the interval.
- Why is it incorrect to interpret a two-sided Wald p-value of 0.02 as a 98% probability that the tested effect is nonzero?
Solutions. (1) \(Z_W=-0.60/0.20=-3.00\); the two-sided p-value is approximately \(0.0027\). The estimated effect is negative, and the result is evidence against a zero coefficient under the model assumptions. (2) The estimate is \(0.30+0.20=0.50\). The variance is \(0.04+0.09+2(0.01)=0.15\), so the standard error is \(\sqrt{0.15}=0.3873\). (3) The interval is \(0.50\pm1.96(0.40)=(-0.284,1.284)\). It includes zero, so it is consistent with not rejecting the two-sided zero null at 0.05. (4) A p-value is calculated assuming the null and model are true; it is the probability, under that assumption, of a test statistic at least as extreme as the observed one. It is not a probability assigned to the null or alternative.