DeclareDesign / DesignLibrary

Library of Research Designs
https://declaredesign.org/library/
Other
30 stars 3 forks source link

Add block_prob_each argument to block_cluster_two_arm_designer #194

Closed macartan closed 6 years ago

jaspercooper commented 6 years ago

Adding this. I think, given that we are in a two-arm world, we can just use block_prob though:

from randomizr help:

block_prob | Use for a two-arm design in which block_prob describes the probability of assignment to treatment within each block. Must be in the same order as sort(unique(blocks)). Differs from prob in that the probability of assignment can vary across blocks.

block_prob_each | Use for a multi-arm design in which the values of block_prob_each determine the probabilities of assignment to each treatment condition. block_prob_each must be a matrix with the same number of rows as blocks and the same number of columns as treatment arms. Cell entries are the probabilities of assignment to treatment within each block. The rows should respect the ordering of the blocks as determined by sort(unique(blocks)). Use only if the probabilities of assignment should vary by block, otherwise use prob_each. Each row of block_prob_each must sum to 1.

jaspercooper commented 6 years ago

I'm actually just going to implement this as one argument, assignment_probs. When it's a scalar, block probs are equal, and when it's a vector of length N_blocks, then those are the probs used in the respective blocks ("as determined by sort(unique(blocks))").

If you have two blocks, for example, assignment_probs = .5 gets you 50/50 in each, while assignment_probs = c(.1,.9) gets you 10% treated in first and 90% in second.