This function implements the BJSM (Bayesian Joint Stage Modeling) method which borrows information across both stages to estimate the individual response rate of each treatment/dose level in a snSMART design with binary outcomes.
BJSM_binary(
data,
prior_dist,
pi_prior,
normal.par,
beta_prior,
n_MCMC_chain = 1,
n.adapt,
BURN.IN = 100,
thin = 1,
MCMC_SAMPLE,
ci = 0.95,
six = TRUE,
DTR = TRUE,
jags.model_options = NULL,
coda.samples_options = NULL,
verbose = FALSE,
...
)# S3 method for summary.BJSM_binary
print(x, ...)
# S3 method for BJSM_binary
print(x, ...)
# S3 method for summary.BJSM_dose_binary
print(x, ...)
# S3 method for BJSM_dose_binary
print(x, ...)
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(P), B(L), C(H)
estimate of differences between treatments A(P) and B(L), B(L) and C(H), A(P) and C(H)
x% credible intervals for the estimated differences between treatments A(P) and B(L), B(L) and C(H), A(P) and C(H)
standard error for the estimated differences between treatments A(P) and B(L), B(L) and C(H), A(P) and C(H)
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
trial data with 4 columns: treatment_stageI, response_stageI,
treatment_stageII
and response_stageII
. Missing data is allowed in stage 2.
for 3 active treatment design: 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"); for dose level design: vector of two
values ("prior distribution for pi_P
", "prior distribution for beta
")
for 3 active treatment design: 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
. for dose level design: vector
of two values (a, b). a
is the parameter a
of the prior distribution for
pi
(response rate) of placebo. b
is the parameter b
of the prior
distribution for pi
of placebo. Please check the Details
section for
more explanation
for dose level design: vector of two values (normal.mean, normal.var).
our function assumes that the logarithm of treatment effect ratio follows a Gaussian
prior distribution \(N(\mu, \sigma^2)\), that is \(log(\pi_L/\pi_P)~N(normal.mean, normal.var)\),
and \(log(\pi_H/\pi_P)~N(normal.mean, normal.var)\). normal.mean
is the mean of
this Gaussian prior. normal.var
is the variance of this Gaussian prior distribution
for 3 active treatment design: vector of four values (a, b, c, d).
a
is the value of parameter a
of the prior distribution for linkage parameter
beta_0
or beta_0m
, b
is the value of parameter b
of the
prior distribution for linkage parameter beta_0
or beta_0m
. c
is the value of parameter a
of the prior distribution for linkage parameter
beta_1
or beta_1m
. d
is the value of parameter b
of the
prior distribution for linkage parameter beta_1
or beta_1m
. for
dose level design: vector of two values (a, b). a
is the parameter a
of the
prior distribution for linkage parameter beta
. b
is the parameter b of
the prior distribution for linkage parameter beta
. Please check the Details
section for more explanation
number of MCMC chains, default to 1.
the number of iterations for adaptation
number of burn-in iterations for MCMC
thinning interval for monitors
number of iterations for MCMC
coverage probability for credible intervals, default = 0.95
TRUE or FALSE. If TRUE, will run the six beta model (allow for estimating
beta_0m
and beta_1m
values that differ among different treatments m), if FALSE
will run the two beta model. default = TRUE. Only need to specify this for 3 active
treatment design.
TRUE or FALSE. If TRUE, will also return the expected response rate of dynamic treatment regimens. default = TRUE. Only need to specify this for 3 active treatment design.
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. The first stage response rate is denoted as \(\pi_m\) for treatment \(m\). In the two \(\beta\) model, the second stage response rate for first stage responders is equal to \(\beta_1\pi_m\). For nonresponders to treatment \(m\) in the first stage who receive treatment \(m'\) in the second the stage, the second stage response rate in the second stage is equal to \(\beta_0\pi_{m'}\). In the six \(\beta\) model, the second stage response rate of the first stage responders to treatment m is denoted by \(\beta_{1m}\pi_m\), and the second stage response rate of the non-responders to first stage treatment $m$ who receive treatment \(m'\) in the second stage is denoted by \(\beta_{0m}\pi_{m'}\). All the \(\beta\)s are linkage parameters.
Please refer to the paper listed under reference
section for standard snSMART trial design and 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/
Wei, B., Braun, T.M., Tamura, R.N. and Kidwell, K.M., 2018. A Bayesian analysis of small n sequential multiple assignment randomized trials (snSMARTs). Statistics in medicine, 37(26), pp.3723-3732. URL: doi:10.1002/sim.7900
Chao, Y.C., Trachtman, H., Gipson, D.S., Spino, C., Braun, T.M. and Kidwell, K.M., 2020. Dynamic treatment regimens in small n, sequential, multiple assignment, randomized trials: An application in focal segmental glomerulosclerosis. Contemporary clinical trials, 92, p.105989. URL: doi:10.1016/j.cct.2020.105989
Fang, F., Hochstedler, K.A., Tamura, R.N., Braun, T.M. and Kidwell, K.M., 2021. Bayesian methods to compare dose levels with placebo in a small n, sequential, multiple assignment, randomized trial. Statistics in Medicine, 40(4), pp.963-977. URL: doi:10.1002/sim.8813
LPJSM_binary
sample_size
mydata <- data_binary
BJSM_result <- BJSM_binary(
data = mydata, 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),
n_MCMC_chain = 1, n.adapt = 1000, MCMC_SAMPLE = 2000, ci = 0.95,
six = TRUE, DTR = TRUE, verbose = FALSE
)
# \donttest{
BJSM_result2 <- BJSM_binary(
data = mydata, 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),
n_MCMC_chain = 1, n.adapt = 10000, MCMC_SAMPLE = 60000, ci = 0.95,
six = FALSE, DTR = FALSE, verbose = FALSE
)
summary(BJSM_result)
summary(BJSM_result2)
# }
data <- data_dose
BJSM_dose_result <- BJSM_binary(
data = data_dose, prior_dist = c("beta", "gamma"),
pi_prior = c(3, 17), normal.par = c(0.2, 100), beta_prior = c(2, 2),
n_MCMC_chain = 2, n.adapt = 1000, MCMC_SAMPLE = 6000, ci = 0.95, verbose = FALSE
)
summary(BJSM_dose_result)
Run the code above in your browser using DataLab