# Two-arm Designs
blocks <- rep(c("A", "B","C"), times = c(50, 100, 200))
Z <- block_ra(blocks = blocks)
table(blocks, Z)
Z <- block_ra(blocks = blocks, prob = .3)
table(blocks, Z)
Z <- block_ra(blocks = blocks, block_prob = c(.1, .2, .3))
table(blocks, Z)
Z <- block_ra(blocks = blocks,
prob_unit = rep(c(.1, .2, .3),
times = c(50, 100, 200)))
table(blocks, Z)
Z <- block_ra(blocks = blocks, m = 20)
table(blocks, Z)
Z <- block_ra(blocks = blocks, block_m = c(20, 30, 40))
table(blocks, Z)
Z <- block_ra(blocks = blocks,
m_unit = rep(c(20, 30, 40),
times = c(50, 100, 200)))
table(blocks, Z)
block_m_each <- rbind(c(25, 25),
c(50, 50),
c(100, 100))
Z <- block_ra(blocks = blocks, block_m_each = block_m_each)
table(blocks, Z)
block_m_each <- rbind(c(10, 40),
c(30, 70),
c(50, 150))
Z <- block_ra(blocks = blocks, block_m_each = block_m_each,
conditions = c("control", "treatment"))
table(blocks, Z)
# Multi-arm Designs
Z <- block_ra(blocks = blocks, num_arms = 3)
table(blocks, Z)
block_m_each <- rbind(c(10, 20, 20),
c(30, 50, 20),
c(50, 75, 75))
Z <- block_ra(blocks = blocks, block_m_each = block_m_each)
table(blocks, Z)
Z <- block_ra(blocks = blocks, block_m_each = block_m_each,
conditions = c("control", "placebo", "treatment"))
table(blocks, Z)
Z <- block_ra(blocks = blocks, prob_each = c(.1, .1, .8))
table(blocks, Z)
Run the code above in your browser using DataLab