This R package provides functions for power analysis and the construction of the set of best embedded dynamic treatment regimes (EDTR) using Bayesian multiple comparison with the best (MCB) methodology. This entails the construction of simultaneous one-sided upper credible intervals for the difference between each EDTR’s summary statistic and the best EDTRs. It is designed for binary outcomes in sequential, multiple assignment, randomized trials.
We extend frequentist methods to the Bayesian setting. In particular, one may determine what sample size to enroll in order to achieve a specified power, where power is the probability of excluding inferior embedded dynamic treatment regimes from the set of best.
The set of best consists of EDTRs which are not significantly inferior to the optimal or best embedded dynamic treatment regime (Artman et al. 2020).
The best EDTR is included in the set of best with probability at least 1 − α.
In this vignette, we outline how the functions may be used together to achieve these goals.
First, run SimDesign1
to simulate a design-1 SMART.
Then, apply PosteriorTrtSeqProb
to sample
from the posterior of the probabilities of response at each stage.
To obtain draws from the probabilities of response for each of the
embedded dynamic treatment regimes (EDTRs), run PosteriorEDTRProbs
.
In order to construct the set of best (or equivalently, upper
credible interval limits), run MCBUpperLimits
.
set.seed(23856)
dat <- SimDesign1(sample_size = 250,
response_prob = c(0.2,0.3,0.4,0.5,0.6,0.7),
stage_one_trt_one_response_prob = 0.7,
stage_one_trt_two_response_prob = 0.4)
set.seed(39864)
posterior_trt_seq_draws <- PosteriorTrtSeqProb(niter = 10000,
dat,
design = "design-1")
Convert draws from each treatment sequence to draws from each embedded DTR.
MCBUpperLimits(thetadraws=posterior_EDTR_draws,
alpha=0.05,
design="design-1",
type="log-OR")
#> [1] -0.8337268 -0.9920360 0.4241352 0.0000000
Note that EDTRs 1 and 2 are statistically significantly inferior to EDTR 4 whereas EDTR 3 is not.
To see what the log-odds ratios are, run LogOR
. Lastly, to compute the
power to exclude inferior embedded dynamic treatment regimes (EDTRs)
from the set of best (or equivalently, for their upper credible interval
to exclude 0), run PowerBayesian
.
Compute log-OR of a success.
LogOR(response_prob = c(0.3,0.3,0.3,0.8,0.6,0.7),
stage_one_trt_one_response_prob = 0.6,
stage_one_trt_two_response_prob = 0.4,
design = "design-1")
#> EDTR 1 EDTR 2 EDTR 3 EDTR 4
#> [1,] -1.893266 -1.893266 -0.2921968 0
Compute power to exclude embedded dynamic treatment regimes 1 and 2. The choice to exclude these embedded dynamic treatment regimes may be based off the values of the log-OR between each EDTR and the best.
To see what the log-relative-risk are, run LogRR
. Lastly, to compute the
power to exclude inferior embedded dynamic treatment regimes (EDTRs)
from the set of best (or equivalently, for their upper credible interval
to exclude 0), run PowerBayesian
.
Compute log-RR of a success.
LogRR(response_prob = c(0.3,0.3,0.3,0.8,0.6,0.7),
stage_one_trt_one_response_prob = 0.6,
stage_one_trt_two_response_prob = 0.4,
design = "design-1")
#> EDTR 1 EDTR 2 EDTR 3 EDTR 4
#> [1,] -0.9028677 -0.9028677 -0.08455739 0
Compute power to exclude embedded dynamic treatment regimes 1 and 2. The choice to exclude these embedded dynamic treatment regimes may be based off the values of the log-RR between each EDTR and the best.
To see what the risk difference are, run RD
. Lastly, to compute the power
to exclude inferior embedded dynamic treatment regimes (EDTRs) from the
set of best (or equivalently, for their upper credible interval to
exclude 0), run PowerBayesian
.
Compute RD of a success.
RD(response_prob = c(0.3,0.3,0.3,0.8,0.6,0.7),
stage_one_trt_one_response_prob = 0.6,
stage_one_trt_two_response_prob = 0.4,
design = "design-1")
#> EDTR 1 EDTR 2 EDTR 3 EDTR 4
#> [1,] -0.44 -0.44 -0.06 0
Compute power to exclude embedded dynamic treatment regimes 1 and 2. The choice to exclude these embedded dynamic treatment regimes may be based off the values of the log-RR between each EDTR and the best.
set.seed(236412)
power3 <- PowerBayesian("design-1",
sample_size = 100,
response_prob = c(0.2,0.3,0.4,0.5,0.6,0.7),
stage_one_trt_one_response_prob = 0.6,
stage_one_trt_two_response_prob = 0.4,
type="RD",
threshold=0.3)
#General SMART To see what the log-odds ratios are, run LogOR
. Lastly, to compute the
power to exclude inferior embedded dynamic treatment regimes (EDTRs)
from the set of best (or equivalently, for their upper credible interval
to exclude 0), run PowerBayesian
.
Compute log-OR of a success.
LogOR(response_prob = c(0.2,0.3,0.4,0.5,0.6,0.7,0.7,0.6),
stage_one_trt_one_response_prob = 0.6,
stage_one_trt_two_response_prob = 0.4,
design = "general")
#> EDTR 1 EDTR 2 EDTR 3 EDTR 4 EDTR 5 EDTR 6 EDTR 7
#> [1,] -1.791759 -1.60107 -1.510592 -1.336846 -0.1840036 -0.4418328 0
#> EDTR 8
#> [1,] -0.2719337
Compute power to exclude embedded dynamic treatment regimes 1, 2, 3, 4. The choice to exclude these embedded dynamic treatment regimes may be based off the values of the log-OR between each EDTR and the best.
To see what the log-odds ratios are, run LogOR
. Lastly, to compute the
power to exclude inferior embedded dynamic treatment regimes (EDTRs)
from the set of best (or equivalently, for their upper credible interval
to exclude 0), run PowerBayesian
.
Compute log-OR of a success.
LogOR(response_prob = c(0.2,0.3,0.4,0.5,0.6,0.7,0.7,0.6,0.9),
stage_one_trt_one_response_prob = 0.6,
stage_one_trt_two_response_prob = 0.4,
stage_one_trt_three_response_prob = 0.7,
design = "design-3")
#> EDTR 1 EDTR 2 EDTR 3 EDTR 4 EDTR 5 EDTR 6
#> [1,] -2.305359 -2.097141 -0.9115175 -0.6631313 -0.4444945 0
Compute power to exclude embedded dynamic treatment regimes 1, 2, and 3. The choice to exclude these embedded dynamic treatment regimes may be based off the values of the log-OR between each EDTR and the best.
Artman, W. J., Ertefaie, A., Lynch, K. G., & McKay, J. R. (2020). Bayesian Set of Best Dynamic Treatment Regimes and Sample Size Determination for SMARTs with Binary Outcomes. arXiv preprint arXiv:2008.02341.