# Load the required packages
library(fabricatr)
library(estimatr)
library(randomizr)
# Set the seed for reproducibility
set.seed(385)
# Simulate the data
data <- fabricate( # fabricatr
N = 1000, # base
treat = complete_ra(N, m = 500), # randomizr
interviews = round(rnorm(N, mean = 10, sd = 2) + 5 * treat, digits = 0) # base
)
# Check the first few rows of the data
head(data)
ID treat interviews
1 0001 0 11
2 0002 1 15
3 0003 1 15
4 0004 1 16
5 0005 0 9
6 0006 0 11