Title: | Bayesian Response-Adaptive Design Analysis |
---|---|
Description: | Provides access to a range of functions for analyzing, applying and visualizing Bayesian response-adaptive trial designs for a binary endpoint. Includes the predictive probability approach and the predictive evidence value designs for binary endpoints. |
Authors: | Riko Kelter [aut, cre] |
Maintainer: | Riko Kelter <[email protected]> |
License: | GPL-3 |
Version: | 1.0 |
Built: | 2024-11-01 04:56:04 UTC |
Source: | https://github.com/cran/brada |
Provides access to a range of functions for analyzing, applying and visualizing Bayesian response-adaptive trial designs for a binary endpoint. Includes the predictive probability approach and the predictive evidence value designs for binary endpoints.
Provides access to a range of functions for analyzing, applying and visualizing
Bayesian response-adaptive trial designs for a binary endpoint. Includes the
predictive probability approach and the predictive evidence value designs for
binary endpoints.
Package: | brada |
Type: | Package |
Title: | Bayesian Response-Adaptive Design Analysis |
Version: | 1.0 |
Date: | 2023-01-18 |
Authors@R: | c(person(given = "Riko", family = "Kelter", role = c("aut", "cre"), email = "[email protected]", comment = c(ORCID = "0000-0001-9068-5696"))) |
Description: | Provides access to a range of functions for analyzing, applying and visualizing Bayesian response-adaptive trial designs for a binary endpoint. Includes the predictive probability approach and the predictive evidence value designs for binary endpoints. |
Imports: | methods, fbst, extraDistr, doParallel, foreach, parallel, doSNOW, progress, cli |
Suggests: | knitr, rmarkdown, DT |
License: | GPL-3 |
VignetteBuilder: | knitr |
NeedsCompilation: | no |
Packaged: | 2023-01-23 14:46:54 UTC; riko |
Author: | Riko Kelter [aut, cre] (<https://orcid.org/0000-0001-9068-5696>) |
Maintainer: | Riko Kelter <[email protected]> |
Date/Publication: | 2023-01-24 10:40:11 UTC |
Repository: | https://riko-k.r-universe.dev |
RemoteUrl: | https://github.com/cran/brada |
RemoteRef: | HEAD |
RemoteSha: | e22655996ab29d7dc4dab458e29cf129b7ffcaf0 |
Index of help topics:
$,brada-method Returns an object from an object of class 'brada'. brada brada brada-class Class '"brada-class"' brada-package Bayesian Response-Adaptive Design Analysis calibrate calibrate generateData generateData monitor monitor names.brada names.brada plot.brada plot.brada power power show.brada show.brada summary.brada summary.brada
Further information is available in the following vignettes:
gettingstarted |
Brada1 (source, pdf) |
monitor |
Brada4 (source, pdf) |
Riko Kelter [aut, cre] (<https://orcid.org/0000-0001-9068-5696>)
Maintainer: Riko Kelter <[email protected]>
brada
.
Returns an object from an object of class brada
-
No return value.
Riko Kelter
Performs a Bayesian response-adaptive design analysis for trials with a binary endpoint.
brada(a0=1,b0=1,Nmax=40,batchsize=5,nInit,p_true,p0,p1, theta_T=0.90,theta_L=0.1,theta_U=1,nsim=100, seed=42,method="PP",refFunc="flat",nu=0, shape1=1,shape2=1,truncation=1,cores=2)
brada(a0=1,b0=1,Nmax=40,batchsize=5,nInit,p_true,p0,p1, theta_T=0.90,theta_L=0.1,theta_U=1,nsim=100, seed=42,method="PP",refFunc="flat",nu=0, shape1=1,shape2=1,truncation=1,cores=2)
a0 |
shape1 parameter of the beta prior. |
b0 |
shape2 parameter of the beta prior. |
Nmax |
Maximum trial size. |
batchsize |
sample size after which an interim analysis is performed. |
nInit |
Initial sample size at which the first interim analysis is performed. |
p_true |
True binary response probability used for simulation. |
p0 |
Right boundary of the null hypothesis to be tested. |
p1 |
Left boundary of the alternative hypothesis to be tested. |
theta_T |
Threshold used in the designs for including trajectories as evidential. |
theta_L |
Stopping threshold for futility. |
theta_U |
Stopping threshold for efficacy. |
nsim |
Number of Monte Carlo iterations. |
seed |
Random number generator seed. |
cores |
Number of CPU cores to be used for computation. Defaults to 2, but 4 or larger is recommended. |
method |
Can be either "PP" or "PPe", depending on whether the predictive probability approach or the predictive evidence value design is desired. Note that the former is a special case of the latter. |
refFunc |
A string, either "flat", "beta", "binaryStep", "relu", "palu" or "lolu". See vignettes for explanation. |
nu |
A numeric value larger or equal to zero, indicating which evidence threshold if used in the predictive evidence value design. |
shape1 |
shape1 parameter of the beta reference function, if used. |
shape2 |
shape2 parameter of the beta reference function, if used. |
truncation |
Truncation point in case an artificial neural network reference function is used. |
Returns an object of class brada.
Riko Kelter
pp_design = brada(Nmax = 30, batchsize = 5, nInit = 10, p_true = 0.2 , p0 = 0.2, p1 = 0.2, nsim = 10, a0 = 1, b0 = 1, theta_T = 0.90, theta_L = 0.1, theta_U = 1, method = "PP", cores = 2) summary(pp_design)
pp_design = brada(Nmax = 30, batchsize = 5, nInit = 10, p_true = 0.2 , p0 = 0.2, p1 = 0.2, nsim = 10, a0 = 1, b0 = 1, theta_T = 0.90, theta_L = 0.1, theta_U = 1, method = "PP", cores = 2) summary(pp_design)
"brada-class"
Class for modelling the results of a Bayesian response-adaptive design analysis
Store the results of a Bayesian response-adaptive design analysis
data
:Object of class "list"
holding the results of the Bayesian response-adaptive design analysis. a0
and b0
store the beta prior shape parameters, Nmax
and batchsize
store the maximum trial size and the batchsize used for interim analyses. nInit
is the minimum sample size at which the first interim analysis is conducted. p_true
is the true response probability used for simulation, p0
is the right boundary of the null hypothesis and p1
the left boundary of the alternative hypothesis. ...
Calibrates a brada object to achieve specified false-positive and false-negative rates.
calibrate(brada_object, nsim = 100, cores = 2, seq, alpha=NULL, beta=NULL, calibration = "nu")
calibrate(brada_object, nsim = 100, cores = 2, seq, alpha=NULL, beta=NULL, calibration = "nu")
brada_object |
An object of class |
nsim |
Number of Monte Carlo iterations |
cores |
Number of cores used for computation |
seq |
Sequence of values for the evidence threshold |
alpha |
Upper bound for false-positive rate. Note that it is only possible to specify either |
beta |
Upper bound for false-negative rate |
calibration |
String which specifies which parameter to calibrate. Can take the values |
Prints the output to the console and returns the false-positive rate or false-negative rate of the calibrated design, depending on which value the calibration
argument takes.
Riko Kelter
Generates a matrix of trial data.
generateData(p,Nmax,nsim,seed=420)
generateData(p,Nmax,nsim,seed=420)
p |
true response probability |
Nmax |
Maximum trial size. |
nsim |
Number of Monte Carlo iterations. |
seed |
Random number generator seed. |
Returns a matrix with simulated trial data.
Riko Kelter
generateData(p=0.2,Nmax=40,nsim=100,seed=420)
generateData(p=0.2,Nmax=40,nsim=100,seed=420)
Monitors a running trial with a binary endpoint and calculates the predictive probability or predictive evidence that the trial will result in a success. Reports whether to stop early for futility or efficacy based on a vector of binary observations.
monitor(brada_object, obs)
monitor(brada_object, obs)
brada_object |
An object of class |
obs |
A vector of binary observations, where 1 is a success (response) and 0 a failure (no response). |
No return value, prints the result of the monitoring to the console.
Riko Kelter
design = brada(Nmax = 40, batchsize = 5, nInit = 10, p_true = 0.2 , p0 = 0.2, p1 = 0.2, nsim = 100, a0 = 1, b0 = 1, theta_T = 0.95, theta_L = 0.05, theta_U = 0.975, method = "PP", cores = 2) monitor(design, obs = c(0,1,1,0,0,1,0,1,1,1))
design = brada(Nmax = 40, batchsize = 5, nInit = 10, p_true = 0.2 , p0 = 0.2, p1 = 0.2, nsim = 100, a0 = 1, b0 = 1, theta_T = 0.95, theta_L = 0.05, theta_U = 0.975, method = "PP", cores = 2) monitor(design, obs = c(0,1,1,0,0,1,0,1,1,1))
Plots the names of the objects stored in the brada
object of a Bayesian response-adaptive design analysis.
## S3 method for class 'brada' names(x)
## S3 method for class 'brada' names(x)
x |
An Object of class |
Plots the names of the objects stored in the trials
object of a Bayesian response-adaptive design analysis.
Returns a list of names.
Riko Kelter
Plots the results of a Bayesian response-adaptive design analysis.
## S3 method for class 'brada' plot(x, trajectories = 100, ...)
## S3 method for class 'brada' plot(x, trajectories = 100, ...)
x |
An Object of class |
trajectories |
Number of trajectories to be plotted. Defaults to 100. |
... |
Additional parameters, see |
Returns a plot.
Riko Kelter
design = brada(Nmax = 40, batchsize = 5, nInit = 10, p_true = 0.2 , p0 = 0.2, p1 = 0.2, nsim = 100, a0 = 1, b0 = 1, theta_T = 0.90, theta_L = 0.1, theta_U = 1, method = "PP", cores = 2) plot(design)
design = brada(Nmax = 40, batchsize = 5, nInit = 10, p_true = 0.2 , p0 = 0.2, p1 = 0.2, nsim = 100, a0 = 1, b0 = 1, theta_T = 0.90, theta_L = 0.1, theta_U = 1, method = "PP", cores = 2) plot(design)
Performs a power analysis for a brada
object.
power(brada_object, p_true, nsim=100, cores=2)
power(brada_object, p_true, nsim=100, cores=2)
brada_object |
An object of class |
p_true |
the true response probability used for the power analysis |
nsim |
the number of Monte Carlo simulation, defaults to 100. |
cores |
CPU cores used for computation. Defaults to 2. |
Returns an object of class brada
.
Riko Kelter
design = brada(Nmax = 30, batchsize = 5, nInit = 10, p_true = 0.2 , p0 = 0.2, p1 = 0.2, nsim = 1000, a0 = 1, b0 = 1, theta_T = 0.90, theta_L = 0.1, theta_U = 1, method = "PP", cores = 1) design_power = power(design, p_true = 0.4, nsim = 1000) plot(design_power)
design = brada(Nmax = 30, batchsize = 5, nInit = 10, p_true = 0.2 , p0 = 0.2, p1 = 0.2, nsim = 1000, a0 = 1, b0 = 1, theta_T = 0.90, theta_L = 0.1, theta_U = 1, method = "PP", cores = 1) design_power = power(design, p_true = 0.4, nsim = 1000) plot(design_power)
Prints the main results of a Bayesian response-adaptive design analysis to the console.
## S3 method for class 'brada' show(object)
## S3 method for class 'brada' show(object)
object |
An Object of class |
Shows the main results of a Bayesian response-adaptive design analysis stored in an object of class brada
.
Prints the results onto the console.
Riko Kelter
Prints the results of a Bayesian response-adaptive design analysis.
## S3 method for class 'brada' summary(object, ...)
## S3 method for class 'brada' summary(object, ...)
object |
An Object of class |
... |
Additional parameters, see |
Summarises the results of a Bayesian response-adaptive design analysis.
Prints the results onto the console.
Riko Kelter
pp_design = brada(Nmax = 40, batchsize = 5, nInit = 10, p_true = 0.2 , p0 = 0.2, p1 = 0.2, nsim = 100, a0 = 1, b0 = 1, theta_T = 0.90, theta_L = 0.1, theta_U = 1, method = "PP", cores = 2) summary(pp_design)
pp_design = brada(Nmax = 40, batchsize = 5, nInit = 10, p_true = 0.2 , p0 = 0.2, p1 = 0.2, nsim = 100, a0 = 1, b0 = 1, theta_T = 0.90, theta_L = 0.1, theta_U = 1, method = "PP", cores = 2) summary(pp_design)