extract.coef.glmnet

Share:

Description

Extract Coefficient Information from Models

Usage

1
2
3
## S3 method for class 'glmnet'
extract.coef(model, lambda = stats::median(model$lambda),
  ...)

Arguments

model

Model object from which to extract information.

lambda

Value of penalty parameter

...

Further arguments

Details

Gets the coefficient values and variable names from a model. Since glmnet does not have standard errors, those will just be NA.

Value

A data.frame containing the coefficient, the standard error and the variable name.

Author(s)

Jared P. Lander

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## Not run: 
library(glmnet)
library(ggplot2)
library(useful)
data(diamonds)
diaX <- build.x(price ~ carat + cut + x - 1, data=diamonds, contrasts = TRUE)
diaY <- build.y(price ~ carat + cut + x - 1, data=diamonds)
modG1 <- glmnet(x=diaX, y=diaY)
extract.coef(modG1)

## End(Not run)

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.