Generate simple randomization treatment assignments

car_sr(n, p_trt)

Arguments

n

Number of observations

p_trt

Proportion allotted to treatment

Value

A vector of treatment assignments as 0's and 1's based on simple randomization.

Examples

car_sr(10, p_trt=0.4)
#>  [1] 0 0 0 0 1 0 0 1 1 0