SEU_simulation_main {RARfreq}R Documentation

Sequential Estimation-adjusted Urn Model with Simulated Data (Binary Data)

Description

Allocates patients to one of treatments based on sequential estimation-adjusted urn model (SEU) with simulated data.

Usage

SEU_simulation_main(n, nstart, p, urn_comp, nstop, replication, group_allo,
 add_rule_index, add_rule, add_rule_full, sig_level)

Arguments

n

The number of patients. The default is 500.

nstart

Burn-in sample size of each arm. The default is n/20.

p

A vector containing response probabilities for each treatment arm (where the first element refers to the control arm). The length of p should correspond to the number of arms. The default is p = c(0.3, 0.3, 0.6).

urn_comp

A vector of current urn composition. The default is NULL, which indicates no ball in the urn.

nstop

A vector of stopping cap of sample size for each arm. The trial stops if at least one arm reaches the corresponding cap. The default is NULL, which means no cap.

replication

the number of replications of the simulation. The default is 100.

group_allo

A number or a vector of group size(s) for allocation. If a number is given, the allocation ratios will be updated for each batch of group_allo samples. If a vector is given, the allocation ratios will be updated sequentially in group according to the vector. Any value greater than n will be omitted. The default is group_allo=1, which is the same as group_allo = seq(nstart*length(p)+1,n).

add_rule_index

Supply a number of 1, 2 or 3 indicting the addition rules to target allocation functions. 1 = randomized play-the-winner (RPW) rule that targets the urn allocation 2 = the SEU model that targets Neyman allocation; 3 = the SEU model that targets Rosenberger allocation;' 4 = the SEU model that assigns probability of 0.6+1/K to winner at each step. The default is 1.

add_rule

Supply a user-specified addition rules function of x.df and arms when add_rule_index is NULL. Default is NULL. (See SEU_BINARY_raw for details on x.df and arms.)

add_rule_full

Indicator of reference data for updating addition rule. If TRUE, the addition rule is updated by full observation at each group allocation. If FALSE,the addition rule is updated by each group observation. The default is FALSE for add_rule_index=1 and TRUE otherwise.

sig_level

Significant level (one-sided). The default is 0.05.

Details

'SEU_simulation_main' can sample response and adaptively randomize subjects group by group.

Value

Examples


## Default method
SEU_simulation_main(n = 500,
nstart = round(500 / 20),
p = c(0.3, 0.3, 0.6),
nstop=c(500,500,500),
urn_comp = c(0,0,0),
replication = 5,
group_allo = 1,
add_rule_index = 1,
add_rule_full = FALSE,
sig_level = 0.05
)


[Package RARfreq version 0.1.5 Index]