Assigns units to treatment conditions, adding the assignment variable (Z
by convention) to the data. The randomization itself is usually a randomizr
function such as randomizr::complete_ra().
Arguments
- ...
(optional) Named arguments forwarded to
fabricatr::fabricate(). Unquoted expressions are evaluated lazily in the caller's environment with access to the current data frame.- label
(optional) Step label. Defaults to
"assignment".- draws
(optional) Number of nested draws for this step. Defaults to
1. When> 1, the step is re-executeddrawstimes for each upstream draw during nested simulation.
Value
A design_step (class c("design_step", "dd", "function")): a
function that takes the current data frame and returns it with the
declared columns added. Add it to a design with +.
See also
Other design declarations:
declare_estimator(),
declare_inquiry(),
declare_measurement(),
declare_model(),
declare_notes(),
declare_parameters(),
declare_sampling(),
declare_step(),
declare_test()