This repository contains a tutorial for the methods in and replication code for “Clarifying the effect of biodiversity on productivity in natural ecosystems with longitudinal data and methods for causal inference” Nature Communicatins, by Dee, Ferraro, Severen et al.