Title: | Merged Block Randomization |
---|---|
Description: | Package to carry out merged block randomization (Van der Pas (2019), <doi:10.1177/1740774519827957>), a restricted randomization method designed for small clinical trials (at most 100 subjects) or trials with small strata, for example in multicentre trials. It can be used for more than two groups or unequal randomization ratios. |
Authors: | Stephanie van der Pas [aut, cre] |
Maintainer: | Stephanie van der Pas <[email protected]> |
License: | GPL-3 |
Version: | 1.1.1 |
Built: | 2024-11-06 09:36:29 UTC |
Source: | CRAN |
Function to carry out merged block randomization, a restricted randomization method designed for small clinical trials (at most 100 subjects) or trials with small strata, for example in multicentre trials. It can be used for more than two groups or unequal randomization ratios.
mergedblocks(n, ratio = c(1, 1), labels = as.character(1:length(ratio)))
mergedblocks(n, ratio = c(1, 1), labels = as.character(1:length(ratio)))
n |
The number of subjects to randomize. |
ratio |
The desired randomization ratio, given as a vector. Default is 1:1 randomization, but more groups or unequal ratios are possible as well. E.g. for 1:1:2 randomization, use c(1, 1, 2). |
labels |
The labels for the assignments, given as a vector, e.g. c("treatment", "placebo"). The
length of |
Allocation of the subjects, given as a vector.
S.L. van der Pas (2019). Merged block randomisation: a novel randomisation procedure for small clinical trials. Clinical Trials 16(3):246-252.
mergedblocksmulti
to create allocations for multiple strata at the same time.
#Randomize 20 patients, 1:1 allocation, with labels "1" and "2". mergedblocks(20) #Randomize 50 patients, 1:1 allocation with labels "treatment" and "placebo". mergedblocks(100, labels = c("treatment", "placebo")) #Randomize 100 patients, 1:2:2 allocation with labels "placebo", #"treatment 1", and "treatment 2". mergedblocks(100, c(1, 2, 2), c("placebo", "treatment 1", "treatment 2"))
#Randomize 20 patients, 1:1 allocation, with labels "1" and "2". mergedblocks(20) #Randomize 50 patients, 1:1 allocation with labels "treatment" and "placebo". mergedblocks(100, labels = c("treatment", "placebo")) #Randomize 100 patients, 1:2:2 allocation with labels "placebo", #"treatment 1", and "treatment 2". mergedblocks(100, c(1, 2, 2), c("placebo", "treatment 1", "treatment 2"))
Function to carry out merged block randomization, for multiple strata.
mergedblocksmulti( K, n, ratio = c(1, 1), labels = as.character(1:length(ratio)) )
mergedblocksmulti( K, n, ratio = c(1, 1), labels = as.character(1:length(ratio)) )
K |
The number of strata. |
n |
The number of subjects to randomize. May be given as a single number, for the same number
of subjects per stratum, or as a vector or length |
ratio |
The desired randomization ratio, given as a vector. Default is 1:1 randomization, but more groups or unequal ratios are possible as well. E.g. for 1:1:2 randomization, use c(1, 1, 2). |
labels |
The labels for the assignments, given as a vector, e.g. c("treatment", "placebo"). The
length of |
Allocation of the subjects, given as a dataframe, with one column per stratum. Padded with NAs in case of different sample sizes per stratum.
S.L. van der Pas (2019). Merged block randomisation: a novel randomisation procedure for small clinical trials. Clinical Trials 16(3):246-252.
mergedblocks
for a version for a single stratum.
#Four strata, randomize 20 patients for each stratum, 1:1 allocation, #with labels "1" and "2". mergedblocksmulti(K = 4, n = 20) #Three strata, randomize 30, 40 and 50 patients for each stratum, #1:2 allocation, with labels "placebo" and "treatment". mergedblocksmulti(K = 3, n = c(30, 40, 50), ratio = c(1, 2), labels = c("placebo", "treatment"))
#Four strata, randomize 20 patients for each stratum, 1:1 allocation, #with labels "1" and "2". mergedblocksmulti(K = 4, n = 20) #Three strata, randomize 30, 40 and 50 patients for each stratum, #1:2 allocation, with labels "placebo" and "treatment". mergedblocksmulti(K = 3, n = c(30, 40, 50), ratio = c(1, 2), labels = c("placebo", "treatment"))