← All projects
Bayesian statistics · Georgia Tech ISYE 6420

Bayesian Educational
Outcomes

Which factors predict how public-school students score in Math, Reading and Writing, and are the gaps by gender and test preparation real? Bayesian regression and MCMC in R on 30,641 students, with missing data filled by model-based imputation.

Rrstanarm (Stan)JAGSBayesFactorrandomForestR Markdown
01 · The question

What moves a test score?

The dataset records 30,641 students: gender, ethnic group, parents' education and marital status, lunch type, test preparation, sport, siblings, transport, weekly study hours, and scores from 0 to 100 in three subjects. Only 19,243 rows are complete. Transport is missing for 10% of students, and parent education and test prep for 6% each.

Dropping a third of the data would bias the answer toward students with complete records, so the first job was filling the gaps carefully.

02 · Method

Impute, fit, prune, check.

ImputeModel per gapFor each variable, a regression model and a random forest compete. The better one on held-out data fills the gaps.
FitBayesian regressionOne model per subject in Stan, with Normal(0, 2) priors on every coefficient.
PruneKeep what's crediblePredictors stay if their 95% credible interval excludes zero.
CheckHeld-out testSlimmer models are scored on about 2,200 rows set aside earlier.
CompareMCMC meansJAGS estimates group means with 95% HPD intervals, and Bayes factors test the gaps.
03 · Results

What the posterior says.

0correlation, Writing model on held-out students
0correlation, Reading model
0correlation, Math model
0points, mean Writing error (MAE)

Mean scores, 95% HPD intervals

SubjectFemaleMaleNo test prepTest prep
Reading72.6–73.165.6–66.166.8–67.373.5–74.0
Writing72.6–73.163.7–64.264.9–65.374.4–75.0
Math≈ 64.168.8–69.164.7–65.2≈ 69.6

With 30,000 students, the intervals are only a few tenths of a point wide, so every gap in the table is clearly real. Two Math cells show sample means.

Gender splits by subject

Girls score about 7 points higher in Reading and 9 in Writing. Boys score about 5 points higher in Math.

Test prep pays, most in writing

Students who completed test prep scored higher in all three subjects, by about 10 points in Writing and 7 in Reading.

Steady predictors

Parents' education, playing sport and the other two subject scores were credible predictors in every model. Lunch type and weekly study hours mattered for Math and Reading.

Imputation as a contest

Choosing each gap's filler by held-out accuracy, rather than one method for everything, kept every student in the analysis.

04 · Caveats

Where to be careful.

The models lean on the other scores. Each subject's model uses the other two scores as predictors, which is why the accuracy is so high. It explains scores well, but it isn't a forecast from background alone.

Pruning isn't formal model selection. Dropping predictors by credible interval is a practical shortcut. A fuller analysis would compare models with LOO or WAIC.

Imputation adds its own error. Each filled value carries model uncertainty that the downstream regressions don't see. Multiple imputation (for example, mice) would carry it through.