Tutorials › Statistical Genetics › Additive Coding for Quantitative Traits

Genetic Effects and Trait Models · Tutorial 22 of 989

Additive Coding for Quantitative Traits

Use allele-count dosage in a linear model to estimate and interpret the fitted change in a quantitative trait per additional counted allele.

Beginner 12 min read

What You'll Learn

  • Define allele-count dosage for a biallelic genotype.
  • Write a quantitative-trait model using dosage as the predictor.
  • Calculate the least-squares dosage coefficient and intercept from data.
  • Interpret the fitted coefficient in trait units per counted allele.
  • Distinguish a fitted genetic association from a causal effect.
  • Recognize assumptions and common interpretation pitfalls.

From Genotype Dosage to a Quantitative-Trait Model

A genotype can be represented by the number of copies it carries of a chosen allele. When the outcome is quantitative, such as a measured concentration or blood pressure, that count can serve as a numerical predictor in a simple linear model. The model’s dosage coefficient summarizes the fitted change in the trait associated with one additional copy of the counted allele.

This is a specific way to represent genotype in a trait model. It keeps the allele-count scale explicit: the coefficient is measured in trait units per allele, rather than being a difference attached to an unspecified genotype label. Its interpretation depends on which allele is counted and on the model being used.

Definition: For a diploid individual at a biallelic locus, let \(G_i\) be the number of copies of the chosen counted allele carried by individual \(i\). The dosage is \(G_i=0\), \(1\), or \(2\). In an additive-coded quantitative-trait model, \(G_i\) is used as a numerical predictor of quantitative outcome \(Y_i\).

For example, if \(B\) is the counted allele, a genotype with no copies of \(B\) has dosage 0, a genotype with one copy has dosage 1, and a genotype with two copies has dosage 2. This tutorial concerns the fitted linear model for a quantitative outcome; the dosage is an encoding of genotype, not the trait itself.

The Model and Its Coefficient

For \(n\) individuals, the simple additive-coded model is

$$ Y_i=\beta_0+\beta_1G_i+\varepsilon_i,\qquad i=1,\ldots,n. $$

Here \(Y_i\) is the quantitative trait for individual \(i\), \(G_i\) is that individual’s counted-allele dosage, \(\beta_0\) is the intercept, and \(\beta_1\) is the dosage coefficient. The error \(\varepsilon_i\) is the difference between the observed outcome and the model’s conditional mean. The model specifies

$$ E(Y_i\mid G_i)=\beta_0+\beta_1G_i. $$

Thus, under this model, \(\beta_1\) describes the change in fitted mean trait value for a one-unit increase in dosage—that is, for one additional counted allele. If \(Y\) is measured in mg/L, then \(\beta_1\) is measured in mg/L per counted allele. The intercept is the fitted mean when dosage is zero.

Model assumptions: The outcome is quantitative, the dosage is recorded on the stated allele-count scale, and the conditional mean is represented by a straight line in dosage. For the usual least-squares interpretation as estimating that conditional mean, errors have mean zero given dosage, \(E(\varepsilon_i\mid G_i)=0\), and the observations are independent. The dosage values must vary in the sample to estimate a slope. Constant error variance is not required to calculate the least-squares coefficient, though it matters for conventional standard-error calculations.

No Hardy–Weinberg equilibrium assumption is needed to fit this regression. The genotype counts determine which dosage values occur in the sample, but the least-squares calculation itself uses the observed \(G_i\) and \(Y_i\) pairs. A fitted coefficient describes an association in the modeled population or sample; by itself, it does not establish that changing an individual’s genotype would cause a change in the trait.

How Least Squares Estimates the Dosage Coefficient

In simple linear regression with an intercept, least squares chooses \(\hat{\beta}_0\) and \(\hat{\beta}_1\) to minimize the sum of squared residuals, where each residual is \(Y_i-\hat{\beta}_0-\hat{\beta}_1G_i\). Define \(\bar{G}\) as the sample mean dosage and \(\bar{Y}\) as the sample mean trait value. The fitted coefficients are

$$ \hat{\beta}_1= \frac{\sum_{i=1}^{n}(G_i-\bar{G})(Y_i-\bar{Y})} {\sum_{i=1}^{n}(G_i-\bar{G})^2}, \qquad \hat{\beta}_0=\bar{Y}-\hat{\beta}_1\bar{G}. $$

The numerator is the centered cross-product of dosage and trait; the denominator is the centered sum of squared dosages. The fitted dosage coefficient therefore reflects how the trait varies with dosage relative to the amount of dosage variation. The intercept is then chosen so that the fitted line passes through \((\bar{G},\bar{Y})\).

Justification: For any fixed slope \(b\), the residual sum of squares is minimized over the intercept \(a\) when the residuals sum to zero. Setting \(\sum_i(Y_i-a-bG_i)=0\) gives \(a=\bar{Y}-b\bar{G}\). Substituting this intercept makes each residual equal to \((Y_i-\bar{Y})-b(G_i-\bar{G})\). Differentiating the resulting sum of squared residuals with respect to \(b\), setting the derivative to zero, and solving gives \(b=\sum_i(G_i-\bar{G})(Y_i-\bar{Y})/\sum_i(G_i-\bar{G})^2\), provided the denominator is positive.

Worked Examples

Worked Example: Fitting a Dosage Coefficient From Seven Individuals

Suppose a hypothetical study measures a quantitative trait in mg/L and counts allele \(B\). The observations are:

Dosage 0: 8 and 10 mg/L; dosage 1: 11, 12, and 13 mg/L; dosage 2: 13 and 15 mg/L. Assume for this calculation that these individuals are independent and that the conditional mean is modeled as linear in dosage with mean-zero errors given dosage.

There are \(n=7\) observations. The mean dosage is \(\bar{G}=1\), since the dosages sum to \(0+0+1+1+1+2+2=7\). The mean trait value is \(\bar{Y}=82/7\) mg/L, since the trait values sum to \(82\) mg/L.

The centered cross-product sum can be calculated by dosage group. For dosage 0, each centered dosage is \(-1\), giving \((-1)(8-82/7)+(-1)(10-82/7)=26/7+12/7=38/7\). For dosage 1, the centered dosage is zero, so the contribution is zero. For dosage 2, the centered dosage is \(1\), giving \((13-82/7)+(15-82/7)=9/7+23/7=32/7\). Thus the numerator is \(38/7+32/7=10\).

The centered dosage sum of squares is \(2(-1)^2+3(0)^2+2(1)^2=4\). Therefore,

$$ \hat{\beta}_1=\frac{10}{4}=2.5\ \text{mg/L per }B\text{ allele}. $$

The intercept is \(\hat{\beta}_0=82/7-(2.5)(1)=129/14\approx9.214\) mg/L. The fitted equation is

$$ \hat{Y}=9.214+2.5G. $$

In this hypothetical sample, the fitted mean trait value increases by 2.5 mg/L per additional counted \(B\) allele under the specified model. This is a fitted association, not evidence by itself that the allele causes a 2.5 mg/L change.

Worked Example: Interpreting a Coefficient in Trait Units

In another hypothetical data set, a quantitative trait is systolic blood pressure in mmHg, and \(C\) is the counted allele. The observations are: dosage 0, 20 and 22 mmHg; dosage 1, 23 and 25 mmHg; dosage 2, 26 and 28 mmHg. For this calculation, assume independent observations and a linear conditional mean in dosage with mean-zero errors given dosage.

The dosage values sum to \(0+0+1+1+2+2=6\), so \(\bar{G}=1\). The outcome values sum to \(144\), so \(\bar{Y}=24\) mmHg. The cross-product sum is

$$ (-1)(20-24)+(-1)(22-24) +(1)(26-24)+(1)(28-24)=4+2+2+4=12. $$

The dosage sum of squares is \(2(-1)^2+2(0)^2+2(1)^2=4\). Hence \(\hat{\beta}_1=12/4=3\) mmHg per counted \(C\) allele, and \(\hat{\beta}_0=24-3(1)=21\) mmHg. The fitted model is \(\hat{Y}=21+3G\).

For an individual with dosage 2, the model’s fitted mean is \(21+3(2)=27\) mmHg. The coefficient is not a predicted value of 3 mmHg for every individual; it is the fitted change in mean blood pressure associated with a one-allele increase in dosage. Individual observations may differ from fitted means because of their residuals.

Worked Example: A Fitted Line Need Not Pass Through Every Genotype-Group Mean

Consider a hypothetical quantitative enzyme-activity measure in units, with allele \(D\) counted. The observations are: dosage 0, 4 and 5 units; dosage 1, 8 and 9 units; dosage 2, 8 and 10 units. Assume independent observations and a linear conditional mean with mean-zero errors given dosage.

The mean dosage is \(\bar{G}=1\), and the mean outcome is \(\bar{Y}=44/6=22/3\) units. The cross-product sum is

$$ (-1)(4-22/3)+(-1)(5-22/3) +(1)(8-22/3)+(1)(10-22/3) =\frac{10}{3}+\frac{7}{3}+\frac{2}{3}+\frac{8}{3}=9. $$

There are two observations at each dosage, so the dosage sum of squares is \(2(-1)^2+2(0)^2+2(1)^2=4\). The estimated slope is \(9/4=2.25\) units per counted \(D\) allele. The intercept is \(\hat{\beta}_0=22/3-9/4=61/12\approx5.083\) units.

The fitted equation is \(\hat{Y}=5.083+2.25G\), giving fitted values of approximately 5.083, 7.333, and 9.583 units at dosages 0, 1, and 2. The observed group means are 4.5, 8.5, and 9 units, so the fitted values do not equal every group mean. Least squares selects the line that minimizes the total squared residuals across all individuals; it does not force the line to pass through each observed group mean.

Interpreting and Reporting the Result

A clear report identifies the outcome units, the counted allele, the model, and the coefficient’s units. For example: “In the fitted additive-coded linear model, each additional counted \(B\) allele was associated with an estimated 2.5 mg/L higher mean trait value.” If the estimated coefficient were negative, “lower” would replace “higher.” The wording “associated with” is appropriate because the fitted regression alone does not establish causality.

The coefficient depends on the chosen allele-count direction. Counting the other allele reverses the dosage direction in a diploid biallelic setting, so the sign and intercept representation change accordingly; the reported allele must therefore be named. Also, a dosage coefficient is not a genotype label: its units are trait units per one dosage unit. A coefficient without its counted allele and trait units is difficult to interpret.

Common Mistakes

  • Calling the coefficient a trait value. The intercept is the fitted value at dosage zero, whereas the slope is a change in fitted mean per additional counted allele.
  • Dropping the units. If the outcome is measured in mg/L, the slope is in mg/L per allele, not simply “2.5.”
  • Interpreting association as causation. A fitted dosage coefficient describes a model-based association; it does not, on its own, show that the counted allele causes the outcome difference.
  • Forgetting which allele was counted. A positive coefficient means higher fitted trait values with increasing dosage of the specified allele, not necessarily with increasing dosage of either allele.
  • Assuming every individual changes by exactly the slope. The coefficient describes the fitted conditional mean trend. Individual outcomes can vary around that mean.
Key takeaway: In an additive-coded quantitative-trait model, genotype enters through the count of a specified allele. The fitted slope is interpreted as the change in fitted mean trait value per additional counted allele, with the outcome’s units stated explicitly.

Check Your Understanding

Answer each question using the dosage model and its coefficient interpretation.

  1. At a biallelic diploid locus, what dosage values can an individual have when allele \(A\) is counted?
  2. A fitted coefficient is \(-0.8\) mmol/L per counted allele. State its interpretation in context without implying causation.
  3. Why does the intercept represent the fitted mean at dosage zero?
  4. For dosage values that do not vary in the sample, why can the least-squares dosage slope not be estimated?
  5. A researcher reports a slope of 1.4 but does not name the counted allele or outcome units. What information is missing for interpretation?
Clinical Biostats