Make [survival::basehaz()] available for coxnet objects.

basehaz(fit, ...)

# S3 method for coxph
basehaz(fit, centered = TRUE, ...)

# S3 method for cv.glmnet
basehaz(
  fit,
  x,
  y,
  s = c("lambda.1se", "lambda.min"),
  times = NULL,
  centered = TRUE,
  ...
)

# S3 method for coxnet
basehaz(fit, x, y, s = NULL, times = NULL, centered = TRUE, ...)

Arguments

fit

fitted model.

...

further arguments passed to basehaz.

centered

logical(1), see survival::basehaz().

x

matrix, model matrix used to fit fit.

y

Surv, Survival object used to fit fit.

s

numeric(1), lambda penality parameter.

times

numeric, estimate baseline hazard for times. If NULL all times are returned.

Value

data.frame with variable names hazard, time and optionally strata.

Author

Sebastian Gibb