scores_glmnet: Score loci by appearance in parse 'glmnet' model

View source: R/scores_glmnet.R

scores_glmnetR Documentation

Score loci by appearance in parse glmnet model

Description

The glmnet package does not provide a way to rank variants. Here is implemented one possible ranking based on when a variable is first selected as the penalty factor lambda of glmnet is varied. glmnet precomputes coefficients at a series of lambda knots, which are used for this score calculation. This approach requires sparsity (does not work for ridge regression).

Usage

scores_glmnet(beta)

Arguments

beta

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

Value

The score vector. Each locus receives a score between 0 and k (number of columns of beta). Loci that were never selected have zero scores. Loci first selected in column i have scores of k + 1 - i, so loci selected earlier have higher scores.

See Also

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

Examples

## Not run: 
scores <- scores_glmnet( beta )

## End(Not run)


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