Description Usage Arguments Details Value Examples
View source: R/make_tr_vec_permutation.R
Create a permutation matrix from possible treatment random assignments with uniform probability.
1 | make_tr_vec_permutation(N, p, R, seed = NULL, allow_repetitions = FALSE)
|
N |
number of units. |
p |
proportion of units assigned to treatment. |
R |
number of repetitions (treatment permutations). If |
seed |
random number for result replicability. |
allow_repetitions |
logical; if |
make_tr_vec_permutation
produces all possible (or a random sample of
all possible) treatment assignments when sampling without replacement, or a
random sample of possible treatment assignments when sampling with
replacement.
An R
* N
numeric matrix. Each row cooresponds to a treatment
assignment vector.
1 2 3 4 | make_tr_vec_permutation(N = 10, p = 0.2, R = 1, seed = 357)
make_tr_vec_permutation(N = 10, p = 0.2, R = 50, seed = 357)
make_tr_vec_permutation(N = 10, p = 0.2, R = 50, seed = 357,
allow_repetitions = TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.