Tutorials › High-Dimensional Genomic Data Analysis › Quasi-Likelihood Tests For RNA-seq

Count-Based Differential Expression for RNA-seq · Tutorial 441 of 795

Quasi-Likelihood Tests For RNA-seq

Understand how quasi-likelihood inference accounts for uncertainty beyond the negative binomial variance when testing gene-level coefficient contrasts.

Intermediate 10 min read

What You'll Learn

  • Distinguish negative binomial dispersion from quasi-likelihood dispersion.
  • State the assumptions behind quasi-likelihood inference for RNA-seq counts.
  • Construct and interpret a quasi-likelihood F test for a coefficient contrast.
  • Explain how moderation stabilizes gene-wise quasi-likelihood dispersion estimates.
  • Compare quasi-likelihood tests with Wald and likelihood-ratio tests.
  • Recognize when excess variability or model misspecification may affect results.

Why Add Quasi-Likelihood Inference?

A negative binomial generalized linear model (GLM) describes each gene’s mean count using the experimental design and allows count variance to exceed the mean. Even when that model is appropriate on average, the observed variability for a particular gene may be greater than its negative binomial variance predicts. Quasi-likelihood inference addresses this uncertainty when testing a specified coefficient contrast. It does not test whether a gene is excessively variable; the hypothesis remains a hypothesis about the contrast.

The distinction matters in small RNA-seq experiments. If the variance estimate is too small, a contrast can appear more precise than the data justify. Quasi-likelihood (QL) testing adds a variance multiplier and accounts for the uncertainty in estimating it. This often produces more cautious inference than a likelihood-ratio test (LRT) that relies on the negative binomial likelihood alone.

Definition: For gene \(g\) in sample \(j\), suppose the count \(Y_{gj}\) has fitted mean \(\mu_{gj}\) and negative binomial dispersion \(\phi_g\), so that $$ \operatorname{Var}(Y_{gj})=\mu_{gj}+\phi_g\mu_{gj}^{2}. $$ A quasi-likelihood model allows $$ \operatorname{Var}(Y_{gj})=q_g\left(\mu_{gj}+\phi_g\mu_{gj}^{2}\right), $$ where \(q_g\) is the gene’s quasi-likelihood dispersion, a multiplier of the negative binomial variance.

Here \(\phi_g\) describes the negative binomial mean-variance relationship, while \(q_g\) describes additional variation relative to that relationship. A value \(q_g=1\) corresponds to the negative binomial variance as specified; \(q_g>1\) means the variance is larger. The two dispersions are not interchangeable. Earlier material on dispersion estimation and shrinkage concerns \(\phi_g\); QL inference adds estimation and moderation of \(q_g\).

A standard setup assumes a correct log-mean model, such as \(\log(\mu_{gj})=o_{gj}+x_j^\mathsf{T}\beta_g\), where \(o_{gj}\) is a known offset and \(x_j\) is the design row. It also assumes independent samples conditional on the model, a suitable negative binomial variance function, and enough residual information to estimate variability. The design, offsets, and negative binomial dispersion must be handled appropriately: a QL multiplier cannot repair a systematically wrong mean model or an omitted covariate.

What the Test Tests

Let \(\beta_g\) be the coefficient vector for gene \(g\), and let \(C\) specify the contrast or set of contrasts of interest. The null hypothesis is \(H_0:C\beta_g=0\); the alternative is that at least one tested contrast is nonzero. For example, \(C\) might select the treatment coefficient in a two-condition design, or select a set of coefficients for a joint test.

Let \(\widehat{\beta}_g\) be the fitted coefficients, and let \(V_{0,g}\) be their estimated covariance matrix under the negative binomial model with \(q_g=1\). If there are \(r\) tested contrasts, a schematic QL statistic is

$$ F_g= \frac{ (C\widehat{\beta}_g)^\mathsf{T} \left(CV_{0,g}C^\mathsf{T}\right)^{-1} (C\widehat{\beta}_g) }{ r\,\widehat{q}_g } \ \approx\ F_{r,\nu_g}. $$

The fitted contrast and its negative-binomial covariance form the numerator; the estimated QL dispersion scales the statistic to account for extra variability. The numerator degrees of freedom \(r\) equal the number of independent restrictions tested. The denominator degrees of freedom \(\nu_g\) reflect residual information and, when dispersion estimates are moderated, information borrowed across genes. Exact implementations can use adjustments to the statistic and degrees of freedom, so this expression is a useful schematic rather than a universal software formula.

For one contrast, the quadratic form reduces to a squared standardized contrast. The QL F statistic is then equivalent to a squared t-like statistic, with \(F_{1,\nu}=t_\nu^2\). The p-value is the upper-tail probability under the relevant F reference distribution. A small p-value is evidence against the specified coefficient null, given the model and variance estimation; it is not the probability that the null is true.

Why the Variance Multiplier Changes Inference

A short variance argument shows the role of \(q_g\). For one contrast estimate \(\widehat{\theta}\), suppose its variance under the negative binomial model alone is \(v_0\). Under the QL model it is approximately \(q_gv_0\). Therefore its standard error is multiplied by \(\sqrt{q_g}\), and its squared standardized value is divided by \(q_g\):

$$ \operatorname{Var}(\widehat{\theta})\approx q_gv_0, \qquad SE(\widehat{\theta})\approx\sqrt{q_gv_0}, \qquad \frac{\widehat{\theta}^{\,2}}{q_gv_0} = \frac{1}{q_g}\frac{\widehat{\theta}^{\,2}}{v_0}. $$

Thus, holding the fitted contrast and baseline covariance fixed, a larger QL dispersion reduces the test statistic. But \(q_g\) is estimated rather than known. Treating it as known would understate uncertainty, particularly with few residual degrees of freedom. QL procedures therefore use an F-type reference distribution, and commonly moderate gene-wise QL dispersion estimates toward a shared trend or prior. This makes the inference reflect both the estimated variance level and the limited information available to estimate it.

Worked Example: One Contrast With Extra Variability

Suppose a hypothetical two-condition RNA-seq experiment gives a treatment log-mean contrast estimate of \(0.6931\), with a negative-binomial-only standard error of \(0.2000\). The estimated QL dispersion is \(1.44\), and the relevant denominator degrees of freedom are 8. Test the treatment contrast against zero.

The contrast is on the natural-log scale. The estimated log2 fold change is \(0.6931/\log(2)=1.000\), or a twofold difference in fitted mean counts. The QL-adjusted standard error is $$ 0.2000\sqrt{1.44}=0.2400. $$

The t-like statistic is \(0.6931/0.2400=2.888\), so the one-contrast F statistic is \(2.888^2=8.34\). Using an \(F_{1,8}\) reference distribution gives a two-sided p-value of approximately \(0.020\) (equivalently, the two-sided \(t_8\) p-value). The data provide evidence of a nonzero treatment contrast at the 0.05 level under the stated model.

For comparison, using the negative-binomial-only standard error would give \(0.6931/0.2000=3.466\), a much larger statistic and a smaller p-value. That comparison illustrates why the QL adjustment can be more conservative: the estimated variance is 44% above the negative binomial baseline, and its estimation has limited degrees of freedom. It does not change the contrast being tested.

Estimating and Moderating Quasi-Likelihood Dispersion

In practice, a gene’s residual variation provides information about \(q_g\). A rough moment-based illustration uses residual deviance divided by residual degrees of freedom. This ratio is not an exact universal estimator: practical implementations may adjust residual quantities for leverage and use their own estimation procedures. Its purpose here is to show why gene-wise dispersion estimates can be unstable when a gene has few residual degrees of freedom.

Moderation stabilizes such estimates by combining gene-specific information with information from a distribution or trend shared across genes. Under a simple chi-square approximation, suppose an unmoderated estimate \(\widehat{q}_g\) has \(d\) residual degrees of freedom and a prior value \(q_0\) has prior degrees of freedom \(d_0\). A transparent weighted estimate is

$$ \widehat{q}_{g,\mathrm{mod}} = \frac{d\widehat{q}_g+d_0q_0}{d+d_0}. $$

This is an illustrative moderation formula, not a claim that every implementation uses this exact calculation. The principle is that a noisy gene-wise estimate receives more shrinkage toward the shared value than a precise estimate does. Moderation also informs the effective denominator degrees of freedom used for testing.

Worked Example: A Moderated QL Dispersion Estimate

For a hypothetical gene, suppose a simple residual-deviance estimate is \(18.0\) on \(12\) residual degrees of freedom. The unmoderated estimate is \(18.0/12=1.50\). Suppose the shared prior value is \(q_0=1.00\), with prior degrees of freedom \(d_0=8\).

Using the weighted approximation, $$ \widehat{q}_{g,\mathrm{mod}} = \frac{12(1.50)+8(1.00)}{12+8} = \frac{18+8}{20} = 1.30. $$

The moderated estimate is 1.30, rather than the noisy gene-wise estimate 1.50. In this simplified example it indicates a variance multiplier 30% above the negative binomial baseline. It is not a 30% increase in the fitted mean, nor does it mean the gene has passed a test of excess variability. The moderation is used to make the coefficient-contrast test better calibrated.

Worked Example: A Joint Test of Two Contrasts

Suppose a hypothetical gene has two estimated contrasts, \(0.300\) and \(-0.100\), and their negative-binomial covariance matrix is diagonal with variances \(0.040\) and \(0.010\). A joint test asks whether both contrasts are zero. Suppose the moderated QL dispersion is \(1.30\) and the denominator degrees of freedom are 12.

The unscaled quadratic form is $$ \frac{0.300^2}{0.040}+\frac{(-0.100)^2}{0.010} =2.25+1.00=3.25. $$ There are \(r=2\) restrictions, so the schematic QL F statistic is $$ F=\frac{3.25}{2(1.30)}=1.250. $$

For \(F_{2,12}\), the upper-tail p-value is approximately \(0.3213\). There is not strong evidence against the joint null at the 0.05 level. The test concerns whether the two specified contrasts are jointly zero; neither the p-value nor the QL dispersion is a probability that the null is true.

Assumptions, Diagnostics, and Alternatives

QL inference is useful only if the mean model and variance structure are credible. Check that the design represents the experimental comparisons, offsets account for library sizes, and the negative binomial dispersion estimates are reasonable. Residual patterns, unusually influential counts, and markedly elevated QL dispersions can flag lack of fit or extra variability. These signs call for investigation; a large \(q_g\) alone does not identify the cause. It could reflect real biological variation, an outlying observation, an omitted design feature, or another model failure.

A QL adjustment cannot make dependent samples independent, correct confounding, or compensate for an inappropriate mean relationship. Very few residual degrees of freedom also limit gene-specific variance estimation, even when moderation helps. Conversely, an estimated \(q_g\) below 1 is possible; QL testing is not guaranteed to be more conservative for every gene. Its aim is calibrated inference accounting for variance estimation, not uniformly larger p-values.

The Wald test evaluates a coefficient contrast using an estimated standard error, typically with a normal or t reference approximation. The LRT compares fitted likelihoods under the full and null models and commonly uses a chi-square reference distribution. Both are appropriate tools under their assumptions, but the QL test explicitly accommodates extra variance beyond the negative binomial variance and the uncertainty in estimating that extra component. It is not simply a test of whether \(q_g\) exceeds 1, and it does not replace the negative binomial mean model. Which test is preferable depends on the design, sample size, and variance-estimation procedure.

Common pitfall: “The QL test asks whether a gene is more variable than the negative binomial model predicts.” That is not its coefficient-test null. The corrected interpretation is: a QL test tests a specified coefficient contrast while accounting for whether the remaining variability exceeds the negative binomial variance. The QL dispersion affects the uncertainty and reference distribution for that contrast.

Check Your Understanding

Answer each question, then compare with the solutions below.

  1. What is the difference between \(\phi_g\) and \(q_g\) in the variance model?
  2. A one-contrast test has negative-binomial-only standard error \(0.15\) and QL dispersion \(q_g=1.96\). What is its QL-adjusted standard error?
  3. What coefficient hypothesis is tested by a joint QL F test with three restrictions?
  4. Why can moderation help when each gene has few residual degrees of freedom, and what can it not fix?

Solutions. (1) \(\phi_g\) defines the negative binomial variance \(\mu_{gj}+\phi_g\mu_{gj}^{2}\); \(q_g\) multiplies that variance to allow additional variability. (2) The adjusted standard error is \(0.15\sqrt{1.96}=0.15(1.40)=0.210\). (3) It tests the joint null that all three specified contrasts are zero; rejection indicates evidence that at least one is nonzero. (4) Moderation combines noisy gene-wise information with shared information, stabilizing dispersion estimates and informing the test’s degrees of freedom. It cannot repair an incorrect mean model, confounding, dependence, or an inappropriate experimental design.

Clinical Biostats