Learn R Programming

glmnetcr (version 1.0.2)

select.glmnet.cr: Select Step of Optimal Fitted AIC or BIC CR Model

Description

This function returns the step number associated with the minimum AIC or BIC models for a glmnet.cr object and so can be used in selecting the step number in calls in functions such as coef.glmnet.cr, nonzero.glmnet.cr, and fitted.glmnet.cr

Usage

select.glmnet.cr(fit, which = "BIC")

Arguments

fit
a glmnet.cr object
which
determines whether the step is associated with the optimal which="BIC" model or which="AIC" model

Value

  • A numeric value of length one representing the step number.

See Also

See Also as coef.glmnet.cr, nonzero.glmnet.cr, fitted.glmnet.cr

Examples

Run this code
data(diabetes)
x <- diabetes[, 2:dim(diabetes)[2]]
y <- diabetes$y
glmnet.fit <- glmnet.cr(x, y)
AIC <- select.glmnet.cr(glmnet.fit, which = "AIC")
AIC
nonzero.glmnet.cr(glmnet.fit, s = AIC)

Run the code above in your browser using DataLab