Analysis in R for Cornish et al. (submitted)