calculateVarFrac_v2: Calculate the fraction of phenotypic variance explained by as...

Description Usage Arguments Details Value Examples

View source: R/varFrac.R

Description

This version takes into account potential rank deficiencies in the correlation matrix and noise in the effect size estimation.

Usage

1
calculateVarFrac_v2(std_bG, std_bI, matcor, varY, N, type)

Arguments

std_bG

is the vector of standardized genetic effect sizes

std_bI

is the vector of standardized interaction effect sizes

matcor

is the genotype correlation matrix

varY

is the phenotypic variance in the pooled sample

N

is the total sample size

type

indicates wether only genetic or interactions effects should be considered or if both should be considered jointly.

Details

For more details, see Shi et al., Am. J. Hum. Genet., 2016

Value

The fraction of phenotypic variance explained by user-specified effects.

Examples

1
2
3
4
5
6
7
8
std_bG = rnorm(5,0,0.01)
std_bI = rnorm(5,0,0.001)
matcor = cor(matrix(runif(5*5,1,5),nrow=5))
varY = 2.25
N = 100000
calculateVarFrac_v2(std_bG, std_bI, matcor, varY, N, "G")
calculateVarFrac_v2(std_bG, std_bI, matcor, varY, N, "I")
calculateVarFrac_v2(std_bG, std_bI, matcor, varY, N, "J")

vincela/VarExp documentation built on May 29, 2019, 12:42 p.m.