randolist
contains home-grown functions for creating randomisation lists in R.
Installation
You can install the development version of randolist
from github with:
remotes::install_github("CTU-Bern/randolist")
Generating randomization lists
Load the package
Unstratified randomization
Where no strata are defined, the blockrand
function can be used to create a randomization list.
blockrand(n = 10,
blocksizes = 1:2)
#> seq_in_list block blocksize seq_in_block arm
#> 1 1 1 4 1 A
#> 2 2 1 4 2 A
#> 3 3 1 4 3 B
#> 4 4 1 4 4 B
#> 5 5 2 2 1 A
#> 6 6 2 2 2 B
#> 7 7 3 4 1 B
#> 8 8 3 4 2 A
#> 9 9 3 4 3 B
#> 10 10 3 4 4 A
The treatment label is set via the arms
argument.
Block sizes are defined via the blocksizes
argument. The above example creates a randomization list with blocks of 1 or 2 of each arm (so in practice, the block sizes are 2 and 4).
Allocation schemes beyond 1:1 randomization are possible by specifying the arms
argument, specifically by using the same arm label multiple times.