This book is Work in Progress. I appreciate your feedback to make the book better.

Resources

Every chapter carries its own Reading boxes and footnotes: the one source that belongs to the argument being made on that page. This page is something else — the standing collection, kept in a single file so that a dead link has to be fixed once rather than eleven times. It is ordered like the book itself, and every entry says what it is for, because a bare URL ages badly and a reason does not.

The works this book actually cites are a different list, generated from references.bib and kept on the References page. This one is for what to read next; that one is for what the argument rests on.

Start Here

Five things this book leans on more than any others. If you read nothing else on this page, read these.

  • R for Data Sciencehttps://r4ds.hadley.nz/ — Wickham, Çetinkaya-Rundel and Grolemund. The tidyverse from the ground up, free and constantly revised. The second edition is the one to use; the widely bookmarked r4ds.had.co.nz is the retired first edition.
  • Statistical Inference via Data Science: A ModernDive into R and the Tidyversehttps://moderndive.com/v2/ — Ismay, Kim and Valdivia. Statistical inference through visualisation and regression rather than through a table of tests. The package it ships is used in this book. Make sure you land on /v2/; the bare address still serves the retired first edition.
  • Introduction to Econometrics with Rhttps://www.econometrics-with-r.org/ — Hanck, Arnold, Gerber and Schmelzer. Stock and Watson's course rewritten as runnable R. The bridge from this book towards a proper econometrics sequence.
  • Discovering Statisticshttps://www.discoveringstatistics.com/ — Andy Field. Statistics taught as a story with jokes in it, and the standing proof that a textbook is allowed to have a voice. His An Adventure in Statistics goes furthest: a science-fiction novel with the statistics inside the plot.
  • Causal Inference: The Mixtapehttps://mixtape.scunning.com/ — Scott Cunningham. Free online, R and Stata side by side. The data behind Section 9.1 comes from here. The online edition is now the in-progress second edition, retitled Causal Inference: The Remix.

What Data Are

Before the methods, the object. Three pieces that take the word itself seriously.

  • Was sind eigentlich Daten?https://libreas.eu/ausgabe23/02voss/ — Jakob Voß, LIBREAS. Library Ideas 23 (2013), 4–11. German. Traces the word from datum, the given, through to research data management, and argues that data are always the product of a decision to record something in a particular way.
  • Data Feminismhttps://data-feminism.mitpress.mit.edu/ — D'Ignazio and Klein, MIT Press 2020, free in full. On who gets counted, who does the counting, and what happens to everything that does not fit the categories.
  • "Raw Data" Is an Oxymoronhttps://mitpress.mit.edu/9780262518284/raw-data-is-an-oxymoron/ — Lisa Gitelman (ed.), MIT Press 2013. The title is the argument. Not free, but the introduction alone is worth the library trip.

Learning R and the Craft

  • What They Forgot to Teach You About Rhttps://rstats.wtf/ — Bryan, Hester, Pileggi and Aja. Project structure, paths, the fresh R session, what belongs in version control. Everything that goes wrong before the statistics start.
  • CRAN Task Viewshttps://cran.r-project.org/web/views/ — one curated page per field, listing the packages that field actually uses. The fastest orientation there is when you enter a new area.
  • bookdown: Authoring Books and Technical Documents with R Markdownhttps://bookdown.org/yihui/bookdown/ — Yihui Xie. The manual for the machinery this book is built on.
  • Posit Cheatsheetshttps://opensource.posit.co/resources/cheatsheets/ — one page per package, printable, worth pinning next to the desk.
  • Advanced Rhttps://adv-r.hadley.nz/ — Hadley Wickham. For the day a function stops behaving and you need to know what R is actually doing.

Books Built the Same Way

Open textbooks written in bookdown or Quarto. Worth reading twice: once for the content, once for how they are made.

  • psyTeachRhttps://psyteachr.github.io/ — University of Glasgow, School of Psychology and Neuroscience, led by Lisa DeBruine and Dale Barr. An entire curriculum published as linked open books. The webexercises package that produces the fill-in and multiple-choice questions throughout this book comes from them.
  • rstudio4edu: A Handbook for Teaching and Learning with R and RStudiohttps://rstudio4edu.github.io/rstudio4edu-book/ — Desirée De Leon and Alison Hill. How to build teaching material that looks like somebody cared; the chapter Make it fancier is the practical guide to customising a bookdown site's CSS, fonts and table of contents.
  • Reproducible Medical Research with Rhttps://bookdown.org/pdr_higgins/rmrwr/ — Peter D. R. Higgins, University of Michigan. A domain-specific version of the same idea, and a good model for how to write for readers who did not come to learn programming.
  • Exercises for Introduction to the New Statisticshttps://bookdown.org/pbaumgartner/itns-exercises/ — Peter Baumgartner. Companion exercises to Cumming and Calin-Jageman's estimation-first textbook. Unfinished and open about it, but a useful example of learning in public.

Showing Data

  • Fundamentals of Data Visualizationhttps://clauswilke.com/dataviz/ — Claus Wilke. Free, opinionated, organised by the question "what am I trying to show?" rather than by chart type. The chapter on telling a story is the source of the argument in Section 1.2.
  • Information Is Beautifulhttps://informationisbeautiful.net/ — David McCandless. Where the dog data of Chapter 5 comes from, and a standing argument that a chart can be an artefact in its own right.
  • Data Visualization: A Practical Introductionhttps://socviz.co/ — Kieran Healy. The social-science counterpart, with the ggplot2 code left in.
  • Our World in Datahttps://ourworldindata.org/ — long series on almost everything, with the sources named and the data downloadable. A model of how to document a figure.

Comparing and Modelling

  • Model to Meaninghttps://marginaleffects.com/ — Vincent Arel-Bundock, Université de Montréal. Documentation for the marginaleffects package, and much more than documentation: a coherent account of how to turn any fitted model into predictions, comparisons, slopes and hypothesis tests. Same author as modelsummary, which produces the regression tables in this book. This is the natural companion to Section 6.6.
  • Common statistical tests are linear modelshttps://lindeloev.github.io/tests-as-linear/ — Jonas Kristoffer Lindeløv. The cheat sheet that Section 6.9 works through and extends.
  • Regression and Other Storieshttps://avehtari.github.io/ROS-Examples/ — Gelman, Hill and Vehtari. The book that takes "what does this coefficient actually mean?" more seriously than any other.
  • UCLA Statistical Methods and Data Analyticshttps://stats.oarc.ucla.edu/ — worked examples for nearly every model in R, Stata and SPSS. The place to look when the output has a term you do not recognise.
  • Statistics By Jimhttps://statisticsbyjim.com/ — Jim Frost. Plain-language explanations of p-values, coefficients and diagnostics, written for people who have to interpret output rather than derive it.
  • StatQuesthttps://www.youtube.com/@statquest — Josh Starmer. Ten-minute videos that build each method from the ground up. The jingles are not a mistake; they are why it works.
  • Cross Validatedhttps://stats.stackexchange.com/ — the statistics arm of Stack Exchange. Search before asking; the answer is usually eight years old and better than anything written since.

Causality and Identification

  • The Effecthttps://theeffectbook.net/ — Nick Huntington-Klein. Free online, and the one book that puts research design before estimators. The natural next step after Chapter 9.
  • Mastering Econometricshttps://learn.mru.org/courses/mastering-econometrics — Joshua Angrist's free video course. The designs told as stories, with the arithmetic kept visible.
  • Lecture Notes on Identification Strategieshttps://home.cerge-ei.cz/jurajda/rms07b.pdf — Štěpán Jurajda, CERGE-EI. Forty compact pages that lay out the whole map: the search for variation, natural experiments, internal and external validity, and where each approach fails.
  • Causal Inference: What Ifhttps://miguelhernan.org/whatifbook — Hernán and Robins. The epidemiological tradition, with causal graphs where economics uses instruments. Free, and worth reading precisely because the vocabulary differs.
  • A cursory review of the identification strategieshttps://doi.org/10.1186/s40100-015-0042-5 — Santeramo (2015). Short review of the older meaning of identification: how supply and demand are separated out of one cloud of price-quantity pairs.
  • Causal Inferencehttps://bookdown.org/gabc91/causinf/ — Gabriel Carrasco. Not a textbook but a worked project, and the shortest route to seeing g-computation and the parametric g-formula actually run in R. The theory behind it belongs to Hernán and Robins above; take this as the example, not the reference.

Getting Data Out of the Web

Text, Space and the Rest

  • Text Mining with Rhttps://www.tidytextmining.com/ — Julia Silge and David Robinson. The tidytext approach used in Section 3.2, from its authors.
  • Text Analysis with Rhttps://m-clark.github.io/text-analysis-with-R/ — Michael Clark, University of Michigan. Goes further than this book currently does, through topic models and word embeddings, with the code readable throughout.
  • Spatial Data Science with Rhttps://rspatial.org/analysis/7-spregression.html — Robert J. Hijmans, author of terra. The spatial-regression chapter, the natural continuation of Section 3.3. Use this address; the older /raster/ path is labelled outdated on the site itself.

Measurement and Latent Variables

Where the Data Come From