After obtain real trial data, this function can be used to decide which arm to drop in an interim analysis or provide a full final analysis.
group_seq(
data,
interim = TRUE,
drop_threshold_pair = NULL,
prior_dist,
pi_prior,
beta_prior,
MCMC_SAMPLE,
n.adapt,
thin = 1,
BURN.IN = 100,
n_MCMC_chain,
ci = 0.95,
DTR = TRUE,
jags.model_options = NULL,
coda.samples_options = NULL,
verbose = FALSE,
...
)# S3 method for summary.group_seq
print(x, ...)
# S3 method for group_seq
print(x, ...)
if interim = TRUE
, this function returns either 0 - no arm is dropped,
or A/B/C - arm A/B/C is dropped
if interim = FALSE
, this function returns:
an mcmc.list
object generated through the coda.samples()
function,
which includes posterior samples of the link parameters and response rates generated through the MCMC
process
estimate of response rate/treatment effect
standard error of the response rate
x% credible intervals for treatment A, B, C
estimate of differences between treatments A and B, B and C, A and C
x% credible intervals for the differences between treatments A and B, B and C, A and C
standard error for the differences between treatments A and B, B and C, A and C
linkage parameter beta0
and beta1
estimates
standard error of the estimated value of linkage
parameter beta0
and beta1
linkage parameter beta0
and beta1
credible interval
expected response rate of dynamic treatment regimens (DTRs)
standard error for the estimated DTR response rate
x% credible intervals for the estimated DTR response rate
dataset should include 8 columns: time.1st.trt
(first treatment
starts time), time.1st.resp
(first response time), time.2nd.trt
(second
treatment starts time), time.2nd.resp
(second response time),
trt.1st
(treatment arm for first treatment), resp.1st
(response for first
treatment), trt.2nd
(treatment arm for second treatment), resp.2nd
(response
for second
treatment) data yet to be observed should be marked as "NA
"
indicates whether user is conducting an interim analysis via BJSM (interim
= TRUE) or an final analysis via BJSM (interim
= FALSE)
a vector of 2 values (drop_threshold_tau_l
, drop_threshold_psi_l
). Both drop_threshold_tau_l
and drop_threshold_psi_l
should be between 0 and 1. only assign value to this parameter when interim = TRUE
. See the details section for more explanation
vector of three values ("prior distribution for pi
",
"prior distribution for beta0
", "prior distribution for beta1
"),
user can choose from "gamma", "beta", "pareto". e.g. prior_dist = c("beta",
"beta", "pareto")
vector of six values (a, b, c, d, e, f), where a and b are the parameter a
and parameter b
of the prior distribution for pi_1A
, c and d are the parameter a
and parameter b
of the prior distribution for pi_1B
, and e and f are the parameter a
and parameter b
of the prior distribution for pi_1C
. Please check the Details
section for more explanation
vector of four values (beta0_prior.a
, beta0_prior.b
, beta1_prior.a
, beta1_prior.c
). beta0_prior.a
is the parameter a of the prior distribution for linkage parameter beta0
. beta0_prior.b
is the parameter b of the prior distribution for linkage parameter beta0
. beta1_prior.a
is the parameter a of the prior distribution for linkage parameter beta1
. beta1_prior.c
is the parameter b of the prior distribution for linkage parameter beta1
. Please check the Details
section for more explanation
number of iterations for MCMC
the number of iterations for adaptation
thinning interval for monitors
number of burn-in iterations for MCMC
number of MCMC chains, default to 1
coverage probability for credible intervals, default = 0.95. only
assign value to this parameter when interim = FALSE
.
if TRUE, will also return the expected response rate of dynamic
treatment regimens. default = TRUE. only assign value to this parameter when
interim = FALSE
.
a list of optional arguments that are passed to jags.model()
function.
a list of optional arguments that are passed to coda.samples()
function.
TRUE or FALSE. If FALSE, no function message and progress bar will be printed.
further arguments. Not currently used.
object to summarize.
For gamma
distribution, prior.a
is the shape parameter r
,
prior.b
is the rate parameter lambda
. For beta
distribution,
prior.a
is the shape parameter a
, prior.b
is the shape parameter
b
.
For pareto
distribution, prior.a
is the scale parameter alpha
,
prior.b
is the shape parameter c
(see jags user manual).
The individual response rate is regarded as a permanent feature of the treatment.
The second stage outcome is modeled conditionally on the first stage results
linking the first and
second stage response probabilities through linkage parameters.
(paper provided in the reference section, section 2.2.2 Bayesian decision rules. drop_threshold_tau_l and drop_threshold_psi_l correspond to \(tau_l\) and \(psi_l\) respectively)
Please refer to the paper listed under reference
section for detailed definition of parameters.
Note that this package does not include the JAGS library, users need to install JAGS separately. Please check this page for more details: https://sourceforge.net/projects/mcmc-jags/
Chao, Y.C., Braun, T.M., Tamura, R.N. and Kidwell, K.M., 2020. A Bayesian group sequential small n sequential multiple‐assignment randomized trial. Journal of the Royal Statistical Society: Series C (Applied Statistics), 69(3), pp.663-680. URL: doi:10.1111/rssc.12406
mydata <- groupseqDATA_look1
result1 <- group_seq(
data = mydata, interim = TRUE, drop_threshold_pair = c(0.5, 0.4),
prior_dist = c("beta", "beta", "pareto"), pi_prior = c(0.4, 1.6, 0.4, 1.6, 0.4, 1.6),
beta_prior = c(1.6, 0.4, 3, 1), MCMC_SAMPLE = 6000, n.adapt = 1000, n_MCMC_chain = 1
)
summary(result1)
mydata <- groupseqDATA_full
result2 <- group_seq(
data = mydata, interim = FALSE, prior_dist = c("beta", "beta", "pareto"),
pi_prior = c(0.4, 1.6, 0.4, 1.6, 0.4, 1.6),
beta_prior = c(1.6, 0.4, 3, 1), MCMC_SAMPLE = 6000, n.adapt = 1000,
n_MCMC_chain = 1, ci = 0.95, DTR = TRUE
)
summary(result2)
Run the code above in your browser using DataLab