anova_glmnet: Assign ANOVA type-II -log10 p-values to every submodel of a...

View source: R/anova_glmnet.R

anova_glmnetR Documentation

Assign ANOVA type-II -log10 p-values to every submodel of a sparse glmnet model

Description

Given a sparse glmnet model (not ridge regression), here we assing ANOVA type-II -log10 p-values to every submodel obtained by varying the lambda penalty factor (i.e. each column of the $beta component matrix of the glmnet object). To achieve this, each set of selected loci is fit again to the original data without penalization.

Usage

anova_glmnet(beta, X, y, pcs = NULL)

Arguments

beta

The matrix of coefficients (component $beta) of the glmnet object.

X

The genotype matrix. Same as was used in glmnet_pca().

y

The trait vector. Same as was used in glmnet_pca().

pcs

The PC (eigenvector) matrix (optional). Same as was used in glmnet_pca(). Unlike genotypes, PCs are not given p-values.

Value

A sparse matrix (class dgCMatrix) with the same dimensions as beta, containing type-II ANOVA -log10 p-values. Zero coefficients (unselected variables) are assigned values of zero as well (to retain sparsity, imply p-values of 1). For selected variables in each column, p-values are calculated using anova2(), see that for more details.

See Also

anova_glmnet_single() for calculations on a single model (by default, approximately the best) instead of all models (all lambdas), which is much faster and generally recommended.

anova_single() for scoring a model specified by locus indexes only.

anova2() for additional details and data restrictions.

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

Examples

## Not run: 
scores <- anova_glmnet( beta, X, y, pcs )

## End(Not run)


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