A six-session workshop on the analysis of household survey data, taught in September 2026: from raw survey files to a reproducible result, working throughout with surveys from the region. The materials below are complete and open.
Sixteen notebooks: six sessions, three tutorials, and seven exercises. They are ordinary Jupyter notebooks and run anywhere the software is installed.
The shared server was rented for the teaching and is being shut down.
Before it goes, log in and download anything of yours you want to
keep — your own edited notebooks, and the
for-your-laptop folder in your home directory, which
holds the credentials that give the survey library its fast download
route. After that date the login will simply stop working.
Nothing else is lost: the notebooks, slides and notes are all on this site and in the materials repository, and the library reads the surveys directly once installed.
Most graduate training inverts the priority. Students learn fixed effects and GMM in some detail, but rarely learn how a survey is designed, where it breaks, and what its structure does and does not let them identify. Yet the design choices — multistage sampling, rotating and refreshment panels, attrition, the household that splits between rounds — are exactly what determine whether a clean-looking regression means anything.
A careful analyst needs both halves, and the second is the one usually missing. The workshop follows Deaton's progression from design to description to demand to dynamics, working throughout with data from the region: Ghana's Living Standards Surveys as the running local example, Uganda's National Panel Survey for the panel and demand material, and comparisons across the LSMS countries where they earn their place.
What to know before touching the data: population, frame, weights. Two-stage cluster sampling and stratification, worked through on Ghana's GLSS7 and a regional sample from Guinea-Bissau — reading a design back out of the weights it produced, and watching an unweighted population pyramid misstate the number of children.
The theory the measurement rests on. What object a consumption aggregate is standing in for, the household's dynamic problem and the marginal utility of money as a welfare index, and an explicit accounting of the assumptions — homotheticity, cardinalisation, separable durables — that dividing expenditure by a price index quietly buys.
How the number in the aggregate is actually produced: item lists, recall periods and diaries, own production and how to price it, durables and imputed rent, spatial deflation, equivalence scales. Then poverty and inequality on Ghana — FGT, Lorenz, Gini, Atkinson — weighted and unweighted, across four rounds.
Engel curves and the Working–Leser form on GLSS7; unit values and the quality correction; the rank of a demand system, and why rank above one means no single price index will do. Then a constant-Frisch-elasticity demand system fitted to Uganda's eight waves, which needs neither prices nor total expenditure, and the exact welfare cost of a price change rather than the first-order approximation.
Fixed effects and two-way fixed effects as a generalised double difference, strict exogeneity, attrition, and clustered inference. Worked on Ghana's GLSS1–2 farm panel, where Mundlak's management bias is visible in the data, and on Uganda's NPS; then pseudo-panels from repeated cross-sections, for when there is no panel to be had.
Where the methods break down: a full risk-sharing test on Uganda and why it has power only against idiosyncratic shocks, Nickell bias in short dynamic panels, non-classical measurement error, and endogeneity. The capstone takes a survey of your own choosing through a small analysis that runs from a clean kernel.
One deck per session, as projected in the room, plus a single set of running notes covering all six.
The installation instructions assume no prior Python and take you through it a step at a time. It is roughly a 1.3 GB download, so do it on a connection you trust. Installed locally, the library downloads the survey data itself; the sessions read pre-built extracts only because that was faster in a classroom.
Sessions 4 to 6 also import datamat, which is not pulled in
as a dependency, so install it alongside:
pip install LSMS_Library datamat jupyterlab.
If something does not work, please say so. Open an issue at ligon/hhsurveys for anything about the workshop materials, or at ligon/LSMS_Library for the library itself — a bad extract, a country that will not load, a variable that is not what it claims. Either is more useful than working around it quietly: the library is a work in progress and these reports are how it improves.
A World Bank Microdata account was not needed during the workshop and is still not required, but it is free and worth having for your own research; the installation page explains where the API key goes.
The hands-on work uses LSMS_Library,
an open-source Python package giving a uniform interface to the household
surveys of roughly forty countries, together with
CFEDemands for the demand
system in sessions 4 to 6 and DataMat
for labelled linear algebra. All three are under active development, and
the workshop was taught against LSMS_Library 0.14.0 and
CFEDemands 0.10.0.
World Bank microdata cannot be freely redistributed, so the sessions worked from harmonised extracts prepared in advance. The materials repository contains code and text only — no survey data.