Tutorials › Statistical Genetics › From Genotypes to Regression Predictors

Single-Variant Association Tests · Tutorial 300 of 989

From Genotypes to Regression Predictors

Translate the three genotypes at a biallelic variant into common predictor codings and identify the equality or contrast each coding imposes on genotype-specific trait means.

Intermediate 9 min read

What You'll Learn

  • Code the number of copies of a chosen allele as a dosage from zero to two.
  • Build two reference-genotype indicators for a three-level genotype factor.
  • Construct dominant and recessive indicator predictors from the same genotypes.
  • Relate each coding to the pattern of genotype-specific means it allows.
  • Recognize how changing the effect allele or reference genotype changes coefficient interpretation.
  • Distinguish a predictor representation from an assumption about the genetic effect.

From a Genotype Call to a Predictor

At a biallelic variant, each individual carries two copies of one of two alleles. A regression model cannot use the genotype label by itself as a numerical predictor without specifying how the labels are represented. The representation matters: it determines which genotype comparisons are made and, in a one-predictor model, which patterns of genotype-specific trait means are allowed.

Call the alleles \(A\) and \(B\), and choose \(B\) as the allele whose copies will be counted. The three possible genotypes are \(AA\), \(AB\), and \(BB\). The same genotype can be represented by a dosage, by indicators for genotype categories, or by a dominant or recessive indicator. These are alternative ways to turn genotype information into predictor columns; they are not interchangeable statements about biological mechanism.

Definition: The allele dosage \(G\) for allele \(B\) is the number of \(B\) copies in the genotype: \(G=0\) for \(AA\), \(G=1\) for \(AB\), and \(G=2\) for \(BB\). A genotype factor treats \(AA\), \(AB\), and \(BB\) as three distinct categories. A dominant indicator for \(B\) is 1 for \(AB\) or \(BB\), and 0 for \(AA\). A recessive indicator for \(B\) is 1 for \(BB\), and 0 for \(AA\) or \(AB\).

A predictor is a column of values assigned to individuals. For example, the dosage column is \(0,1,\) or \(2\), while the dominant-indicator column is \(0\) or \(1\). The genotype categories remain the same whichever coding is used. What changes is the model's mathematical description of how the trait mean can differ among those categories.

Four Ways to Represent the Same Genotypes

The table shows the usual predictor values when \(B\) is the counted allele. For a three-level factor, \(I(AB)\) and \(I(BB)\) are indicator variables: each equals 1 when the genotype in parentheses is present and 0 otherwise. \(AA\) is the reference category, represented when both indicators equal 0.

GenotypeDosage \(G\)\(I(AB)\)\(I(BB)\)Dominant \(I(G\geq 1)\)Recessive \(I(G=2)\)
\(AA\)00000
\(AB\)11010
\(BB\)20111

A three-level factor uses two indicator columns along with an intercept. It can represent three separate genotype means without imposing an ordering or equal-spacing relationship. Dosage instead uses one numerical column. A dominant or recessive indicator also uses one column, but groups two genotype categories together. Thus the choice is not merely a formatting decision: a one-column coding imposes a particular structure on the means.

What Each Coding Says About the Means

To make the implications precise, let \(Y\) be a quantitative trait and let \(m_0\), \(m_1\), and \(m_2\) denote its conditional mean for genotypes with zero, one, and two copies of \(B\), respectively. In this section, the models describe these means without additional covariates. No claim about a causal effect follows from a coding or from a mean model alone.

Under a dosage-linear mean model, the conditional mean is an intercept plus a coefficient times dosage. The genotype means must lie on a straight line as dosage goes from 0 to 2. Under the two-indicator factor model, each genotype can have its own mean. Under a dominant model, the heterozygote and \(BB\) share a mean; under a recessive model, \(AA\) and the heterozygote share a mean.

$$ \begin{aligned} \text{Dosage:}\quad & E(Y\mid G)=\beta_0+\beta_1G, & (m_0,m_1,m_2)&=(\beta_0,\ \beta_0+\beta_1,\ \beta_0+2\beta_1),\\ \text{Genotype factor:}\quad & E(Y\mid G)=\beta_0+\beta_1 I(AB)+\beta_2 I(BB), & (m_0,m_1,m_2)&=(\beta_0,\ \beta_0+\beta_1,\ \beta_0+\beta_2),\\ \text{Dominant:}\quad & E(Y\mid G)=\beta_0+\beta_1 I(G\geq 1), & (m_0,m_1,m_2)&=(\beta_0,\ \beta_0+\beta_1,\ \beta_0+\beta_1),\\ \text{Recessive:}\quad & E(Y\mid G)=\beta_0+\beta_1 I(G=2), & (m_0,m_1,m_2)&=(\beta_0,\ \beta_0,\ \beta_0+\beta_1). \end{aligned} $$

These equations are conditional-mean specifications. In a regression analysis, the coefficients describe differences in those means under the stated model and coding. They do not by themselves establish that a genotype causes a trait difference. The models also do not specify residual variation; assumptions about errors and inference are separate from the choice of predictor representation.

Key implication: Dosage coding imposes \(m_1-m_0=m_2-m_1\), so the change from zero to one copy equals the change from one to two copies. A dominant coding imposes \(m_1=m_2\); a recessive coding imposes \(m_0=m_1\). The two-indicator genotype-factor coding imposes none of these equalities.

Worked Examples of Predictor Construction

Worked Example: Building the Predictor Columns

Suppose six hypothetical individuals have genotypes \(AA, AB, BB, AB, AA, BB\). Construct the dosage, genotype-factor, dominant, and recessive predictors for each individual, counting \(B\).

For each genotype, apply the definitions directly. \(AA\) has no \(B\) copies, \(AB\) has one, and \(BB\) has two. The resulting columns are:

IndividualGenotypeDosage \(G\)\(I(AB)\)\(I(BB)\)DominantRecessive
1\(AA\)00000
2\(AB\)11010
3\(BB\)20111
4\(AB\)11010
5\(AA\)00000
6\(BB\)20111

For individual 4, for example, \(AB\) gives dosage \(1\), factor indicators \((1,0)\), dominant indicator \(1\), and recessive indicator \(0\). The same encoding rules apply to every row. Notice that the factor requires two columns, whereas each of the other representations shown uses one column.

Worked Example: Reading Model-Implied Means

Consider the hypothetical dosage model \(E(Y\mid G)=12+2G\), where \(Y\) is measured in millimeters. Calculate the predicted mean for each genotype and state the pattern imposed by this coding.

For \(AA\), \(G=0\), so the predicted mean is \(12+2(0)=12\) mm. For \(AB\), \(G=1\), giving \(12+2(1)=14\) mm. For \(BB\), \(G=2\), giving \(12+2(2)=16\) mm.

The model therefore implies genotype means of 12, 14, and 16 mm. The change from \(AA\) to \(AB\) is \(14-12=2\) mm, and the change from \(AB\) to \(BB\) is \(16-14=2\) mm. This equal spacing is required by the dosage-linear model; it is not a conclusion established just by assigning dosage values. Here \(\beta_1=2\) represents a 2 mm increase in the model-implied mean for each additional \(B\) copy.

Worked Example: Contrasting a Factor With Dominant and Recessive Coding

Suppose a hypothetical set of genotype-specific mean trait values, in units per liter, is \(m_0=30\) for \(AA\), \(m_1=34\) for \(AB\), and \(m_2=39\) for \(BB\). Express these means using a genotype-factor model and check whether a single dominant or recessive indicator can represent them exactly.

Use \(AA\) as the reference in the factor model. The intercept is the \(AA\) mean, \(\beta_0=30\). The \(AB\) indicator coefficient must be \(34-30=4\), and the \(BB\) indicator coefficient must be \(39-30=9\). Thus the model is \(E(Y\mid G)=30+4I(AB)+9I(BB)\). Substitution gives means \(30\), \(30+4=34\), and \(30+9=39\), as required.

A dominant model requires the \(AB\) and \(BB\) means to be equal. They are \(34\) and \(39\), so that model cannot represent these three means exactly. A recessive model requires the \(AA\) and \(AB\) means to be equal. They are \(30\) and \(34\), so that model cannot represent them exactly either. The factor representation accommodates the stated means without either equality constraint.

Why Allele and Reference Choices Matter

The allele counted as dosage must be stated. If \(A\), rather than \(B\), is counted, the dosage is \(2-G\): it is 2 for \(AA\), 1 for \(AB\), and 0 for \(BB\). Reversing the counted allele reverses the direction of a dosage coefficient in a model with an intercept, but it does not change the genotype categories or the underlying fitted means when the model is transformed consistently.

For a genotype factor, the reference category determines how coefficients are expressed. With \(AA\) as reference, the two coefficients compare \(AB\) with \(AA\) and \(BB\) with \(AA\). Choosing \(BB\) as reference changes the comparisons, but the model can still represent all three means. A coefficient is therefore meaningful only alongside its coding and reference category.

The word “dominant” here names a statistical grouping: carriers of at least one \(B\) copy are placed together. “Recessive” names the grouping in which only \(BB\) is separated. These labels do not prove a biological mechanism, and the corresponding model may be an imperfect description of the genotype means. Similarly, assigning dosage does not mean that the trait response is in fact linear in copy number; the equal-spacing restriction is an assumption of the dosage mean model.

Common mistake: “The genotypes can be written as 0, 1, and 2, so every regression on genotype estimates three unrestricted genotype effects.” This is incorrect. One numerical dosage predictor gives the constraint \(m_1-m_0=m_2-m_1\). To allow three unrestricted means, use the two-indicator genotype-factor representation with an intercept. A one-column dominant or recessive representation imposes its own equality between two genotype means.

Choosing a Representation

Choose the representation to match the genetic comparison that the analysis is intended to describe, and state it explicitly. A dosage predictor represents a per-copy linear pattern in the conditional mean. A genotype factor separates the three categories without restricting their means. A dominant or recessive indicator tests or describes a grouped contrast in which two categories share a mean under the model.

These encodings are useful because they make the assumed comparison visible. Before interpreting a coefficient, check which allele is counted, which category is the reference, what units the trait uses, and which genotype means the model constrains to be equal or equally spaced. That check prevents a predictor's numerical values from being mistaken for a biological conclusion.

Check Your Understanding

Answer each question by referring to the genotype coding and the mean restrictions it implies.

  1. For genotypes \(AA, AB, BB\), what are the dosage values when \(A\) is the counted allele?
  2. In a model with an intercept and \(I(AB)\) and \(I(BB)\), which genotype is the reference, and what do the two coefficients compare?
  3. What equality among genotype-specific means is imposed by a dominant indicator for allele \(B\)?
  4. Suppose the means for \(AA\), \(AB\), and \(BB\) are 8, 11, and 14 units. Do they satisfy the equal-spacing restriction of a dosage-linear mean model? Show the two differences.
  5. Why does a numerical dosage predictor not, by itself, establish that each allele copy has a causal effect?
Clinical Biostats