Learn R Programming

confidenceSim (version 0.1.0)

getBlockedArm: Get Blocked Arm

Description

Randomize patients to arms using blocked randomization.

Usage

getBlockedArm(numsubjects, num.per.block, prob = NULL)

Value

Return vector of arm allocations.

Arguments

numsubjects

Number of subjects to randomize.

num.per.block

Number from each arm per block. Block size is 'sum(num.per.block)'.

prob

Probability of randomization to each arm. Default assumes equal probability.

Details

To balance covariates, each block gets an equal distribution of treatment arms to remove the effect that could come from the block characteristics (e.g. covariates). If not balancing covariates, patients will be randomized according to ratios.

Examples

Run this code
arm <- getBlockedArm(500, c(1,1))

Run the code above in your browser using DataLab