compute_expl_var {CJAMP} | R Documentation |
Phenotypic variance explained by genetic variants.
Description
Function to estimate the percentage of the variance of a phenotype that can be explained by given single nucleotide variants (SNVs).
Usage
compute_expl_var(genodata = NULL, phenodata = NULL,
type = "Rsquared_unadj", causal_idx = NULL, effect_causal = NULL)
Arguments
genodata |
Numeric vector or dataframe containing the genetic variant(s) in columns. Must be in allelic coding 0, 1, 2. |
phenodata |
Numeric vector or dataframe of the phenotype. |
type |
String (vector) specifying the estimation approach(es) that are computed.
Available are the methods |
causal_idx |
Vector with entries |
effect_causal |
Numeric vector containing the effect sizes of the causal SNVs.
Has to be supplied for the approaches |
Details
Four different approaches are available to estimate the percentage of explained phenotypic variance (Laird & Lange, 2011):
(1) "Rsquared_unadj"
: Unadjusted R^2
from a linear regression of
the phenotype conditional on all provided SNVs.
(2) "Rsquared_adj"
: Adjusted R^2
from a linear regression of
the phenotype conditional on all provided SNVs.
(3) "MAF_based"
: Expected explained phenotypic variance computed based on the
MAF and effect size of the provided causal SNVs.
(4) "MAF_based_Y_adjusted"
: Expected explained phenotypic variance computed
based on the MAF and effect size of the causal SNVs, with respect to the empirical
phenotypic variance, which is the broad-sense heritability relative to the
empirical phenotypic variance.
References:
Laird NM, Lange C (2011). The fundamentals of modern statistical genetics. New York: Springer.
Value
A list containing the estimated percentage of explained phenotypic variance.
Examples
set.seed(10)
genodata <- generate_genodata(n_SNV = 20, n_ind = 1000)
phenodata <- generate_phenodata_1_simple(genodata = genodata[,1],
type = "quantitative", b = 0)
compute_expl_var(genodata = genodata, phenodata = phenodata$Y,
type = c("Rsquared_unadj", "Rsquared_adj"),
causal_idx = NULL, effect_causal = NULL)