# Create car_strata variables
library(fastDummies)
library(dplyr)
x <- runif(100)
z <- cut(x, breaks=c(0, 0.25, 0.5, 0.75, 1.0))
z <- dummy_cols(z)
A <- car_ps(
z=z[, 2:5],
treat=c(0, 1, 2),
ratio=c(1, 1, 1),
imb_measure="Range"
)
Run the code above in your browser using DataLab