if (FALSE) {
# Generate synthetic data
X <- matrix(rnorm(100*5), 100, 5) # 5 covariates
# Generate 1000 randomizations for 100 units with 50 treated
rand_less_strict <- generate_randomizations_mc(
n_units = 100,
n_treated = 50,
X = X,
randomization_accept_prob=0.01,
max_draws = 100000,
batch_size = 1000)
# Use a stricter balance criterion
rand_more_strict <- generate_randomizations_mc(
n_units = 100,
n_treated = 50,
X = X,
randomization_accept_prob=0.001,
max_draws = 1000000,
batch_size = 1000)
}
Run the code above in your browser using DataLab