Skip to contents

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

Usage

sumTable(
  thisResp,
  TotalSample,
  cut_B,
  cut_W,
  parX,
  YPri = c(0.5, 0.5),
  Round = 2
)

Arguments

thisResp

number of responses

TotalSample

sample size

cut_B

a meaningful improvement threshold: at least cut_B (e.g. 15%) improvement

cut_W

a poor improvement threshold: at most cut_W (e.g. 5%) improvement

parX

non-negative parameters of the beta distribution of the control (posterior)

YPri

non-negative parameters of the beta prior of the treatment, default Beta(0.5,0.5)

Round

Rounding of the output statistics

Value

A vector with the results.

Examples

sumTable(2, 25, parX = c(1, 52), cut_B = 0.2, cut_W = 0.05, YPri = c(1, 1))
#>               summaries
#> # resp             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,
    TotalSample = 25,
    parX = c(1, 52),
    cut_B = 0.2,
    cut_W = 0.05
  )
)
summaries
#>               summaries summaries summaries summaries summaries summaries
#> # resp             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
#> # resp             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