blkrandomization: Blocked randomization

Description Usage Arguments Value Examples

View source: R/blkrandomization.R

Description

The fuction is used to generate treatment assignments based on blocked randomization.

Usage

1
blkrandomization(n, blocksize, block)

Arguments

n

numeric number of subjects who will be randomized

blocksize

numeric value of block size used for blocked randomization

block

vector of treatment blocks used for blocked randomization

Value

trt a sequence of treatment assignments

Examples

1
2
3
4
blocksize <- 4
block <- c(1, 2, 3, 4) # treatment 1, 2, 3, 4
n <- 35
blkrandomization(n, blocksize, block)

Example output

 [1] 1 3 2 4 3 2 4 1 3 1 4 2 1 2 3 4 4 1 2 3 3 1 4 2 1 2 3 4 2 4 3 1 1 3 2

Minirand documentation built on Jan. 26, 2020, 9:10 a.m.