surv.fi: Calculate a fragility index for survival data with...

Description Usage Arguments Value Examples

View source: R/front.R

Description

This is a function which is a wrapper around internal functions which calculate the fragility index for different data types and test specifications. It is used for survival data. The function uses a log rank test by default.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
surv.fi(
  time,
  status,
  group,
  test = "logrank",
  q = 0.5,
  cl = NULL,
  alpha = 0.05,
  tau = NULL,
  verbose = FALSE,
  max.time = Inf
)

Arguments

time

the time of either an event or right censoring

status

a 0,1 variable, with 1 if event and 0 if right-censored

group

a factor with levels representing group membership

test

a string specifying the test type, default is 'logrank' but could also use 'rmst.diff' for a restricted mean survival test.

q

the per-patient probability of permitted modifications, bigger values further constrain the permitted modificiations.

cl

a cluster from the parallel package, used to compute fragility index over each modified observation at each stage of the greedy algorithm

alpha

a number for the size of test

tau

an optional parameter for the rmst difference test, by default NULL

verbose

a logical value for whether to print status updates while running

max.time

a numeric for when the study ended and no more events can be observed, by default Inf

Value

the output of greedy.fi for the time to event test

Examples

1
2
3
4
dat <- get.survival.data(100, 6)
cl <- parallel::makeCluster(parallel::detectCores() - 2)
out <- surv.fi(dat$time, dat$status, dat$group, q=0.3, cl = cl, verbose=TRUE)
parallel::stopCluster(cl)

brb225/FragilityTools documentation built on Jan. 21, 2022, 1:26 a.m.