bin.fi.greedy: Greedy calculation of fragility indices for 2x2 contingency...

Description Usage Arguments Value Examples

View source: R/internal.R

Description

This is an internal function, please use bin.fi instead

Usage

1
2
3
4
5
6
7
bin.fi.greedy(
  crosstab,
  get.p,
  alpha = 0.05,
  can.vary = matrix(rep(TRUE, 4), nrow = 2),
  crosstab.offset = matrix(rep(0, 4), nrow = 2)
)

Arguments

crosstab

a 2x2 contingency table with interventions on rows and outcomes on columns

get.p

a function inputting a table and outputting a p-value

alpha

a scalar numeric for the significance cutoff, by default 0.05

can.vary

a 2x2 boolean matrix for whether each entry can decrease. See the incidence fragility index article for explanation.

crosstab.offset

a 2x2 contingency table with interventions on rows and outcomes on columns. The default has all entries equal to 0. These patients are not subject to modification, unlike crosstab, but they do contribute to the evaluation of the p value, like crosstab. Note, this is a variant of the 'dont.consider' argument in greedy.fi

Value

a list containing the signed fragility index, in addition to the modified contingency table which has reversed statistical significance and the p value sequence (as in greedy.fi)

Examples

1
2
3
4
5
x <- matrix(nrow = 2, byrow = TRUE, rgeom(4, 1 / 50))
colnames(x) <- c("event", "nonevent")
rownames(x) <- c("control", "treatment")
get.p <- function(tab) fisher.test(tab)$p.value
FragilityTools:::bin.fi.greedy(x, get.p)

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