Tutorials › High-Dimensional Genomic Data Analysis › Testing SNP-By-Environment Interaction

Single-Variant GWAS · Tutorial 230 of 795

Testing SNP-By-Environment Interaction

Learn to fit and interpret SNP-by-environment product terms in quantitative- and binary-trait regression models.

Intermediate 13 min read

What You'll Learn

  • Write linear and logistic regression models that include a genotype-by-environment product term.
  • State and test the null hypothesis that the SNP association does not vary with the environment on the model’s scale.
  • Interpret SNP effects at specific environment values and distinguish them from interaction coefficients.
  • Test interaction with a continuous environment or with multiple categorical-environment terms.
  • Check coding, overlap, model fit, and other conditions that can make interaction estimates unreliable.

Why Test SNP-By-Environment Interaction?

A genetic association may differ across environmental conditions. For example, the change in a quantitative trait associated with one additional effect allele could be larger among people with high exposure than among people with low exposure. A regression model can represent this pattern with a genotype-by-environment product term. The term tests whether the SNP association changes with environment on the scale of the model; it does not, by itself, show that changing the environment would cause a change in the genetic effect.

Let \(G\) be an individual's effect-allele dosage, usually coded \(0\), \(1\), or \(2\), and let \(E\) be an environmental variable. Let \(C\) denote covariates included to adjust for relevant features of the sample. For a continuous environment, it is often convenient to center \(E\), so that \(E=0\) represents a meaningful value such as the sample mean. Centering helps interpretation but does not remove confounding or change the fitted interaction pattern.

Regression Models and the Interaction Null

For a quantitative trait \(Y\), the linear model with a continuous environment is

$$ Y_i=\beta_0+\beta_G G_i+\beta_E E_i+\beta_{GE}G_iE_i+\boldsymbol{\gamma}^{T}C_i+\varepsilon_i. $$

Here \(\beta_{GE}\) is the interaction coefficient. The conditional mean is modeled as linear in the included predictors. For conventional standard errors and tests, observations are assumed independent and errors are assumed to have mean zero conditional on the predictors; constant error variance is also required for the usual homoskedastic standard errors. Exact small-sample \(t\)-based inference additionally relies on normally distributed errors. If the variance assumption is questionable, a suitable robust standard error may be used, but it does not repair a misspecified mean model or dependence between observations.

For a binary trait \(Y_i\), a logistic model is

$$ \log\!\left(\frac{P(Y_i=1\mid G_i,E_i,C_i)}{1-P(Y_i=1\mid G_i,E_i,C_i)}\right) =\beta_0+\beta_G G_i+\beta_E E_i+\beta_{GE}G_iE_i+\boldsymbol{\gamma}^{T}C_i. $$

This model assumes independent Bernoulli outcomes conditional on the predictors and a correctly specified conditional log-odds model. The fit must also be estimable: sparse genotype-environment combinations or separation can produce unstable or non-finite estimates. For case-control samples, interpreting the fitted odds-ratio slopes requires the usual condition that selection into the sample depends on outcome, not additionally on genotype or environment within outcome and covariate strata.

Definition: For a continuous environment, the interaction null hypothesis is \(H_0:\beta_{GE}=0\), against \(H_a:\beta_{GE}\ne 0\) for a two-sided test. Under this null, the SNP effect is constant across values of \(E\) on the model scale: the conditional mean scale in linear regression or the log-odds scale in logistic regression.

The interaction coefficient is not the SNP effect at every environment value. In either model, the SNP slope at \(E=e\) is \(\beta_G+\beta_{GE}e\). In a logistic model this is a log odds ratio per additional effect allele, so its exponentiation gives the conditional odds ratio. The main-effect coefficient \(\beta_G\) is the SNP effect at \(E=0\); the environment main effect \(\beta_E\) is the environment slope at \(G=0\). Centering \(E\) makes these reference values more useful, but does not alter \(\beta_{GE}\) or its test.

Worked Example: A Quantitative-Trait Interaction

Suppose a hypothetical GWAS of 600 unrelated adults models a blood biomarker measured in milligrams per deciliter. \(G\) is the dosage of the effect allele, and \(E\) is a standardized exposure score, centered at its sample mean. The model adjusts for age and sex. A fitted model reports \(\hat{\beta}_G=0.30\), \(\hat{\beta}_E=0.20\), \(\hat{\beta}_{GE}=0.42\), and \(SE(\hat{\beta}_{GE})=0.15\), with the coefficients measured in the units implied by the model.

At the mean exposure, \(E=0\), the estimated change in mean biomarker level per additional effect allele is \(\hat{\beta}_G=0.30\) milligrams per deciliter. At one standard deviation below the mean, \(E=-1\), it is

$$ \hat{\beta}_G+\hat{\beta}_{GE}(-1)=0.30-0.42=-0.12 $$

milligrams per deciliter per allele. At one standard deviation above the mean, \(E=1\), the estimate is \(0.30+0.42=0.72\) milligrams per deciliter per allele. The estimated difference between those two SNP slopes is \(0.72-(-0.12)=0.84\) milligrams per deciliter per allele.

For the interaction test, the Wald statistic is \(z=0.42/0.15=2.80\). A two-sided standard normal test gives \(p\approx0.0051\). Subject to the model assumptions, this is evidence that the SNP association varies with exposure on the conditional mean scale. It is not evidence that the exposure causally modifies a biological genetic effect.

Deriving the Meaning of the Product Term

The interpretation follows directly by comparing the model's SNP slopes at two environmental values. Holding covariates fixed, the linear-model conditional mean at \(G=g\) and \(E=e\) contains the terms \(\beta_Gg+\beta_Ee+\beta_{GE}ge\). Its change for a one-unit increase in dosage is therefore

$$ \frac{\partial E(Y\mid G,E,C)}{\partial G}=\beta_G+\beta_{GE}E. $$

Consequently, the difference between the SNP slopes at \(E=e_2\) and \(E=e_1\) is

$$ (\beta_G+\beta_{GE}e_2)-(\beta_G+\beta_{GE}e_1) =\beta_{GE}(e_2-e_1). $$

Thus \(\beta_{GE}=0\) exactly when the linear SNP slope does not vary with \(E\). In logistic regression, the same algebra applies to the log odds. Exponentiating the difference gives the ratio of the conditional SNP odds ratios at the two environment values: \(\exp\{\beta_{GE}(e_2-e_1)\}\).

Worked Example: A Binary-Trait Interaction

Consider a hypothetical case-control analysis of 1,200 participants. The binary outcome indicates disease status, \(G\) is effect-allele dosage, and \(E\) is a centered continuous exposure score. After adjustment for specified covariates, suppose the logistic model estimates \(\hat{\beta}_G=-0.18\), \(\hat{\beta}_{GE}=0.55\), and \(SE(\hat{\beta}_{GE})=0.20\).

At \(E=0\), the estimated log odds ratio per additional allele is \(-0.18\), giving a conditional odds ratio of \(\exp(-0.18)\approx0.835\). At \(E=1\), the log odds ratio is

$$ -0.18+0.55(1)=0.37, $$

so the conditional odds ratio is \(\exp(0.37)\approx1.448\). The ratio of these two odds ratios is \(\exp(0.55)\approx1.733\). In this fitted model, the per-allele odds ratio at exposure one unit above the reference is about 1.73 times the per-allele odds ratio at the reference exposure.

The interaction Wald statistic is \(z=0.55/0.20=2.75\), giving a two-sided \(p\)-value of approximately \(0.0060\). This tests whether the log odds ratio changes with exposure. It does not test whether the disease probability changes by the same amount across exposure levels: odds ratios and probability differences are different scales, and logistic-model effects on the probability scale also depend on baseline risk.

Categorical Environments and Joint Tests

If environment has categories rather than a meaningful numeric scale, represent it with indicator variables and interact each indicator with genotype. For a three-category environment with “low” as the reference, let \(I_M\) and \(I_H\) indicate middle and high categories. The linear predictor includes \(\beta_GG+\beta_MI_M+\beta_HI_H+\beta_{GM}GI_M+\beta_{GH}GI_H\), along with the intercept and covariates. The SNP slopes are \(\beta_G\) in the low group, \(\beta_G+\beta_{GM}\) in the middle group, and \(\beta_G+\beta_{GH}\) in the high group. The interaction null is the joint hypothesis \(H_0:\beta_{GM}=\beta_{GH}=0\), with two restrictions. A single coefficient test would not test this full null.

Worked Example: Testing Across Three Environment Groups

Suppose a hypothetical study divides 700 participants into low, middle, and high exposure groups, with all three groups containing participants across the observed genotype dosages. A logistic model includes two genotype-by-group terms, using low exposure as the reference. The fitted reduced model without either interaction has log likelihood \(-412.6\); the fitted model with both interactions has log likelihood \(-408.5\).

The likelihood-ratio statistic for the joint interaction test is

$$ 2\{\ell_{\text{full}}-\ell_{\text{reduced}}\} =2\{-408.5-(-412.6)\}=8.20. $$

The full model adds two interaction coefficients, so the reference chi-square distribution has \(df=2\). For \(X\sim\chi^2_2\), the upper-tail probability at 8.20 is \(\exp(-8.20/2)\approx0.0166\). The data therefore provide evidence against equal log-odds SNP slopes across the three groups, conditional on the model. This test does not identify which pair of groups differs; group-specific contrasts and their uncertainty are needed for that question.

Model Checks, Alternatives, and Limitations

Before interpreting an interaction, check that its coding matches the scientific question. A linear dosage-by-environment term assumes an additive dosage effect and a change in that effect that is linear in a continuous \(E\). If the exposure is categorical, use the appropriate indicator interactions. If a linear dosage assumption is unsuitable, genotype indicators can be interacted with environment, but this adds parameters and requires an appropriately defined joint test. The interaction is scale-dependent: a null interaction on the log-odds scale does not imply a null interaction on the probability-difference scale.

Also examine the data support for the comparisons being made. If one genotype is rare at high exposure, the fitted interaction may rely heavily on a small number of observations. For a categorical environment, inspect genotype counts within every group; for a continuous environment, check whether genotypes occur across the exposure range. Sparse cells, near-collinearity between product and main-effect terms, an extreme exposure range, or separation in logistic regression can lead to large standard errors, unstable estimates, or convergence warnings. A small \(p\)-value does not resolve these problems.

The product-term model is generally preferable to running separate association tests in exposure subgroups and informally comparing their \(p\)-values. A significant result in one subgroup and a nonsignificant result in another does not establish that the effects differ: the subgroup estimates may differ little, with different precision. A formal interaction test directly assesses the difference in effects. Conversely, an additive-only model is simpler and can be more precise when interaction is absent, but it constrains the SNP slope to be the same across environments.

As with other single-variant models, correct adjustment and sound sampling matter. Population structure, relatedness, or omitted covariates associated with genotype, environment, and outcome can distort the interaction estimate. Including main effects for both genotype and environment is essential when including their product; otherwise, the product coefficient can absorb main-effect patterns. Statistical interaction is not automatically biological interaction or causal effect modification. Causal interpretation requires additional design and assumptions beyond the regression specification.

Common pitfall: “The SNP effect is \(0.55\) at every exposure level because the interaction coefficient is \(0.55\).” This confuses the interaction coefficient with the SNP slope. The slope is \(\beta_G+\beta_{GE}e\); \(\beta_{GE}\) describes how much that slope changes per one-unit increase in exposure. In logistic regression, it describes the change in log odds ratio, not a constant change in disease probability.

Check Your Understanding

Work each question using the model scale and reference values stated. Solutions are included below the questions.

  1. In a linear model, \(\hat{\beta}_G=0.4\) and \(\hat{\beta}_{GE}=-0.3\). What is the estimated SNP slope at \(E=2\), and what are its units if \(Y\) is measured in micromoles per liter?
  2. In a logistic model, \(\beta_{GE}=0\). Does this imply equal disease probabilities across genotypes at all exposure levels? Explain.
  3. A three-level categorical environment is represented with two indicators. How many interaction coefficients are tested by the joint null?
  4. Why does a significant SNP association in one exposure subgroup and a nonsignificant association in another not by itself demonstrate interaction?

Solutions. 1. The slope is \(0.4+(-0.3)(2)=-0.2\) micromoles per liter per additional allele. 2. No. It implies a constant SNP log odds ratio across exposure values in this model; disease probabilities can still vary with genotype and exposure because they also depend on baseline risk. 3. Two, one for each nonreference environment category; the joint null sets both coefficients to zero. 4. The two subgroup tests have separate uncertainty and power. Their differing significance labels do not test whether their estimated effects differ; a formal interaction test tests that difference directly.

Clinical Biostats