View source: R/SEU_BINARY_raw.R
SEU_BINARY_raw | R Documentation |
Allocates patients to one of treatments based on sequential estimation-adjusted urn model (SEU) on summarized data.
SEU_BINARY_raw(x.df, urn_comp, arms, group_allo, add_rule_index,
add_rule)
x.df |
A data frame of two columns: treatment arm and response value. |
urn_comp |
A vector of current urn composition. |
arms |
A vector of arm names. If it is not provided, the arms occurred in x.df will be assumed as all possible arms. Suggest to always assign arms. |
group_allo |
An integer of the size of group allocation. The default is 1. |
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. |
'SEU_BINARY_raw' assigns the next subject to a group given the observed data, current urn composition, full list of arm codes, number of group allocation and addition rule function.
Code of arms that the next group of subjects assigned to and the updated urn composition.
x.df = data.frame(
ARM = sample(LETTERS[1:3],50,replace = TRUE),
RESPONSE = sample(c(0,1),50,replace = TRUE)
)
SEU_BINARY_raw(x.df, urn_comp=c(0,0,0), arms=c("A","B","C"))
x.df = data.frame(
ARM = sample(LETTERS[1:2],40,replace = TRUE),
RESPONSE = sample(c(0,1),40,replace = TRUE)
)
SEU_BINARY_raw(x.df,
urn_comp=c(0,0),
arms=c("A","B"),
group_allo = 1,
add_rule_index = 3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.