Publications by Thomas Wood (

Code lab cartography

10.04.2025

Cartography Not even a real lab today – just a brief tour of the cartographical capabilities built into R. By way of caveats: R can do full blown geographic computation – proximty math, density counts, geographical statistics. But that’s not what we’re talking about today. You can do proper cartography. But we’re just doing a thin si...

3564 sym R (8148 sym/16 pcs) 11 img

Document

30.01.2025

Lists are important As trained statisticians I’m sure you have a deep affinity for tabular data. But as statistical programmers, as people who want just enough coding to be dangerous, lists are your beau ideal. They are the most general tool you can deploy: A list of models, estimated on subsets of your data A list of data frames, bootstrapped...

4083 sym R (14222 sym/27 pcs) 4 img 1 tbl

impromptu_microtask

22.01.2025

Imagine a coauthor storms into your office one day and exclaims: oh those survey firm dummies screwed up bad! I wanted our three country, three wave data in a nice long table–but instead, we got `COUNTRYCODE_wave_WAVEN_.csv` what dummies! As the menschy coauthor you are, you don’t sit down and star writing "wave_1/USA_wave_1.csv" %>% read_...

505 sym R (1420 sym/2 pcs)

Lab 17

16.01.2025

How lovely to be back! Oh it’s nice to be back. I had a very memorable experience at Melbourne’s Center for Behavior Change last semester. Terms of academic employment are very distinct in different countries, and this was illuminating. What topics should we cover this semester? We’ve covered a lot of ground to date, and at least so far a...

2416 sym R (2654 sym/4 pcs) 2 img

Scraping Json

24.07.2024

Loading a json object Often when you’re interested in some super complicated data presentation online, and converting the underlying data to a nice table, there’s a super elegant way to proceed lurking underneath the site. Javascript is the way super rich maps and graphs are built online When you imagine: a cool map like this from the Time...

2868 sym R (1128 sym/3 pcs) 5 img

Document

09.07.2024

Web scraping Web scraping is the process of programmaticaly loading a large number of static html pages inside R, and turning tables or text or some other data on those static pages into tabular data we can use for stats. Scraping is a legal grey area. Many sites expressly forbid the practice–while the owners of a data set don’t mind using t...

6344 sym R (5315 sym/15 pcs) 9 img

Predicting Box Office Multiples

17.06.2024

When does a movie have box office ‘legs’? Perhaps the most famous dictum in Hollywood production comes from the dean of American screenwriters, two time Oscar winner William Goldman: No one knows anything Not one person in the entire motion picture field knows for a certainty what’s going to work. Every time out it’s a guess—and, if ...

3821 sym R (159 sym/1 pcs) 2 img 1 tbl

Dates and Lubridate

12.06.2024

dates and lubridate A couple of simple exercises to reprise the lubridate toolkit. We’ll also be using our familiar tidy tools–specifically, dplyr and purrr. First–excess mortality is a concept public health uses to measure the net effect of a pandemic/war some exogenous shock to mortality data, after adjusting for the regular pattern of ...

973 sym R (445 sym/2 pcs)

Succession plans for post estimation tools

05.06.2024

Should we abandon emmeans for marginaleffects? A couple of labs ago I provided you the memorable while still deeply pedagogical aphorism– you estimated an lm, but you probably want to tidy and plot an emmeans. I remain certain that, in most cases, the contrasts and pvalues from an object which reports combinations of coefficients is of more...

4221 sym R (9445 sym/21 pcs) 2 img

Dplyr Reprise

27.05.2024

dplyr–a brief reprise I feel we’ve learned a lot of dplyr, and hopefully you’ve been persuaded that this is a good toolkit for the kinds of tasks we face as bench social scientists–data manipulation before modelling. But it’s a little like learning Italian–the lab is just providing vocabulary lists and some exemplary turns of phrase...

955 sym R (150 sym/1 pcs) 1 tbl