Question: Function returning % trait explained for a SNP given effect size, MAF, prevalence, etc. for a complex trait
gravatar for Vincent Laufer
24 months ago by
Vincent Laufer1.1k
United States
Vincent Laufer1.1k wrote:

Hello all,

Is there a function written in R or another language of the form:

Variance_Explained <- get_var_exp(effect_size, minor_allele_frequency, [other args])

Specifically, on page 25 of the supplemental methods of Stahl et al. 2012 (see ), an equation for variance explained is given:

It returns the percent variance of a trait that a given variant accounts for, given effect size (in either beta or odds ratio) and MAF. Coding this would not be particularly difficult, but there are a couple assumptions made that add some leg work (need liability threshold assumptions and I have other necessary parameters such as population prevalence (1%)). Is anyone aware of a function that is already written that will do this?

Update: I have located a few packages that tackle similar problems:

heritability -

genabel -

rrBLUP -

will update further once I can evaluate each package.

ADD COMMENTlink modified 23 months ago by zx87549.3k • written 24 months ago by Vincent Laufer1.1k

Not an R package, but maybe:

ADD REPLYlink written 23 months ago by zx87549.3k
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 964 users visited in the last hour