Learn R Programming

BayesMAMS (version 0.1)

ssbayes: Bayesian Sample Size Calculation for Multi-Arm Studies

Description

This function implements a Bayesian approach to designing multi-arm trials where several experimental treatments are compared to a common control. The sample size is calculated to fulfil two criteria: (1) the probability of concluding a treatment is better than control (by a relevant margin) exceeds a prespecified value, eta, and (2) the probability of concluding that none of the treatments is better than control exceeds another prespecified value, zeta. The calculations can be performed with the precision assumed to be known or unknown. The underlying methods are described in Whitehead et al. (2015).

Usage

ssbayes(k, nu, q0, deltastar, eta, zeta, alpha0, beta0, xi, prec="known", crit="1")

Arguments

k
Number of experimental treatments.
nu
Anticipated precision i.e., inverse of the variance.
q0
Vector of prior precisions to be multiplied with nu (first element for control, then experimental treatments)
deltastar
Clinically important treatment difference.
eta
Desired minimum posterior probability that a specific treatment (criterion 1) or at least any treatment (criterion 2) shows promise.
zeta
Desired minimum posterior probability that no treatment shows the clinically important treatment difference deltastar.
alpha0
Parameter in the gamma prior distribution for nu (only required if prec="unknown").
beta0
Parameter in the gamma prior distribution for nu (only required if prec="unknown").
xi
Desired probability that condition (10) in Whitehead et al. (2015) is fulfilled (only required if prec="unknown").
prec
Character string indicating whether the precision is assumed to be "known" or "unknown".
crit
Character string indicating whether a sample size is to be set with respect to criterion "1" or "2" (see details below).

Value

A matrix giving the sample sizes required per group (rounded up to the nearest integer).

Warning

When the precisions nu and/or q0 are extremely large, the calculation may yield negative values. In such cases the sample size is set to 0, and a warning message is printed.

Details

Criterion (1) requires that the posterior probability of one ore more experimental treatments being better than control is at least eta, or else the posterior probability of none of the treatments being better than control (by a relevant margin deltastar) is at least zeta.

Criterion (2) requires that the posterior probability of at least one (any) experimental treatment being better than control is at least eta, or else the posterior probability of none of the treatments being better than control (by a relevant margin deltastar) is at least zeta.

The crucial difference between the two criteria is that (1) allows to tell which treatment(s) show(s) promise whereas (2) only allows to state that at least one treatment is promising (but we do not know which one). More details on the criteria can be found in Whitehead et al. (2015).

References

Whitehead, J., Cleary, F., Turner, A. (2015) Bayesian sample sizes for exploratory clinical trials comparing multiple experimental treatments with a control. Statistics in Medicine, 34(12), 2048--2061.

Examples

Run this code
### Known precision (example from Section 3 of Whitehead et al. 2015)

# Criterion 1
ssbayes(k=2, nu=1, q0=c(16, 4, 4), eta=0.95, zeta=0.90, deltastar=0.5, prec="known", crit="1")

# Criterion 2
ssbayes(k=2, nu=1, q0=c(16, 4, 4), eta=0.95, zeta=0.90, deltastar=0.5, prec="known", crit="2")

### Unknown precision (example from Section 5 of Whitehead et al. 2015)

# Criterion 1
ssbayes(k=4, q0=c(10, rep(2, 4)), eta=0.95, zeta=0.90, deltastar=5, alpha0=1, beta0=49, xi=0.95,
        prec="unknown", crit="1")

# Criterion 2
ssbayes(k=4, q0=c(10, rep(2, 4)), eta=0.95, zeta=0.90, deltastar=5, alpha0=1, beta0=49, xi=0.95,
        prec="unknown", crit="2")

Run the code above in your browser using DataLab