boot.glmnet: Bootstrap Validation for Survival Model

bootstrapR Documentation

Bootstrap Validation for Survival Model

Description

Boostrap validation for survival data as described in Harrell et al. 1996.

Usage

bootstrap(
  x,
  y,
  fun = rcv.glmnet,
  nboot = 200L,
  m = 50,
  times = 90,
  ...,
  s = "lambda.1se",
  verbose = interactive()
)

## S3 method for class 'boot.glmnet'
print(x, digits = max(3L, getOption("digits") - 3L), ...)

Arguments

x

matrix, data/feature matrix.

y

Surv, survival time and status as Surv object.

fun

model function, e.g. rcv.glmnet().

nboot

integer number of bootstrap samples

m

integer, individuals/observations per interval

times

numeric predict survival at times.

s

character/numeric, value(s) of the penality parameter lambda. See glmnet::predict.cv.glmnet() for details.

verbose

logical, if TRUE a progressbar is shown.

digits

integer(1), number of digits shown in table.

...

further params passed to fun.

Value

A list, with the fitted model fit and the over-optimistic error.

References

Harrell Jr, Frank E., Kerry L. Lee, and Daniel B. Mark. "Multivariable prognostic models: issues in developing models, evaluating assumptions and adequacy, and measuring and reducing errors." Statistics in medicine 15.4 (1996): 361-387. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1002/(SICI)1097-0258(19960229)15:4<361::AID-SIM168>3.0.CO;2-4")}

Examples

# nboot should usually be higher but to keep the runtime of the example low
# we choose 2 here
data(eldd)
x <- na.omit(eldd)
y <- Surv(x$DaysAtRisk, x$Deceased)
x <- as.matrix(x[,c("Age", "ALB_S", "BILI_S", "CRE_S", "INR_C")])
boot <- bootstrap(
    x, y, rcv.glmnet, family = "cox",
    nboot = 2, nrepcv = 2, nfolds = 3
)
boot

ampel-leipzig/ameld documentation built on Aug. 23, 2024, 7:31 p.m.