From Genotype Summaries to Association Results
A quantitative-trait association calculation often begins with a compact summary: the number of participants in each genotype group, the mean phenotype in each group, and the within-group variability. These summaries can be enough to estimate regression effects, quantify their uncertainty, and test association. The calculation depends on the genetic model: coding genotype as a dosage estimates a linear per-allele trend, while treating genotype as a category allows each group to have its own mean.
The examples below use hypothetical data and an unadjusted analysis of one variant. The phenotype is measured in trait units. A genotype dosage \(x\) counts copies of a specified allele, so \(x=0,1,2\) for the three genotypes. The dosage model assumes the mean phenotype changes linearly with that count. The categorical model does not impose that pattern.
Assumptions and Summary Formulas
For the classical standard errors, confidence intervals, and tests in this tutorial, assume participants are independent, the genotype coding is correct, and the errors have mean zero and a common variance across genotype groups. For exact small-sample \(t\) and \(F\) reference distributions, also assume normally distributed errors conditional on genotype. These assumptions concern the statistical analysis; they do not make an observational association causal.
For the additive model, write \(n_g\) for the count with dosage \(g\), \(\bar{y}_g\) for that group’s phenotype mean, and \(W_g\) for its within-group sum of squared deviations from the mean. Let \(N=n_0+n_1+n_2\), and let \(\bar{x}\) and \(\bar{y}\) be the overall means. Group summaries give the regression quantities directly:
The fitted intercept is \(\hat{\beta}_0=\bar{y}-\hat{\beta}_1\bar{x}\). To obtain the residual sum of squares, combine the variability within genotype groups with any lack of fit of the dosage line to the three group means:
The dosage-slope test uses \(H_0:\beta_1=0\), with \(t=\hat{\beta}_1/SE(\hat{\beta}_1)\) and \(df=N-2\). A two-sided confidence interval is \(\hat{\beta}_1\pm t^*SE(\hat{\beta}_1)\), where \(t^*\) is the appropriate critical value.
For a categorical model with dosage zero as the reference, the fitted means can be written \(\mu_0\), \(\mu_0+\delta_1\), and \(\mu_0+\delta_2\) for genotypes 0, 1, and 2. The estimates are \(\hat{\mu}_0=\bar{y}_0\), \(\hat{\delta}_1=\bar{y}_1-\bar{y}_0\), and \(\hat{\delta}_2=\bar{y}_2-\bar{y}_0\). The common residual variance estimate is \(MSE=\sum_g W_g/(N-3)\). The standard error for a difference from the reference is \(\sqrt{MSE(1/n_g+1/n_0)}\). The omnibus test of equal genotype means uses an \(F\) statistic with 2 and \(N-3\) degrees of freedom.
Worked Calculations
Worked Example: Additive Per-Allele Effect
In a hypothetical sample, the phenotype summaries are:
| Dosage \(g\) | Count \(n_g\) | Mean \(\bar{y}_g\) (trait units) | Within-group sum \(W_g\) (trait units squared) |
|---|---|---|---|
| 0 | 20 | 10 | 19 |
| 1 | 30 | 12 | 29 |
| 2 | 10 | 14 | 9 |
There are \(N=60\) participants. The dosage mean is \(\bar{x}=(0(20)+1(30)+2(10))/60=0.8333\), and the phenotype mean is \(\bar{y}=(20(10)+30(12)+10(14))/60=11.667\). Thus,
Therefore, \(\hat{\beta}_1=56.667/28.333=2.000\) trait units per additional allele. The intercept is \(11.667-2.000(0.8333)=10.00\) trait units. The three group means lie exactly on the fitted dosage line, so the between-group lack-of-fit component of \(SSE\) is zero. The residual sum of squares is \(19+29+9=57\), giving \(MSE=57/(60-2)=0.9828\) and:
The test statistic is \(t=2.000/0.1862=10.74\), with 58 degrees of freedom and a two-sided \(p\)-value below 0.0001. Using \(t^*\approx2.002\), the 95% confidence interval is \(2.000\pm2.002(0.1862)=[1.627,2.373]\) trait units per allele. Under the additive model, the estimated mean increases by about 2 trait units for each additional copy of the allele.
Worked Example: Categorical Effects and an Omnibus Test
In a second hypothetical sample, each genotype group has 12 participants. The phenotype means are 5, 7, and 6 trait units for dosages 0, 1, and 2, respectively, and each group has within-group sum of squares \(W_g=11\). The categorical model uses dosage zero as the reference.
The estimated effects relative to dosage zero are \(\hat{\delta}_1=7-5=2\) trait units and \(\hat{\delta}_2=6-5=1\) trait unit. There are \(N=36\) participants, so \(MSE=(11+11+11)/(36-3)=1.000\) trait unit squared. For either reference-group contrast, the standard error is:
For dosage 1 versus dosage 0, \(t=2/0.4082=4.899\), with 33 degrees of freedom. The 95% interval, using \(t^*\approx2.034\), is \(2\pm2.034(0.4082)=[1.170,2.830]\) trait units. For dosage 2 versus dosage 0, \(t=1/0.4082=2.449\); the corresponding interval is \(1\pm2.034(0.4082)=[0.170,1.830]\) trait units. These are individual contrast tests and intervals, not a single test of all genotype differences.
For the omnibus test, the overall mean is \((5+7+6)/3=6\) trait units. The between-group sum of squares is \(12[(5-6)^2+(7-6)^2+(6-6)^2]=24\). Thus \(F=(24/2)/1=12.00\), with 2 and 33 degrees of freedom; the \(p\)-value is approximately 0.00012. This test rejects equal means across the three genotype groups. It does not require the group means to follow a per-allele linear trend.
Checking the Calculations and Choosing the Interpretation
The additive slope is a weighted linear trend across the three dosage means, not necessarily the difference between any particular pair of groups. One way to verify the summary calculation is to note that the fitted line passes through \((\bar{x},\bar{y})\), and its slope is the phenotype–dosage cross-product divided by the dosage sum of squares. For residual variability, a group mean that falls away from the fitted line contributes additional squared error beyond the variation among participants within that group.
Worked Example: A Trend Can Differ From Group-Specific Effects
A third hypothetical sample has 10 participants at each dosage, phenotype means 4, 7, and 7 trait units, and \(W_g=18\) trait units squared in every group. The overall means are \(\bar{x}=1\) and \(\bar{y}=6\). The additive sums of squares are \(S_{xx}=10(1+0+1)=20\) and \(S_{xy}=10[(-1)(-2)+0(1)+1(1)]=30\). Hence \(\hat{\beta}_1=30/20=1.500\) trait units per allele and \(\hat{\beta}_0=6-1.500(1)=4.500\) trait units.
The fitted means are 4.5, 6.0, and 7.5. Their differences from the observed group means are \(-0.5\), \(1.0\), and \(-0.5\). The lack-of-fit sum is \(10[(-0.5)^2+1.0^2+(-0.5)^2]=15\), so \(SSE=54+15=69\), \(MSE=69/(30-2)=2.464\), and \(SE(\hat{\beta}_1)=\sqrt{2.464/20}=0.3510\) trait units per allele. The slope test gives \(t=1.500/0.3510=4.274\), with 28 degrees of freedom and a two-sided \(p\)-value of about 0.0002. Its 95% interval is \(1.500\pm2.048(0.3510)=[0.781,2.219]\) trait units per allele.
The categorical model has residual sum of squares \(54\) and \(MSE=54/(30-3)=2.000\). Its between-group sum of squares is \(10[(4-6)^2+(7-6)^2+(7-6)^2]=60\), so \(F=(60/2)/2=15.00\), with 2 and 27 degrees of freedom. The categorical test asks whether all three means are equal; the slope test asks whether the linear dosage trend is zero. They are different hypotheses. Here the group means show a rise followed by a plateau, so the slope summarizes an average trend rather than reproducing every group mean.
Common Pitfalls and Practical Interpretation
- Treating the dosage slope as every genotype contrast. A slope of 1.5 trait units per allele does not assert that each adjacent pair of genotype means differs by exactly 1.5. That interpretation follows only when the additive mean model is appropriate.
- Using a categorical model but reporting an additive effect. Categorical coefficients are differences from the chosen reference group. They are not per-allele slopes.
- Omitting the lack-of-fit component. In the additive model, adding only the within-group sums \(W_g\) gives the correct \(SSE\) only when the observed group means lie exactly on the fitted dosage line.
- Interpreting a small \(p\)-value as a large effect or as causation. A \(p\)-value measures compatibility of the data with a specified null model; it does not give the size or practical importance of an effect and does not establish that the variant causes the trait.
For an additive result, report the estimated change in phenotype units per allele, its standard error or confidence interval, and the test used. For a categorical result, report the reference genotype, each contrast in phenotype units, and—when the question concerns any genotype association—the omnibus test. State the genetic coding and analysis assumptions so the meaning of the estimate is clear.
Check Your Understanding
Use the definitions and calculations above to answer these questions.
- In the additive model, what does a slope of \(-0.8\) phenotype units per allele mean in context?
- Why can the additive-model \(SSE\) exceed the sum of the within-genotype sums of squares?
- In a categorical model with dosage zero as the reference, what does the coefficient for dosage two represent?
- What null hypothesis is tested by the categorical omnibus \(F\) test?
- Why are the additive slope test and categorical omnibus test not interchangeable?