anova_glmnet | R Documentation |
glmnet
modelGiven 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.
anova_glmnet(beta, X, y, pcs = NULL)
beta |
The matrix of coefficients (component |
X |
The genotype matrix.
Same as was used in |
y |
The trait vector.
Same as was used in |
pcs |
The PC (eigenvector) matrix (optional).
Same as was used in |
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.
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.
## Not run: scores <- anova_glmnet( beta, X, y, pcs ) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.