swap_treatment: Swap Treatment

View source: R/MinMSET.R

swap_treatmentR Documentation

Swap Treatment

Description

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.

Usage

swap_treatment(current_treatment,
               change,
               prev_index_list = NULL)

Arguments

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.

Value

Returns a new treatment vector.

Author(s)

Sebastian Schneider sschneider@coll.mpg.de; sebastian@sebastianschneider.eu, Giulia Baldini giulia.baldini@uni-bonn.de

Examples

swap_treatment(current_treatment = c(0, 2, 0, 1, 1, 0, 2, 1, 1, 0),
               change = 2)

minMSE documentation built on March 18, 2022, 8:05 p.m.