Why Use Moderated Confidence Intervals?
A gene-wise linear model estimates an effect, such as a difference in mean log-expression between two conditions. A confidence interval for that effect communicates both its estimated size and the uncertainty attached to it. In microarray studies, each gene may have only a few residual degrees of freedom, so its own residual variance estimate can be highly variable. Empirical Bayes moderation stabilizes these variance estimates by combining each gene’s residual information with information across genes. This tutorial shows how to use the moderated variance estimate and its degrees of freedom to construct a confidence interval for a single gene-wise contrast.
The interval concerns the contrast estimate in the linear model; moderation changes its estimated uncertainty, not its center. The introductory material on empirical Bayes shrinkage of gene-wise variances gives the motivation for borrowing information across genes. Here the focus is the interval calculation, its assumptions, and the interpretation of how shrinkage affects its width.
Model, Contrast, and Moderated Variance
For gene \(g\), let \(y_g\) be its vector of measured expression values and \(X\) the design matrix. The gene-wise linear model is \(y_g=X\beta_g+\varepsilon_g\), where \(\beta_g\) is the coefficient vector. Assume the errors are normally distributed with mean zero and variance \(\sigma_g^2\), and are independent across samples within the gene. The model’s design and contrast must be specified so that the target effect is estimable. Let \(c\) be the contrast vector, and write the target as \(\theta_g=c^\mathsf{T}\beta_g\). The ordinary least-squares estimate is \(\hat{\theta}_g=c^\mathsf{T}\hat{\beta}_g\).
Under this model, the covariance matrix of \(\hat{\beta}_g\), conditional on \(\sigma_g^2\), is \(\sigma_g^2(X^\mathsf{T}X)^{-1}\) when the design has full column rank. More generally, use the appropriate covariance matrix for the fitted design. Define \(q_g\) as the contrast’s unscaled variance factor: the variance of \(\hat{\theta}_g\) is \(\sigma_g^2q_g\). Thus \(q_g\) depends on the design and contrast, not on the gene’s residual variance.
Let \(s_g^2\) be the ordinary residual variance estimate and \(d_g\) its residual degrees of freedom. Moderation models the gene variances with a scaled inverse-chi-squared prior. For gene-specific prior degrees of freedom \(d_0\) and prior scale \(s_{0g}^2\), the parameterization is defined by \(d_0s_{0g}^2/\sigma_g^2\sim\chi^2_{d_0}\). The prior scale is not generally the prior mean variance: when \(d_0>2\), that mean is \(d_0s_{0g}^2/(d_0-2)\).
The weighted average in the formula is an average of scale parameters, weighted by their degrees of freedom. It does not say that the posterior mean variance is this weighted average. If \(d_{g,\mathrm{post}}>2\), the posterior mean variance is \(d_{g,\mathrm{post}}s_{g,\mathrm{post}}^2/(d_{g,\mathrm{post}}-2)\). The moderated standard error conventionally uses the posterior scale, not that posterior mean variance.
From the Variance Model to an Interval
The interval uses the moderated standard error together with a Student \(t\) critical value at the moderated degrees of freedom. The justification follows from the normal linear model and the scaled inverse-chi-squared variance distribution. Conditional on a variance, the contrast estimate has a normal sampling distribution with variance \(\sigma_g^2q_g\). The residual sum of squares divided by \(\sigma_g^2\) has a chi-squared distribution with \(d_g\) degrees of freedom and, under the normal model, is independent of the coefficient estimate. Combining this residual information with the prior yields the posterior variance distribution defined above. Integrating the normal uncertainty in the contrast over that variance distribution gives a Student \(t\) distribution centered at \(\hat{\theta}_g\), with scale \(\sqrt{s_{g,\mathrm{post}}^2q_g}\) and \(d_0+d_g\) degrees of freedom.
Here \(t_{1-\alpha/2,\ d_{g,\mathrm{post}}}\) is the \(1-\alpha/2\) quantile of the Student \(t\) distribution. Under the stated variance model, this is a central \(100(1-\alpha)\%\) interval for the contrast. In empirical Bayes analysis, the prior parameters are usually estimated from the collection of genes and then treated as fixed for the calculation. Consequently, the displayed interval is ordinarily a plug-in, gene-wise interval: its model-based interpretation depends on the assumptions and on the estimated prior parameters being suitable. It is not a simultaneous interval for all genes.
Worked Example: A Contrast With a Smaller Moderated Standard Error
Suppose a hypothetical gene has a contrast estimate of \(0.70\) log2-expression units, ordinary residual variance \(s_g^2=0.0900\), and residual degrees of freedom \(d_g=4\). Let the fitted prior have \(d_0=8\) and prior scale \(s_{0g}^2=0.0400\), and let the contrast’s unscaled variance factor be \(q_g=0.50\). Assume the linear model and contrast are valid and that the prior parameters are held fixed for this calculation.
The moderated scale and degrees of freedom are $$ s_{g,\mathrm{post}}^2=\frac{8(0.0400)+4(0.0900)}{8+4} =\frac{0.320+0.360}{12}=0.05667, \qquad d_{g,\mathrm{post}}=12. $$ The moderated standard error is $$ \mathrm{SE}_{g,\mathrm{mod}}=\sqrt{0.05667(0.50)} =\sqrt{0.02833}=0.1683\ \text{log2-expression units}. $$
For a 95% interval, \(t_{0.975,12}\approx2.179\). Therefore the margin of error is \(2.179(0.1683)=0.3667\) log2-expression units, and the interval is \(0.70\pm0.3667\), or approximately \([0.3333,1.067]\) log2-expression units. Under the model and plug-in variance assumptions, the interval estimates the gene’s contrast. It does not mean there is a 95% probability that this fixed contrast lies in this particular interval.
For comparison, the ordinary standard error is \(\sqrt{0.0900(0.50)}=0.2121\), with \(4\) residual degrees of freedom. The ordinary 95% margin is approximately \(0.5890\), using the unrounded standard error and \(t_{0.975,4}\), giving \([0.1110,1.2890]\). In this example moderation both lowers the variance estimate and increases the degrees of freedom, so the moderated interval is narrower.
Shrinkage Can Widen an Interval
Moderation does not guarantee a narrower interval for every gene. If a gene’s residual variance is below its prior scale, shrinkage moves its moderated scale upward. The larger scale can outweigh the reduction in the critical value that comes from having more degrees of freedom. The next calculation holds the contrast estimate and design factor fixed to isolate this effect.
Worked Example: A Smaller Residual Variance Is Shrunk Upward
For a second hypothetical gene, let \(\hat{\theta}_g=-0.30\) log2-expression units, \(s_g^2=0.0100\), and \(d_g=4\). Use \(d_0=8\), \(s_{0g}^2=0.0400\), and \(q_g=0.50\). The same normal linear-model assumptions apply.
The moderated scale is $$ s_{g,\mathrm{post}}^2=\frac{8(0.0400)+4(0.0100)}{12} =\frac{0.320+0.040}{12}=0.03000, \qquad d_{g,\mathrm{post}}=12. $$ The moderated standard error is \(\sqrt{0.03000(0.50)}=\sqrt{0.01500}=0.1225\) log2-expression units. Using \(t_{0.975,12}=2.179\), the margin is \(2.179(0.1225)=0.2669\). Thus the 95% interval is \(-0.30\pm0.2669\), or approximately \([-0.5669,-0.0331]\) log2-expression units.
The ordinary standard error would be \(\sqrt{0.0100(0.50)}=0.07071\). With \(4\) degrees of freedom, the ordinary margin is \(2.776(0.07071)=0.1963\), yielding \([-0.4963,-0.1037]\). The moderated interval is wider because this gene’s unusually small residual variance was pulled upward toward the prior scale. The point estimate remains \(-0.30\) in both intervals.
Contrast Scale and Units
A confidence interval inherits its meaning and units from the contrast. For a difference between two group means on a log2-expression scale, its endpoints are log2-expression differences. If a fold-change interpretation is useful, exponentiating the estimate and both interval endpoints with base 2 gives the corresponding ratio scale. The transformation must be applied consistently to all three values; simply labeling a log2-scale endpoint as a fold change is incorrect.
Worked Example: Interval for a Difference Contrast
Suppose a hypothetical two-group analysis estimates a treated-minus-control contrast as \(0.45\) log2-expression units. Let \(s_g^2=0.0625\), \(d_g=6\), \(d_0=10\), prior scale \(s_{0g}^2=0.0400\), and contrast factor \(q_g=0.20\). Assume the contrast is estimable and the normal model and variance moderation assumptions are reasonable.
The moderated scale is $$ s_{g,\mathrm{post}}^2 =\frac{10(0.0400)+6(0.0625)}{16} =\frac{0.400+0.375}{16} =0.04844, \qquad d_{g,\mathrm{post}}=16. $$ Hence \(\mathrm{SE}_{g,\mathrm{mod}}=\sqrt{0.04844(0.20)}=\sqrt{0.009688}=0.09843\) log2-expression units. With \(t_{0.975,16}\approx2.120\), the margin is \(2.120(0.09843)=0.2087\). The 95% interval is \(0.45\pm0.2087=[0.2413,0.6587]\) log2-expression units.
On a ratio scale, the point estimate corresponds to \(2^{0.45}\approx1.366\), and the endpoints correspond to \(2^{0.2413}\approx1.182\) and \(2^{0.6587}\approx1.579\). Thus the fitted expression ratio is about 1.366, with transformed interval endpoints about 1.182 and 1.578, subject to the same model-based qualifications.
Assumptions, Diagnostics, and Alternatives
The interval’s assumptions deserve attention before interpreting its endpoints. Within each gene, the linear model should represent the mean structure, residual errors should be approximately normal and independent with a common variance across samples, and the contrast must be estimable. The variance moderation additionally relies on a suitable prior scale and prior degrees of freedom for the genes being analyzed. The plug-in interval does not account fully for uncertainty in estimating those hyperparameters.
Useful diagnostics include residual-versus-fitted plots and sample-level checks for outliers or unusual variance patterns, considered in the context of the design. Inspecting the distribution of residual variances across genes can reveal extreme values or a broad pattern that a single prior scale may not represent. If the assumed variance pattern changes with average expression, a mean-variance trend may be needed. If a small set of genes is unusually variable, robust estimation of prior parameters may be relevant. These checks assess whether the model and moderation are plausible; they do not prove that all assumptions hold.
An ordinary gene-wise interval uses \(s_g^2\) and \(d_g\), so it does not borrow variance information across genes. It can be appropriate when each gene has ample residual information, but small-sample estimates can be unstable. A moderated interval replaces that variance estimate with the posterior scale and uses the increased moderated degrees of freedom. A normal-based interval using a fixed critical value would ignore the finite degrees of freedom and is not the same procedure. These are gene-wise intervals: they do not provide simultaneous coverage across thousands of genes, nor do they by themselves resolve multiplicity when many genes are examined.
Practical Interpretation
A moderated interval makes the gene-wise effect estimate easier to assess than a point estimate alone: its center gives the estimated contrast, and its width reflects the contrast’s design factor, moderated variance scale, and moderated degrees of freedom. Shrinkage acts on the uncertainty calculation rather than pulling the contrast estimate toward zero. A narrow interval is not automatically evidence of a large biological effect, and an interval that excludes zero is not a statement about the probability that the null hypothesis is true. Report the contrast, scale, interval, and gene-wise nature of the inference clearly.
State the gene-wise contrast, its expression scale, and the design-based factor \(q_g\).
Combine residual variance and prior scale using their degrees of freedom, then calculate \(\sqrt{s_{g,\mathrm{post}}^2q_g}\).
Use the Student \(t\) critical value with \(d_0+d_g\) degrees of freedom; interpret the endpoints in the contrast’s units and qualify the model-based, gene-wise inference.
Check Your Understanding
Answer these questions, then compare your reasoning with the solutions.
- For \(d_0=6\) and \(s_{0g}^2=0.0300\), what is the prior mean variance? Assume the prior degrees of freedom exceed 2.
- If \(s_g^2\) is smaller than \(s_{0g}^2\), must the moderated interval be narrower than the ordinary interval? Explain.
- What changes and what stays fixed when a gene’s variance is moderated?
- Does a gene-wise 95% moderated interval guarantee 95% simultaneous coverage over all genes?
Solutions. (1) The prior mean variance is \(6(0.0300)/(6-2)=0.04500\), not \(0.0300\). (2) No. Shrinkage raises the moderated scale in this case, and the resulting increase in standard error may outweigh the smaller \(t\) critical value. (3) The contrast estimate stays fixed; its moderated standard error and degrees of freedom change. (4) No. The interval is gene-wise and does not guarantee simultaneous coverage across genes.