Data & Code
Publish the data and code or it didn’t happen *
The textbook is a complete, reproducible package of text, code, and data — all free. Get the data, get the code, set up your machine, and reproduce any table or graph in the book.
Get the data
All datasets on OSF
Raw and clean versions of every dataset. Download only what you need, or grab all clean datasets as one ZIP.
Dataset summaries
What's in each dataset: coverage, key variables, related case studies, sources, and licenses.
Load straight from code
Open any file directly — no download. For example, hotels-europe:
- R:
read.csv(url("https://osf.io/p6tyr/download")) - Python:
pd.read_csv("https://osf.io/p6tyr/download") - Stata:
import delimited "https://osf.io/p6tyr/download"
Get the code
da_case_studies on GitHub
Code to reproduce every table and graph for all 47 case studies, in R, Python, and Stata.
Folder conventions
da_case_studies for code and output, da_data_repo for data — each with its own subfolders.
Set up your machine
The fastest way to start is in the cloud — no install needed. Or set up locally in your language of choice; each guide installs the software, prepares folders, and connects code with data.
Run in the cloud — GitHub Codespaces ★
Best for starters. One click opens a ready-made environment in your browser — pre-configured for both R and Python, nothing to install, no version headaches. You get a full VS Code workspace on GitHub's servers; just open a case study and run it. Ideal for a first course or trying things out fast.
R (local)
R + RStudio, with renv restoring the exact package versions from the lockfile.
Python (local)
Uses uv: it installs the right Python and the exact packages from uv.lock in one step. Plus VS Code and Git.
Stata (local)
Folder setup and the few edits needed to run the do-files.
The book is language-neutral — R, Python, and Stata all work; compare the languages or read advice on learning to code. Results in the book come from R; Stata and Python match closely, with small differences from plotting defaults, randomization, and formula defaults.
Looking for more? Coding courses from zero, the AI course and open book, and interactive teaching apps all live in the open-source ecosystem.