Tutorials › Statistical Genetics › Efficient Score Tests With Covariate Adjustment

Covariates, Missingness, and Robust Inference · Tutorial 331 of 989

Efficient Score Tests With Covariate Adjustment

Learn how to test a genetic effect under the null while accounting for fitted covariates by residualizing genotype with the appropriate information weights.

Intermediate 12 min read

What You'll Learn

  • State the logistic model and null hypothesis for an adjusted genetic score test
  • Derive the efficient score and its information when covariate effects are nuisance parameters
  • Show why weighted residualization of genotype produces the adjusted score statistic
  • Calculate a covariate-adjusted score test from hypothetical binary-trait data
  • Recognize when genotype–covariate collinearity leaves no information for an adjusted test
  • Distinguish the model-based score variance from a robust variance calculation

Why Adjust the Genetic Score?

A genetic association test often asks whether genotype is associated with a trait after accounting for covariates, such as age, sex, or ancestry variables. One way to answer is to fit a model under the null hypothesis of no genetic effect, then test whether adding genotype would improve the fit. The score test does this using quantities evaluated under the null, without fitting the genetic-effect model.

Adjustment is not achieved by simply subtracting a covariate’s effect from the outcome and then treating genotype as if it were unrelated to that covariate. The genetic score must account both for the fitted null mean and for the part of genotype predictable from the covariates. In logistic regression, that second adjustment is a weighted residualization.

Definition: Let \(Y_i\) be a binary trait for individual \(i\), \(g_i\) a prespecified genotype score (for example, allele dosage coded 0, 1, or 2), and \(c_i\) a vector of covariates that includes an intercept. Consider the logistic model $$ \operatorname{logit}\{P(Y_i=1\mid g_i,c_i)\}=c_i^{T}\gamma+\beta g_i. $$ The genetic-effect test is \(H_0:\beta=0\) against \(H_a:\beta\ne 0\). The covariate coefficients \(\gamma\) are nuisance parameters: they are included in the model but are not the target of this test.

Efficient Score and Information

Assume the observations are conditionally independent Bernoulli variables given their genotypes and covariates, and that the logistic model is correctly specified under the null. Write \(C\) for the matrix whose \(i\)th row is \(c_i^T\), and write \(g\) for the vector of genotype scores. Under \(H_0\), fit the null model containing the covariates but not genotype. Let \(\hat{\mu}_i\) be its fitted probability and let \(W\) be the diagonal matrix with entries \(\hat{\mu}_i(1-\hat{\mu}_i)\).

For a logistic model, the score for \(\beta\) at the null fit is \(U_\beta=g^T(y-\hat{\mu})\), where \(y\) is the vector of observed outcomes. The nuisance score is \(U_\gamma=C^T(y-\hat{\mu})\). Because \(\hat{\gamma}\) maximizes the null likelihood, its score equations give \(C^T(y-\hat{\mu})=0\). The raw genetic score is therefore evaluated at a covariate-adjusted null fit.

The information matrix for \((\beta,\gamma)\) has blocks \(I_{\beta\beta}=g^TWg\), \(I_{\beta\gamma}=g^TWC\), and \(I_{\gamma\gamma}=C^TWC\). Estimating \(\gamma\) reduces the information available for \(\beta\): the efficient information is the Schur complement of the nuisance block.

$$ I_{\mathrm{eff}} =I_{\beta\beta}-I_{\beta\gamma}I_{\gamma\gamma}^{-1}I_{\gamma\beta} =g^TWg-g^TWC(C^TWC)^{-1}C^TWg. $$

This expression is the weighted sum of squares left after projecting genotype onto the covariates. Define the weighted residualized genotype by \(\tilde g=g-C(C^TWC)^{-1}C^TWg\). The fitted values from this weighted projection are the part of genotype explained by the covariates; \(\tilde g\) is what remains.

$$ U_{\mathrm{eff}}=\tilde g^T(y-\hat{\mu}),\qquad I_{\mathrm{eff}}=\tilde g^TW\tilde g. $$

To see the score identity, write \(a=(C^TWC)^{-1}C^TWg\), so \(\tilde g=g-Ca\). Then \(\tilde g^T(y-\hat{\mu})=g^T(y-\hat{\mu})-a^TC^T(y-\hat{\mu})\). The second term is zero by the null nuisance score equations, leaving \(U_\beta\). Expanding \(\tilde g^TW\tilde g\) gives \(g^TWg-g^TWC(C^TWC)^{-1}C^TWg\), the efficient information above.

The adjustment has two related but distinct roles. The null fit supplies residuals \(y-\hat{\mu}\), and the weighted projection removes genotype variation explained by the covariates. Since the null residuals are orthogonal to the covariate columns, either the raw or residualized genotype gives the same score at the fitted null; the residualized version makes the nuisance adjustment explicit.

Theorem: If the null model is identifiable, \(C^TWC\) is invertible, and \(I_{\mathrm{eff}}>0\), then under \(H_0\) and standard large-sample regularity conditions, $$ Z_{\mathrm{score}}=\frac{U_{\mathrm{eff}}}{\sqrt{I_{\mathrm{eff}}}}\ \dot{\sim}\ N(0,1), \qquad T_{\mathrm{score}}=\frac{U_{\mathrm{eff}}^2}{I_{\mathrm{eff}}}\ \dot{\sim}\ \chi^2_1. $$ The two-sided p-value is the upper-tail probability \(P(\chi^2_1\ge T_{\mathrm{score}})\). The signed statistic indicates the direction of the score, but the one-degree-of-freedom test is based on its square.

Worked Adjusted Tests

Worked Example: Binary Trait With a Categorical Covariate

Suppose a hypothetical study has eight unrelated participants. The binary covariate \(C\) divides them into two groups, and the null logistic model includes an intercept and \(C\). In each group there are four participants and one case, so the fitted null probability is \(\hat{\mu}=1/4\) in both groups and every weight is \(W_{ii}=(1/4)(3/4)=0.1875\). The outcome and genotype values are:

Covariate groupOutcomes \(y\)Genotype scores \(g\)
\(C=0\)\((1,0,0,0)\)\((0,1,1,2)\)
\(C=1\)\((1,0,0,0)\)\((0,2,2,1)\)

Within each group, the weighted projection of genotype onto the intercept and group indicator is the group mean, because all four weights are equal. For \(C=0\), the mean dosage is \(1\), so \(\tilde g=(-1,0,0,1)\). The outcome residuals are \((0.75,-0.25,-0.25,-0.25)\), giving score contribution \((-1)(0.75)+(1)(-0.25)=-0.75-0.25=-1\).

For \(C=1\), the mean dosage is \(1.25\), so \(\tilde g=(-1.25,0.75,0.75,-0.25)\). The score contribution is \((-1.25)(0.75)+(0.75)(-0.25)+(0.75)(-0.25)+(-0.25)(-0.25)=-1.25\). Thus \(U_{\mathrm{eff}}=-1-1.25=-2.25\). The total residualized genotype sum of squares is \(2+2.75=4.75\), so

$$ I_{\mathrm{eff}}=0.1875(4.75)=0.890625,\qquad Z_{\mathrm{score}}=\frac{-2.25}{\sqrt{0.890625}}\approx-2.3842, \qquad T_{\mathrm{score}}=\frac{(-2.25)^2}{0.890625}\approx5.6842. $$

The one-degree-of-freedom chi-square approximation gives \(p\approx0.0171\). At the 0.05 significance level, this hypothetical adjusted score test is evidence against no genetic effect. The negative signed score indicates that, in this coding, the observed score points toward lower odds with increasing genotype dosage; it is not by itself an estimate of the change in log odds.

Worked Example: An Intercept-Only Null Model

Consider six hypothetical unrelated participants with binary outcomes \(y=(0,1,0,1,1,1)\) and dosages \(g=(0,0,1,1,2,2)\). The null model contains only an intercept, so its fitted probability is the sample proportion \(\hat{\mu}=4/6=2/3\), and every weight is \(W_{ii}=(2/3)(1/3)=2/9\). The weighted projection of genotype onto the intercept is its mean, \(\bar g=1\); hence \(\tilde g=(-1,-1,0,0,1,1)\).

The adjusted score is \(U_{\mathrm{eff}}=\tilde g^T(y-\hat{\mu})\). Equivalently, since the residuals sum to zero, it is \(\tilde g^Ty\): \((-1)(0)+(-1)(1)+(0)(0)+(0)(1)+(1)(1)+(1)(1)=1\). The residualized genotype sum of squares is \(1+1+0+0+1+1=4\), so \(I_{\mathrm{eff}}=(2/9)(4)=8/9\).

$$ Z_{\mathrm{score}}=\frac{1}{\sqrt{8/9}}\approx1.0607,\qquad T_{\mathrm{score}}=\frac{1^2}{8/9}=1.125. $$

The two-sided chi-square p-value is approximately \(0.289\). These data do not provide strong evidence against the null at the 0.05 level. The calculation illustrates that the adjustment here centers genotype around its mean; with additional covariates, the weighted projection removes their combined predictive component instead.

Worked Example: Genotype Fully Explained by a Covariate

Suppose a hypothetical study includes a binary covariate \(C\), an intercept, and genotype score \(g=C\) for every participant. This could occur, for example, in a small dataset where the observed genotype score happens to match a group indicator exactly. Under the null model, \(g\) lies in the column space of \(C\), so its projection onto the covariates is itself. Therefore \(\tilde g=g-g=0\).

It follows that \(U_{\mathrm{eff}}=0^T(y-\hat{\mu})=0\) and \(I_{\mathrm{eff}}=0^TW0=0\). The ratio \(U_{\mathrm{eff}}^2/I_{\mathrm{eff}}\) is undefined; there is no adjusted score test statistic to report. The data contain no genotype variation separate from the covariate, so these observations cannot distinguish a genetic effect from the covariate effect. This is a lack of identifiability, not evidence that the genetic effect equals zero.

Assumptions and Practical Interpretation

The displayed information and chi-square reference distribution are model-based. Their standard use requires a correctly specified null mean model, independent observations under the stated likelihood, a finite and identifiable null fit, and positive efficient information. Genotype coding and covariates must be specified for the test; changing the genotype score changes the genetic effect being tested. For dosage \(0,1,2\), the usual one-degree-of-freedom score test targets a linear per-allele effect on the log-odds scale.

In related or otherwise clustered samples, observations may not be independent. The simple diagonal \(W\) and model-based information above do not automatically account for that dependence. A robust variance approach requires an appropriate variance calculation for the efficient score; one should not assume that replacing a standard error elsewhere in the model automatically makes this particular score test robust.

A score-test p-value is a probability, under the null model and its assumptions, of obtaining a statistic at least as extreme as the observed statistic. It is not the probability that the null hypothesis is true. A small p-value indicates incompatibility between the observed score and that null reference distribution; it does not establish causality or quantify the genetic effect’s size.

Common Mistakes

  • Residualizing the outcome but not adjusting genotype. Covariate adjustment in the score test is represented through the null fitted probabilities and the weighted projection of genotype. The score can be expressed using raw genotype because the null residuals satisfy the nuisance score equations, but the efficient information still subtracts the genotype component explained by covariates.
  • Using an unweighted genotype projection in logistic regression. The information weights are \(\hat{\mu}_i(1-\hat{\mu}_i)\). Unless these weights are all equal, ordinary least-squares residualization does not produce the logistic efficient information.
  • Reporting a test when efficient information is zero. If genotype is fully explained by the covariates, the adjusted genetic effect cannot be separated from them. A zero denominator does not yield a valid score statistic.
  • Interpreting a score statistic as an effect estimate. The score and its standardized form are test quantities. They do not directly give a per-allele odds ratio; that requires estimating the genetic coefficient in a model that includes genotype.
Key takeaway: Under the logistic null model, estimate covariate effects first. Project genotype onto the covariates using the null information weights, then calculate efficient score \(U_{\mathrm{eff}}\) and information \(I_{\mathrm{eff}}\). Their ratio \(U_{\mathrm{eff}}^2/I_{\mathrm{eff}}\) gives the one-degree-of-freedom adjusted score test when the information is positive and the model assumptions support its reference distribution.

Check Your Understanding

Use the definitions and calculations in this tutorial to answer the following.

  1. In the logistic model, what are the null hypothesis for the genetic effect and the nuisance parameters?
  2. Why does the fitted null model make the raw genetic score equal to the score formed with residualized genotype?
  3. What information weights are used when residualizing genotype in logistic regression?
  4. If \(U_{\mathrm{eff}}=-3\) and \(I_{\mathrm{eff}}=4\), calculate the signed score statistic and the one-degree-of-freedom test statistic.
  5. What does it mean for genotype to be fully explained by the covariates, and what happens to the efficient information in that case?
Clinical Biostats