anova_single: Assign ANOVA type-II -log10 p-values to a sparse genetic...

View source: R/anova_single.R

anova_singleR Documentation

Assign ANOVA type-II -log10 p-values to a sparse genetic model

Description

Given a sparse model defined by explicit locus indexes, here we assing ANOVA type-II -log10 p-values to these loci. To achieve this, loci coefficients are fit to the data as multiple linear regression, without penalization.

Usage

anova_single(X, y, indexes, pcs = NULL, ret_sparse = FALSE)

Arguments

X

The genotype matrix.

y

The trait vector.

indexes

Indexes of the loci to fit.

pcs

The PC (eigenvector) matrix (optional). Unlike genotypes, PCs are not given p-values.

ret_sparse

Logical that controls return value (see that).

Value

If ret_sparse = FALSE (default), returns a complete vector of scores (-log10 p-values) for every locus in X, with zeroes for all loci with zero coefficients. For loci with non-zero coefficients, p-values are calculated using anova2(), see that for more details. If ret_sparse = TRUE, returns a list of indexes and scores corresponding only to the loci with non-zero coefficients.

See Also

glmnet_pca(), particularly option cv = TRUE, for obtaining cross-validation objects with PCs.

anova_glmnet_single() for scores on a single glmnet model, instead of specifying indexes explicitly as here.

anova_glmnet() for scores for all glmnet models (all lambdas), though it is much slower and not generally recommended.

anova2() for additional details and data restrictions.

scores_glmnet() for a different way of scoring/raking variants.

Examples

## Not run: 
scores <- anova_single( X, y, indexes, pcs )

## End(Not run)


OchoaLab/polygenr documentation built on March 18, 2022, 10:52 a.m.