bin.fi.incidence: Calculate all of the incidence fragility indices

Description Usage Arguments Value Examples

View source: R/front.R

Description

The function is used to calculate the incidence fragility indices for every possible sufficiently likely threshold. Note, the incidence fragility indices are formally defined in the article Incidence fragility index. The function bin.fi in this package will calculate an incidence fragility index for a given threshold, and this function loops over bin.fi for relevant grid of sufficiently likely thresholds min.p (i.e. q). The function incidence.plot allows for a convenient visualization of these values.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
bin.fi.incidence(
  crosstab = NULL,
  alg = "exact",
  test = "fisher",
  fi.start = NULL,
  alpha = 0.05,
  verbose = FALSE,
  delta = NULL,
  X = NULL,
  Y = NULL
)

Arguments

crosstab

a 2x2 non negative integer matrix (contingency table) representing the output of a clinical trial. The rows correspond to treatment/control and the columns to event/nonevent.

alg

a string specifying the FI algorithm, 'exact', 'greedy', 'hybrid'. See the documentation of bin.fi for more information. Note that 'original' and 'original.bothdir' do not support the per-patient sufficiently likely threshold so cannot be used here.

test

a string specifying the test, defaulting to 'fisher' for the Fisher exact test. Alternatives include 'fisher.midp' and 'pearson.chisq'.

fi.start

the starting fragility index considered in the exact algorithm

alpha

a numeric for the significance threshold of the statistical test

verbose

a logical value for whether to print status updates while running

Value

a matrix containing the sufficiently likely threshold values q at which there is a changepoint and the corresponding values of the incidence fragility index. The value is the limit from the right.

Examples

1
2
3
x <- matrix(nrow=2,byrow=TRUE,c(5, 100, 30, 70),
dimnames = list(c('treatment', 'control'), c('event', 'nonevent')))
out <- bin.fi.incidence(crosstab=x, alg='exact')

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