nonzero.coef: Extract Non-Zero Model Coefficients

View source: R/nonzero.coef.R

nonzero.coefR Documentation

Extract Non-Zero Model Coefficients

Description

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

Usage

nonzero.coef(object, s)

Arguments

object

a glmpathcr object

s

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

Value

A vector of estimated coefficients is returned. The nonzero.coef function returns only those non-zero coefficient estimates for a selected model.

Author(s)

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

See Also

See also as glmpathcr, coef.glmpathcr

Examples

data(diabetes)
x <- diabetes[, 2:dim(diabetes)[2]]
y <- diabetes$y
fit <- glmpathcr(x, y)
step <- model.select(fit, which="BIC")
nonzero.coef(fit, s = step)

glmpathcr documentation built on May 29, 2024, 4:25 a.m.