View source: R/groupRAR_functions.R
PolyaUrn | R Documentation |
Simulating randomized Pólya urn procedure with two-sided hypothesis testing in a clinical trial context.
PolyaUrn(k, p, ssn, Y0 = NULL, nsim = 2000, alpha = 0.05)
k |
a positive integer. The value specifies the number of treatment groups involved in a clinical trial. ( |
p |
a positive vector of length equals to |
ssn |
a positive integer. The value specifies the total number of participants involved in each round of the simulation. |
Y0 |
A vector of length |
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. |
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 i
ball is drawn, i=1, \ldots, K
, then treatment i
is assigned to the next patient. If the response is a success, a ball of type i
is added to the urn. Otherwise the urn remains unchanged.
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. |
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.
## 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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.