# 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 = simple_ra(N, prob = 0.5), # 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 1 13
2 0002 0 8
3 0003 1 15
4 0004 1 17
5 0005 0 12
6 0006 1 15