aft_pec_cv: Calculate cross-validated prediction error curves

Description Usage Arguments Examples

View source: R/pec-eha-aftreg.R

Description

Calculate cross-validated prediction error curves

Usage

1
2
3
4
5
6
7
8
9
aft_pec_cv(
  data,
  mod.form,
  ipcw.form,
  times = c(0, 30, 100),
  seed = NULL,
  k = 10,
  ...
)

Arguments

data

The data set used for cross-validated brier-score calculation.

mod.form

The model specification used to fit the model in each fold. Will be passed to aftreg.

ipcw.form

The specification of the model that calculates the inverse probability censoring weights (ipcw). Will be passed to ipcw.

times

For what="IPCW.times" a vector of times at which to compute the probabilities of not being censored.

seed

If specified this seed will be used (to replicate CV folds for example).

k

Number of folds (an integer).

...

Further arguments passed to aft_pec.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
library(eha)
pec_cv_df <- aft_pec_cv(
 data = mort,
 mod.form = "Surv(time = enter, time2 = exit, event = event)~ses",
 ipcw.form = "Surv(time = enter, time2 = exit, event = event)~ses",
 times = seq(0, 10, by = 1),
 method = "cox",
 k = 5)
pec_cv_df <- aft_pec_cv(
 data = mort,
 mod.form = "Surv(time = enter, time2 = exit, event = event)~ses",
 ipcw.form = "Surv(time = enter, time2 = exit, event = event)~ses",
 times = seq(0, 10, by = 1),
 method = "aftreg",
 k = 5)

adibender/ldatools documentation built on March 7, 2020, 5:30 a.m.