Title: | Small N Sequential Multiple Assignment Randomized Trial Methods |
---|---|
Description: | Consolidated data simulation, sample size calculation and analysis functions for several snSMART (small sample sequential, multiple assignment, randomized trial) designs under one library. See Wei, B., Braun, T.M., Tamura, R.N. and Kidwell, K.M. "A Bayesian analysis of small n sequential multiple assignment randomized trials (snSMARTs)." (2018) Statistics in medicine, 37(26), pp.3723-3732 <doi:10.1002/sim.7900>. |
Authors: | Sidi Wang [aut], Kelley Kidwell [aut], Michael Kleinsasser [cre] |
Maintainer: | Michael Kleinsasser <[email protected]> |
License: | GPL (>= 2) |
Version: | 0.2.4 |
Built: | 2024-11-06 05:58:42 UTC |
Source: | https://github.com/sidiwang/snsmart |
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 class 'summary.BJSM_binary' print(x, ...) ## S3 method for class 'BJSM_binary' print(x, ...) ## S3 method for class 'summary.BJSM_dose_binary' print(x, ...) ## S3 method for class 'BJSM_dose_binary' print(x, ...)
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 class 'summary.BJSM_binary' print(x, ...) ## S3 method for class 'BJSM_binary' print(x, ...) ## S3 method for class 'summary.BJSM_dose_binary' print(x, ...) ## S3 method for class 'BJSM_dose_binary' print(x, ...)
data |
trial data with 4 columns: |
prior_dist |
for 3 active treatment design: vector of three values
("prior distribution for |
pi_prior |
for 3 active treatment design: vector of six values (a, b, c, d, e, f),
where a and b are the parameter |
normal.par |
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 |
beta_prior |
for 3 active treatment design: vector of four values (a, b, c, d).
|
n_MCMC_chain |
number of MCMC chains, default to 1. |
n.adapt |
the number of iterations for adaptation |
BURN.IN |
number of burn-in iterations for MCMC |
thin |
thinning interval for monitors |
MCMC_SAMPLE |
number of iterations for MCMC |
ci |
coverage probability for credible intervals, default = 0.95 |
six |
TRUE or FALSE. If TRUE, will run the six beta model (allow for estimating
|
DTR |
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. |
jags.model_options |
a list of optional arguments that are passed to |
coda.samples_options |
a list of optional arguments that are passed to |
verbose |
TRUE or FALSE. If FALSE, no function message and progress bar will be printed. |
... |
further arguments. Not currently used. |
x |
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 for treatment
. In the two
model, the second stage response rate for first stage responders is equal to
. For nonresponders to treatment
in the first stage who
receive treatment
in the second the stage, the second stage response rate in the second stage is equal to
. In the six
model, the second stage response rate of the first stage responders to treatment m is denoted by
, and the second stage response rate of the non-responders
to first stage treatment $m$ who receive treatment
in the second stage is denoted by
. All the
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/
posterior_sample |
an |
pi_hat_bjsm |
estimate of response rate/treatment effect |
se_hat_bjsm |
standard error of the response rate |
ci_pi_A(P) , ci_pi_B(L) , ci_pi_C(H)
|
x% credible intervals for treatment A(P), B(L), C(H) |
diff_AB(PL) , diff_BC(LH). diff_AC(PH)
|
estimate of differences between treatments A(P) and B(L), B(L) and C(H), A(P) and C(H) |
ci_diff_AB(PL) , ci_diff_BC(LH) , ci_diff_AC(PH)
|
x% credible intervals for the estimated differences between treatments A(P) and B(L), B(L) and C(H), A(P) and C(H) |
se_AB(PL) , se_BC(LH) , se_AC(PH)
|
standard error for the estimated differences between treatments A(P) and B(L), B(L) and C(H), A(P) and C(H) |
beta0_hat , beta1_hat
|
linkage parameter |
se_beta0_hat , se_beta1_hat
|
standard error of the estimated value of linkage
parameter |
ci_beta0_hat , ci_beta1_hat
|
linkage parameter |
pi_DTR_est |
expected response rate of dynamic treatment regimens (DTRs) |
pi_DTR_se |
standard error for the estimated DTR response rate |
ci_pi_AB , ci_pi_AC , ci_pi_BA , ci_pi_BC , ci_pi_CA , ci_pi_CB
|
x% credible intervals for the estimated DTR response rate |
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. 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. 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. doi:10.1002/sim.8813
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 ) 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)
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 ) 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)
BJSM (Bayesian Joint Stage Modeling) method that borrows information across both stages to estimate the individual response rate of each treatment (with continuous outcome and a mapping function).
BJSM_c( data, xi_prior.mean, xi_prior.sd, phi3_prior.sd, n_MCMC_chain, n.adapt, MCMC_SAMPLE, ci = 0.95, n.digits, thin = 1, BURN.IN = 100, jags.model_options = NULL, coda.samples_options = NULL, verbose = FALSE, ... ) ## S3 method for class 'BJSM_c' summary(object, ...) ## S3 method for class 'summary.BJSM_c' print(x, ...) ## S3 method for class 'BJSM_c' print(x, ...)
BJSM_c( data, xi_prior.mean, xi_prior.sd, phi3_prior.sd, n_MCMC_chain, n.adapt, MCMC_SAMPLE, ci = 0.95, n.digits, thin = 1, BURN.IN = 100, jags.model_options = NULL, coda.samples_options = NULL, verbose = FALSE, ... ) ## S3 method for class 'BJSM_c' summary(object, ...) ## S3 method for class 'summary.BJSM_c' print(x, ...) ## S3 method for class 'BJSM_c' print(x, ...)
data |
trial ddatset with columns: |
xi_prior.mean |
a 3-element vector of mean of the prior distributions
(normal distribution) for |
xi_prior.sd |
a 3-element vector of standard deviation of the prior distributions
(normal distribution) for |
phi3_prior.sd |
standard deviation of the prior distribution (folded normal
distribution) of |
n_MCMC_chain |
number of MCMC chains, default to 1 |
n.adapt |
the number of iterations for adaptation |
MCMC_SAMPLE |
number of iterations for MCMC |
ci |
coverage probability for credible intervals, default = 0.95 |
n.digits |
number of digits to keep in the final estimation of treatment effect |
thin |
thinning interval for monitors |
BURN.IN |
number of burn-in iterations for MCMC |
jags.model_options |
a list of optional arguments that are passed to |
coda.samples_options |
a list of optional arguments that are passed to |
verbose |
TRUE or FALSE. If FALSE, no function message and progress bar will be printed. |
... |
further arguments. Not currently used. |
object |
object to summarize. |
x |
object to print |
section 2.2.1 and 2.2.2 of the paper listed under reference
provides a detailed
description of the assumptions and prior distributions of the model.
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/
posterior_sample |
an |
mean_estimate |
BJSM estimate of each parameter:
|
ci_estimate |
x% credible interval for each parameter. By default round to
2 decimal places, if more decimals are needed, please access the results by
|
Hartman, H., Tamura, R.N., Schipper, M.J. and Kidwell, K.M., 2021. Design and analysis considerations for utilizing a mapping function in a small sample, sequential, multiple assignment, randomized trials with continuous outcomes. Statistics in Medicine, 40(2), pp.312-326. doi:10.1002/sim.8776
trialData <- trialDataMF BJSM_result <- BJSM_c( data = trialData, xi_prior.mean = c(50, 50, 50), xi_prior.sd = c(50, 50, 50), phi3_prior.sd = 20, n_MCMC_chain = 1, n.adapt = 1000, MCMC_SAMPLE = 5000, BURIN.IN = 1000, ci = 0.95, n.digits = 5, verbose = FALSE ) summary(BJSM_result) print(BJSM_result)
trialData <- trialDataMF BJSM_result <- BJSM_c( data = trialData, xi_prior.mean = c(50, 50, 50), xi_prior.sd = c(50, 50, 50), phi3_prior.sd = 20, n_MCMC_chain = 1, n.adapt = 1000, MCMC_SAMPLE = 5000, BURIN.IN = 1000, ci = 0.95, n.digits = 5, verbose = FALSE ) summary(BJSM_result) print(BJSM_result)
sample synthetic dataset of snSMART (3 active treatment) with binary outcomes
data_binary
data_binary
This data frame contains the following columns:
treatment received in stage 1 - possible values: 1 (placebo), 2, 3
whether patients respond to stage 1 treatment - possible values: 0 (nonresponder), 1 (responder)
treatment received in stage 2 - possible values: 2, 3
whether patients respond to stage 2 treatment - possible values: 0 (nonresponder), 1 (responder)
mydata <- data_binary LPJSM_result <- LPJSM_binary(data = mydata, six = TRUE, DTR = TRUE)
mydata <- data_binary LPJSM_result <- LPJSM_binary(data = mydata, six = TRUE, DTR = TRUE)
sample synthetic dataset of snSMART (dose level treatment) with binary outcomes
data_dose
data_dose
This data frame contains the following columns:
treatment received in stage 1 - possible values: 1 (placebo), 2, 3
whether patients respond to stage 1 treatment - possible values: 0 (nonresponder), 1 (responder)
treatment received in stage 2 - possible values: 2, 3
whether patients respond to stage 2 treatment - possible values: 0 (nonresponder), 1 (responder)
mydata <- 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 = 100, MCMC_SAMPLE = 2000, ci = 0.95 )
mydata <- 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 = 100, MCMC_SAMPLE = 2000, ci = 0.95 )
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 class 'summary.group_seq' print(x, ...) ## S3 method for class 'group_seq' print(x, ...)
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 class 'summary.group_seq' print(x, ...) ## S3 method for class 'group_seq' print(x, ...)
data |
dataset should include 8 columns: |
interim |
indicates whether user is conducting an interim analysis via BJSM ( |
drop_threshold_pair |
a vector of 2 values ( |
prior_dist |
vector of three values ("prior distribution for |
pi_prior |
vector of six values (a, b, c, d, e, f), where a and b are the parameter |
beta_prior |
vector of four values ( |
MCMC_SAMPLE |
number of iterations for MCMC |
n.adapt |
the number of iterations for adaptation |
thin |
thinning interval for monitors |
BURN.IN |
number of burn-in iterations for MCMC |
n_MCMC_chain |
number of MCMC chains, default to 1 |
ci |
coverage probability for credible intervals, default = 0.95. only
assign value to this parameter when |
DTR |
if TRUE, will also return the expected response rate of dynamic
treatment regimens. default = TRUE. only assign value to this parameter when
|
jags.model_options |
a list of optional arguments that are passed to |
coda.samples_options |
a list of optional arguments that are passed to |
verbose |
TRUE or FALSE. If FALSE, no function message and progress bar will be printed. |
... |
further arguments. Not currently used. |
x |
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 and
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/
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:
posterior_sample |
an |
pi_hat_bjsm |
estimate of response rate/treatment effect |
se_hat_bjsm |
standard error of the response rate |
ci_pi_A , ci_pi_B , ci_pi_C
|
x% credible intervals for treatment A, B, C |
diff_AB , diff_BC. diff_AC
|
estimate of differences between treatments A and B, B and C, A and C |
ci_diff_AB , ci_diff_BC , ci_diff_AC
|
x% credible intervals for the differences between treatments A and B, B and C, A and C |
se_AB , se_BC , se_AC
|
standard error for the differences between treatments A and B, B and C, A and C |
beta0_hat , beta1_hat
|
linkage parameter |
se_beta0_hat , se_beta1_hat
|
standard error of the estimated value of linkage
parameter |
ci_beta0_hat , ci_beta1_hat
|
linkage parameter |
pi_DTR_est |
expected response rate of dynamic treatment regimens (DTRs) |
pi_DTR_se |
standard error for the estimated DTR response rate |
ci_pi_AB , ci_pi_AC , ci_pi_BA , ci_pi_BC , ci_pi_CA , ci_pi_CB
|
x% credible intervals for the estimated DTR response rate |
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. 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)
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)
sample synthetic dataset of group sequential trial design snSMART, can be used for final analysis
groupseqDATA_full
groupseqDATA_full
This data frame contains the following columns:
first treatment time
first response time
second treatment time
second response time
treatment arm for first treatment
response for first treatment
treatment arm for second treatment
response for second treatment
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 )
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 )
sample synthetic dataset of group sequential trial design snSMART, can be used for interim analysis
groupseqDATA_look1
groupseqDATA_look1
This data frame contains the following columns:
first treatment time
first response time
second treatment time
second response time
treatment arm for first treatment
response for first treatment
treatment arm for second treatment
response for second treatment
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 )
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 )
A joint-stage regression model (LPJSM) is a frequentist modeling approach that incorporates the responses of both stages as repeated measurements for each subject. Generalized estimating equations (GEE) are used to estimate the response rates of each treatment. The marginal response rates for each DTR can also be obtained based on the GEE results.
LPJSM_binary(data, six = TRUE, DTR = TRUE, ...) ## S3 method for class 'LPJSM_binary' summary(object, ...) ## S3 method for class 'summary.LPJSM_binary' print(x, ...) ## S3 method for class 'LPJSM_binary' print(x, ...)
LPJSM_binary(data, six = TRUE, DTR = TRUE, ...) ## S3 method for class 'LPJSM_binary' summary(object, ...) ## S3 method for class 'summary.LPJSM_binary' print(x, ...) ## S3 method for class 'LPJSM_binary' print(x, ...)
data |
dataset with columns named as |
six |
if TRUE, will run the six beta model, if FALSE will run the two
beta model. Default is |
DTR |
if TRUE, will also return the expected response rate and its standard error of dynamic treatment regimens |
... |
optional arguments that are passed to |
object |
object to print |
x |
object to summarize. |
a list
containing
GEE_output |
- original output of the GEE (geeglm) model |
pi_hat |
- estimate of response rate/treatment effect |
sd_pi_hat |
- standard error of the response rate |
pi_DTR_hat |
- expected response rate of dynamic treatment regimens (DTRs) |
pi_DTR_se |
- standard deviation of DTR estimates |
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. 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. 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. doi:10.1002/sim.8813
data <- data_binary LPJSM_result <- LPJSM_binary(data = data, six = TRUE, DTR = TRUE) summary(LPJSM_result)
data <- data_binary LPJSM_result <- LPJSM_binary(data = data, six = TRUE, DTR = TRUE) summary(LPJSM_result)
conduct Bayesian sample size calculation for a snSMART design with 3 active treatments and a binary outcome to distinguish the best treatment from the second-best treatment using the Bayesian joint stage model.
sample_size(pi, beta1, beta0, coverage, power, mu, n, verbose = FALSE) ## S3 method for class 'sample_size' summary(object, ...) ## S3 method for class 'summary.sample_size' print(x, ...) ## S3 method for class 'sample_size' print(x, ...)
sample_size(pi, beta1, beta0, coverage, power, mu, n, verbose = FALSE) ## S3 method for class 'sample_size' summary(object, ...) ## S3 method for class 'summary.sample_size' print(x, ...) ## S3 method for class 'sample_size' print(x, ...)
pi |
a vector with 3 values ( |
beta1 |
the linkage parameter (ranges from 1.00 to 1/largest response rate) for first stage responders. (A smaller value leads to more conservative sample size calculation because two stages are less correlated) |
beta0 |
the linkage parameter (ranges from 0.01 to 0.99) for first stage non-responders. A larger value leads to a more conservative sample size calculation because two stages are less correlated |
coverage |
the coverage rate (ranges from 0.01 to 0.99) for the posterior difference of top two treatments |
power |
the probability (ranges from 0.01 to 0.99) for identify the best treatment |
mu |
a vector with 3 values ( |
n |
a vector with 3 values ( |
verbose |
TRUE or FALSE. If FALSE, no function message and progress bar will be printed. |
object |
object to summarize. |
... |
further arguments. Not currently used. |
x |
object to print |
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/ This function may take a few minutes to run
final_N |
the estimated sample size per arm for this snSMART |
critical_value |
critical value based on the provided coverage value |
grid_result |
for each iteration we calculate |
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. doi:10.1002/sim.7900
Wei, B., Braun, T.M., Tamura, R.N. and Kidwell, K., 2020. Sample size determination for Bayesian analysis of small n sequential, multiple assignment, randomized trials (snSMARTs) with three agents. Journal of Biopharmaceutical Statistics, 30(6), pp.1109-1120. doi:10.1080/10543406.2020.1815032
## Not run: # short running time example sampleSize <- sample_size( pi = c(0.7, 0.5, 0.25), beta1 = 1.4, beta0 = 0.5, coverage = 0.9, power = 0.3, mu = c(0.65, 0.55, 0.25), n = c(10, 10, 10) ) ## End(Not run) sampleSize <- sample_size( pi = c(0.7, 0.5, 0.25), beta1 = 1.4, beta0 = 0.5, coverage = 0.9, power = 0.8, mu = c(0.65, 0.55, 0.25), n = c(4, 2, 3) )
## Not run: # short running time example sampleSize <- sample_size( pi = c(0.7, 0.5, 0.25), beta1 = 1.4, beta0 = 0.5, coverage = 0.9, power = 0.3, mu = c(0.65, 0.55, 0.25), n = c(10, 10, 10) ) ## End(Not run) sampleSize <- sample_size( pi = c(0.7, 0.5, 0.25), beta1 = 1.4, beta0 = 0.5, coverage = 0.9, power = 0.8, mu = c(0.65, 0.55, 0.25), n = c(4, 2, 3) )
summary
method for class "BJSM_binary
"
## S3 method for class 'BJSM_binary' summary(object, ...)
## S3 method for class 'BJSM_binary' summary(object, ...)
object |
an object of class " |
... |
further arguments. Not currently used. |
a 3 x 5 matrix with columns for the estimated treatment effects, its standard error, coverage probability of its credible interval, lower bound for its credible interval and higher bound for its credible interval
a 3 x 5 matrix with columns for the estimated differences in treatment effects between two treatments, its standard error, coverage probability of its credible interval, lower bound and higher bound of the credible interval
a 2 x 5 matrix, if the two beta model is fitted, or a 6 x 5 matrix, if the six beta model is fitted, with columns for the estimated linkage parameters
only when DTR = TRUE
summary
method for class BJSM_dose_binary
## S3 method for class 'BJSM_dose_binary' summary(object, ...)
## S3 method for class 'BJSM_dose_binary' summary(object, ...)
object |
an object of class |
... |
further arguments. Not currently used. |
a 3 x 5 matrix with columns for the estimated treatment effects, its standard error, coverage probability of its credible interval, lower bound for its credible interval and higher bound for its credible interval
a 3 x 5 matrix with columns for the estimated differences in treatment effects between two treatments, its standard error, coverage probability of its credible interval, lower bound and higher bound of the credible interval
a 6 x 5 matrix with columns for the estimated linkage parameters
summary
method for class "group_seq
"
## S3 method for class 'group_seq' summary(object, ...)
## S3 method for class 'group_seq' summary(object, ...)
object |
an object of class " |
... |
further arguments. Not currently used. |
a 3 x 5 matrix with columns for the estimated treatment effects, its standard error, coverage probability of its credible interval, lower bound for its credible interval and higher bound for its credible interval
a 3 x 5 matrix with columns for the estimated differences in treatment effects between two treatments, its standard error, coverage probability of its credible interval, lower bound and higher bound of the credible interval
a 2 x 5 matrix, if the two beta model is fitted, or a 6 x 5 matrix, if the six beta model is fitted, with columns for the estimated linkage parameters
only when DTR = TRUE
sample synthetic dataset of snSMART (mapping function) with continuous outcomes
trialDataMF
trialDataMF
This data frame contains the following columns:
participant ID
treatment received in stage 1 - possible values: 1 (placebo), 2, 3
a number between 0-100 that represents the stage 1 treatment effect
indicates whether the participant stayed on the same treatment arm in stage 2 - possible values: 0 (didn't stay), 1 (stayed)
treatment received in stage 2 - possible values: 2, 3
a number between 0-100 that represents the stage 2 treatment effect
trialData <- trialDataMF BJSM_result <- BJSM_c( data = trialData, xi_prior.mean = c(50, 50, 50), xi_prior.sd = c(50, 50, 50), phi3_prior.sd = 20, n_MCMC_chain = 1, n.adapt = 1000, MCMC_SAMPLE = 5000, ci = 0.95, n.digits = 5 ) summary(BJSM_result) print(BJSM_result)
trialData <- trialDataMF BJSM_result <- BJSM_c( data = trialData, xi_prior.mean = c(50, 50, 50), xi_prior.sd = c(50, 50, 50), phi3_prior.sd = 20, n_MCMC_chain = 1, n.adapt = 1000, MCMC_SAMPLE = 5000, ci = 0.95, n.digits = 5 ) summary(BJSM_result) print(BJSM_result)