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 https://www.nature.com/articles/ng.2232 ), 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 - https://cran.r-project.org/web/packages/heritability/heritability.pdf
genabel - http://forum.genabel.org/viewtopic.php?f=6&t=134#p202
rrBLUP - https://www.nature.com/articles/s41437-017-0023-4
will update further once I can evaluate each package.
0 answers
No answers yet.
Log in to answer this question.
Please see How to add images to a Biostars post and edit your post to display your image properly. You'll need the direct link to the image, not the page where the hosting website has embedded your image (which is what you've used here).
Emended to reflect your recommendation. Thanks
No it has not. Did you read the post I pointed to?
Yes. I changed the link to end in .png, and when I click the link, it directs me to a URL where only the image is visible. I thought this was in accordance with Method 1 you posted.
No, it's not. Please see highlighted portion below:
Method 1: Upload the image, get the image direct URL (should end with an image file extension such as .jpeg or .png, and when you open the link in a browser, it should show only the image) and use with the image option on the biostars toolbar
OK, now it's better. You got it! I'll delete this chain of posts now.
Thank you very much for your help.
Not an R package, but maybe: http://cnsgenomics.com/software/gcta/#Overview