View source: R/groupRAR_functions.R
| Bai.Hu.Shen.Urn | R Documentation |
Bai, Hu, and Shen (2002) proposed an adaptive design for multi-arm clinical trials. The allocation probabilities adapt to the performance of the patients already treated: a success on a treatment increases the chance that the next patient is assigned to it, and a failure moves probability to the other treatments in proportion to their estimated success rates. This function simulates the Bai, Hu, and Shen urn with two-sided hypothesis testing in a clinical trial context.
Bai.Hu.Shen.Urn(k, p, ssn, Y0 = NULL, nsim = 2000, alpha = 0.05,
test.fun = NULL, typeI = FALSE, seed = NULL)
k |
A positive integer. The number of treatment groups in the trial ( |
p |
A vector of length |
ssn |
A positive integer. The total number of participants in each simulated trial. |
Y0 |
A vector of length |
nsim |
A positive integer. The number of simulated trials, with a default value of 2000. |
alpha |
A number between 0 and 1. The significance level of the two-sided test, with a default value of 0.05. |
test.fun |
An optional function |
typeI |
Logical. If |
seed |
An optional integer passed to |
Bai, Hu and Shen's urn can be described as follows. An urn initially contains balls of K types, where balls of types 1, 2, \ldots, K represent treatments 1, 2, \ldots, K. A ball is drawn at random from the urn and, if it is of type k, the next patient is assigned to treatment k. After the response is observed, the urn composition is updated. A success on treatment k adds one ball of type k to the urn. A failure on treatment k adds \hat p_j/(\hat M - \hat p_k) balls of each other type j \ne k, where \hat p_j = (S_j + 1)/(N_j + 1) is the current estimate of the success rate of treatment j (S_j successes among N_j patients) and \hat M = \hat p_1 + \cdots + \hat p_K. The estimates use the responses of the previous patients only. This is adaptive design 3 of Bai, Hu and Shen (2002), the design proposed in the paper. (Versions of grouprar before 0.2.0 used the true success rates instead, which is their design 2.)
An object of class "grouprar", a list that is printed as a short summary (see print.grouprar), with the following elements.
method |
The name of the procedure. |
sample size |
The total sample size. |
parameter |
The true success rates used in the simulations, named |
propotion |
The mean allocation proportion of each arm over the simulations, named |
sd of propotion |
The standard deviation of the allocation proportion of each arm over the simulations. |
failure rate |
The mean failure rate over the simulations. |
sd of failure rate |
The standard deviation of the failure rate (or mean response) over the simulations. |
power |
The proportion of simulated trials that reject the null hypothesis of equal success rates. Simulations in which the test cannot be computed are dropped. |
data: failureRate |
The failure rate (or mean response) of each simulated trial. |
data: test |
The test decision of each simulated trial (1 = reject). |
data: assignment |
The treatment assignments of the last simulated trial. |
data: propotion |
A data frame with the allocation proportions of each simulated trial. |
data: allocation |
An |
type I error |
Only if |
Bai, Z. D., Hu, F. and Shen, L. (2002). An adaptive design for multi-arm clinical trials. Journal of Multivariate Analysis, 81(1), 1-18. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1006/jmva.2001.1987")}
## a simple use
bhs.res <- Bai.Hu.Shen.Urn(k = 3,
p = c(0.7, 0.8, 0.6),
ssn = 200,
Y0 = NULL,
nsim = 100,
alpha = 0.05)
## view the output
bhs.res
## view all simulation settings
bhs.res[["method"]]
bhs.res[["parameter"]]
## view the simulation results
bhs.res[["propotion"]]
bhs.res[["failure rate"]]
bhs.res[["power"]]
bhs.res[["data: assignment"]]
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.