Skip to contents

This function will calculate the summary statistics for a specific response outcome scenario.

Usage

sumTable(x, n, go_cut, stop_cut, parX, parY = c(0.5, 0.5), round = 2)

Arguments

x

(numeric):
number of successes.

n

(number):
number of patients.

go_cut

(number):
a meaningful improvement threshold, the lower boundary of a meaningfully improvement in response rate

stop_cut

(number):
a poor improvement threshold, the upper boundary of a meaningfully poor improvement in response rate

parX

(numeric):
two parameters of X's Beta distribution (Control)

parY

(numeric):
two parameters of Y's Beta distribution (Treatment)

round

(number):
Digit rounding of the output statistics

Value

A vector with the results.

Examples

sumTable(
  x = 2,
  n = 25,
  parX = c(1, 52),
  parY = c(1, 1),
  go_cut = 0.2,
  stop_cut = 0.05
)
#>               summaries
#> responders         2.00
#> obs ORR [%]        8.00
#> mode [%]           6.48
#> CI lower [%]       0.71
#> CI upper [%]      20.68
#> prob.go [%]        5.87
#> prob.nogo [%]     26.59

# for multiple response scenarios (e.g. 0 to 8 responses out of 25)
summaries <- do.call(
  cbind,
  lapply(c(0:8),
    sumTable,
    n = 25,
    parX = c(1, 52),
    go_cut = 0.2,
    stop_cut = 0.05
  )
)
summaries
#>               summaries summaries summaries summaries summaries summaries
#> responders         0.00      1.00      2.00      3.00      4.00      5.00
#> obs ORR [%]        0.00      4.00      8.00     12.00     16.00     20.00
#> mode [%]           0.00      1.02      4.80      8.83     12.92     17.04
#> CI lower [%]      -4.55     -2.42     -0.24      2.03      4.55      7.27
#> CI upper [%]      17.51     13.05     18.83     24.07     28.97     33.64
#> prob.go [%]        0.05      0.74      3.79     11.58     25.23     43.17
#> prob.nogo [%]     93.39     66.49     36.46     16.09      6.00      1.98
#>               summaries summaries summaries
#> responders         6.00      7.00      8.00
#> obs ORR [%]       24.00     28.00     32.00
#> mode [%]          21.18     25.32     29.47
#> CI lower [%]      10.17     13.20     16.37
#> CI upper [%]      38.13     42.46     46.67
#> prob.go [%]       61.70     77.26     88.13
#> prob.nogo [%]      0.59      0.17      0.04