Skip to contents

cmprsk::crr does not ship a coef.crr method, so a bare stats::coef() on a crr fit falls through to coef.default() and returns NULL. morie registers this method (via S3method in NAMESPACE, generated by roxygen @exportS3Method) so the standard accessor returns the fitted coefficient vector for any caller – not just morie_survival_finegray.

Usage

# S3 method for class 'crr'
coef(object, ...)

Arguments

object

A cmprsk::crr fit.

...

Ignored.

Value

Named numeric vector of regression coefficients.

Examples

# \donttest{
if (requireNamespace("cmprsk", quietly = TRUE)) {
  set.seed(1)
  fit <- cmprsk::crr(rexp(80), sample(0:2, 80, replace = TRUE),
                     matrix(rnorm(80), ncol = 1))
  coef(fit)
}
#> matrix(rnorm(80), ncol = 1)1 
#>                   0.01022006 
# }