Package 'grouprar'

Title: Group Response Adaptive Randomization for Clinical Trials
Description: Implement group response-adaptive randomization procedures, which also integrates standard non-group response-adaptive randomization methods as specialized instances. It is also uniquely capable of managing complex scenarios, including those with delayed and missing responses, thereby expanding its utility in real-world applications. This package offers 16 functions for simulating a variety of response adaptive randomization procedures. These functions are essential for guiding the selection of statistical methods in clinical trials, providing a flexible and effective approach to trial design. Some of the detailed methodologies and algorithms used in this package, please refer to the following references: LJ Wei (1979) <doi:10.1214/aos/1176344614> L. J. WEI and S. DURHAM (1978) <doi:10.1080/01621459.1978.10480109> Durham, S. D., FlournoY, N. AND LI, W. (1998) <doi:10.2307/3315771> Ivanova, A., Rosenberger, W. F., Durham, S. D. and Flournoy, N. (2000) <https://www.jstor.org/stable/25053121> Bai Z D, Hu F, Shen L. (2002) <doi:10.1006/jmva.2001.1987> Ivanova, A. (2003) <doi:10.1007/s001840200220> Hu, F., & Zhang, L. X. (2004) <doi:10.1214/aos/1079120137> Hu, F., & Rosenberger, W. F. (2006, ISBN:978-0-471-65396-7). Zhang, L. X., Chan, W. S., Cheung, S. H., & Hu, F. (2007) <https://www.jstor.org/stable/26432528> Zhang, L., & Rosenberger, W. F. (2006) <doi:10.1111/j.1541-0420.2005.00496.x> Hu, F., Zhang, L. X., Cheung, S. H., & Chan, W. S. (2008) <doi:10.1002/cjs.5550360404>.
Authors: Guannan Zhai [aut, cre], Feifang Hu [aut, ths]
Maintainer: Guannan Zhai <[email protected]>
License: GPL (>= 2)
Version: 0.1.0
Built: 2024-11-09 06:08:48 UTC
Source: https://github.com/cran/grouprar

Help Index


Bai Hu Shen's Urn

Description

Bai, Hu, and Shen bai2002adaptive proposed a new adaptive design for multi-arm clinical trials. The main idea behind this procedure is that the allocation probability adapts based on the performance of the most recent patients under their assigned treatment. Positive performance in that treatment increase the likelihood of the next patient being assigned to this group, whereas negative outcomes decrease it. This function is for simulating the Bai, Hu, and Shen's urn model under two-sided hypothesis testing in clinical trial context.

Usage

Bai.Hu.Shen.Urn(k, p, ssn, Y0 = NULL, nsim = 2000, alpha = 0.05)

Arguments

k

a positive integer. The value specifies the number of treatment groups involved in a clinical trial. (k2k \ge 2)

p

a positive vector of length equals to k. The values specify the true success rates for the various treatments, and these rates are used to generate data for simulations.

ssn

a positive integer. The value specifies the total number of participants involved in each round of the simulation.

Y0

A vector of length k, specifying the initial probability of allocating a patient to each group. For instance, if Y0 = c(1, 1, 1), the initial probabilities are calculated as Y0 / sum(Y0). When Y0 is NULL, the initial urn will be set as If Y0 is NULL, then Y0 is set to a vector of length k, with all values equal to 1 by default.

nsim

a positive integer. The value specifies the total number of simulations, with a default value of 2000.

alpha

A number between 0 and 1. The value represents the predetermined level of significance that defines the probability threshold for rejecting the null hypothesis, with a default value of 0.05.

Details

Bai, Hu and Shen's urn can be describe as follows: An urn contains KK types of balls initially. Balls of types 1,2,,K1, 2, \cdots, K represent treatments 1,2,,K1, 2, \cdots, K. A type kk ball is drawn randomly from the urn, and then we assign the patient, who is waiting to be assigned, to the treatment kk. After obtaining the response, we may adapt the composition of the urn. A success on treatment kk adds a ball of type of $k$ to the urn and a failure on treatment kk adds pi(Mpk)\frac{p_i}{(M-p_k)} ball for each of the other K1K-1 types, where M=p1+...+pKM = p_1 + ... + p_K.

Value

name

The name of procedure.

parameter

The true parameters used to do the simulations.

assignment

The randomization sequence.

propotion

Average allocation porpotion for each of treatment groups.

failRate

The proportion of individuals who do not achieve the expected outcome in each simulation, on average.

pwClac

The probability of the study to detect a significant difference or effect if it truly exists.

k

Number of arms involved in the trial.

References

Bai Z D, Hu F, Shen L. An adaptive design for multi-arm clinical trials[J]. Journal of Multivariate Analysis, 2002, 81(1): 1-18.

Examples

## a simple use
bhs.res = Bai.Hu.Shen.Urn(k = 3,
                          p = c(0.7, 0.8, 0.6),
                          ssn = 500,
                          Y0 = NULL,
                          nsim = 200,
                          alpha = 0.05)

## view the output
bhs.res

  ## view all simulation settings
  bhs.res$name
  bhs.res$parameter
  bhs.res$k

  ## View the simulations results
  bhs.res$propotion
  bhs.res$failRate
  bhs.res$pwCalc
  bhs.res$assignment

Birth and Death Urn

Description

Simulating birth and death urn procedure (number of arms 2\ge 2) with two-sided hypothesis testing in a clinical trial context.

Usage

BirthDeathUrn(k, p, ssn, Y0 = NULL, nsim = 2000, alpha = 0.05)

Arguments

k

a positive integer. The value specifies the number of treatment groups involved in a clinical trial. (k=2k = 2)

p

a positive vector of length equals to k. The values specify the true success rates for the various treatments, and these rates are used to generate data for simulations.

ssn

a positive integer. The value specifies the total number of participants involved in each round of the simulation.

Y0

A vector of length k, specifying the initial probability of allocating a patient to each group. For instance, if Y0 = c(1, 1, 1), the initial probabilities are calculated as Y0 / sum(Y0). When Y0 is NULL, the initial urn will be set as If Y0 is NULL, then Y0 is set to a vector of length k, with all values equal to 1 by default.

nsim

a positive integer. The value specifies the total number of simulations, with a default value of 2000.

alpha

A number between 0 and 1. The value represents the predetermined level of significance that defines the probability threshold for rejecting the null hypothesis, with a default value of 0.05.

Details

The birth and death urn works as follows: Initially an urn contains balls of KK types and aa immigration balls. A ball is drawn randomly with replacement. If it is an immigration ball, one ball of each type is added to the urn, no patient is treated, and the next ball is drawn. The procedure is repeated until a type ii ball (i=1,,K)(i = 1, \cdots, K) is drawn. Then the subject is assigned to treatment ii. If a success, a type ii ball is added in the urn; if a failure, a type ii ball is removed. (Hu and Rosenberger (2006)). More detail could be found in paper A birth and death urn for randomized clinical trials written by Ivanova etl (2000).

Value

name

The name of procedure.

parameter

The true parameters used to do the simulations.

assignment

The randomization sequence.

propotion

Average allocation porpotion for each of treatment groups.

failRate

The proportion of individuals who do not achieve the expected outcome in each simulation, on average.

pwClac

The probability of the study to detect a significant difference or effect if it truly exists.

k

Number of arms involved in the trial.

References

Hu, F., & Rosenberger, W. F. (2006). The theory of response-adaptive randomization in clinical trials. John Wiley & Sons.

Ivanova, A., Rosenberger, W. F., Durham, S. D. and Flournoy, N. (2000). A birth and death urn for randomized clinical trials. Sankhya B 62 104-118.

Examples

## a simple use
bd.res = BirthDeathUrn(k = 3, p = c(0.6, 0.7, 0.6), ssn = 400, Y0 = NULL, nsim = 200, alpha = 0.05)

## view the output
bd.res

  ## view all simulation settings
  bd.res$name
  bd.res$parameter
  bd.res$k

  ## View the simulations results
  bd.res$propotion
  bd.res$failRate
  bd.res$pwCalc
  bd.res$assignment

Complete Randomization

Description

Simulating complete randomization with two-sided hypothesis testing in a clinical trial context.

Usage

CRDesign(k, p, ssn, nsim = 2000, alpha = 0.05)

Arguments

k

a positive integer. The value specifies the number of treatment groups involved in a clinical trial. (k2k \ge 2)

p

a positive vector of length equals to k. The values specify the true success rates for the various treatments, and these rates are used to generate data for simulations.

ssn

a positive integer. The value specifies the total number of participants involved in each round of the simulation.

nsim

a positive integer. The value specifies the total number of simulations, with a default value of 2000.

alpha

An integer between 0 and 1. The value represents the predetermined level of significance that defines the probability threshold for rejecting the null hypothesis, with a default value of 0.05.

Details

Complete randomization: Allocating participants or subjects to different treatment groups in a clinical trial in such a way that each participant has an equal and independent chance of being assigned to any of the treatment groups.

Value

name

The name of procedure.

parameter

The true parameters used to do the simulations.

assignment

The randomization sequence.

propotion

Average allocation porpotion for each of treatment groups.

failRate

The proportion of individuals who do not achieve the expected outcome in each simulation, on average.

pwClac

The probability of the study to detect a significant difference or effect if it truly exists.

k

Number of arms involved in the trial.

Examples

## a simple use
CR.res = CRDesign(k=3, p = c(0.7, 0.8, 0.6), nsim = 500, ssn = 400)
## view the output
CR.res

  ## view all simulation settings
  CR.res$name
  CR.res$parameter
  CR.res$k
  ## View the simulations results
  CR.res$propotion
  CR.res$failRate
  CR.res$pwCalc
  CR.res$assignment

Hu and Zhang's Doubly Biased Coin Design with Binary Response Type

Description

Simulating Hu and Zhang's doubly biased coin deisgn with binary response (number of arms 2\ge 2) in a clinical trial context. (Inference: two-sided hypothesis testing t-test or chi-square test)

Usage

DBCD_Bin(n0 = 20, p, k, ssn, theta0 = NULL, target.alloc = "RPW",
         r = 2, nsim = 2000, mRate = NULL, alpha = 0.05)

Arguments

n0

A positive integer. n0 represents the initial patient population assogned through restricted randomization for initial parameter estimation.

p

A positive vector of length equals to k. The values specify the true success rates for the various treatments, and these rates are used to generate data for simulations.

k

A positive integer. The value specifies the number of treatment groups involved in a clinical trial. (k2k \ge 2)

ssn

A positive integer. The value specifies the total number of participants involved in each round of the simulation.

theta0

A vector of length k. Each value in the vector represents a probability used for adjusting parameter estimates. If the argument is not provided, it defaults to a vector of length k, with all values set to 0.5.

target.alloc

Desired allocation proportion. The option for this argument could be one of "Neyman", "RSIHR", "RPW", "WeisUrn". The default is "RPW".

r

A positive number. Parameter for Hu and Zhang's doubly biased coin design and usually take values 2-4. The default value is 2.

nsim

a positive integer. The value specifies the total number of simulations, with a default value of 2000.

mRate

a numerical value between 0 and 1, inclusive, representing the missing rate for the responses. This parameter pertains to missing-at-random data. The default value is NULL, indicating no missing values by default.

alpha

A number between 0 and 1. The value represents the predetermined level of significance that defines the probability threshold for rejecting the null hypothesis, with a default value of 0.05.

Details

The objective of Hu and Zhang's doubly biased coin design is to allocate patients sequentially while closely approximating the desired allocation proportion, which is a function of certain unknown parameters related to the response variable under each treatment.

The process begins by assigning n0 patients to treatment groups using restricted randomization and collecting their responses. Initial parameter estimates for the response variable are then obtained for each treatment group. Subsequently, based on these parameter estimates, the desired allocation proportion is calculated. Afterward, the Hu and Zhang's allocation function is applied to determine the probabilities for the next patient to be assigned to each treatment group, which force the allocation proportion close to the desired one. This process is repeated sequentially for each patient until the desired number of patients has been allocated, as predetermined.

This methodology was introduced by Hu and Zhang in their 2004 paper titled 'Asymptotic Properties of Doubly Adaptive Biased Coin Designs for Multitreatment Clinical Trials.

Value

name

The name of procedure.

parameter

The true parameters used to do the simulations.

assignment

The randomization sequence.

propotion

Average allocation porpotion for each of treatment groups.

failRate

The proportion of individuals who do not achieve the expected outcome in each simulation, on average.

pwClac

The probability of the study to detect a significant difference or effect if it truly exists.

k

Number of arms involved in the trial.

References

Hu, F., & Zhang, L. X. (2004). Asymptotic properties of doubly adaptive biased coin designs for multi-treatment clinical trials. The Annals of Statistics, 32(1), 268-301.

Examples

DBCD_Bin(n0 = 20, p = c(0.7, 0.8), k = 2, ssn = 300, theta0 = NULL,
         target.alloc = "RPW", r = 2, nsim = 50, mRate = NULL, alpha = 0.05)

Hu and Zhang's Doubly Biased Coin Design with Continuous Response Type

Description

Simulating Hu and Zhang's doubly biased coin deisgn with continuous response (number of arms 2\ge 2) in a clinical trial context. (Inference: two-sided hypothesis testing t-test or chi-square test)

Usage

DBCD_Cont(n0 = 20, theta, k, ssn, theta0 = NULL, target.alloc = "Neyman",
          r = 2, nsim = 2000, alpha = 0.05)

Arguments

n0

A positive integer. n0 represents the initial patient population assogned through restricted randomization for initial parameter estimation.

theta

A numerical vector of length equal to 2k. These values specify the true parameters for each treatment and are used for generating data in simulations. For example, if k=2, you should provide two pairs of parameter values, each consisting of the mean and variance, like: theta = c(13, 4.0^2, 15, 2.5^2).

k

A positive integer. The value specifies the number of treatment groups involved in a clinical trial. (k2k \ge 2)

ssn

A positive integer. The value specifies the total number of participants involved in each round of the simulation.

theta0

A vector of length 2k. Each value in the vector represents a probability used for adjusting parameter estimates. If the argument is not provided, it defaults to a vector of length 2k, with all paramter pair setted to be (0, 1).

target.alloc

Desired allocation proportion. The option for this argument could be one of "Neyman", "ZR", "DaOptimal". The default is "Neyman". The details see Zhang L. and Rosenberger. W (2006).

r

A positive number. Parameter for Hu and Zhang's doubly biased coin design and usually take values 2-4. The default value is 2.

nsim

a positive integer. The value specifies the total number of simulations, with a default value of 2000.

alpha

A number between 0 and 1. The value represents the predetermined level of significance that defines the probability threshold for rejecting the null hypothesis, with a default value of 0.05.

Details

The objective of Hu and Zhang's doubly biased coin design is to allocate patients sequentially while closely approximating the desired allocation proportion, which is a function of certain unknown parameters related to the response variable under each treatment.

The process begins by assigning n0 patients to treatment groups using restricted randomization and collecting their responses. Initial parameter estimates for the response variable are then obtained for each treatment group. Subsequently, based on these parameter estimates, the desired allocation proportion is calculated. Afterward, the Hu and Zhang's allocation function is applied to determine the probabilities for the next patient to be assigned to each treatment group, which force the allocation proportion close to the desired one. This process is repeated sequentially for each patient until the desired number of patients has been allocated, as predetermined.

This methodology was introduced by Hu and Zhang in their 2004 paper titled 'Asymptotic Properties of Doubly Adaptive Biased Coin Designs for Multitreatment Clinical Trials.

Value

name

The name of procedure.

parameter

The true parameters used to do the simulations.

assignment

The randomization sequence.

propotion

Average allocation porpotion for each of treatment groups.

failRate

The average response value for the entire trial.

pwClac

The probability of the study to detect a significant difference or effect if it truly exists.

k

Number of arms involved in the trial.

References

Hu, F., Zhang, L. X., Cheung, S. H., & Chan, W. S. (2008). Doubly adaptive biased coin designs with delayed responses. Canadian Journal of Statistics, 36(4), 541-559.

Zhang, L., & Rosenberger, W. F. (2006). Response‐adaptive randomization for clinical trials with continuous outcomes. Biometrics, 62(2), 562-569.

See Also

See DBCD_Bin for simulations of Hu and Zhang's doubly biased coin deisgn with binary response.

See dyldDBCD_Cont for simulations of Hu and Zhang's doubly biased coin deisgn with delayed continuous response.

Examples

# A simple use!
# Define the arguments
## Arguments for generate the simulated data
theta = c(13, 4.0^2, 15, 2.5^2)
k = 2
ssn = 88
### Other arguments
target.alloc = "Neyman"

res = DBCD_Cont(n0 = 20, theta, k, ssn, theta0 = NULL,
                target.alloc = "Neyman", r = 2, nsim = 200, alpha = 0.05)

# View the output (A list of all results)
res

Drop the loser rule

Description

Simulating drop the loser rule procedure with two-sided hypothesis testing in a clinical trial context.

Usage

DLRule(k, p, ssn, Y0 = NULL, nsim = 2000, alpha = 0.05)

Arguments

k

a positive integer. The value specifies the number of treatment groups involved in a clinical trial. (k=2k = 2)

p

a positive vector of length equals to k. The values specify the true success rates for the various treatments, and these rates are used to generate data for simulations.

ssn

a positive integer. The value specifies the total number of participants involved in each round of the simulation.

Y0

A vector of length k, specifying the initial probability of allocating a patient to each group. For instance, if Y0 = c(1, 1, 1), the initial probabilities are calculated as Y0 / sum(Y0). When Y0 is NULL, the initial urn will be set as If Y0 is NULL, then Y0 is set to a vector of length k, with all values equal to 1 by default.

nsim

a positive integer. The value specifies the total number of simulations, with a default value of 2000.

alpha

A number between 0 and 1. The value represents the predetermined level of significance that defines the probability threshold for rejecting the null hypothesis, with a default value of 0.05.

Details

Drop the loser rule can be describe as follows: An urn contains three types of balls (A,B,0)(A, B, 0) initially. Balls of types AA and BB represent treatments AA and BB, balls of 0 type are immigration balls. If AA (or BB) is drawn, then treatment AA (or BB) is assigned to the subject and the response is observed. If the observed response is a failure, then the ball is not replaced, else replaced. If an immigration ball (type 0) is drawn, no treatment is assigned, and the ball is returned to the urn together with one AA and one BB ball.

Value

name

The name of procedure.

parameter

The true parameters used to do the simulations.

assignment

The randomization sequence.

propotion

Average allocation porpotion for each of treatment groups.

failRate

The proportion of individuals who do not achieve the expected outcome in each simulation, on average.

pwClac

The probability of the study to detect a significant difference or effect if it truly exists.

k

Number of arms involved in the trial.

References

Ivanova, A. (2003). A play-the-winner-type urn design with reduced variability. Metrika, 58, 1-13.

Examples

## a simple use
dl.res = DLRule(k = 2, p = c(0.7, 0.8), ssn = 400, Y0 = NULL, nsim = 200, alpha = 0.05)

## view the output
dl.res


  ## view all simulation settings
  dl.res$name
  dl.res$parameter
  dl.res$k

  ## View the simulations results
  dl.res$propotion
  dl.res$failRate
  dl.res$pwCalc
  dl.res$assignment

Hu and Zhang's Doubly Biased Coin Deisgn with delayed Binary Response

Description

Simulating Hu and Zhang's doubly biased coin deisgn with delayed binary response (number of arms 2\ge 2) in a clinical trial context. (Inference: two-sided hypothesis testing t-test or chi-square test)

Usage

dyldDBCD_Bin(n0 = 20, p, k, ssn, ent.param, rspT.dist,
             rspT.param, theta0 = NULL, target.alloc = "RPW", r = 2,
             nsim = 2000, mRate = NULL, alpha = 0.05)

Arguments

n0

A positive integer. n0 represents the initial patient population assogned through restricted randomization for initial parameter estimation.

p

A positive vector of length equals to k. The values specify the true success rates for the various treatments, and these rates are used to generate data for simulations.

k

A positive integer. The value specifies the number of treatment groups involved in a clinical trial. (k=2k = 2)

ssn

A positive integer. The value specifies the total number of participants involved in each round of the simulation.

ent.param

A positive integer. The value specified the parameter for an expoential distribution which determine the time for each participant enter the trial.

rspT.dist

Distribution Type. Specifies the type of distribution that models the time spent for the availability of patient ii under treatment kk. Acceptable options for this argument include: "exponential", "normal", and "uniform".

rspT.param

A vector. Specifies the parameters required by the distribution that models the time spent for the availability under each treatment. (eg. If there are 3 treatments groups and each of them follows truncated normal distribution with parameter pair (3, 2), (2, 1), (4, 1), repectively. Then the rspT.param = c(3, 2, 2, 1, 4, 1))

theta0

A vector of length k. Each value in the vector represents a probability used for adjusting parameter estimates. If the argument is not provided, it defaults to a vector of length k, with all values set to 0.5.

target.alloc

Desired allocation proportion. The option for this argument could be one of "Neyman", "RSIHR", "RPW", "WeisUrn". The default is "RPW".

r

A positive number. Parameter for Hu and Zhang's doubly biased coin design and usually take values 2-4. The default value is 2.

nsim

a positive integer. The value specifies the total number of simulations, with a default value of 2000.

mRate

a numerical value between 0 and 1, inclusive, representing the missing rate for the responses. This parameter pertains to missing-at-random data. The default value is NULL, indicating no missing values by default.

alpha

a numerical value between 0 and 1. The value represents the predetermined level of significance that defines the probability threshold for rejecting the null hypothesis, with a default value of 0.05.

Details

Hu and Zhang's Doubly Biased Coin Design with delayed Binary Response employs the following treatment allocation scheme:

(a) Initially, due to limited information about treatment efficacy, the first n0 patients are assigned to K treatments using restricted randomization (as described by Rosenberger and Lachin, 2002).

(b) For mn0m \ge n_0, patient (m+1)(m+1) is allocated to treatment kk with a probability pm+1,kp_{m+1, k}, which depends on the available responses and estimated target allocation via gkg_k, as proposed by Hu and Zhang (2004).

For a more comprehensive description of the procedure, please refer to the paper titled 'Doubly adaptive biased coin designs with delayed responses' authored by Hu et al. in 2008.

Value

name

The name of procedure.

parameter

The true parameters used to do the simulations.

assignment

The randomization sequence.

propotion

Average allocation porpotion for each of treatment groups.

failRate

The proportion of individuals who do not achieve the expected outcome in each simulation, on average.

pwClac

The probability of the study to detect a significant difference or effect if it truly exists.

k

Number of arms involved in the trial.

References

Hu, F., Zhang, L. X., Cheung, S. H., & Chan, W. S. (2008). Doubly adaptive biased coin designs with delayed responses. Canadian Journal of Statistics, 36(4), 541-559.

Examples

# a simple use
# Define the arguments
## Arguments for generate the simulated data
### For response simulation
p = c(0.6, 0.8)
k = 2
ssn = 100
### for enter time and response time simulation
ent.param = 0.7
rspT.dist = "exponential"
rspT.param = c(1, 1, 3, 1)

## Arguments for the deisgn
n0 = 20
target.alloc = "RSIHR"

dyldDBCD_Bin(n0 = n0, p = p, k = k, ssn = ssn, ent.param, rspT.dist, rspT.param, theta0 = NULL,
             target.alloc, r = 2, nsim = 150, mRate = NULL, alpha = 0.05)

Hu and Zhang's Doubly Biased Coin Deisgn with delayed Continuous Response

Description

Simulating Hu and Zhang's doubly biased coin deisgn with delayed continuous response (number of arms 2\ge 2) in a clinical trial context. (Inference: two-sided hypothesis testing t-test or chi-square test)

Usage

dyldDBCD_Cont(n0 = 20, theta, k, ssn, ent.param, rspT.dist, rspT.param,
              target.alloc = "Neyman", r = 2, nsim = 2000, mRate = NULL, alpha = 0.05)

Arguments

n0

A positive integer. n0 represents the initial patient population assogned through restricted randomization for initial parameter estimation.

theta

A numerical vector of length equal to 2k. These values specify the true parameters for each treatment and are used for generating data in simulations. For example, if k=2, you should provide two pairs of parameter values, each consisting of the mean and variance, like: theta = c(13, 4.0^2, 15, 2.5^2).

k

A positive integer. The value specifies the number of treatment groups involved in a clinical trial. (k2k \ge 2)

ssn

A positive integer. The value specifies the total number of participants involved in each round of the simulation.

ent.param

A positive integer. The value specified the parameter for an expoential distribution which determine the time for each participant enter the trial.

rspT.dist

Distribution Type. Specifies the type of distribution that models the time spent for the availability of patient ii under treatment kk. Acceptable options for this argument include: "exponential", "normal", and "uniform".

rspT.param

A vector. Specifies the parameters required by the distribution that models the time spent for the availability under each treatment. (eg. If there are 3 treatments groups and each of them follows truncated normal distribution with parameter pair (3, 2), (2, 1), (4, 1), repectively. Then the rspT.param = c(3, 2, 2, 1, 4, 1))

target.alloc

Desired allocation proportion. The option for this argument could be one of "Neyman", "ZR", "DaOptimal". The default is "Neyman". The details see Zhang L. and Rosenberger. W (2006).

r

A positive number. Parameter for Hu and Zhang's doubly biased coin design and usually take values 2-4. The default value is 2.

nsim

a positive integer. The value specifies the total number of simulations, with a default value of 2000.

mRate

a numerical value between 0 and 1, inclusive, representing the missing rate for the responses. This parameter pertains to missing-at-random data. The default value is NULL, indicating no missing values by default.

alpha

a numerical value between 0 and 1. The value represents the predetermined level of significance that defines the probability threshold for rejecting the null hypothesis, with a default value of 0.05.

Details

Hu and Zhang's Doubly Biased Coin Design with delayed Contiunous Response employs the following treatment allocation scheme:

(a) Initially, due to limited information about treatment efficacy, the first n0 patients are assigned to K treatments using restricted randomization (as described by Rosenberger and Lachin, 2002).

(b) For mn0m \ge n_0, patient (m+1)(m+1) is allocated to treatment kk with a probability pm+1,kp_{m+1, k}, which depends on the available responses and estimated target allocation via gkg_k, as proposed by Hu and Zhang (2004).

For a more comprehensive description of the procedure, please refer to the paper titled 'Doubly adaptive biased coin designs with delayed responses' authored by Hu et al. in 2008.

Value

name

The name of procedure.

parameter

The true parameters used to do the simulations.

assignment

The randomization sequence.

propotion

Average allocation porpotion for each of treatment groups.

failRate

The average response value for the entire trial.

pwClac

The probability of the study to detect a significant difference or effect if it truly exists.

k

Number of arms involved in the trial.

References

Hu, F., & Zhang, L. X. (2004). Asymptotic properties of doubly adaptive biased coin designs for multi-treatment clinical trials. The Annals of Statistics, 32(1), 268-301.

Hu, F., Zhang, L. X., Cheung, S. H., & Chan, W. S. (2008). Doubly adaptive biased coin designs with delayed responses. Canadian Journal of Statistics, 36(4), 541-559.

Examples

# a simple use
# Define the arguments
## Arguments for generate the simulated data
### For response simulation
theta = c(13, 4.0^2, 15, 2.5^2)
k = 2
ssn = 88

### for enter time and response time simulation
ent.param = 5
rspT.param = rep(10, 2)
rspT.dist = "exponential"

## Arguments for the deisgn
target.alloc = "Neyman"

res = dyldDBCD_Cont(n0 = 10, theta, k, ssn, ent.param, rspT.dist,
                    rspT.param, target.alloc, r = 2, nsim = 200,
                    mRate = 0.2, alpha = 0.05)

# View the output (A list of all results)
res

Generalized drop-the-loser rule

Description

Simulating generalized drop-the-loser rule procedure (number of arms >2> 2) with two-sided hypothesis testing in a clinical trial context.

Usage

GDLRule(k, p, ssn, aK, Y0 = NULL, nsim = 2000, alpha = 0.05)

Arguments

k

a positive integer. The value specifies the number of treatment groups involved in a clinical trial. (k2k \ge 2)

p

a positive vector of length equals to k. The values specify the true success rates for the various treatments, and these rates are used to generate data for simulations.

ssn

a positive integer. The value specifies the total number of participants involved in each round of the simulation.

aK

a positive vector of length equals to k. The values specifies when the immigration ball is drawn, the number of each treatment ball added to the urn.

Y0

A vector of length k, specifying the initial probability of allocating a patient to each group. For instance, if Y0 = c(1, 1, 1), the initial probabilities are calculated as Y0 / sum(Y0). When Y0 is NULL, the initial urn will be set as If Y0 is NULL, then Y0 is set to a vector of length k, with all values equal to 1 by default.

nsim

a positive integer. The value specifies the total number of simulations, with a default value of 2000.

alpha

A number between 0 and 1. The value represents the predetermined level of significance that defines the probability threshold for rejecting the null hypothesis, with a default value of 0.05.

Details

Consider an urn containing balls of K+1K+1 types. Balls of types $1, ..., K$ represent treatments, balls of type 0 will be called immigration balls. When the subject arrived for randomizition, a ball is drawn at random. If the ball is of type 0 (i.e, an immigration ball), no subject is treated, and the ball is returned to the urn together with A=a1++aKA=a_1+\cdots+a_K additional balls, aka_k of treatment type k,k=1,,Kk, k=1, \ldots, K. If a treatment ball is drawn (say, of type kk, for some k=1,,Kk=1, \ldots, K) the next subject is given treatment kk and the ball is not replaced. If the observed response of this subject is a success, then the ball is replaced, otherwise not replaced.

Value

name

The name of procedure.

parameter

The true parameters used to do the simulations.

assignment

The randomization sequence.

propotion

Average allocation porpotion for each of treatment groups.

failRate

The proportion of individuals who do not achieve the expected outcome in each simulation, on average.

pwClac

The probability of the study to detect a significant difference or effect if it truly exists.

k

Number of arms involved in the trial.

References

Zhang, L. X., Chan, W. S., Cheung, S. H., & Hu, F. (2007). A generalized drop-the-loser urn for clinical trials with delayed responses. Statistica Sinica, 17(1), 387-409.

Examples

## a simple use
gdl.res = GDLRule(k = 3, p = c(0.6, 0.7, 0.6),
                  ssn = 400, aK = c(1, 1, 1), Y0 = NULL, nsim = 200, alpha = 0.05)

## view the output
gdl.res


  ## view all simulation settings
  gdl.res$name
  gdl.res$parameter
  gdl.res$k

  ## View the simulations results
  gdl.res$propotion
  gdl.res$failRate
  gdl.res$pwCalc
  gdl.res$assignment

Group Doubly Biased Coin Design with Binary Response Type

Description

Simulating group doubly biased coin deisgn with binary response (number of arms 2\ge 2) in a clinical trial context. (Inference: two-sided hypothesis testing t-test or chi-square test)

Usage

Group.DBCD_Bin(n0 = 20, p, k, gsize.param, ssn, theta0 = NULL,
                target.alloc = "RPW", r = 2, nsim = 2000,
                mRate = NULL, alpha = 0.05)

Arguments

n0

A positive integer. n0 represents the initial patient population assigned through restricted randomization for initial parameter estimation.

p

A positive vector of length equals to k. The values specify the true success rates for the various treatments, and these rates are used to generate data for simulations.

k

A positive integer. The value specifies the number of treatment groups involved in a clinical trial. (k2k \ge 2)

gsize.param

A positive integer. It represents the expected number of people enrolling in a specified interval, assuming that the enrollment rate per unit time follows a Poisson distribution.

ssn

A positive integer. The value specifies the total number of participants involved in each round of the simulation.

theta0

A vector of length k. Each value in the vector represents a probability used for adjusting parameter estimates. If the argument is not provided, it defaults to a vector of length k, with all values set to 0.5.

target.alloc

Desired allocation proportion. The option for this argument could be one of "Neyman", "RSIHR", "RPW", "WeisUrn". The default is "RPW".

r

A positive number. Parameter for Hu and Zhang's doubly biased coin design and usually take values 2-4. The default value is 2.

nsim

A positive integer. The value specifies the total number of simulations, with a default value of 2000.

mRate

A numerical value between 0 and 1, inclusive, representing the missing rate for the responses. This parameter pertains to missing-at-random data. The default value is NULL, indicating no missing values by default.

alpha

A number between 0 and 1. The value represents the predetermined level of significance that defines the probability threshold for rejecting the null hypothesis, with a default value of 0.05.

Details

Hu and Zhang's Doubly Biased Coin Design (DBCD) adjusts the probability of assigning each patient to a specific treatment group in a clinical trial, based on the responses of all previous patients. The Group DBCD is an enhanced version of this approach, offering a more practical perspective. It dynamically updates the allocation probabilities for patients in each group based on the responses of all preceding groups, either when the data available or at fixed time intervals (weekly or biweekly).

The process begins by assigning n0 (perhaps the first few groups of) patients to treatment groups using restricted randomization and collecting their responses. Initial parameter estimates for the response variable are then obtained for each treatment group. Subsequently, based on these parameter estimates, the esmatied desired allocation proportion is calculated. Afterward, the Hu and Zhang's allocation function is applied to determine the probabilities for the next group of patients to be assigned to each treatment group, which force the allocation proportion close to the desired one. This process is repeated sequentially for each group until the desired number of patients has been allocated, as predetermined.

This methodology was introduced by Zhai, Li, Zhang and Hu in their 2023 paper titled 'Group Response-Adaptive Randomization with Delayed and Missing Responses'.

Value

name

The name of procedure.

parameter

The true parameters used to do the simulations.

assignment

The randomization sequence.

propotion

Average allocation porpotion for each of treatment groups.

failRate

The proportion of individuals who do not achieve the expected outcome in each simulation, on average.

pwClac

The probability of the study to detect a significant difference or effect if it truly exists.

k

Number of arms involved in the trial.

References

Zhai, G., Li, Y., Zhang, L. X. & Hu, F. (2023). Group Response-Adaptive Randomization with Delayed and Missing Responses.

Examples

Group.DBCD_Bin(n0 = 20, p = c(0.65, 0.8), k = 2, gsize.param = 5,
               ssn = 300, theta0 = NULL, target.alloc = "RPW",
               r = 2, nsim = 400, mRate = NULL, alpha = 0.05)

Group Doubly Biased Coin Design with Continuous Response Type

Description

Simulating group doubly biased coin deisgn with continuous response (number of arms 2\ge 2) in a clinical trial context. (Inference: two-sided hypothesis testing t-test or chi-square test)

Usage

Group.DBCD_Cont(n0 = 20, theta, k, gsize.param, ssn,
                theta0 = NULL, target.alloc = "Neyman",
                r = 2, nsim = 2000, mRate = NULL, alpha = 0.05)

Arguments

n0

A positive integer. n0 represents the initial patient population assigned through restricted randomization for initial parameter estimation.

theta

A numerical vector of length equal to 2k. These values specify the true parameters for each treatment and are used for generating data in simulations. For example, if k=2, you should provide two pairs of parameter values, each consisting of the mean and variance, like: theta = c(13, 4.0^2, 15, 2.5^2).

k

A positive integer. The value specifies the number of treatment groups involved in a clinical trial. (k=2k = 2)

ssn

A positive integer. The value specifies the total number of participants involved in each round of the simulation.

gsize.param

A positive integer. It represents the expected number of people enrolling in a specified interval, assuming that the enrollment rate per unit time follows a Poisson distribution.

theta0

A vector of length 2k. Each value in the vector represents a probability used for adjusting parameter estimates. If the argument is not provided, it defaults to a vector of length 2k, with all paramter pair setted to be (0, 1).

target.alloc

Desired allocation proportion. The option for this argument could be one of "Neyman", "ZR", "DaOptimal". The default is "Neyman". The details see Zhang L. and Rosenberger. W (2006).

r

A positive number. Parameter for Hu and Zhang's doubly biased coin design and usually take values 2-4. The default value is 2.

nsim

a positive integer. The value specifies the total number of simulations, with a default value of 2000.

mRate

a numerical value between 0 and 1, inclusive, representing the missing rate for the responses. This parameter pertains to missing-at-random data. The default value is NULL, indicating no missing values by default.

alpha

a numerical value between 0 and 1. The value represents the predetermined level of significance that defines the probability threshold for rejecting the null hypothesis, with a default value of 0.05.

Details

Hu and Zhang's Doubly Biased Coin Design (DBCD) adjusts the probability of assigning each patient to a specific treatment group in a clinical trial, based on the responses of all previous patients. The Group DBCD is an enhanced version of this approach, offering a more practical perspective. It dynamically updates the allocation probabilities for patients in each group based on the responses of all preceding groups, either when the data available or at fixed time intervals (weekly or biweekly).

The process begins by assigning n0 (perhaps the first few groups of) patients to treatment groups using restricted randomization and collecting their responses. Initial parameter estimates for the response variable are then obtained for each treatment group. Subsequently, based on these parameter estimates, the esmatied desired allocation proportion is calculated. Afterward, the Hu and Zhang's allocation function is applied to determine the probabilities for the next group of patients to be assigned to each treatment group, which force the allocation proportion close to the desired one. This process is repeated sequentially for each group until the desired number of patients has been allocated, as predetermined.

This methodology was introduced by Zhai, Li, Zhang and Hu in their 2023 paper titled 'Group Response-Adaptive Randomization with Delayed and Missing Responses'.

Value

name

The name of procedure.

parameter

The true parameters used to do the simulations.

assignment

The randomization sequence.

propotion

Average allocation porpotion for each of treatment groups.

failRate

The average response value for the entire trial.

pwClac

The probability of the study to detect a significant difference or effect if it truly exists.

k

Number of arms involved in the trial.

References

Zhai, G., Li, Y., Zhang, L. X. & Hu, F. (2023). Group Response-Adaptive Randomization with Delayed and Missing Responses.

Examples

theta = c(13, 4.0^2, 15, 2.5^2)
k = 2
gsize.param = 5
ssn = 120
Group.DBCD_Cont(n0 = 20, theta, k, gsize.param, ssn,
                target.alloc = "Neyman", r = 2, nsim = 500,
                mRate = NULL, alpha = 0.05)

Group Doubly Biased Coin Design with Delayed Discrete Response

Description

Simulating group doubly biased coin deisgn with delayed discrete response (number of arms 2\ge 2) in a clinical trial context. (Inference: two-sided hypothesis testing t-test or chi-square test)

Usage

Group.dyldDBCD_Bin(n0 = 20, p, k, ssn, gsize.param,
                  rspT.dist, rspT.param, theta0 = NULL,
                  target.alloc = "RPW",  r = 2, nsim = 2000,
                  eTime = 7,  mRate = NULL, alpha = 0.05)

Arguments

n0

A positive integer. n0 represents the initial patient population assogned through restricted randomization for initial parameter estimation.

p

A positive vector of length equals to k. The values specify the true success rates for the various treatments, and these rates are used to generate data for simulations.

k

A positive integer. The value specifies the number of treatment groups involved in a clinical trial. (k=2k = 2)

ssn

A positive integer. The value specifies the total number of participants involved in each round of the simulation.

gsize.param

A positive integer. It represents the expected number of people enrolling in a specified interval, assuming that the enrollment rate per unit time follows a Poisson distribution.

rspT.dist

Distribution Type. Specifies the type of distribution that models the time spent for the availability of patient ii under treatment kk. Acceptable options for this argument include: "exponential", "normal", and "uniform".

rspT.param

A vector with length 2k2k. Specifies the parameters required by the distribution that models the time spent for the availability under each treatment and each response. (eg. If there are 3 treatments groups with 0 or 1 as response and each of them follows exponential distribution with parameter (3, 2, 3, 3, 1, 2), repectively. Then the rspT.param = c(3, 2, 2, 1, 4, 1))

theta0

A vector of length k. Each value in the vector represents a probability used for adjusting parameter estimates. If the argument is not provided, it defaults to a vector of length k, with all values set to 0.5.

target.alloc

Desired allocation proportion. The option for this argument could be one of "Neyman", "RSIHR", "RPW", "WeisUrn". The default is "RPW".

r

A positive number. Parameter for Hu and Zhang's doubly biased coin design and usually take values 2-4. The default value is 2.

nsim

A positive integer. The value specifies the total number of simulations, with a default value of 2000.

eTime

A positive number. The interval time between enrollment of participants in each group. The default is 7.

mRate

a numerical value between 0 and 1, inclusive, representing the missing rate for the responses. This parameter pertains to missing-at-random data. The default value is NULL, indicating no missing values by default.

alpha

a numerical value between 0 and 1. The value represents the predetermined level of significance that defines the probability threshold for rejecting the null hypothesis, with a default value of 0.05.

Details

Hu and Zhang's Doubly Biased Coin Design (DBCD) adjusts the probability of assigning each patient to a specific treatment group in a clinical trial, based on the responses of all previous patients. The Group DBCD is an enhanced version of this approach, offering a more practical perspective. It dynamically updates the allocation probabilities for patients in each group based on the avaiable responses of all preceding groups, either when the data available or at fixed time intervals (weekly or biweekly). Here, the function focuses on implementing the group doubly biased coin design, tailored to delayed binary responses.

The process begins by assigning n0 (perhaps the first few groups of) patients to treatment groups using restricted randomization and collecting their responses. Initial parameter estimates for the response variable are then obtained for each treatment group. Subsequently, based on these parameter estimates, the esmatied desired allocation proportion is calculated. Afterward, the Hu and Zhang's allocation function is applied to determine the probabilities for the next group of patients to be assigned to each treatment group, which force the allocation proportion close to the desired one. This process is repeated sequentially for each group until the desired number of patients has been allocated, as predetermined.

This methodology was introduced by Zhai, Li, Zhang and Hu in their 2023 paper titled 'Group Response-Adaptive Randomization with Delayed and Missing Responses'.

Value

name

The name of procedure.

parameter

The true parameters used to do the simulations.

assignment

The randomization sequence.

propotion

Average allocation porpotion for each of treatment groups.

failRate

The proportion of individuals who do not achieve the expected outcome in each simulation, on average.

pwClac

The probability of the study to detect a significant difference or effect if it truly exists.

k

Number of arms involved in the trial.

References

Zhai, G., Li, Y., Zhang, L. X. & Hu, F. (2023). Group Response-Adaptive Randomization with Delayed and Missing Responses.

Examples

# a simple use
# Define the arguments
## Arguments for generate the simulated data
### For response simulation
p = c(0.7, 0.5)
k = 2
ssn = 200

### for enter time and response time simulation
eTime = 7
rspT.param = rep(10, 4)
rspT.dist = "exponential"
gsize.param = 5

## Arguments for the deisgn
n0 = 10
target.alloc = "RPW"

res = Group.dyldDBCD_Bin(n0, p, k, ssn, gsize.param,
                         rspT.dist, rspT.param, theta0 = NULL,
                         target.alloc = "RPW",  r = 2,
                         nsim = 120, eTime = 7,  mRate = NULL, alpha = 0.05)

# View the output (A list of all results)
res

Group Doubly Biased Coin Design with Delayed Continuous Response

Description

Simulating group doubly biased coin deisgn with delayed continuous response (number of arms 2\ge 2) in a clinical trial context. (Inference: two-sided hypothesis testing t-test or chi-square test)

Usage

Group.dyldDBCD_Cont(n0 = 20, theta, k, ssn,
                    gsize.param, rspT.dist, rspT.param,
                    target.alloc = "Neyman",  r = 2,
                    nsim = 2000, eTime = 7,
                    mRate = NULL, alpha = 0.05)

Arguments

n0

A positive integer. n0 represents the initial patient population assogned through restricted randomization for initial parameter estimation.

theta

A numerical vector of length equal to 2k. These values specify the true parameters for each treatment and are used for generating data in simulations. For example, if k=2, you should provide two pairs of parameter values, each consisting of the mean and variance, like: theta = c(13, 4.0^2, 15, 2.5^2).

k

A positive integer. The value specifies the number of treatment groups involved in a clinical trial. (k=2k = 2)

ssn

A positive integer. The value specifies the total number of participants involved in each round of the simulation.

gsize.param

A positive integer. It represents the expected number of people enrolling in a specified interval, assuming that the enrollment rate per unit time follows a Poisson distribution.

rspT.dist

Distribution Type. Specifies the type of distribution that models the time spent for the availability of patient ii under treatment kk. Acceptable options for this argument include: "exponential", "normal", and "uniform".

rspT.param

A vector. Specifies the parameters required by the distribution that models the time spent for the availability under each treatment. (eg. If there are 3 treatments groups and each of them follows truncated normal distribution with parameter pair (3, 2), (2, 1), (4, 1), repectively. Then the rspT.param = c(3, 2, 2, 1, 4, 1))

target.alloc

Desired allocation proportion. The option for this argument could be one of "Neyman", "ZR", "DaOptimal". The default is "Neyman". The details see Zhang L. and Rosenberger. W (2006).

r

A positive number. Parameter for Hu and Zhang's doubly biased coin design and usually take values 2-4. The default value is 2.

nsim

a positive integer. The value specifies the total number of simulations, with a default value of 2000.

eTime

A positive number. The interval time between enrollment of participants in each group. The default is 7.

mRate

a numerical value between 0 and 1, inclusive, representing the missing rate for the responses. This parameter pertains to missing-at-random data. The default value is NULL, indicating no missing values by default.

alpha

a numerical value between 0 and 1. The value represents the predetermined level of significance that defines the probability threshold for rejecting the null hypothesis, with a default value of 0.05.

Details

Hu and Zhang's Doubly Biased Coin Design (DBCD) adjusts the probability of assigning each patient to a specific treatment group in a clinical trial, based on the responses of all previous patients. The Group DBCD is an enhanced version of this approach, offering a more practical perspective. It dynamically updates the allocation probabilities for patients in each group based on the avaiable responses of all preceding groups, either when the data available or at fixed time intervals (weekly or biweekly). Here, the function focuses on implementing the group doubly biased coin design, tailored to delayed continuous responses.

The process begins by assigning n0 (perhaps the first few groups of) patients to treatment groups using restricted randomization and collecting their responses. Initial parameter estimates for the response variable are then obtained for each treatment group. Subsequently, based on these parameter estimates, the esmatied desired allocation proportion is calculated. Afterward, the Hu and Zhang's allocation function is applied to determine the probabilities for the next group of patients to be assigned to each treatment group, which force the allocation proportion close to the desired one. This process is repeated sequentially for each group until the desired number of patients has been allocated, as predetermined.

This methodology was introduced by Zhai, Li, Zhang and Hu in their 2023 paper titled 'Group Response-Adaptive Randomization with Delayed and Missing Responses'.

Value

name

The name of procedure.

parameter

The true parameters used to do the simulations.

assignment

The randomization sequence.

propotion

Average allocation porpotion for each of treatment groups.

failRate

The average response value for the entire trial.

pwClac

The probability of the study to detect a significant difference or effect if it truly exists.

k

Number of arms involved in the trial.

References

Zhai, G., Li, Y., Zhang, L. X. & Hu, F. (2023). Group Response-Adaptive Randomization with Delayed and Missing Responses.

Examples

# a simple use
# Define the arguments
## Arguments for generate the simulated data
### For response simulation
theta = c(13, 4.0^2, 15, 2.5^2)
k = 2
ssn = 120

### for enter time and response time simulation
eTime = 7
gsize.param = 5
rspT.param = rep(10, 2)
rspT.dist = "exponential"

## Arguments for the deisgn
n0 = 10
target.alloc = "Neyman"

res = Group.dyldDBCD_Cont(n0, theta, k, ssn, gsize.param,
                          rspT.dist, rspT.param, target.alloc = "Neyman",
                          r = 2, nsim = 200, eTime = 7,  mRate = 0.2, alpha = 0.05)

# View the output (A list of all results)
res

grouprar-package: Group Response-Adaptive Randomization for Clinical Trials

Description

Implement group response-adaptive randomization procedures, which also integrates standard non-group response-adaptive randomization methods as specialized instances. It is also uniquely capable of managing complex scenarios, including those with delayed and missing responses, thereby expanding its utility in real-world applications. This package offers 16 functions for simulating a variety of response adaptive randomization procedures. These functions are essential for guiding the selection of statistical methods in clinical trials, providing a flexible and effective approach to trial design. Some of the detailed methodologies and algorithms used in this package, please refer to the following references: LJ Wei (1979) <doi:10.1214/aos/1176344614> L. J. WEI and S. DURHAM (1978) <doi:10.1080/01621459.1978.10480109> Durham, S. D., FlournoY, N. AND LI, W. (1998) <doi:10.2307/3315771> Ivanova, A., Rosenberger, W. F., Durham, S. D. and Flournoy, N. (2000) <https://www.jstor.org/stable/25053121> Bai Z D, Hu F, Shen L. (2002) <doi:10.1006/jmva.2001.1987> Ivanova, A. (2003) <doi:10.1007/s001840200220> Hu, F., & Zhang, L. X. (2004) <doi:10.1214/aos/1079120137> Hu, F., & Rosenberger, W. F. (2006, ISBN:978-0-471-65396-7). Zhang, L. X., Chan, W. S., Cheung, S. H., & Hu, F. (2007) <https://www.jstor.org/stable/26432528> Zhang, L., & Rosenberger, W. F. (2006) <doi:10.1111/j.1541-0420.2005.00496.x> Hu, F., Zhang, L. X., Cheung, S. H., & Chan, W. S. (2008) <doi:10.1002/cjs.5550360404>.

Author(s)

Guannan Zhai [email protected]; Feifang Hu [email protected].

References

Bai Z D, Hu F, Shen L. An adaptive design for multi-arm clinical trials[J]. Journal of Multivariate Analysis, 2002, 81(1): 1-18.

Hu F, Zhang L X. Asymptotic properties of doubly adaptive biased coin designs for multitreatment clinical trials[J]. The Annals of Statistics, 2004, 32(1): 268-301.

Hu F, Zhang L X, Cheung S H, et al. Doubly adaptive biased coin designs with delayed responses[J]. Canadian Journal of Statistics, 2008, 36(4): 541-559.

Hu F, Rosenberger W F. Optimality, variability, power: evaluating response-adaptive randomization procedures for treatment comparisons[J]. Journal of the American Statistical Association, 2003: 671-678.

Ivanova A. A play-the-winner-type urn design with reduced variability[J]. Metrika, 2003, 58: 1-13.

Ivanova A, Rosenberger W F, Durham S D, et al. A birth and death urn for randomized clinical trials: asymptotic methods[J]. Sankhyā: the Indian Journal of Statistics, Series B, 2000: 104-118

Wei L J. The generalized Polya's urn design for sequential medical trials[J]. The Annals of Statistics, 1979, 7(2): 291-296.

Wei L J, Durham S. The randomized play-the-winner rule in medical trials[J]. Journal of the American Statistical Association, 1978: 840-843.

Zelen M. Play the winner rule and the controlled clinical trial[J]. Journal of the American Statistical Association, 1969: 131-146.

Zhang L X, Chan W S, Cheung S H, et al. A generalized drop-the-loser urn for clinical trials with delayed responses[J]. Statistica Sinica, 2007, 17(1): 387-409.

Zhang L, Rosenberger W F. Response‐adaptive randomization for clinical trials with continuous outcomes[J]. Biometrics, 2006, 62(2): 562-569.


Randomized Pólya urn procedure

Description

Simulating randomized Pólya urn procedure with two-sided hypothesis testing in a clinical trial context.

Usage

PolyaUrn(k, p, ssn, Y0 = NULL, nsim = 2000, alpha = 0.05)

Arguments

k

a positive integer. The value specifies the number of treatment groups involved in a clinical trial. (k2k \ge 2)

p

a positive vector of length equals to k. The values specify the true success rates for the various treatments, and these rates are used to generate data for simulations.

ssn

a positive integer. The value specifies the total number of participants involved in each round of the simulation.

Y0

A vector of length k, specifying the initial probability of allocating a patient to each group. For instance, if Y0 = c(1, 1, 1), the initial probabilities are calculated as Y0 / sum(Y0). When Y0 is NULL, the initial urn will be set as If Y0 is NULL, then Y0 is set to a vector of length k, with all values equal to 1 by default.

nsim

a positive integer. The value specifies the total number of simulations, with a default value of 2000.

alpha

A number between 0 and 1. The value represents the predetermined level of significance that defines the probability threshold for rejecting the null hypothesis, with a default value of 0.05.

Details

The randomized Pólya urn (RPU) procedure can be describe as follows: An urn contains at least one ball of each treatment type (totally K treatments) initially. A ball is drawn from the urn with replacement. If a type ii ball is drawn, i=1,,Ki=1, \ldots, K, then treatment ii is assigned to the next patient. If the response is a success, a ball of type ii is added to the urn. Otherwise the urn remains unchanged.

Value

name

The name of procedure.

parameter

The true parameters used to do the simulations.

assignment

The randomization sequence.

propotion

Average allocation porpotion for each of treatment groups.

failRate

The proportion of individuals who do not achieve the expected outcome in each simulation, on average.

pwClac

The probability of the study to detect a significant difference or effect if it truly exists.

k

Number of arms involved in the trial.

References

Durham, S. D., FlournoY, N. AND LI, W. (1998). Sequential designs for maximizing the probability of a favorable response. Canadian Journal of Statistics, 3, 479-495.

Examples

## a simple use
Polya.res = PolyaUrn(k = 3, p = c(0.6, 0.7, 0.6), ssn = 400, Y0 = NULL, nsim = 200, alpha = 0.05)

## view the output
Polya.res

  ## view all simulation settings
  Polya.res$name
  Polya.res$parameter
  Polya.res$k

  ## View the simulations results
  Polya.res$propotion
  Polya.res$failRate
  Polya.res$pwCalc
  Polya.res$assignment

Randomized Play-the-winner Rule

Description

Simulating randomized play-the-winner rule with two-sided hypothesis testing in a clinical trial context.

Usage

RPWRule(k, p, ssn, Y0 = NULL, nsim = 2000, alpha = 0.05)

Arguments

k

a positive integer. The value specifies the number of treatment groups involved in a clinical trial. (k=2k = 2)

p

a positive vector of length equals to k. The values specify the true success rates for the various treatments, and these rates are used to generate data for simulations.

ssn

a positive integer. The value specifies the total number of participants involved in each round of the simulation.

Y0

A vector of length k, specifying the initial probability of allocating a patient to each group. For instance, if Y0 = c(1, 1,), the initial probabilities are calculated as Y0 / sum(Y0). When Y0 is NULL, the initial urn will be set as If Y0 is NULL, then Y0 is set to a vector of length k, with all values equal to 1 by default.

nsim

a positive integer. The value specifies the total number of simulations, with a default value of 2000.

alpha

An integer between 0 and 1. The value represents the predetermined level of significance that defines the probability threshold for rejecting the null hypothesis, with a default value of 0.05.

Details

The Randomized Play-the-Winner Rule allocates future subjects in a clinical trial to treatment groups based on the performance of previously treated subjects. This rule increases the likelihood of future patients being assigned to the better-performing treatment, as determined by the outcomes of previously treated subjects.

Value

name

The name of procedure.

parameter

The true parameters used to do the simulations.

assignment

The randomization sequence.

propotion

Average allocation porpotion for each of treatment groups.

failRate

The proportion of individuals who do not achieve the expected outcome in each simulation, on average.

pwClac

The probability of the study to detect a significant difference or effect if it truly exists.

k

Number of arms involved in the trial.

References

L. J. WEI and S. DURHAM (1978) The Randomized Play-the-Winner Rule in Medical Trials. Journal of the American Statistical Association, 73, 364, 840–843.

Examples

## a simple use
RPW.res = RPWRule(k = 2, p = c(0.7, 0.8), ssn = 400, Y0 = NULL, nsim = 200, alpha = 0.05)
## view the output
RPW.res


  ## view all simulation settings
  RPW.res$name
  RPW.res$parameter
  RPW.res$k

  ## View the simulations results
  RPW.res$propotion
  RPW.res$failRate
  RPW.res$pwCalc
  RPW.res$assignment

Randomized Play-the-winner rule with multiple arms (k>2k > 2)

Description

Simulating randomized play-the-winner rule (multiple arms) with two-sided hypothesis testing in a clinical trial context.

Usage

WeiUrn(k, p, ssn, Y0 = NULL, nsim = 2000, alpha = 0.05)

Arguments

k

a positive integer. The value specifies the number of treatment groups involved in a clinical trial. (k>2k > 2)

p

a positive vector of length equals to k. The values specify the true success rates for the various treatments, and these rates are used to generate data for simulations.

ssn

a positive integer. The value specifies the total number of participants involved in each round of the simulation.

Y0

A vector of length k, specifying the initial probability of allocating a patient to each group. For instance, if Y0 = c(1, 1, 1), the initial probabilities are calculated as Y0 / sum(Y0). When Y0 is NULL, the initial urn will be set as If Y0 is NULL, then Y0 is set to a vector of length k, with all values equal to 1 by default.

nsim

a positive integer. The value specifies the total number of simulations, with a default value of 2000.

alpha

A number between 0 and 1. The value represents the predetermined level of significance that defines the probability threshold for rejecting the null hypothesis, with a default value of 0.05.

Details

Wei's urn procedure is obtained by extending the randomized play the winner rule (Wei1978) from the case k=2k = 2 to k>2k > 2. Hence, It enables to conduct multi-arm clinical trials, and offers a greater range of applications.

Value

name

The name of procedure.

parameter

The true parameters used to do the simulations.

assignment

The randomization sequence.

propotion

Average allocation porpotion for each of treatment groups.

failRate

The proportion of individuals who do not achieve the expected outcome in each simulation, on average.

pwClac

The probability of the study to detect a significant difference or effect if it truly exists.

k

Number of arms involved in the trial.

References

LJ Wei (1979). The generalized polya’s urn design for sequential medical trials. The Annals of Statistics, 7(2):291–296, 19

Examples

## a simple use
wei.res = WeiUrn(k = 3, p = c(0.7, 0.8, 0.7), ssn = 400, Y0 = NULL, nsim = 200, alpha = 0.05)

## view the output
wei.res


  ## view all simulation settings
  wei.res$name
  wei.res$parameter
  wei.res$k

  ## View the simulations results
  wei.res$propotion
  wei.res$failRate
  wei.res$pwCalc
  wei.res$assignment