test_scorea simulated test score for the student
schoolwhether the student attended public or private school
lotterywhether the student was entered into a lottery for a private-school voucher
groupthe racial/ethnic group of the student
acad_motivationthe overall level of involvement and concern of the student's parents for the student's academic performance
relig_motivationthe overall level of interest motivated by religion. This is potentially an issue because a large majority of urban private schools are Catholic.
School_data data frame comes from a simulation designed by the package author to
replicate the overall results but supporting a very different policy recommendation. WARNING: This is
just a simulation, reflecting one hypothesis about how the world might work. Don't be tempted
to draw conclusions about the actual factors involved in school performance from such simulated data.
lm(test_score ~ school, data = School_data) # the simulation mechanism itself: nstudents <- 500 acad_motivation <- rnorm(nstudents) group <- sample(c("black", "hispanic", "white"), replace = TRUE, size = nstudents) relig_motivation <- ifelse( group == "black", -1, ifelse(group == "white", 0, 1)) relig_motivation <- rnorm(nstudents, mean = relig_motivation) lottery <- (acad_motivation + relig_motivation) > 0 school <- ifelse( (runif(nstudents) + .8* lottery ) > 1, "private", "public") test_score <- rnorm(nstudents, mean = 100 - 5 * (school == "private") + 20 * acad_motivation) School_data <- data.frame(test_score, acad_motivation, group, relig_motivation, lottery, school)