Open Source · MIT License

Interactive tools for
development economics

A suite of 11 open-source Shiny apps for impact evaluation, poverty analysis, program design, and data exploration. Built for researchers, practitioners, and students working in global development.

11
Interactive Apps
6
Python Shiny
5
R Shiny
4
Categories
MIT
License

The Apps

Organized into four categories spanning the full lifecycle of development economics work.

🎯

Impact Evaluation & Econometrics

4 apps · Design and analyze causal studies
Python Shiny

RCT Power Calculator

Compute sample size, statistical power, and minimum detectable effect size for randomized controlled trials. Supports cluster randomization and multiple treatment arms with ICC adjustment.

Sample sizePower curvesMDECluster RCTICC
Python Shiny

DiD Simulator

Simulate difference-in-differences designs with OLS output, event-study coefficient plots, and automatic parallel trends violation detection.

Parallel trendsEvent studyOLS regressionVisualization
R Shiny

RDD Explorer

Explore sharp and fuzzy regression discontinuity designs with local polynomial estimation, McCrary manipulation testing, and bandwidth sensitivity analysis.

Sharp RDDFuzzy RDDMcCrary testBandwidth
Python Shiny

Synthetic Control Visualizer

Visualize the synthetic control method with constrained optimization, in-space and in-time placebo tests, gap plots, and pre-treatment fit diagnostics.

SCMPlacebo testsGap plotsDonor weights
📊

Poverty & Inequality

3 apps · Measure and decompose welfare outcomes
R Shiny

Gini & Lorenz Curve Tool

Calculate the Gini coefficient, Theil index, and Palma ratio from generated or uploaded distributions. Compare distributions side by side with interactive Lorenz curves.

GiniTheilPalma ratioLorenz curve
Python Shiny

MPI Explorer

Explore the Multidimensional Poverty Index using the Alkire-Foster method. Radar charts, decomposition by dimension, and sensitivity analysis to the poverty cutoff (k).

Alkire-FosterMPIRadar chartsCutoff sensitivity
R Shiny

Poverty Line Analysis

Compute FGT(0), FGT(1), FGT(2) and Watts indices against World Bank international poverty lines. Simulate pro-poor growth and redistribution scenarios.

FGT indicesPoverty linesWatts indexSimulations
📋

Program Design & Management

3 apps · Plan, cost, and track development programs
Python Shiny

Theory of Change Visualizer

Build interactive ToC diagrams with sector templates for Education, Health, Livelihoods, and WASH. Auto-generates narrative descriptions and exportable summaries.

ToC diagramsSector templatesNarrative exportInteractive
Python Shiny

Cost-Benefit Analysis Tool

Calculate NPV, BCR, and IRR with tornado diagrams and Monte Carlo simulation. Includes a cost-effectiveness tab benchmarked against GiveWell thresholds.

NPV / BCR / IRRMonte CarloTornadoGiveWell CEA
R Shiny

LogFrame Builder

Build logical frameworks with editable matrices, indicator tracking with progress bars, results chain visualization, and HTML/CSV export.

LogFrame matrixIndicator trackingResults chainExport
🌍

Data Exploration

1 app · Explore global development data
R Shiny

WDI Dashboard

Explore 15 key development indicators across 50 countries and 6 regions using World Bank WDI data. Time series, cross-country scatter plots, regional comparisons, and downloadable data tables.

World Bank WDITime seriesCross-countryData download

Getting Started

Clone the repo and run any app locally in under two minutes. No API keys or external datasets required.

1 Python Shiny Apps

6 apps built with Python Shiny. Each has its own requirements.txt.

# Clone the repository
git clone https://github.com/Varnasr/deveconomics-toolkit.git
cd deveconomics-toolkit

# Pick any Python app
cd python-shiny/rct-power-calculator

# Create a virtual environment (recommended)
python -m venv .venv
source .venv/bin/activate

# Install dependencies and run
pip install -r requirements.txt
shiny run app.py

Opens at http://127.0.0.1:8000

2 R Shiny Apps

5 apps built with R Shiny. Standard CRAN packages.

# Install R dependencies (once)
install.packages(c(
  "shiny", "ggplot2", "dplyr",
  "tidyr", "DT"
))

# Run any R app
shiny::runApp("r-shiny/rdd-explorer")

Or from the terminal:

cd r-shiny/rdd-explorer
Rscript -e "shiny::runApp('.')"

Opens at http://127.0.0.1:3838 (or the port R assigns)

Detailed Documentation

Expand any app below for full usage instructions, inputs, outputs, and methodological notes.

RCT Power Calculator
Python

Overview

Computes the required sample size, statistical power, or minimum detectable effect (MDE) for two-arm and multi-arm randomized controlled trials — the workhorse design in development economics.

Inputs

  • Solve for: Choose between Sample Size, Power, or MDE
  • Significance level (α): Type I error rate (default 0.05)
  • Power (1-β): Probability of detecting a true effect (default 0.80)
  • Effect size (Cohen's d): Standardized effect size
  • Number of treatment arms: 1 to 5 arms with Bonferroni correction
  • Cluster randomization: Toggle cluster-level assignment with cluster size and ICC

Outputs

  • Calculated result (sample size, power, or MDE) with formula shown
  • Power curve plot across a range of sample sizes
  • Design effect calculation for cluster RCTs

Methods

Uses the standard normal approximation for power analysis. For cluster RCTs, applies the design effect formula: DE = 1 + (m - 1) × ICC, where m is the cluster size. Multi-arm trials apply a Bonferroni correction to the significance level.

Run it

cd python-shiny/rct-power-calculator
pip install -r requirements.txt && shiny run app.py
Difference-in-Differences Simulator
Python

Overview

Generates synthetic panel data and estimates difference-in-differences models with full regression output. Designed to help students and practitioners build intuition for the assumptions behind DiD.

Inputs

  • Number of units: Total units in the panel (treatment + control)
  • Time periods: Number of pre- and post-treatment periods
  • Treatment effect: True ATT injected into the data
  • Treatment timing: Period when treatment begins
  • Parallel trends violation: Slider to introduce differential pre-trends
  • Noise level: Standard deviation of the error term

Outputs

  • Raw data panel plot (treatment vs. control over time)
  • OLS regression table with coefficient estimates, SEs, and p-values
  • Event-study plot with dynamic treatment effects and confidence intervals
  • Parallel trends diagnostic

Methods

Implements the canonical two-way fixed effects estimator: Y = α + β₁Treat + β₂Post + δ(Treat × Post) + ε. The event-study specification replaces the single post indicator with period-specific dummies.

Run it

cd python-shiny/did-simulator
pip install -r requirements.txt && shiny run app.py
Regression Discontinuity Explorer
R

Overview

Interactive tool for exploring sharp and fuzzy RD designs. Visualize the discontinuity, test for manipulation, and assess sensitivity to bandwidth and polynomial order.

Inputs

  • Design type: Sharp or Fuzzy RDD
  • Sample size: Number of observations
  • Treatment effect: True discontinuity jump
  • Cutoff: Running variable threshold
  • Bandwidth: Window around the cutoff for local estimation
  • Polynomial order: Degree of the local polynomial (1 or 2)
  • Compliance rate (fuzzy): Fraction of units that comply with assignment

Outputs

  • Scatter plot with fitted lines on both sides of the cutoff
  • Local polynomial regression estimates
  • McCrary density test for manipulation of the running variable
  • Bandwidth sensitivity plot showing how estimates vary

Methods

Sharp RDD estimates the LATE at the cutoff using local polynomial regression. Fuzzy RDD instruments actual treatment with the assignment indicator (2SLS). McCrary test checks for bunching at the cutoff.

Run it

Rscript -e "shiny::runApp('r-shiny/rdd-explorer')"
Synthetic Control Visualizer
Python

Overview

Implements the synthetic control method for comparative case studies where a single unit receives treatment. Constructs a weighted combination of donor units that approximates the treated unit's pre-treatment trajectory.

Inputs

  • Number of donor units: Size of the donor pool
  • Time periods: Pre- and post-treatment periods
  • Treatment effect: True effect injected post-treatment
  • Treatment timing: Period when intervention begins
  • Noise level: Idiosyncratic variation in unit outcomes

Outputs

  • Treated unit vs. synthetic control time series
  • Gap plot (difference between treated and synthetic)
  • Donor unit weights table
  • In-space placebo tests (reassign treatment to each donor)
  • Pre-treatment RMSPE fit diagnostic

Methods

Solves a constrained optimization problem to find non-negative donor weights that minimize pre-treatment RMSPE. Placebo tests assess whether the estimated gap is unusually large relative to placebo gaps. Based on Abadie, Diamond & Hainmueller (2010).

Run it

cd python-shiny/synthetic-control
pip install -r requirements.txt && shiny run app.py
Gini & Lorenz Curve Tool
R

Overview

Calculate and visualize inequality measures from income or expenditure distributions. Compare two distributions side by side to see how policy interventions or structural changes affect inequality.

Inputs

  • Distribution type: Log-normal, Pareto, or custom data upload
  • Parameters: Mean, standard deviation (log-normal) or shape parameter (Pareto)
  • Sample size: Number of observations to generate
  • Comparison mode: Toggle a second distribution for side-by-side analysis

Outputs

  • Interactive Lorenz curve with 45-degree equality line
  • Gini coefficient, Theil index (GE(1)), Palma ratio (top 10% / bottom 40%)
  • Income share by quintile table
  • Kernel density plot of the distribution

Run it

Rscript -e "shiny::runApp('r-shiny/gini-lorenz')"
Multidimensional Poverty Index Explorer
Python

Overview

Explore multidimensional poverty using the Alkire-Foster counting approach. Understand how the choice of dimensions, indicators, weights, and the poverty cutoff (k) affect who is identified as poor.

Inputs

  • Dimensions & indicators: Health, Education, Living Standards with sub-indicators
  • Weights: Adjustable weights for each indicator (equal or custom)
  • Poverty cutoff (k): Fraction of weighted deprivations needed to be MPI-poor (default 1/3)
  • Population size: Number of synthetic households

Outputs

  • MPI value (H × A: headcount ratio × average intensity)
  • Radar chart showing deprivation rates by indicator
  • Dimensional decomposition bar chart
  • Sensitivity plot: MPI as a function of the cutoff k

Methods

Implements Alkire & Foster (2011). Each household is assigned a deprivation score across weighted indicators. Those whose score exceeds k are identified as multidimensionally poor. The MPI decomposes into incidence (H) and intensity (A).

Run it

cd python-shiny/mpi-explorer
pip install -r requirements.txt && shiny run app.py
Poverty Line Analysis
R

Overview

Analyze poverty using the Foster-Greer-Thorbecke family of indices against international and custom poverty lines. Simulate how economic growth and redistribution affect poverty outcomes.

Inputs

  • Poverty line: $2.15, $3.65, $6.85 (2017 PPP) or custom value
  • Distribution: Log-normal income with adjustable mean and inequality
  • Growth scenario: Uniform growth rate applied to all incomes
  • Redistribution scenario: Transfer from top to bottom quintile

Outputs

  • FGT(0): Headcount ratio — share of population below the poverty line
  • FGT(1): Poverty gap — average distance below the line
  • FGT(2): Squared poverty gap — severity-weighted measure
  • Watts index: Log-based measure sensitive to the poorest
  • Before/after comparison under growth and redistribution

Methods

Implements Foster, Greer & Thorbecke (1984): FGT(α) = (1/n) ∑ [(z - yᵢ)/z]𝑞 for yᵢ < z. Higher α gives more weight to the poorest. The Watts index uses the log ratio: W = (1/n) ∑ ln(z/yᵢ).

Run it

Rscript -e "shiny::runApp('r-shiny/poverty-line-analysis')"
Theory of Change Visualizer
Python

Overview

Build interactive Theory of Change diagrams for development programs. Start from sector-specific templates or build from scratch. Generates visual diagrams and narrative summaries ready for donor proposals.

Inputs

  • Sector template: Education, Health, Livelihoods, WASH, or blank
  • Components: Inputs, Activities, Outputs, Outcomes, Impact (editable at each level)
  • Assumptions: Add assumptions and risks at each causal link
  • Indicators: Attach measurable indicators to outputs and outcomes

Outputs

  • Visual ToC diagram with color-coded levels and connecting arrows
  • Auto-generated narrative description
  • Exportable summary for reports and proposals

Run it

cd python-shiny/theory-of-change
pip install -r requirements.txt && shiny run app.py
Cost-Benefit Analysis Tool
Python

Overview

A comprehensive CBA/CEA calculator for development projects. Computes standard investment metrics, runs sensitivity analysis, and benchmarks cost-effectiveness against GiveWell thresholds.

Inputs

  • Project horizon: Number of years (1-30)
  • Discount rate: Social discount rate for present value calculations
  • Costs: Year-by-year cost streams (initial + recurring)
  • Benefits: Year-by-year monetized benefit streams
  • Monte Carlo parameters: Distribution assumptions for uncertainty analysis

Outputs

  • Net Present Value (NPV), Benefit-Cost Ratio (BCR), Internal Rate of Return (IRR)
  • Cumulative NPV chart over the project horizon
  • Tornado diagram showing sensitivity to each input parameter
  • Monte Carlo histogram of NPV distribution with confidence intervals
  • Cost-effectiveness ratio benchmarked against GiveWell's $50-$150/DALY thresholds

Run it

cd python-shiny/cost-benefit-analysis
pip install -r requirements.txt && shiny run app.py
LogFrame Builder
R

Overview

Build and manage logical frameworks for development projects with editable matrices, progress tracking, and sector-specific templates aligned with major donor requirements.

Inputs

  • Template: Choose from 6 sector templates or start blank
  • Hierarchy levels: Goal, Purpose, Outputs, Activities
  • Indicators: OVI (Objectively Verifiable Indicators) with baselines and targets
  • Means of verification: Data sources for each indicator
  • Assumptions: Risks and conditions at each level

Outputs

  • Standard 4×4 LogFrame matrix (interactive, editable)
  • Indicator tracking dashboard with progress bars
  • Results chain visualization (vertical flow diagram)
  • Export to HTML and CSV

Run it

Rscript -e "shiny::runApp('r-shiny/logframe-builder')"
World Development Indicators Dashboard
R

Overview

Explore World Bank development data with interactive visualizations. Compare countries and regions across key indicators spanning economic growth, health, education, and infrastructure.

Inputs

  • Indicator: Choose from 15 development indicators (GDP per capita, life expectancy, enrollment rates, etc.)
  • Countries: Select up to 50 countries
  • Regions: 6 World Bank regions for aggregate comparison
  • Time range: Adjustable year slider

Outputs

  • Time series line charts for selected countries
  • Cross-country scatter plots (choose X and Y indicators)
  • Regional comparison bar charts
  • Downloadable data tables (CSV)

Run it

Rscript -e "shiny::runApp('r-shiny/wdi-dashboard')"

Deployment

Each app is self-contained and can be deployed independently to any of these platforms.

PlatformBest ForHow
shinyapps.io R Shiny apps — free tier available rsconnect::deployApp("r-shiny/rdd-explorer")
Hugging Face Spaces Python Shiny apps — free CPU instances Create a Space with Docker SDK, copy the app directory
Shinylive (WASM) Python apps — runs entirely in the browser shinylive export app.py site/
Posit Connect Enterprise deployment for R + Python Follow Posit Connect documentation
Docker Any app — portable containers Dockerfile per app (see repo)
Your website Embed deployed apps via iframe <iframe src="https://app-url" width="100%" height="800"></iframe>

Tech Stack

Built on well-supported, production-ready frameworks.

Python Shiny · 6 apps

Modern reactive web apps in Python, deployable as Shinylive for zero-server client-side execution via WebAssembly.

shiny ≥ 0.6.0numpyscipymatplotlibpandasstatsmodels

R Shiny · 5 apps

The original reactive framework for statistical computing, with deep integration into R's visualization and data analysis ecosystem.

shinyggplot2dplyrtidyrDT

All apps generate synthetic data for demonstration — no external API calls or datasets required.

Key References

The methods behind these tools come from the development economics canon.

2009 Angrist, J. & Pischke, J. Mostly Harmless Econometrics. Princeton University Press.
2007 Duflo, E., Glennerster, R. & Kremer, M. Using Randomization in Development Economics Research. Handbook of Development Economics.
2010 Abadie, A., Diamond, A. & Hainmueller, J. Synthetic Control Methods for Comparative Case Studies. JASA.
2008 Imbens, G. & Lemieux, T. Regression Discontinuity Designs: A Guide to Practice. Journal of Econometrics.
2011 Alkire, S. & Foster, J. Counting and Multidimensional Poverty Measurement. Journal of Public Economics.
1984 Foster, J., Greer, J. & Thorbecke, E. A Class of Decomposable Poverty Measures. Econometrica.
1994 Card, D. & Krueger, A. Minimum Wages and Employment: A Case Study of the Fast-Food Industry. AER.