swap_treatment | R Documentation |
Scrambles the elements of the vector and swaps a predefined number of elements. Afterwards, the vector is ordered according to the original ordering and returned.
swap_treatment(current_treatment, change, prev_index_list = NULL)
current_treatment |
a treatment vector to be changed. |
change |
number of elements that will be changed in the treatment vector. |
prev_index_list |
not used, needed for compatibility. |
Returns a new treatment vector.
Sebastian Schneider sschneider@coll.mpg.de; sebastian@sebastianschneider.eu, Giulia Baldini giulia.baldini@uni-bonn.de
swap_treatment(current_treatment = c(0, 2, 0, 1, 1, 0, 2, 1, 1, 0), change = 2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.