Why Test Several Coefficients Together?
A gene-level linear model can describe expression across multiple groups or conditions using several regression coefficients. Sometimes the question concerns one coefficient, such as whether one group differs from a reference group. Other times the question is whether a set of coefficients is jointly zero. For example, a researcher may ask whether a gene has any effect across several non-reference groups, without specifying in advance which group should differ. A joint test answers that question while accounting for the covariance among the coefficient estimates.
In microarray analysis, gene-wise residual variances can be imprecise when each gene has few residual degrees of freedom. Empirical Bayes moderation stabilizes these variances by combining each gene's residual information with a variance prior estimated across genes. A moderated F-test applies that stabilized variance to a joint coefficient test. The result is one test for the specified set of restrictions, not a collection of separate tests.
Model, Restrictions, and Assumptions
For gene \(g\), write the linear model as \(y_g=X\beta_g+\varepsilon_g\), where \(y_g\) is the vector of measured expression values, \(X\) is the design matrix, and \(\beta_g\) is the vector of regression coefficients. Assume that, conditional on the gene-specific residual variance \(\sigma_g^2\), the errors are normally distributed with mean zero and covariance \(\sigma_g^2 I\). Thus observations are independent and have a common residual variance within the gene. The design matrix is taken to have full column rank, and the residual degrees of freedom are positive.
Let \(\widehat{\beta}_g\) be the least-squares estimate, \(s_g^2\) the residual variance estimate, and \(df_g\) its residual degrees of freedom. The unscaled covariance matrix \(V=(X'X)^{-1}\) gives the coefficient covariance as \(\sigma_g^2 V\). In applications that represent a contrast covariance directly, the same role is played by the corresponding unscaled covariance matrix.
A matrix \(C\) can have redundant rows: for example, one restriction may be the sum of two others. The rank of \(C\) still gives the number of distinct restrictions, but the matrix \(CVC'\) formed from all the redundant rows is singular. The formula below therefore uses a full-row-rank representation of the restrictions, not a redundant one. If the design is rank deficient, the coefficient vector is not uniquely identified; the restrictions must be expressed in terms of estimable functions before applying a test.
For moderation, the empirical-Bayes model assigns a scaled inverse-chi-squared prior to the residual variance, with prior degrees of freedom \(d_0\) and prior scale \(s_{0g}^2\). The scale may be common across genes or gene-specific, for example when a mean-variance trend is used. Conditional on the fitted prior settings, the moderated variance and total degrees of freedom are
This is a weighted average of the prior variance scale and the gene's residual variance, with weights given by their degrees of freedom. The prior settings are estimated from the collection of genes; treating those fitted settings as fixed gives the usual empirical-Bayes moderated reference test. Consequently, the reference distribution is conditional on the fitted hyperparameters, and uncertainty from estimating them is not fully represented by the per-gene statistic.
Deriving the Moderated F-Test
With \(q\) independent restrictions, the estimated restricted effects are \(C\widehat{\beta}_g\). Their covariance, apart from the residual variance, is \(CVC'\). The quadratic form using its inverse measures the joint size of the estimated effects while accounting for their scale and correlation. Dividing that quadratic form by \(q\) gives a mean squared effect. Dividing again by the moderated residual variance yields the moderated F-statistic:
Under the normal linear model and the scaled inverse-chi-squared variance prior, with prior settings treated as fixed, the moderated reference distribution under \(H_0\) is \(F_{q,\,df_{g,\mathrm{total}}}\). The numerator degrees of freedom count independent restrictions; the denominator degrees of freedom combine the gene's residual degrees of freedom with the prior degrees of freedom. In empirical-Bayes use, estimated prior settings make this a plug-in reference distribution.
Write the coefficient restrictions as \(C\beta_g=0\), and identify which coefficients or combinations are being tested.
Find \(q=\operatorname{rank}(C)\). Replace redundant rows with \(q\) independent rows spanning the same restrictions; confirm the restrictions are estimable.
Calculate \(s_{g,\mathrm{post}}^2\) and \(df_{g,\mathrm{total}}\) from the gene-wise residual estimate and the fitted prior settings.
Evaluate the quadratic form, divide by \(q s_{g,\mathrm{post}}^2\), and compare the result with the \(F_{q,\,df_{g,\mathrm{total}}}\) reference distribution.
Worked Calculations
Worked Example: A Two-Coefficient Joint Test
Suppose a hypothetical gene has two coefficients of interest, each measured in log2 expression units. The estimates are \(1.2\) and \(-0.6\). The selected two-row restriction matrix tests whether both coefficients are zero. For this example, the relevant unscaled covariance matrix and variance information are
There are \(q=2\) independent restrictions. First, moderate the residual variance:
The determinant of \(CVC'\) is \(0.04(0.09)-0.01^2=0.0035\), so its inverse exists and is \(\begin{pmatrix}25.714&-2.857\\-2.857&11.429\end{pmatrix}\), to the displayed precision. The quadratic form is
Therefore \(F_g^{\mathrm{mod}}=45.257/(2(0.118))\approx191.8\), with reference distribution \(F_{2,10}\). For \(F_{2,10}\), the upper-tail probability is \((10/(10+2F))^5\), giving \(p\approx1.06\times10^{-8}\). Under the model and fitted prior settings, this is strong evidence against the null that both coefficients are zero. It does not identify which coefficient, on its own, is responsible for the joint result.
Worked Example: Removing a Redundant Restriction
Consider three stated restrictions: \(\beta_1=0\), \(\beta_2=0\), and \(\beta_1+\beta_2=0\). The third is implied by the first two. A matrix containing all three rows has rank \(q=2\), but \(CVC'\) for that three-row matrix is singular, so its ordinary inverse cannot be used. Use the first two independent rows instead. Suppose their estimated effects are \(0.5\) and \(-0.2\), and their unscaled covariance matrix is \(0.04I\). Take \(s_g^2=0.30\), \(df_g=3\), \(s_{0g}^2=0.10\), and \(d_0=5\).
The reduced covariance matrix is invertible, with inverse \(25I\). The quadratic form is \(0.5^2(25)+(-0.2)^2(25)=6.25+1=7.25\). The moderated variance and total degrees of freedom are
Thus \(F_g^{\mathrm{mod}}=7.25/(2(0.175))\approx20.71\), with reference distribution \(F_{2,8}\). Its upper-tail probability is \((8/(8+2(20.71)))^4\approx0.000686\). This calculation tests the same joint null as the original three statements, using a valid two-row matrix and numerator degrees of freedom \(q=2\).
Worked Example: A Single Contrast Is Not the Same Null
Suppose two coefficients have estimates \(0.8\) and \(0.8\), unscaled covariance \(V=0.04I\), and moderated variance \(s_{g,\mathrm{post}}^2=0.20\). A joint test of \(\beta_1=\beta_2=0\) has quadratic form \(0.8^2/0.04+0.8^2/0.04=32\), so \(F^{\mathrm{mod}}=32/(2(0.20))=80\), with two numerator degrees of freedom.
Now consider the single contrast \(\beta_1+\beta_2=0\). Its estimate is \(1.6\), and its unscaled variance is \((1,1)V(1,1)'=0.08\). The moderated t-statistic is \(t^{\mathrm{mod}}=1.6/\sqrt{0.08(0.20)}\approx12.65\), so its squared value is approximately \(160\). Squaring this single-contrast statistic gives a one-degree-of-freedom test of the sum, not the two-degree-of-freedom test that both coefficients are zero. The hypotheses differ, so the statistics need not agree.
Comparison, Diagnostics, and Limitations
| Procedure | Question answered | Key distinction |
|---|---|---|
| Moderated F-test | Are all \(q\) specified independent restrictions satisfied? | One joint test; uses a \(q\)-dimensional quadratic form. |
| Moderated t-test | Is one specified contrast equal to zero? | A single restriction; its squared statistic corresponds to an F-test with one numerator degree of freedom. |
| Separate moderated t-tests | Is each of several individual contrasts equal to zero? | Answers several distinct questions, not one joint question; interpreting them together requires attention to multiplicity and dependence. |
| Ordinary F-test | Is a set of restrictions satisfied using the gene's residual variance? | Uses \(s_g^2\) and \(df_g\), rather than the moderated variance and total degrees of freedom. |
Before interpreting a result, check the design and restrictions. A non-full-rank design, non-estimable restriction, or redundant rows can invalidate the matrix calculation. Also check that the supplied unscaled covariance matrix corresponds to the coefficients and parameterization in \(C\); changing coefficient scales changes the corresponding covariance entries. Confirm that \(q\) is the number of independent restrictions, not simply the number of rows initially written down.
The normal, independent, common-within-gene variance model is an assumption, not a guarantee. Strong outliers, dependence among observations not represented in the design, or severe variance misspecification can undermine the gene-wise model. The empirical-Bayes variance prior also relies on information pooled across genes; poorly fitted prior settings can distort moderation. Robust empirical-Bayes fitting can limit the influence of hypervariable genes on the prior, but it does not repair a misspecified design or an invalid restriction. A moderated F-test provides evidence about a specified joint null; it does not show that every coefficient is nonzero, establish a biological mechanism, or imply causation.
Check Your Understanding
Try each question, then compare with the brief solutions below.
- A null hypothesis is written with four rows in \(C\), but one row is a linear combination of the other three. What is \(q\), and what must be done before using the ordinary inverse formula?
- For \(df_g=5\), \(d_0=7\), \(s_g^2=0.20\), and \(s_{0g}^2=0.10\), calculate the moderated variance and total degrees of freedom.
- A test concerns two independent restrictions and yields \(F^{\mathrm{mod}}=4\) with denominator degrees of freedom 12. State its reference distribution.
- Why does a moderated t-test of \(\beta_1+\beta_2=0\) not generally answer whether both \(\beta_1=0\) and \(\beta_2=0\)?
Solutions. (1) The rank is \(q=3\). Replace the four rows by three independent rows spanning the same restrictions; then use the invertible \(3\times3\) restriction covariance matrix. (2) \(s_{g,\mathrm{post}}^2=(7(0.10)+5(0.20))/12=1.70/12\approx0.1417\), and \(df_{g,\mathrm{total}}=12\). (3) The reference distribution is \(F_{2,12}\). (4) The single contrast tests only the sum, a one-dimensional restriction. Two separate coefficient restrictions define a two-dimensional joint null, which the contrast alone does not establish.