Learn R Programming

riskscores (version 1.2.3)

coef.risk_mod: Extract Model Coefficients

Description

Extracts a vector of model coefficients (both nonzero and zero) from a "risk_mod" object. Equivalent to accessing the beta attribute of a "risk_mod" object.

Usage

# S3 method for risk_mod
coef(object, ...)

Value

Numeric vector with coefficients.

Arguments

object

An object of class "risk_mod", usually a result of a call to risk_mod().

...

Additional arguments.

Examples

Run this code
y <- breastcancer[[1]]
X <- as.matrix(breastcancer[,2:ncol(breastcancer)])

mod <- risk_mod(X, y, lambda0 = 0.01)
coef(mod)

Run the code above in your browser using DataLab