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

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

# S3 method for 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. 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
#> 
#> Call: bootstrap(x = x, y = y, fun = rcv.glmnet, nboot = 2, family = "cox",      nrepcv = 2, nfolds = 3) 
#> 
#> Number of bootstrap samples: 2
#> Selected variables:
#> ALB_S, BILI_S, CRE_S, INR_C
#> 
#> Variables selected in bootstrap samples:
#>  ALB_S BILI_S  CRE_S  INR_C 
#>      2      2      2      2 
#> 
#> Calibrated:
#>     [0,0.744] (0.744,0.841]  (0.841,0.88]  (0.88,0.902] (0.902,0.917] 
#>    0.28839973   -0.12006792   -0.07712471   -0.07194103    0.05186481 
#>  (0.917,0.93]  (0.93,0.945]     (0.945,1] 
#>   -0.13388939   -0.07429987   -0.05146661