Tutorials › Statistical Genetics › A Worked SKAT Analysis from Genotypes to Inference

Kernel Tests and SKAT Methods · Tutorial 456 of 989

A Worked SKAT Analysis from Genotypes to Inference

Work through the choices and calculations in a covariate-adjusted SKAT test, then interpret its gene-level result without overstating the evidence.

Advanced 10 min read

What You'll Learn

  • Set up a gene-level SKAT analysis and state the assumptions needed for its null model.
  • Code genotype dosages, calculate allele frequencies, and define direct kernel weights.
  • Fit a covariate-adjusted quantitative-trait null model and calculate variant score statistics.
  • Derive the SKAT mixture chi-square reference distribution from its kernel eigenvalues.
  • Calculate and interpret a gene-level p-value, including the limits of a small illustrative example.

From a Sequenced Gene to a Test

A gene-level rare-variant analysis brings together several choices that are easy to blur: which variants enter the test, how their genotypes are represented, which covariates are adjusted for, and how the resulting statistic is calibrated. A SKAT p-value is meaningful only relative to those choices. This tutorial follows one hypothetical quantitative-trait analysis from its input data to its inference.

The example uses a small sample so that every step can be checked by hand. It is an arithmetic illustration, not a study design or a reliable basis for scientific conclusions. In practice, analysis also requires careful sequencing quality control and an appropriate calibration for the sample size and trait model.

Definition: For \(n\) individuals and \(m\) variants in a gene, let \(G\) be the \(n\)-by-\(m\) genotype matrix, with entries coded as allele dosages 0, 1, or 2. Let \(X\) be the covariate design matrix and \(y\) the trait vector. In a quantitative-trait SKAT, the null model relates \(y\) to \(X\), excluding the gene's variant effects. The test assesses whether the variant scores, considered together through a weighted kernel, are collectively inconsistent with that null model.

For the worked analysis, assume individuals are unrelated and their errors are independent with a common variance. The quantitative trait is adequately modeled by a linear mean in the stated covariates. Genotypes are correctly called, the included variants and weights are fixed without looking at the trait values, and relevant confounding is addressed by the covariates. These assumptions matter: for example, relatedness or heteroskedasticity may require a different null model and corresponding calibration.

Define the Variants, Weights, and Kernel

A gene-level test begins by specifying its variant set. Quality and inclusion decisions should be made using genotype data and prespecified criteria, not by selecting variants because they appear associated with the trait. The dosage \(G_{ij}\) is the number of copies of the coded allele for individual \(i\) at variant \(j\). A direct kernel weight \(a_j\) is nonnegative; in the convention used here, the kernel and test statistic are

$$ K=G\,\operatorname{diag}(a_1,\ldots,a_m)G^\mathsf{T}, \qquad Q=U^\mathsf{T}\operatorname{diag}(a_1,\ldots,a_m)U =\sum_{j=1}^{m}a_jU_j^2, \qquad U=G^\mathsf{T}r. $$

Here \(r\) is the vector of residuals from the covariate-only null model, and \(U_j\) is the score for variant \(j\). Some software describes weights through square-root weights applied to the genotype columns; that is a different parameterization of the same kernel if it produces these \(a_j\). Naming the direct kernel weights avoids ambiguity.

Weights determine how much each variant contributes to the test. Equal weights are a transparent choice for a worked calculation. In an applied analysis, weights may depend on allele frequency or annotation, but their rationale and exact parameterization should be reported. A weight of zero excludes a variant from the kernel; a larger weight gives its score more influence.

Worked Example: Coding Two Hypothetical Variants

Suppose sequencing identifies two eligible variants in a hypothetical gene among eight individuals, with no missing genotypes. Each variant has four copies of its coded allele across the eight individuals. For either variant, the sample allele frequency is

$$ \hat p=\frac{\text{allele count}}{2n}=\frac{4}{2(8)}=\frac{4}{16}=0.25. $$

For this illustration, take the minor allele to be the coded allele, so the minor-allele frequency is also 0.25 at each variant. Use dosage columns \(g_1\) and \(g_2\), and set \(a_1=a_2=1\). Then \(K=g_1g_1^\mathsf{T}+g_2g_2^\mathsf{T}\), and \(Q=U_1^2+U_2^2\). These equal weights are chosen to make the calibration arithmetic simple; they are not claimed to be optimal weights for a real gene.

Fit the Covariate-Adjusted Null Model

For a quantitative trait with an intercept and one covariate \(x\), the null model is \(y_i=\beta_0+\beta_1x_i+\epsilon_i\), with no variant term. Write \(X\) for the columns of the intercept and covariate, and define the residual-maker matrix \(M=I-X(X^\mathsf{T}X)^{-1}X^\mathsf{T}\). The fitted null-model residual vector is \(r=My\). The score vector \(U=G^\mathsf{T}r\) measures how each genotype column aligns with the part of the trait not explained by the covariates.

Fitting covariates is not an optional final adjustment to a score computed from the raw trait. The residuals must come from the specified null model, and the null distribution must account for the same covariate adjustment. The following hypothetical dataset has two covariate groups and includes one observation at each of the four genotype combinations in each group.

IndividualCovariate \(x\)\(g_1\)\(g_2\)Trait \(y\)
100010.125
20019.375
30109.625
401110.875
510012.125
610111.375
711011.625
811112.875

Worked Example: Fitting the Null Model and Computing Scores

Fit the null model \(y_i=\beta_0+\beta_1x_i+\epsilon_i\). The four trait values at \(x=0\) sum to 40, giving mean 10; those at \(x=1\) sum to 48, giving mean 12. Thus the fitted intercept and slope are \(\hat\beta_0=10\) and \(\hat\beta_1=2\). The fitted value is 10 for individuals 1–4 and 12 for individuals 5–8.

Subtract each fitted value from the observed trait. The residuals, in individual order, are \(0.125,-0.625,-0.375,0.875,0.125,-0.625,-0.375,0.875\). They sum to zero within each covariate group, as required by this fitted model. The first score is the sum of residuals for individuals with \(g_1=1\):

$$ U_1=(-0.375)+(0.875)+(-0.375)+(0.875)=1.000. $$

For \(g_2=1\), individuals 2, 4, 6, and 8 contribute, giving

$$ U_2=(-0.625)+(0.875)+(-0.625)+(0.875)=0.500. $$

Because the null model includes an intercept, adding a constant to a genotype column does not change its score: the residuals sum to zero. These scores are therefore equivalent to using genotype columns centered at their covariate-adjusted means.

Calibrate the SKAT Statistic

Under the quantitative-trait null model, assume \(\epsilon\sim N(0,\sigma^2I)\). Then \(r=M\epsilon\) under the null and \(U=G^\mathsf{T}M\epsilon\). Consequently, \(U\) has mean zero and covariance matrix \(\sigma^2G^\mathsf{T}MG\). The quadratic statistic \(Q=U^\mathsf{T}WU\), where \(W=\operatorname{diag}(a_1,\ldots,a_m)\), has a mixture chi-square null distribution. Its weights are the nonnegative eigenvalues of \(\sigma^2W^{1/2}G^\mathsf{T}MGW^{1/2}\).

To see why, write \(C=\sigma^2G^\mathsf{T}MG\) and represent the score vector as \(U=C^{1/2}Z\), where \(Z\) has independent standard normal components on the nonzero-eigenvalue subspace. Then \(Q=Z^\mathsf{T}C^{1/2}WC^{1/2}Z\). Diagonalizing this symmetric matrix by an orthogonal transformation preserves the standard normal distribution of \(Z\), so the quadratic form becomes a sum of eigenvalues times independent squared standard normals:

$$ Q\ \overset{d}{=}\ \sum_{\ell=1}^{m}\lambda_\ell\chi^2_{1,\ell}. $$

Here \(\lambda_\ell\) are the eigenvalues just specified, and the \(\chi^2_{1,\ell}\) variables are independent chi-square random variables with one degree of freedom. Zero eigenvalues contribute zero. In an ordinary analysis, \(\sigma^2\) is generally unknown and must be estimated or handled by the chosen calibration procedure. The calculation below uses the residual-variance estimate as a plug-in, making the resulting p-value an approximation.

Worked Example: Eigenvalues, Test Statistic, and P-Value

For the displayed data, the two genotype columns are orthogonal to the intercept and to \(x\), and are mutually orthogonal after covariate adjustment. Each has squared adjusted length 2. Therefore

$$ G^\mathsf{T}MG= \begin{pmatrix} 2&0\\ 0&2 \end{pmatrix}. $$

The residual sum of squares is

$$ \mathrm{RSS}=2\left(0.125^2+(-0.625)^2+(-0.375)^2+0.875^2\right) =2(1.3125)=2.625. $$

There are \(8-2=6\) residual degrees of freedom, so the estimated residual variance is \(s^2=2.625/6=0.4375\). With both direct kernel weights equal to 1, the two plug-in mixture weights are \(0.4375(2)=0.875\). The observed statistic and its reference-distribution scaling are

$$ Q=1(1.000)^2+1(0.500)^2=1.250, \qquad \frac{Q}{0.875}=1.4286. $$

The two mixture weights are equal, so \(Q/0.875\) has the plug-in reference distribution \(\chi^2_2\). For a chi-square variable with two degrees of freedom, the upper-tail probability at \(t\) is \(\exp(-t/2)\). Thus

$$ p=\exp(-1.4286/2)=\exp(-0.7143)\approx 0.4895. $$

Under this illustrative calibration, the observed gene-level statistic is not unusual under the null model: the p-value is about 0.490. It is not the probability that the null hypothesis is true, nor does it establish that the variants have no effects. The sample is deliberately tiny, so this plug-in calculation should not be treated as a dependable real-study p-value.

What the Result Does—and Does Not—Say

A SKAT p-value is a statement about how extreme the observed weighted score statistic is under the specified null model and its calibration. It is not an estimate of the size or direction of a single gene effect. Because the test combines squared scores, opposing variant effects do not cancel in the way they can in a simple burden sum. The result also depends on the variant set, weights, covariates, and null-model assumptions; these choices belong in the analysis report.

The calculation above illustrates the logic of a SKAT test rather than a general rule for selecting a test. If a study instead uses SKAT-O, the reported p-value must come from the calibrated hybrid procedure, including its parameter search, rather than from substituting a selected SKAT statistic into the SKAT mixture calculation. Likewise, testing many genes requires an appropriate interpretation of the gene-level p-values in light of the testing plan.

1
Specify the analysis.
State the gene’s variant set, dosage coding, weights, trait model, covariates, and assumptions before computing the test.
2
Fit the null model.
Estimate the covariate-only model, obtain residuals, and calculate the variant scores from those residuals.
3
Calculate and calibrate \(Q\).
Form the weighted quadratic statistic and use the corresponding kernel eigenvalues and a suitable null-distribution method.
4
Interpret in context.
Report the p-value as evidence against the stated gene-level null, without treating it as a probability that the null is true or as proof of causation.

Common Mistake: Using the Wrong Null Distribution

A tempting but incorrect shortcut is to compute \(Q\) and compare it with an ordinary chi-square distribution with \(m\) degrees of freedom simply because there are \(m\) variants. That reasoning ignores both the covariate-adjusted genotype correlations and the variant weights. The SKAT reference distribution is generally a weighted sum of chi-square variables; its eigenvalues depend on the adjusted genotype matrix and the kernel weights. Only in special cases, such as the equal-eigenvalue case in the worked example, can the mixture be reduced to a scaled ordinary chi-square distribution.

Key takeaway: A reproducible SKAT analysis links the genotype coding and kernel weights to the covariate-adjusted null model, the resulting score statistic, and the eigenvalue-based calibration. A p-value is interpretable only with those choices and assumptions made clear.

Check Your Understanding

Use the definitions and calculations above to answer these questions.

  1. Why must the residuals used to calculate SKAT scores come from the covariate-only null model?
  2. With eight individuals and four copies of a coded allele, what is the allele frequency if there is no missing genotype data?
  3. If the direct kernel weight for a variant is zero, what is its contribution to the kernel and to \(Q\)?
  4. Why is the SKAT null distribution generally a mixture of chi-square variables rather than an unscaled chi-square distribution with one degree of freedom per variant?
  5. In the worked example, what does the p-value of about 0.490 describe, and what does it not describe?
Clinical Biostats