rand_arm: Generate block randomized arms

View source: R/randomization.R

rand_armR Documentation

Generate block randomized arms

Description

Generate block randomized arms

Usage

rand_arm(nsbj, ratio, arm_name = paste("arm", 1:length(ratio), sep = "_"))

Arguments

nsbj

an integer for total number of subjects to be randominzed

ratio

the allocation ratio with block size of sum(ratio)

arm_name

a vector of characters for arms

Value

a vector of length nsbj with randomized treatment arms

Examples

rand_arm(nsbj = 1, ratio = c(1, 1))
rand_arm(nsbj = 12, ratio = c(2, 2, 1))
rand_arm(nsbj = 4, ratio = c(1, 2, 0, 1))


zhuob/R4ClinicalTrial documentation built on Feb. 4, 2025, 1:15 a.m.