Three real analyses on Kenyan data — bank rates, pension allocation, M-PESA growth — implemented end-to-end in Stata. Replicating these in your practice environment is the most useful applied exercise in this course.
Project 1 — bank-rates spread
use bankrates.dta, cleargenerate spread = lending_rate - deposit_ratetsset month, monthlytsline spread, title("Lending-deposit spread") ytitle("Spread (pp)")* Linear time trendgenerate t = _nregress spread t, robust
Project 2 — pension allocation shift
use pension.dta, cleargenerate govt_share = govt_securities / totaltsset period, halfyearlytsline govt_share, title("Govt securities share of pension assets") ///ytitle("Share") yscale(range(0 1)) ylabel(0(0.1)1)* Trend break test (Chow): split at period 8generate t = _ngenerate t_post = (t > 8) * (t - 8)regress govt_share t t_post, robust
Project 3 — M-PESA growth rate
use mpesa.dta, cleartsset month, monthly* Year-on-year growthgenerate yoy = (volume / L12.volume - 1) * 100tsline yoy, title("M-PESA YoY volume growth") ytitle("YoY growth (%)") ///yline(0)
What you've learned
If you can load Kenyan data, transform it, run a panel regression with clustered SEs, and export an esttab table — you have working Stata at the level a Kenyan ministry, the World Bank country office, or a research consultancy expects. The next moves: ivreg2 for IV (ssc install ivreg2), reghdfe for high-dimensional FE, the synth or sdid suites for synthetic control.
Stata is invested-in once and used forever
The command grammar hasn't changed in 20+ years. A do-file you write today will run unchanged in 2045. That stability is worth a lot in a world where Python and R refactor every two years.
Exercise
A development-economics researcher has been hired by the World Bank's Africa region to evaluate a cash-transfer programme that started in three Kenyan counties in 2022. They have administrative data on 80,000 households (matched treatment and control), with monthly follow-up through 2025. The brief: produce a publication-ready impact evaluation in 4 weeks. Walk through how you'd structure the Stata do-file architecture, the estimation strategy, and the deliverables.