crd {FSM} | R Documentation |
Completely Randomized Design (CRD)
Description
Generates an assignment under completely randomized design (CRD).
Usage
crd(data_frame, n_treat, treat_sizes, control = FALSE)
Arguments
data_frame |
A data frame corresponding to the full sample of units. |
n_treat |
Number of treatment groups. |
treat_sizes |
A vector of treatment group sizes. If |
control |
If |
Value
The original data frame augmented with the column of the treatment indicator.
Author(s)
Ambarish Chattopadhyay, Carl N. Morris and Jose R. Zubizarreta.
References
Chattopadhyay, A., Morris, C. N., and Zubizarreta, J. R. (2020),
“Randomized and Balanced Allocation of Units into Treatment Groups Using the Finite Selection Model for R
”.
Examples
# Consider N = 12, n1 = n2 = n3 = 4.
df_sample = data.frame(index = 1:12, x = c(20,30,40,40,50,60,20,30,40,40,50,60))
# Draw a random assignment from CRD.
fc = crd(data_frame = df_sample, n_treat = 3, treat_sizes = c(4,4,4))
# Get vector of treatment assignments.
Z_crd = fc$Treat
[Package FSM version 1.0.0 Index]