Learn R Programming

glmnetcr (version 1.0.2)

nonzero.glmnet.cr: Extract Non-Zero Model Coefficients

Description

The nonzero.glmnet.cr function returns only those non-zero coefficient estimates for a selected model

Usage

nonzero.glmnet.cr(fit, s)

Arguments

fit
a glmnet.cr object
s
the step at which the non-zero coefficient estimates are desired

Value

  • a0intercept estimate
  • betanon-zero estimates for variables and ordinal thresholds

See Also

See Also as glmnet.cr, coef.glmnet.cr, select.glmnet.cr

Examples

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

Run the code above in your browser using DataLab