Template R code for estimating causal effects from lifecourse data (assuming no unmeasured confounding). Specifically, this is designed for situations where you have: repeated measures of exposure and an outcome occuring later
Currently based on having access to a data file that I'm using locally. You would need to replace with your own data file and edit variable names etc accordingly. I hope to update later with some test data that will be downloadable.
Suggestions for refining the syntax are very welcome. If you use it, a citation/acknowledgement would be nice!
The R file is the code, the PDF is the poster I created for SER2019 using the code.