Double Machine Learning (DML) framework for causal inference in education: Teacher quality and learning outcomes in Tanzania.
# 🎓 Causal Impact of Teacher Quality on Tanzania CSEE Outcomes
## Double/Debiased Machine Learning (DML) with Instrumental Variables
**The first causal machine learning study of teacher quality effects on secondary education outcomes in Tanzania, using BEST administrative panel data (2020–2024).**
Motivation · Design · Methods · Results · Usage · Structure
---
## Motivation
My earlier project — BEST ML Forecasting — demonstrated that the qualified teacher ratio is the strongest *predictive* driver of Tanzania CSEE pass rates across 26 mainland regions. However, prediction is not causation: regions with more qualified teachers may also differ in wealth, governance capacity, or historical investment patterns, any of which could independently drive examination outcomes.
This project answers the question the forecasting model could not:
> **Does increasing the qualified teacher ratio *causally* improve CSEE pass rates — and by how much, for which regions, and under what conditions?**
Answering this requires a causal design that accounts for the endogeneity of teacher deployment: qualified teachers tend to be assigned to regions with better infrastructure and historically higher performance, creating a confounding structure that ordinary regression cannot disentangle.
---
## Causal Design
### Treatment Variable
**Qualified Teacher Ratio** (`qualified_teacher_ratio`): proportion of secondary school teachers holding full professional qualification, drawn from BEST annual reports.
### Outcome Variable
**CSEE National Pass Rate** (`csee_pass_rate`): percentage of Form 4 candidates awarded Division I–IV, reported annually by NECTA.
### Instrumental Variable
**Distance from Dar es Salaam** (`dist_km`): geodesic distance (kilometres) from each region's administrative capital to Dar es Salaam.
**Why this instrument is valid:**
| IV Condition | Justification |
|---|---|
| **Relevance** | Remoteness is a well-documented predictor of teacher deployment diff …