if (FALSE) {
# Generate synthetic data
X <- matrix(rnorm(60), nrow = 10) # 10 units, 6 covariates
# Generate balanced randomizations with covariates
BalancedRandomizations <- generate_randomizations_exact(
n_units = 10,
n_treated = 5,
X = X,
randomization_accept_prob = 0.25 # Keep top 25% most balanced
)
}
Run the code above in your browser using DataLab