# Implementing treatment allocation for control to treatment with 1:1.5
# randomization ratio
randomization(
N_total = 100,
block = 5,
allocation = c(control = 2, treatment = 3)
)
# Treatment allocation with 2:1 for control to treatment
randomization(
N_total = 70,
block = 9,
allocation = c(treatment = 1, control = 2)
)
# Treatment allocation for control to treatment with 1:2 for control
# to treatment with multiple block sizes c(3, 9, 6)
randomization(
N_total = 100,
block = c(3, 9, 6),
allocation = c(control = 1, treatment = 2)
)
# For complete randomization set the N_total to block size
randomization(
N_total = 100,
block = 100,
allocation = c(control = 1, treatment = 1)
)
# randomization() is a two-arm helper; a multi-arm allocation is rejected.
try(randomization(
N_total = 60,
block = 6,
allocation = c(1, 1, 1)
), silent = TRUE)
Run the code above in your browser using DataLab