Tutorials › Statistical Genetics › Pitfalls in Choosing Inheritance Codings

Single-Variant Association Tests · Tutorial 318 of 989

Pitfalls in Choosing Inheritance Codings

Compare inheritance codings, interpret what each model tests, and account for the extra uncertainty created by selecting a coding after inspecting association results.

Intermediate 10 min read

What You'll Learn

  • Define additive, dominant, and recessive genotype coding for a biallelic variant
  • Interpret the association parameter under each coding
  • See why choosing the smallest p-value after fitting several codings inflates false-positive risk
  • Apply a Bonferroni adjustment when searching across three prespecified coding options
  • Distinguish a biologically motivated, prespecified contrast from an exploratory model search
  • Recognize how sparse genotype groups and effect patterns can make coding choices misleading

Why the Choice of Inheritance Coding Matters

For a biallelic variant, the genotype can be represented by the number of copies of a chosen allele: 0, 1, or 2. An association model must decide how those three genotype groups relate to the outcome. An additive coding assumes a particular stepwise pattern; dominant and recessive codings combine genotype groups in different ways. These choices are not merely alternative labels for the same coefficient: each defines a different association contrast and tests a different pattern.

A coding selected before examining the association results can express a scientific hypothesis. Choosing whichever coding gives the smallest p-value after inspecting the data is different: it is a search across several analyses. Reporting only the selected result as if it were the sole planned test makes the evidence look stronger than it is.

Definition: Let \(G\) denote the number of copies of a specified allele, so \(G\in\{0,1,2\}\). The additive coding uses \(G\); the dominant coding uses \(D=I(G\geq 1)\), comparing carriers with noncarriers; and the recessive coding uses \(R=I(G=2)\), comparing individuals with two copies against those with zero or one. The choice of which allele is counted must be stated. The genetic model describes how genotype groups enter the statistical model; it does not by itself establish a causal effect.

What Each Coding Assumes and Tests

For a quantitative outcome \(Y\), a simple linear regression with a coded genotype \(X\) is

$$ Y_i=\beta_0+\beta_1X_i+\varepsilon_i. $$

Here \(X_i\) is \(G_i\), \(D_i\), or \(R_i\), according to the chosen coding. Under additive coding, \(\beta_1\) is the modeled mean change in \(Y\) per additional copy of the counted allele. Under dominant coding, it is the modeled mean difference between carriers and noncarriers. Under recessive coding, it is the modeled mean difference between individuals with two copies and the combined group with zero or one. These interpretations are conditional on the model and its covariates, if any.

For a binary outcome, the same coding choice can be used in a logistic regression:

$$ \operatorname{logit}\{P(Y_i=1\mid X_i)\}=\beta_0+\beta_1X_i. $$

The coefficient then describes a change in log odds per allele for additive coding, or a log-odds contrast between the two coded groups for dominant or recessive coding. In either setting, using one genotype score imposes a pattern across the three genotype groups. A significant result under one coding does not prove that its assumed pattern is biologically correct.

Inference also relies on appropriate data and model conditions. Genotypes should be correctly coded, observations should be independent for the stated standard errors, and the outcome model and its error assumptions should be adequate. For the usual small-sample linear-model \(t\) inference, errors are assumed to have mean zero, constant variance, and an approximately normal distribution conditional on the predictors. Logistic-regression inference requires a suitably specified logit mean model and valid standard errors. A coding search does not repair violations of these conditions.

Worked Example: Comparing the Contrasts on One Hypothetical Data Set

Suppose a hypothetical quantitative-trait sample has 40 people with \(G=0\), 40 with \(G=1\), and 20 with \(G=2\). Their group means are, respectively, 10, 11, and 14 trait units. Calculate the three coded contrasts and the additive regression slope. These summaries illustrate effect patterns; without within-group variability, they do not determine standard errors or p-values.

Dominant contrast. The noncarrier mean is 10. The carrier mean combines the \(G=1\) and \(G=2\) groups, so it is

$$ \bar{Y}_{G\geq1}=\frac{40(11)+20(14)}{40+20} =\frac{720}{60}=12. $$

The dominant-coded mean difference is therefore \(12-10=2\) trait units.

Recessive contrast. The mean for \(G=2\) is 14. The combined mean for \(G=0\) and \(G=1\) is

$$ \bar{Y}_{G<2}=\frac{40(10)+40(11)}{40+40} =\frac{840}{80}=10.5. $$

The recessive-coded mean difference is \(14-10.5=3.5\) trait units.

Additive slope. The mean allele count is \(\bar{G}=(40(0)+40(1)+20(2))/100=0.8\), and the overall trait mean is \(\bar{Y}=(40(10)+40(11)+20(14))/100=11.2\). The regression slope based on these grouped data is

$$ \hat{\beta}_1= \frac{\sum_g n_g(g-\bar{G})\bar{Y}_g} {\sum_g n_g(g-\bar{G})^2} = \frac{40(-0.8)(10)+40(0.2)(11)+20(1.2)(14)} {40(0.64)+40(0.04)+20(1.44)} = \frac{104}{56} =1.857. $$

Thus the fitted additive slope is about 1.857 trait units per additional counted allele. The three numerical contrasts differ because they summarize the genotype groups in different ways. They cannot be ranked by the sizes of these estimates alone: their standard errors and tests depend on the data variability and the model.

Why Searching Across Codings Changes the Error Rate

Suppose the null hypothesis of no association is tested using all three codings, and the analyst reports a positive result if any p-value is at most \(\alpha\). Even if each individual p-value is valid under its null hypothesis, the chance of at least one false rejection can exceed \(\alpha\). The tests are often dependent because they use the same individuals and overlapping genotype groups; dependence does not make an unadjusted search harmless.

Result: If \(p_A,p_D,p_R\) are valid p-values for the additive, dominant, and recessive tests under the global null, then
$$ P\{\min(p_A,p_D,p_R)\leq\alpha\} \leq P(p_A\leq\alpha)+P(p_D\leq\alpha)+P(p_R\leq\alpha) \leq 3\alpha. $$

This union bound does not require the tests to be independent. At \(\alpha=0.05\), it gives an upper bound of 0.15 for the probability of at least one rejection under the global null. The actual probability depends on the joint distribution of the tests and may be lower. If all three p-values are exact uniform random variables under their nulls and are mutually independent, the probability is \(1-(1-\alpha)^3\), which equals \(1-0.95^3=0.142625\) at \(\alpha=0.05\). Validity alone does not imply that formula or a lower bound of \(\alpha\).

A simple safeguard is the Bonferroni procedure: for three tests, compare each p-value with \(\alpha/3\), or report the Bonferroni-adjusted p-value \(\min(1,3p)\). The union-bound argument justifies this threshold even when the tests are dependent. If the candidate codings were specified in advance and each test is valid whenever its own null is true, Bonferroni also controls the probability of one or more false rejections among the tested hypotheses. Other valid multiplicity procedures may be less conservative, but the correction must match the search that was actually conducted.

Worked Example: Adjusting a Search Across Three Codings

In a hypothetical analysis, an investigator fits all three codings and obtains p-values of 0.048 for additive, 0.021 for dominant, and 0.009 for recessive. Assume the underlying models and tests are appropriate. The investigator had not specified a preferred coding before examining the results and chooses the smallest p-value.

The smallest unadjusted p-value is \(p_{\min}=0.009\), from the recessive-coded test. Comparing it directly with 0.05 would ignore that three tests were searched. The Bonferroni-adjusted value is

$$ p_{\mathrm{Bonf}}=\min(1,3p_{\min}) =\min(1,3(0.009)) =0.027. $$

Equivalently, the smallest p-value is below the Bonferroni threshold because \(0.009<0.05/3=0.01667\). Under this correction, the search-level result remains statistically significant at the 0.05 family-wise level. It should be reported as a result from an exploratory search across three codings, with the adjusted p-value, rather than as though a recessive test had been the only analysis planned. The correction addresses this multiplicity; it does not verify the recessive model’s biological truth or remove other sources of bias.

Prespecification Versus Exploratory Choice

Prespecification means choosing the genetic contrast and the test before examining the association results that will be used to draw the conclusion. The choice may be motivated by prior biological knowledge, a previous study, or a clearly stated scientific question. It does not mean the model is guaranteed to be correct; it means the test was not selected because it produced the most favorable result in the current data.

If a dominant contrast is prespecified, the primary analysis tests that contrast. The analyst may still examine additive or recessive models for descriptive or exploratory purposes, but those additional tests should be identified as such. If a later claim is based on whichever coding performed best, the inferential account must include the search. Reporting only the winning coding and its original p-value conceals that choice.

Worked Example: A Prespecified Recessive Hypothesis

Suppose, before analyzing a hypothetical study, researchers state that their primary question concerns whether two copies of a specified allele are associated with a quantitative trait. They choose recessive coding, set \(\alpha=0.05\), and fit the model \(Y_i=\beta_0+\beta_1R_i+\varepsilon_i\), where \(R_i=I(G_i=2)\).

The primary null hypothesis is \(H_0:\beta_1=0\), and the alternative is \(H_a:\beta_1\ne0\), if a two-sided test is planned. The coefficient compares the mean trait level for \(G=2\) with the mean for \(G=0\) or \(G=1\), in trait units. If the valid test returns \(p=0.032\), the prespecified test rejects \(H_0\) at the 0.05 level. That p-value is not the probability that \(H_0\) is true; it is the probability, under \(H_0\) and the test assumptions, of observing a test statistic at least as incompatible with \(H_0\) as the one obtained.

If the researchers then fit additive and dominant models and use whichever gives the smallest p-value to make the primary claim, that claim no longer rests only on the prespecified recessive test. The extra search must be disclosed and addressed, for example by applying a multiplicity adjustment to the three tests. A prespecified primary contrast remains distinct from those subsequent exploratory comparisons.

Practical Checks Before Interpreting a Result

The genotype coding should be named explicitly, including which allele defines \(G\). Switching the counted allele reverses the direction of an additive coefficient, while changing the reference grouping changes how a dominant or recessive contrast is described. Such changes do not automatically alter the underlying association evidence, but unclear coding makes effect interpretation difficult.

Inspect genotype counts before interpreting a contrast. A recessive test may rely on a small \(G=2\) group; a dominant test may combine groups with genuinely different outcome patterns. Sparse groups can produce imprecise estimates, and in a binary-outcome model may create estimation difficulties. A small p-value does not resolve those limitations. Effect estimates, uncertainty intervals, group counts, and the analysis plan all help put the test in context.

Key takeaway: Additive, dominant, and recessive codings encode different genotype-to-outcome patterns. A contrast chosen before examining association results can test a focused hypothesis; selecting the smallest p-value among codings is a multiple-testing search and must be reported and accounted for as one.

Common Mistake

Wrong reasoning: “The recessive p-value was below 0.05, so there is a significant recessive association; the additive and dominant tests do not matter.” This is not justified if the investigator looked at all three p-values and selected the recessive result because it was smallest. The chance of a false positive from the search can be higher than the nominal level.

Correction: State whether the recessive contrast was selected in advance. If it was the sole prespecified primary test, interpret that test under its assumptions and planned significance level. If the coding was chosen after inspecting the results, disclose the alternatives examined and use an appropriate multiplicity adjustment or describe the finding as exploratory. Do not treat a selected unadjusted p-value as though it came from a single planned test.

Check Your Understanding

Try these questions without looking back.

  1. For \(G=0,1,2\), define the additive, dominant, and recessive genotype scores. What comparison does each non-additive score represent?
  2. An analyst tests three codings and reports only the smallest p-value. Why can that p-value overstate the evidence if it is interpreted as the result of one prespecified test?
  3. Using Bonferroni with three tests and \(\alpha=0.05\), what per-test threshold should be used, and what adjusted p-value corresponds to a smallest p-value of 0.012?
  4. Why does the union-bound justification for Bonferroni not require the three tests to be independent?
  5. What information must be reported to make the interpretation of an additive genotype coefficient clear?
Clinical Biostats