Why Test Interaction Jointly?
When genotype has three categories, an interaction analysis need not assume that the exposure effect changes by the same amount at each step in genotype. A categorical coding allows the exposure effect in each genotype group to differ without imposing a linear trend. The corresponding global test asks whether the exposure effects are all equal across the three groups. It is an omnibus question: a rejection indicates evidence of some difference, but does not by itself identify which groups differ.
A one-degree-of-freedom additive-trend test asks a narrower question. It treats genotype as a dosage, such as 0, 1, or 2 copies of an allele, and assumes the interaction changes linearly with dosage. The trend test can be more focused when that pattern is plausible, but it does not test every possible pattern across three genotype categories. Planned genotype-specific exposure contrasts complement the global test by estimating particular differences on the scale of the fitted model.
Model and Hypotheses
Let \(G\) denote a genotype with categories 0, 1, and 2, and let \(E\) be a binary exposure coded 0 or 1. For a quantitative outcome \(Y\), use genotype 0 and unexposed individuals as the reference categories. With covariates \(Z\), an unrestricted categorical-interaction model is
Here \(I(\cdot)\) is an indicator, equal to 1 when its condition is true and 0 otherwise. The coefficients \(\theta_1\) and \(\theta_2\) are differences in exposure effects relative to genotype 0. The model allows a separate exposure effect for each genotype category. For a linear model, that effect is a mean difference in outcome units; it is an adjusted association, not necessarily a causal effect.
The exposure contrast within each genotype follows directly from the model. It is the predicted outcome for \(E=1\) minus the predicted outcome for \(E=0\), holding genotype and covariates fixed:
These are genotype-specific exposure contrasts. The interaction coefficients themselves are contrasts of contrasts: \(\theta_1=\Delta_1-\Delta_0\) and \(\theta_2=\Delta_2-\Delta_0\). Specifying the exposure contrast is important: a coefficient for \(E\) in this reference-coded model describes the exposure effect only in genotype 0, not an overall exposure effect.
Global Wald Test
Let \(\hat{\boldsymbol{\theta}}=(\hat{\theta}_1,\hat{\theta}_2)^T\), and let \(\widehat V_\theta\) be its estimated covariance matrix from the fitted model. The two-degree-of-freedom Wald statistic is
Under \(H_0\), and with a sufficiently large sample and a correctly specified model, \(W\) is approximately distributed as a chi-square random variable with 2 degrees of freedom. The p-value is the probability, under that reference distribution and assuming \(H_0\), of observing a statistic at least as large as the one calculated. Rejecting at level \(\alpha\) provides evidence against equal exposure effects on the model scale. It does not establish that the interaction is causal.
The Wald statistic measures the estimated interaction vector relative to its covariance. Its inverse covariance weighting matters: the two coefficient estimates may be correlated, so testing them separately and then informally combining their p-values is not the joint test. A likelihood-ratio test can instead compare the unrestricted model with the model constrained by \(H_0\); under the usual large-sample conditions, its reference distribution also has 2 degrees of freedom.
Worked Example: Testing the Two Interaction Coefficients Jointly
Suppose a hypothetical study of 600 participants models a continuous biomarker in units. Genotype is coded 0, 1, or 2, and exposure is coded 0 or 1. The fitted categorical model adjusts for age and sex. Assume independent observations, an adequate linear conditional-mean model, and a suitable estimated covariance matrix. The estimated interaction coefficients and their covariance matrix are
The null hypothesis is \(H_0:\theta_1=\theta_2=0\). The determinant of the covariance matrix is \(0.36(0.49)-0.12^2=0.162\), so
Substitution into the Wald formula gives
Against a chi-square distribution with 2 degrees of freedom, this gives \(p\approx0.0079\). At \(\alpha=0.05\), the study has evidence that the exposure contrast is not the same in all three genotype categories, conditional on the model and covariates. The test does not tell us which genotype-specific contrast differs; those require estimates and contrasts of interest.
How the Additive-Trend Test Differs
If genotype dosage is coded numerically as \(G=0,1,2\), an additive interaction model includes the product \(E G\) rather than two separate genotype-by-exposure terms. In the same linear-model setting, it can be written as
This model imposes a particular relationship on the categorical-model coefficients: \(\theta_1=\kappa\) and \(\theta_2=2\kappa\). Its interaction null is \(H_0:\kappa=0\), tested with 1 degree of freedom. Thus the trend test does not simply provide a shorter version of the global test; it tests a more restricted alternative. It can miss a nonmonotone pattern, such as a different exposure effect in genotype 1 but similar effects in genotypes 0 and 2.
Worked Example: Calculating an Additive-Trend Test
For the same hypothetical study, suppose the separately fitted dosage-interaction model estimates \(\hat{\kappa}=0.85\) biomarker units per exposure-by-allele-dosage unit, with \(SE=0.30\). Assume the model is correctly specified and the large-sample normal approximation for the coefficient is adequate. The Wald statistic for the one-coefficient null is
Compared with a chi-square distribution with 1 degree of freedom, the two-sided p-value is approximately 0.0046. At the 0.05 level, this is evidence against no linear dosage interaction. The estimate describes an increase of 0.85 biomarker units in the exposure contrast for each additional allele dosage, under this model. It does not show that all categorical patterns of interaction are absent or present.
The global test and trend test can yield different results because they ask different questions. The global test allows any pair of interaction coefficients; the trend test asks whether those coefficients follow the specific 1-to-2 dosage pattern. Their p-values should not be treated as interchangeable measures of a single hypothesis.
Planned Genotype-Specific Exposure Contrasts
A planned contrast is a specified linear combination of model coefficients. If a contrast is \(L^T\hat{\boldsymbol{\beta}}\), where \(\hat{\boldsymbol{\beta}}\) is the vector of estimated coefficients and \(\widehat V\) is its covariance matrix, its estimated variance is \(L^T\widehat V L\). Therefore its standard error is the square root of that variance. This calculation includes covariance terms; adding coefficient standard errors, or variances without the appropriate covariance terms, is generally incorrect.
For example, comparing the exposure effects in genotypes 2 and 1 gives \(\Delta_2-\Delta_1=\theta_2-\theta_1\). Comparing genotype 2 with the reference genotype gives \(\Delta_2-\Delta_0=\theta_2\). The model scale must remain explicit. In a logistic model, the corresponding exposure contrasts are on the log-odds scale unless transformed; they are not automatically risk differences.
Worked Example: Estimating Planned Exposure Contrasts
Suppose the categorical model gives \(\hat{\beta}_E=1.00\), \(\hat{\theta}_1=1.20\), and \(\hat{\theta}_2=2.00\), all in biomarker units. Assume the estimated covariance matrix for these three coefficients, in the stated order, is
The estimated exposure contrasts are \(\hat{\Delta}_0=1.00\), \(\hat{\Delta}_1=1.00+1.20=2.20\), and \(\hat{\Delta}_2=1.00+2.00=3.00\) biomarker units. For genotype 1, the variance is
A 95% Wald confidence interval is \(2.20\pm1.96(0.6801)\), or approximately \(0.867\) to \(3.533\) biomarker units. Under the model, this interval estimates the adjusted exposure-associated mean difference among genotype-1 participants. The confidence procedure has 95% coverage over repeated samples under its assumptions; it is not a 95% probability statement about this fixed interval containing the parameter.
For the planned comparison of exposure effects between genotypes 2 and 1, the estimate is \(\hat{\theta}_2-\hat{\theta}_1=2.00-1.20=0.80\) biomarker units. Its variance and standard error are
The 95% Wald interval is \(0.80\pm1.96(0.7810)\), or approximately \(-0.731\) to \(2.331\) biomarker units. This interval includes zero, so these data do not provide strong evidence at the two-sided 0.05 level that the exposure contrast differs between genotypes 2 and 1. This pairwise result does not contradict the global test: the global test combines information about both interaction coefficients and tests a different null hypothesis.
Justification for the Wald Procedure
The basis for the joint statistic is the large-sample approximation to the sampling distribution of the estimated coefficients. Under \(H_0\), the two-dimensional interaction estimate is approximately centered at zero, with covariance \(\widehat V_\theta\). Standardizing by the inverse covariance gives a quadratic form:
The final approximation follows because the sum of squares of two independent standard normal variables has a chi-square distribution with 2 degrees of freedom. This justification requires estimable interaction coefficients and a covariance estimate appropriate to the model and sampling structure. If the model assumptions or large-sample approximation are poor, the nominal p-value and interval may not have their stated properties.
Common Mistake and Interpretation
A global rejection is evidence of heterogeneity of the exposure contrast across genotype groups on the specified model scale; it is not proof of a biological mechanism. Planned contrasts help describe the pattern, but choosing many contrasts after examining results raises a multiple-testing concern. State which contrasts were planned, report estimates with units and uncertainty, and distinguish them from the omnibus test.
Check Your Understanding
Answer each question by naming the model scale and the null hypothesis involved.
- In the categorical model, why does a global test of a three-level genotype interaction have 2 degrees of freedom?
- What relationship between \(\theta_1\) and \(\theta_2\) is imposed by an additive dosage interaction model for genotype coded 0, 1, and 2?
- If the exposure coefficient is \(\beta_E\), which genotype-specific exposure contrast does it represent in the reference-coded model?
- Write the coefficient contrast for comparing the exposure effects in genotype 2 and genotype 1.
- Why is it incorrect to conclude that the global interaction null is true merely because a planned pairwise contrast interval includes zero?