Learn R Programming

glmnetcr (version 1.0.2)

coef.glmnet.cr: Extract All Model Coefficients

Description

The coef.glmnet.cr function returns all estimated coefficients for a glmnet.cr fitted model, where the model selected is indicated by step s.

Usage

## S3 method for class 'glmnet.cr':
coef(object, s, ...)

Arguments

object
a glmnet.cr object
s
the step at which the coefficient estimates are desired
...
additional optional arguments

Value

  • a0the intercept
  • betaestimated coefficients for the variables and the ordinal thresholds

See Also

See Also as glmnet.cr, nonzero.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)
BIC.model <- select.glmnet.cr(glmnet.fit)
estimates <- coef(glmnet.fit, s = BIC.model)

Run the code above in your browser using DataLab