Tutorials › Statistical Genetics › Cell-Mean Contrasts At A Two-Locus Table

Gene–Gene Interaction · Tutorial 816 of 989

Cell-Mean Contrasts At A Two-Locus Table

Use cell means and difference-in-differences contrasts to describe and test departures from additive locus effects on a quantitative-trait mean scale.

Advanced 10 min read

What You'll Learn

  • Define additivity of two locus effects using the nine genotype-cell means.
  • Derive difference-in-differences contrasts that compare locus effects across genotypes at the other locus.
  • Show why four independent contrasts are needed for a three-by-three genotype table.
  • Calculate an interaction sum of squares and an F statistic for a balanced table.
  • Compute a contrast standard error and t statistic when cell sizes are unequal.
  • Distinguish statistical departures from additivity on the mean scale from biological interaction.

Why Use a Cell-Mean Table?

For two loci with three genotype categories each, the outcome means can be arranged in a three-by-three table. This representation makes a particular question visible: does the mean difference between genotypes at one locus stay the same across the genotypes at the other locus? If it does not, the table departs from an additive pattern on the quantitative-trait mean scale.

The question is about the pattern of means, not about whether either locus has an effect at all. Both loci can have substantial mean differences and still combine additively. Conversely, a departure from additivity can occur even when a summary of each locus's marginal effect looks modest.

Definition: Let \(i,j\in\{0,1,2\}\) index genotype categories at loci A and B, respectively, and let \(\mu_{ij}\) be the population mean of a quantitative trait in the cell with genotype \(i\) at A and genotype \(j\) at B. The cell means are additive across loci on the mean scale if there are values \(\mu,\alpha_i,\beta_j\) such that \(\mu_{ij}=\mu+\alpha_i+\beta_j\) for every cell. The genotype effects \(\alpha_i\) and \(\beta_j\) may be arbitrary across the three categories; this definition does not require a linear per-allele trend.

The same condition can be written using row means, column means, and the grand mean. In the population table, define \(\mu_{i\cdot}\) as the mean for row \(i\) averaged over the three B categories with equal weighting, \(\mu_{\cdot j}\) as the corresponding column mean, and \(\mu_{\cdot\cdot}\) as the equally weighted grand mean. Equal weighting here defines a property of the nine cell means; it is not a claim that the population genotype frequencies are equal.

$$ \mu_{ij}=\mu_{i\cdot}+\mu_{\cdot j}-\mu_{\cdot\cdot} \quad\text{for every }i,j $$

This equation says that the mean predicted by combining the two locus-specific patterns equals the actual cell mean. The difference between the actual mean and this additive prediction is the cell's interaction departure. In a sample, \(\bar{x}_{ij}\) estimates \(\mu_{ij}\), and the same calculations describe estimated departures.

Difference-in-Differences Contrasts

A contrast compares means using coefficients whose sum is zero. For example, compare the change from genotype 0 to genotype 1 at locus A when locus B is 0 with that same change when locus B is 1. The difference between those two changes is a difference-in-differences contrast.

$$ D_{01,01} =(\mu_{11}-\mu_{01})-(\mu_{10}-\mu_{00}) =\mu_{11}-\mu_{01}-\mu_{10}+\mu_{00} $$

Under an additive mean pattern, the A effect in the first parenthesis is \(\alpha_1-\alpha_0\), and the A effect in the second parenthesis is also \(\alpha_1-\alpha_0\). Their difference is zero. Thus, a nonzero contrast indicates that this particular A-genotype difference varies between the two stated B genotypes. The contrast is measured in the units of the quantitative trait.

Worked Example: A Single Difference-in-Differences

Suppose a hypothetical analysis gives these cell means for a trait measured in units:

Locus A genotypeB = 0B = 1B = 2
A = 0101214
A = 1131517
A = 2161820

For B = 0, the mean difference from A = 0 to A = 1 is \(13-10=3\) units. For B = 1, it is \(15-12=3\) units. Therefore,

$$ D_{01,01}=(15-12)-(13-10)=3-3=0\text{ units}. $$

This contrast shows no departure for this particular comparison. In fact, the entire table follows an additive pattern: moving one category higher at A adds 3 units, and moving one category higher at B adds 2 units. A zero contrast alone does not establish that every possible contrast is zero; the remaining genotype comparisons must also be considered.

For three categories at each locus, use two linearly independent contrasts within each locus. One convenient pair is \(c_1=(-1,1,0)\) and \(c_2=(-1,0,1)\), representing category 1 versus 0 and category 2 versus 0. Applying one contrast to each locus gives four cross-contrasts:

$$ D_{ab}=\sum_{i=0}^{2}\sum_{j=0}^{2}c_{a,i}c_{b,j}\mu_{ij}, \qquad a,b\in\{1,2\}. $$

For instance, \(D_{11}\) is the comparison calculated above, and \(D_{12}\) compares the A = 0 to A = 1 difference between B = 0 and B = 2. The four contrasts correspond to the four possible pairings of the two independent contrasts at A and the two at B. Their values all equal zero if and only if the table has an additive mean pattern.

Why Four Contrasts Capture the Departure

There are nine cell means. An additive representation uses one overall mean, two independent A-genotype effects, and two independent B-genotype effects: five parameters in total. The remaining four dimensions describe departures from additivity. The following justification shows how the four cross-contrasts capture precisely those dimensions.

1
Remove row and column patterns.
For each cell, subtract its row mean and column mean, then add the grand mean. The resulting residual is \(r_{ij}=\mu_{ij}-\mu_{i\cdot}-\mu_{\cdot j}+\mu_{\cdot\cdot}\). These residuals have row sums and column sums equal to zero.
2
Relate residuals to the contrasts.
Each \(c_a\) has coefficients summing to zero. Consequently, \(c_a^\mathsf{T}(\mu_{ij})c_b=c_a^\mathsf{T}(r_{ij})c_b\): the grand, row, and column patterns cancel from each cross-contrast.
3
Check whether any departure remains.
The zero-row-sum, zero-column-sum residual tables have four independent entries. The two chosen contrasts span the two-dimensional zero-sum contrast space at each locus. Thus their four cross-products are a complete set of coordinates for the residual table: all four are zero exactly when every \(r_{ij}=0\).

Equivalently, \(r_{ij}=0\) in every cell means \(\mu_{ij}=\mu_{i\cdot}+\mu_{\cdot j}-\mu_{\cdot\cdot}\), the additive condition. This is why checking only one difference-in-differences is not a global test: it checks one of four independent directions of departure.

A Global Test for the Four Departures

For a balanced design with \(n\) independent observations in every cell, suppose trait values have normally distributed errors with common variance \(\sigma^2\) and are independent across individuals. The full cell-means model allows nine means; the additive model imposes four constraints. The interaction sum of squares is the variation of the observed cell means around their additive predictions, multiplied by the common cell size.

$$ SS_{\text{departure}} =n\sum_{i=0}^{2}\sum_{j=0}^{2} \left(\bar{x}_{ij}-\bar{x}_{i\cdot}-\bar{x}_{\cdot j}+\bar{x}_{\cdot\cdot}\right)^2, \qquad F=\frac{SS_{\text{departure}}/4}{MSE}. $$

Here \(MSE\) is the pooled within-cell residual mean square from the full cell-means model. Under the null hypothesis of additivity, the statistic has an \(F\) distribution with 4 numerator degrees of freedom and \(N-9\) denominator degrees of freedom, where \(N\) is the total sample size. This reference distribution requires the stated normality, independence, and common-variance assumptions. The test asks whether the four departures jointly equal zero; it does not identify a biological mechanism.

Worked Example: Testing Additivity in a Balanced Table

Consider a hypothetical study with \(n=8\) independent observations in each of nine genotype cells. The observed cell means, in trait units, are:

Locus A genotypeB = 0B = 1B = 2
A = 0121014
A = 1111717
A = 2161820

Assume independent, normally distributed within-cell errors with a common variance, and suppose the pooled within-cell \(MSE=4\) squared trait units. The row means are 12, 15, and 18; the column means are 13, 15, and 17; and the grand mean is 15. The additive predictions are therefore the row mean plus the column mean minus 15. Subtracting these predictions from the observed means gives residuals:

$$ \begin{pmatrix} 2&-2&0\\ -2&2&0\\ 0&0&0 \end{pmatrix}. $$

The sum of squared residuals is \(2^2+(-2)^2+(-2)^2+2^2=16\). Hence,

$$ SS_{\text{departure}}=8(16)=128,\qquad F=\frac{128/4}{4}=8.00. $$

There are \(N=9(8)=72\) observations and nine fitted cell means, so the denominator degrees of freedom are \(72-9=63\). The result is \(F(4,63)=8.00\), with \(p<0.001\). At the 0.05 significance level, reject the null hypothesis that the nine population means are additive. This provides evidence of a departure from additivity on the trait mean scale; it does not show that the loci interact biologically.

Testing One Contrast When Cell Sizes Differ

A specific contrast can also be estimated and tested directly. Suppose the cell means are estimated from independent individuals and the within-cell errors have common variance \(\sigma^2\). For a contrast with coefficients \(w_{ij}\), the estimated contrast is \(\widehat{D}=\sum_{ij}w_{ij}\bar{x}_{ij}\). Its estimated standard error, using the pooled \(MSE\), is \(\sqrt{MSE\sum_{ij}w_{ij}^2/n_{ij}}\). This formula allows unequal cell sizes; only cells with nonzero contrast coefficients contribute to this contrast's standard error.

Worked Example: An Unequal-Size Contrast

In another hypothetical study, the four relevant cell means are \(\bar{x}_{00}=10\), \(\bar{x}_{01}=12\), \(\bar{x}_{10}=13\), and \(\bar{x}_{11}=16\) trait units. Their sample sizes are 4, 5, 6, and 5, respectively. Suppose the full nine-cell model has pooled \(MSE=9\) squared trait units, based on 45 observations, and its assumptions of independent, normal, common-variance errors are reasonable.

For the difference-in-differences contrast, the coefficients for cells 11, 01, 10, and 00 are \(+1,-1,-1,+1\). Thus the estimated contrast is

$$ \widehat{D}=16-12-13+10=1\text{ trait unit}. $$

The standard error is

$$ SE(\widehat{D}) =\sqrt{9\left(\frac{1}{5}+\frac{1}{5}+\frac{1}{6}+\frac{1}{4}\right)} =\sqrt{7.35} =2.711\text{ trait units}. $$

The full cell-means model estimates nine means, so the residual degrees of freedom are \(45-9=36\). Testing \(H_0:D=0\) gives \(t=1/2.711=0.369\), with 36 degrees of freedom and a two-sided \(p\)-value of approximately 0.714. At the 0.05 level, this contrast is not statistically significant. The estimate is one trait unit, but its standard error is large relative to that estimate; the result does not establish that the population contrast is exactly zero.

Interpretation and Common Pitfalls

Cell-mean contrasts are useful because their definitions stay close to the observed genotype groups. A contrast can say exactly which A-genotype difference is being compared across which B genotypes, and its units remain those of the trait. The four-contrast global test answers a broader question: whether any departure from the additive table is supported by the data.

The word additive here refers specifically to addition of locus-specific components in the expected trait mean. It does not automatically mean an additive allele-dose model, and the nine-cell approach permits each locus to have any pattern across its three genotype categories. Nor does a statistical departure by itself establish a molecular mechanism or causal interaction. Conclusions also depend on the trait scale: additivity of means is a statement about this outcome measured on this scale.

  • Mistake: One zero contrast proves the table is additive. A single contrast checks only one of four independent departure directions. Correction: use a joint four-degree-of-freedom test for the global question, or state clearly that a single contrast addresses only its specified comparison.
  • Mistake: Additivity means a straight-line effect per allele. The cell-mean definition allows arbitrary effects across the three categories at each locus. Correction: distinguish additivity between loci from a separate assumption of linear genotype dosage effects.
  • Mistake: A significant departure proves biological epistasis. The test detects a pattern on the chosen quantitative mean scale under its statistical assumptions. Correction: describe the scale-specific statistical result and avoid turning association into a mechanistic or causal claim.
Key takeaway: A three-by-three two-locus table has four independent departures from additive locus-specific mean patterns. Difference-in-differences contrasts express those departures; one contrast addresses one comparison, while a joint test assesses all four.

Check Your Understanding

Work through these questions using the cell-mean definitions and formulas above.

  1. In a two-locus table, what does it mean for the cell means to be additive across loci?
  2. Why does a zero difference-in-differences for one pair of genotype comparisons not prove global additivity?
  3. How many independent departures from additivity are there in a three-by-three table, and why?
  4. In the balanced global test, what assumptions support the stated \(F\) reference distribution?
  5. Explain why a significant departure from additivity on the mean scale is not, by itself, proof of a biological interaction.
Clinical Biostats