lassoAIC: Grab AIC Solution for Lasso

View source: R/lassoAIC.R

lassoAICR Documentation

Grab AIC Solution for Lasso

Description

This function runs a glmnet() function with lasso regression and pulls the best AIC estimate.

Usage

lassoAIC(y, x)

Arguments

y

Required. response variable. Quantitative for family="gaussian", or family="poisson" (non-negative counts). For family="binomial" should be either a factor with two levels, or a two-column matrix of counts or proportions (the second column is treated as the target class; for a factor, the last level in alphabetical order is the target class). For family="multinomial", can be a nc>=2 level factor, or a matrix with nc columns of counts or proportions. For either "binomial" or "multinomial", if y is presented as a vector, it will be coerced into a factor. For family="cox", preferably a Surv object from the survival package: see Details section for more information. For family="mgaussian", y is a matrix of quantitative responses.

x

Required. An input matrix, of dimension nobs x nvars; each row is an observation vector. Can be in sparse matrix format (inherit from class "sparseMatrix" as in package Matrix)

Value

Lowest AIC value.


Sage-Bionetworks/metanetwork documentation built on April 27, 2022, 7:42 a.m.