# Synthetic teaching data only. No real individuals or empirical programme results.
# Run from this folder: Rscript generate_data.R
set.seed(20261005)
n <- 240
id <- seq_len(n)
age <- sample(18:29, n, replace = TRUE)
education <- factor(sample(c('School', 'Vocational', 'University'), n,
                           replace = TRUE, prob = c(.35, .45, .20)))
treatment <- sample(rep(0:1, each = n / 2))
# Assignment is random in this simulation; generated outcomes are illustrative.
probability <- plogis(-.25 + .4 * treatment + .25 * (education == 'Vocational') +
                     .55 * (education == 'University'))
employed <- rbinom(n, 1, probability)
# Continuous interview score; kept unrounded for the normal-model demonstration.
score_before <- rnorm(n, 50, 10)
score_after <- score_before + 2 + 3 * treatment + rnorm(n, 0, 6)
earnings <- ifelse(employed == 1, round(pmax(0, rnorm(n, 1700 + 150 * treatment, 350))), 0)
youth <- data.frame(id, age, education, treatment, employed,
                    earnings, score_before, score_after)
dir.create('data', showWarnings = FALSE)
write.csv(youth, 'data/synthetic_youth.csv', row.names = FALSE)
stopifnot(nrow(youth) == 240, !anyNA(youth), sum(treatment) == 120,
          all(employed %in% 0:1), all(earnings >= 0))
cat('Saved 240 SYNTHETIC observations; seed 20261005.\n')
