From Genotype Coding to an Interaction Test
A two-locus association analysis connects three decisions: how genotypes are represented, what regression model is fitted, and which interaction hypothesis is tested. A product term can be computed correctly and still be misleading if the model is poorly supported by the observed genotype combinations or if its coefficient is interpreted outside the coding scheme. This worked analysis follows one hypothetical quantitative-trait dataset from coding through estimation and uncertainty.
The example uses additive allele-dosage coding at both loci. It estimates one additive-by-additive product term, so the interaction block contains one coefficient. The joint test of that block is therefore a one-degree-of-freedom test. This is not a general test of every possible form of gene–gene interaction: a model allowing dominance or arbitrary genotype-specific effects would require additional terms and a different joint test.
Here \(Y_i\) is a quantitative trait for individual \(i\), and \(\varepsilon_i\) is the model error. The coefficients describe conditional mean differences, not causal effects. For example, \(\beta_A\) is the fitted difference per additional \(A\)-allele copy when \(B=0\); it is not necessarily the average effect of locus \(A\) across all \(B\) dosages.
Assumptions and the Simulated Dataset
For the worked inference below, assume individuals are independent, the conditional mean is given by the stated regression model, and errors have mean zero and a common variance \(\sigma^2\). Assume also that the errors are normally distributed for exact small-sample \(t\)- and \(F\)-inference. The simulated dataset has no missing observations or additional covariates. In an actual association analysis, these assumptions and the choice of covariates would need substantive and empirical consideration; the numerical example alone cannot establish them.
Suppose 36 hypothetical individuals are observed, with four individuals in each of the nine dosage combinations. The table gives the mean trait value in each genotype cell. Trait values are in arbitrary trait units.
| \(A\) dosage | \(B=0\) cell mean | \(B=1\) cell mean | \(B=2\) cell mean | Individuals per cell |
|---|---|---|---|---|
| 0 | 10.0 | 9.0 | 8.0 | 4 |
| 1 | 12.0 | 12.5 | 13.0 | 4 |
| 2 | 14.0 | 16.0 | 18.0 | 4 |
To make the individual-level data explicit, suppose that within every cell the four outcomes equal that cell's mean plus \(-1.0\), \(-0.5\), \(0.5\), and \(1.0\) trait units. These deviations sum to zero, so the displayed values are the cell means. Their squared sum within a cell is \(1^2+0.5^2+0.5^2+1^2=2.5\).
Worked Example: Coding the Two Loci
An individual has genotype \(A/a\) at locus \(A\) and \(b/b\) at locus \(B\), where \(A\) and \(b\) are the effect alleles. The dosage for locus \(A\) is \(A_i=1\), and the dosage for locus \(B\) is \(B_i=2\). The product term is $$ A_iB_i=(1)(2)=2. $$
That individual's model-predicted mean is therefore \(\beta_0+\beta_A+2\beta_B+2\beta_{AB}\). The product is a predictor value, not a genotype category or an outcome. If the effect allele at a locus is recoded, the corresponding main-effect and interaction coefficients change; comparisons require consistent allele coding.
Fitting the Hierarchical Regression
In this balanced dataset, the cell means follow the stated regression surface exactly. The cell at \((A,B)=(0,0)\) has mean 10, so \(\hat{\beta}_0=10\). Moving from \((0,0)\) to \((1,0)\) changes the mean from 10 to 12, giving \(\hat{\beta}_A=2\) trait units per \(A\)-allele copy when \(B=0\). Moving from \((0,0)\) to \((0,1)\) changes the mean from 10 to 9, giving \(\hat{\beta}_B=-1\) trait unit per \(B\)-allele copy when \(A=0\). The cell at \((1,1)\) then gives the product coefficient: $$ \hat{\beta}_{AB} =\bar{Y}_{11}-\bar{Y}_{10}-\bar{Y}_{01}+\bar{Y}_{00} =12.5-12.0-9.0+10.0 =1.5\text{ trait units per dosage-product unit}. $$