set.seed(42)
n <- 600
enfants <- data.frame(
scolarise = rbinom(n, 1, 0.72),
sexe = sample(c("H","F"), n, TRUE),
niveau = sample(c("primaire","secondaire"), n, TRUE),
poids = runif(n, 0.8, 1.3)
)
parite_education(enfants, "scolarise", "sexe",
poids="poids", var_niveau="niveau")
Run the code above in your browser using DataLab