randomize_treatment: randomize treatment to n units with probability pi then if...

View source: R/placebo-simulations.R

randomize_treatmentR Documentation

randomize treatment to n units with probability pi then if the number of treated units is zero, assign treatment to one unit uniformly at random and if the number of treated units exceeds a cap, remove treatment uniformly at random so it is exactly that cap

Description

randomize treatment to n units with probability pi then if the number of treated units is zero, assign treatment to one unit uniformly at random and if the number of treated units exceeds a cap, remove treatment uniformly at random so it is exactly that cap

Usage

randomize_treatment(pi, N, N1)

Arguments

pi,

the randomization probabilities

N,

the number of units

N1,

the cap on the number of treated units

Value

a binary vector of length N, with ones indicating assignment to treatment


synth-inference/synthdid documentation built on Jan. 26, 2024, 7:21 a.m.