Returns the optimized convex-combination weights from a fitted
SuperSurv object.
Value
For type = "event" or type = "censoring", a named
numeric vector of ensemble weights. For type = "both", a list with
elements event and censoring.
Examples
if (requireNamespace("glmnet", quietly = TRUE)) {
data("metabric", package = "SuperSurv")
dat <- metabric[1:80, ]
x_cols <- grep("^x", names(dat))[1:5]
X <- dat[, x_cols, drop = FALSE]
new.times <- seq(20, 120, by = 20)
fit <- SuperSurv(
time = dat$duration,
event = dat$event,
X = X,
newdata = X,
new.times = new.times,
event.library = c("surv.coxph", "surv.ridge"),
cens.library = c("surv.coxph"),
control = list(saveFitLibrary = TRUE)
)
coef(fit)
coef(fit, type = "both")
}
#> $event
#> surv.coxph_screen.all surv.ridge_screen.all
#> 0.1686131 0.8313869
#>
#> $censoring
#> surv.coxph_screen.all
#> 1
#>
