coef.risk_mod {riskscores} | R Documentation |
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 class 'risk_mod'
coef(object, ...)
Arguments
object |
An object of class "risk_mod", usually a result of a call to
|
... |
Additional arguments. |
Value
Numeric vector with coefficients.
Examples
y <- breastcancer[[1]]
X <- as.matrix(breastcancer[,2:ncol(breastcancer)])
mod <- risk_mod(X, y, lambda0 = 0.01)
coef(mod)
[Package riskscores version 1.1.1 Index]