# Does Hail's linear regression method account for additivity or dominance?

**URL:** https://discuss.hail.is/t/does-hails-linear-regression-method-account-for-additivity-or-dominance/2914
**Category:** Hail Query & hailctl
**Created:** [October 22, 2022, 7:14am UTC](https://discuss.hail.is/t/does-hails-linear-regression-method-account-for-additivity-or-dominance/2914 "2022-10-22T07:14:28Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![jbchang](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.hail.is/jbchang/32/818_2.png) [@jbchang](https://discuss.hail.is/u/jbchang)
#### Post date: [October 22, 2022, 7:14am UTC](https://discuss.hail.is/t/does-hails-linear-regression-method-account-for-additivity-or-dominance/2914/1 "2022-10-22T07:14:28Z")

</div>

Hi folks,

I’m pretty new to statistical genetics, and I’m wondering whether Hail’s linear regression outputs separate beta values for additivity/dominance.

When I learned about GWAS, I was taught to define random variables (X\_a, X\_d) = (-1, -1), (0, 1), and (1, -1) corresponding to genotypes homozygous ref, heterozygous, and homozygous alt, respectively. This would then give you two betas, beta\_a and beta\_d, whose values tell you whether the trait is additive, dominant, neither, or some mixture.

My guess from the [documentation](https://hail.is/docs/0.2/methods/stats.html#hail.methods.linear_regression_rows) is that it only outputs a single beta corresponding to the genotype (I’m running it the same way as in the documentation—feeding in GT.num\_alt\_alleles()).

If this is the case, could Hail’s method miss some associations because a trait isn’t strictly linear?

Best,  
Jeremy

---

<div class="post-metadata">

### Author: ![danking](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.hail.is/danking/32/43_2.png) [@danking](https://discuss.hail.is/u/danking)
#### Post date: [October 24, 2022, 8:17pm UTC](https://discuss.hail.is/t/does-hails-linear-regression-method-account-for-additivity-or-dominance/2914/2 "2022-10-24T20:17:23Z")

</div>

That’s right, Hail only runs one test per phenotype per variant. If you’re using mt.GT.n\_alt\_alleles you’re testing the additive model. Regarding the -1,0,1 model vs the 0,1,2 model, I think you should be able to convert between the betas from these two representations but I don’t know the math off the top of my head.

You can run a dominance model by manually producing a dominance encoding which is orthogonal to the 0,1,2 model.

Alternatively, you could just write write the dominance and additive models using your representation:

```python
mt = mt.annotate_entries(
    mt_add = mt.GT.n_alt_alleles() - 1, # assuming biallelic
    mt_dom = 1 - 2 * mt.GT.is_het()
)

```

NB: When is\_het you get 1 when !is\_het you get -1.
