SAS macro used for the analyses in the paper
Combining high quality data with rigorous methods: emulation of a target trial using electronic health records and a nested case-control design BMJ 2023; 383 doi: https://doi.org/10.1136/bmj-2022-072346 (Published 28 December 2023) Cite this as: BMJ 2023;383:e072346
The doumentation for the macro is contained in the Data Supplement - Supplementary information: Supplemental file 1: guideline and SAS macro
https://www.bmj.com/content/383/bmj-2022-072346/related#datasupp