Tutorials › Statistical Genetics › From Logistic Coefficients to Genotype Odds Ratios

Single-Variant Association Tests · Tutorial 309 of 989

From Logistic Coefficients to Genotype Odds Ratios

Convert additive and categorical logistic coefficients into odds ratios for each genotype comparison, while keeping the effect allele, reference group, and covariate conditions clear.

Intermediate 9 min read

What You'll Learn

  • Identify the effect allele and genotype coding needed to interpret a logistic coefficient
  • Derive genotype-specific odds ratios from an additive logistic model
  • Compare heterozygotes with each homozygote under additive coding
  • Obtain all pairwise genotype odds ratios from a categorical model
  • Re-express genotype comparisons when the reference group changes
  • Distinguish odds ratios from risk ratios and absolute risks

From a Logistic Coefficient to a Genotype Comparison

A logistic-regression coefficient is measured on the log-odds scale, while genetic association results are often presented as odds ratios. Turning one into the other is straightforward only after the comparison is made explicit: which genotype is being compared with which, and which allele does the genotype count represent? The same coefficient can imply different genotype comparisons under additive and categorical coding.

Let \(Y=1\) indicate the binary outcome of interest and \(Y=0\) its absence. For a biallelic variant, code genotype \(G\) as the number of copies of a specified effect allele, so \(G\) is 0, 1, or 2. The two homozygote groups are \(G=0\) and \(G=2\), and the heterozygote group is \(G=1\). All odds comparisons below are conditional on any covariates in the model being held at the same values.

Definition: For a genotype \(g\) and fixed covariate values, the odds of the outcome are \(P(Y=1\mid G=g)/[1-P(Y=1\mid G=g)]\). The odds ratio comparing genotype \(g_a\) with genotype \(g_b\) is the odds for \(g_a\) divided by the odds for \(g_b\), under the same covariate conditions. An odds ratio greater than 1 means higher outcome odds for the numerator genotype; an odds ratio less than 1 means lower outcome odds.

The logistic model writes the log odds as a linear predictor. For a genotype association analysis with covariates \(\mathbf{Z}\), a general form is

$$ \operatorname{logit}\{P(Y=1\mid G,\mathbf{Z})\} = \log\left(\frac{P(Y=1\mid G,\mathbf{Z})}{1-P(Y=1\mid G,\mathbf{Z})}\right) = \text{genotype terms}+\text{covariate terms}. $$

For the coefficient-to-odds-ratio calculations, the key condition is that the two genotypes being compared have the same covariate values. The model then gives a difference in log odds, and exponentiating that difference gives the odds ratio. These interpretations presume the stated logistic model is the one used for the analysis, with the outcome and genotype coded as specified. They do not by themselves establish that an association is causal.

Additive Genotype Coding

In an additive logistic model, genotype enters as the allele count:

$$ \operatorname{logit}\{P(Y=1\mid G,\mathbf{Z})\} = \beta_0+\beta_G G+\boldsymbol{\gamma}^{\mathsf T}\mathbf{Z}. $$

Here \(\beta_G\) is the change in log odds for each additional copy of the effect allele, at fixed covariate values. The model constrains the change from \(G=0\) to \(G=1\) to equal the change from \(G=1\) to \(G=2\) on the log-odds scale. It does not require equal changes in probability or risk.

Result: Under the additive model, the odds ratio for a comparison from genotype \(g_b\) to genotype \(g_a\) is \(\exp\{\beta_G(g_a-g_b)\}\), with covariates held fixed. Thus \(\exp(\beta_G)\) is the per-effect-allele odds ratio. The genotype \(G=1\) versus \(G=0\) odds ratio is \(\exp(\beta_G)\), the \(G=2\) versus \(G=0\) odds ratio is \(\exp(2\beta_G)\), and the \(G=1\) versus \(G=2\) odds ratio is \(\exp(-\beta_G)\).

The direction of a comparison matters. Reversing numerator and denominator takes the reciprocal of the odds ratio. For example, if the odds ratio for \(G=1\) versus \(G=0\) is \(\exp(\beta_G)\), then the odds ratio for \(G=0\) versus \(G=1\) is \(\exp(-\beta_G)=1/\exp(\beta_G)\).

Worked Example: Additive Model and Both Homozygote Comparisons

Suppose a hypothetical analysis codes the effect allele as \(A\), so \(G=0,1,2\) counts copies of \(A\). At the same fixed covariate values, the fitted additive model has \(\hat{\beta}_G=0.35\). Calculate the odds ratios for the heterozygote and the \(A/A\) homozygote relative to the \(G=0\) homozygote, and compare the heterozygote directly with \(A/A\).

For \(G=1\) versus \(G=0\), the genotype-count difference is 1:

$$ \widehat{OR}_{1:0} = \exp\{0.35(1-0)\} = \exp(0.35) = 1.419. $$

The fitted odds are 1.419 times as high for heterozygotes as for \(G=0\) homozygotes, conditional on the same covariate values. For \(G=2\) versus \(G=0\), the difference is 2:

$$ \widehat{OR}_{2:0} = \exp\{0.35(2-0)\} = \exp(0.70) = 2.014. $$

For the heterozygote versus the \(G=2\) homozygote, the difference is \(1-2=-1\):

$$ \widehat{OR}_{1:2} = \exp\{0.35(1-2)\} = \exp(-0.35) = 0.7047. $$

Thus the fitted outcome odds for heterozygotes are about 0.705 times the odds for \(A/A\) homozygotes, or, in the reverse direction, the \(A/A\) odds are \(1/0.7047=1.419\) times the heterozygote odds. These are odds comparisons, not statements that outcome probability changes by the same percentages.

Categorical Genotype Coding

An additive model imposes a particular pattern across the three genotypes. A categorical, or genotypic, model instead gives each genotype its own log-odds level relative to a reference genotype. With \(G=0\) as the reference, write

$$ \operatorname{logit}\{P(Y=1\mid G,\mathbf{Z})\} = \beta_0+\beta_1 I(G=1)+\beta_2 I(G=2) +\boldsymbol{\gamma}^{\mathsf T}\mathbf{Z}, $$

where \(I(G=k)\) equals 1 when \(G=k\) and 0 otherwise. The coefficient \(\beta_1\) is the difference in log odds for \(G=1\) versus \(G=0\), and \(\beta_2\) is that for \(G=2\) versus \(G=0\). Exponentiating each coefficient gives the corresponding odds ratio. To compare \(G=1\) directly with \(G=2\), subtract their linear predictors: the intercept and covariate terms cancel, leaving \(\beta_1-\beta_2\).

Result: With \(G=0\) as the reference genotype, the categorical-model odds ratios are \(\exp(\beta_1)\) for \(G=1\) versus \(G=0\), \(\exp(\beta_2)\) for \(G=2\) versus \(G=0\), and \(\exp(\beta_1-\beta_2)\) for \(G=1\) versus \(G=2\). Reversing any comparison changes the sign of the log-odds contrast and takes the reciprocal of the odds ratio.

Worked Example: Three Genotypes in a Categorical Model

In a hypothetical study, use \(G=0\) as the reference and fit the categorical model at common covariate values. Suppose the fitted genotype coefficients are \(\hat{\beta}_1=0.50\) for \(G=1\) and \(\hat{\beta}_2=0.20\) for \(G=2\). Calculate the odds ratios for both nonreference genotypes relative to \(G=0\), then compare the two nonreference genotypes.

For the heterozygote versus \(G=0\), exponentiate \(\hat{\beta}_1\):

$$ \widehat{OR}_{1:0} = \exp(0.50) = 1.649. $$

For \(G=2\) versus \(G=0\), exponentiate \(\hat{\beta}_2\):

$$ \widehat{OR}_{2:0} = \exp(0.20) = 1.221. $$

For heterozygotes versus \(G=2\), the log-odds contrast is the difference between the coefficients:

$$ \widehat{OR}_{1:2} = \exp(\hat{\beta}_1-\hat{\beta}_2) = \exp(0.50-0.20) = \exp(0.30) = 1.350. $$

At the same covariate values, the fitted outcome odds for heterozygotes are 1.350 times the odds for \(G=2\) homozygotes. Notice that this comparison is not obtained by exponentiating either coefficient alone: each coefficient is relative to \(G=0\), so their difference gives the direct comparison.

Changing the Reference Genotype

A categorical model can use a different reference genotype without changing the fitted genotype contrasts. The coefficient values change because each coefficient is defined relative to the chosen reference. To obtain a comparison between any two groups, subtract their fitted log odds, or equivalently subtract their coefficients after accounting for the reference. This rule is useful for interpreting software output that uses a reference group other than \(G=0\).

Worked Example: Reading Coefficients With \(G=2\) as Reference

Consider a hypothetical categorical model that uses \(G=2\) as the reference. At fixed covariate values, its fitted genotype contribution is \(-0.30\) for \(G=0\), \(0.40\) for \(G=1\), and 0 for \(G=2\). Equivalently, the model has coefficients \(-0.30\) for \(I(G=0)\) and \(0.40\) for \(I(G=1)\). Find the heterozygote odds ratio against each homozygote group, and compare the two homozygote groups.

For \(G=1\) versus \(G=2\), the log-odds difference is \(0.40-0\):

$$ \widehat{OR}_{1:2} = \exp(0.40-0) = \exp(0.40) = 1.492. $$

For \(G=1\) versus \(G=0\), subtract the \(G=0\) contribution from the \(G=1\) contribution:

$$ \widehat{OR}_{1:0} = \exp\{0.40-(-0.30)\} = \exp(0.70) = 2.014. $$

Finally, for \(G=0\) versus \(G=2\):

$$ \widehat{OR}_{0:2} = \exp(-0.30-0) = \exp(-0.30) = 0.7408. $$

The odds ratio for \(G=2\) versus \(G=0\) is the reciprocal, \(1/0.7408=1.350\). The reference choice changes the printed coefficients, but direct contrasts recover the comparisons of interest.

Why the Model Choice Matters

Under additive coding, one coefficient summarizes a specified per-allele change in log odds. It consequently determines all three pairwise genotype comparisons. Under categorical coding, two coefficients allow the \(G=1\) and \(G=2\) groups to differ from \(G=0\) without requiring equal successive log-odds increments. The additive pattern is a restriction within the broader categorical description: it requires \(\beta_1=\beta_G\) and \(\beta_2=2\beta_G\) when \(G=0\) is the reference.

The choice of coding therefore affects what a coefficient means, not the definition of an odds ratio. Always state the effect allele for allele-count coding, the reference genotype for indicator coding, and the direction of the comparison. Also keep the outcome coding clear: if \(Y=1\) is changed to represent the opposite outcome, the log-odds signs reverse and the odds ratios are reciprocated.

Key takeaway: To obtain a genotype odds ratio, form the difference between the two genotypes' fitted log odds at the same covariate values, then exponentiate that difference. In an additive model the difference is \(\beta_G(g_a-g_b)\); in a categorical model it is the corresponding difference in genotype-specific coefficients.

Common Mistakes

  • Exponentiating the wrong coefficient. In a categorical model with \(G=0\) as reference, \(\exp(\beta_1)\) compares \(G=1\) with \(G=0\), not \(G=1\) with \(G=2\). For the latter, use \(\exp(\beta_1-\beta_2)\).
  • Ignoring comparison direction. An odds ratio of 1.4 for \(G=1\) versus \(G=0\) means the reverse comparison is \(1/1.4\), not 1.4.
  • Calling an odds ratio a risk ratio. An odds ratio compares \(P(Y=1)/P(Y=0)\), not probabilities directly. It should not be described as a proportional change in outcome risk.
  • Treating an additive coefficient as a risk-scale effect. The additive assumption is linearity in log odds per allele. It does not imply a constant probability difference per allele.
  • Leaving out the allele or reference group. A per-allele odds ratio is uninterpretable unless the counted allele is named, and a categorical coefficient is uninterpretable without its reference genotype.

Check Your Understanding

For each question, specify the genotype comparison and keep covariate values fixed where relevant.

  1. An additive logistic model has an effect-allele coefficient of \(-0.20\). What is the odds ratio for \(G=2\) versus \(G=0\), and what does its direction mean?
  2. With \(G=0\) as reference, a categorical model has \(\beta_1=0.30\) and \(\beta_2=-0.10\). Write the formula for the \(G=1\) versus \(G=2\) odds ratio.
  3. Why is the heterozygote-versus-\(G=2\) odds ratio not generally \(\exp(\beta_1)\) in a categorical model using \(G=0\) as the reference?
  4. If an odds ratio for \(G=1\) versus \(G=0\) is 0.80, what is the odds ratio for \(G=0\) versus \(G=1\)?
  5. In one sentence, distinguish the additive-model assumption from a claim of equal risk differences across genotypes.
Clinical Biostats