BirthDeathUrn {grouprar}R Documentation

Birth and Death Urn

Description

Simulating birth and death urn procedure (number of arms \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 = 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 K types and a 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 i ball (i = 1, \cdots, K) is drawn. Then the subject is assigned to treatment i. If a success, a type i ball is added in the urn; if a failure, a type i 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
  

[Package grouprar version 0.1.0 Index]