benefit_cv: Cross validated c index and c for benefit

Description Usage Arguments Value Examples

Description

Cross validated c index and c for benefit

Usage

1
2
3
benefit_cv(model_fit, treat_name, folds = 10, times = 10,
  reproducible = FALSE, match_by = "benefit", data = NULL,
  replace = FALSE, matchit_args = list())

Arguments

model_fit

An object as returned by model_fit or model_fit_glmnet

treat_name

The name of the treatment variable as a string

folds

Number of folds for k-fold cross validation

times

Number of repetitions of the cross validation

reproducible

Logical. If 'TRUE', then at each repetition of the cross validation and every time 'matchit' is called the seed is fixed.

match_by

One of "benefit" or "covariates" - what should the matching be based on?

data

Must only be specified if match_by = "covariates", the data frame.

replace

Logical, whether matching should be done with replacement. Default is 'FALSE'. This argument is passed to MatchIt::matchit and overrides the parameters given in the 'matchit_args' argument.

matchit_args

A list with other arguments that are passed on to matchit. See ?MatchIt::matchit for options like distance or method of matching.

Value

An object of class cbenefit

Examples

1
2
3
m1 <- model_fit(Surv(time, status) ~  treat + x1 + x2 + x3 + x4 + x5 + x6 + x7 + x8,
dat_toy, model = "coxph")
benefit_cv(m1, "treat", folds = 5, times = 3)

tbalan/cbenefit documentation built on May 8, 2019, 12:58 p.m.