nonzero.glmnetcr: Extract Non-Zero Model Coefficients

Description Usage Arguments Value Author(s) See Also Examples

View source: R/nonzero.glmnetcr.R

Description

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

Usage

1

Arguments

fit

a glmnetcr object

s

the step at which the non-zero coefficient estimates are desired

Value

a0

intercept estimate

beta

non-zero estimates for variables and ordinal thresholds

Author(s)

Kellie J. Archer, archer.43@osu.edu

See Also

See Also as glmnetcr, coef.glmnetcr, select.glmnetcr

Examples

1
2
3
4
5
6
data(diabetes)
x <- diabetes[, 2:dim(diabetes)[2]]
y <- diabetes$y
glmnet.fit <- glmnetcr(x, y)
AIC.step <- select.glmnetcr(glmnet.fit, which = "AIC")
nonzero.glmnetcr(glmnet.fit, s = AIC.step)

Example output

Loading required package: glmnet
Loading required package: Matrix
Loading required package: foreach
Loaded glmnet 2.0-16

Warning message:
from glmnet Fortran code (error code -26); Convergence for 26th lambda value not reached after maxit=100 iterations; solutions for larger lambdas returned 
$a0
     s23 
3.192533 

$beta
 ILMN_1705116  ILMN_1759232           cp1           cp2 
 6.614969e-03 -2.035163e-02  1.894492e+00  2.153126e-15 

glmnetcr documentation built on July 8, 2020, 6:21 p.m.