Comparison of methods of adjusting for time-varying confounding with missing data – A Monte-Carlo simulation study

Stata and R Analysis Code

This repository contains the Stata and R code used in the missing data simulation by Clare et al. 2019

The Stata code creates a series of quasi-random datasets (3 different datasets were used in the simulation) using a pre-specified data structure. Analysis code runs all analyses on those datasets, and saves the results. Note that the code is written to run on the UNSW Katana cluster computer, which uses a scheduler to sequentially call the R script and pass it the particular iterations of the data to be processed in each step. To run the code on a standard computer, the code can be edited so the parameters passed by the Katana scheduler are defined internally.

S1 - Data creation of Dataset 1 - Stata CodeData creation code
S2 - Data creation of Dataset 2 - Stata CodeData creation code
S3 - Data creation of Dataset 3 - Stata CodeData creation code
S4 - Analysis - R CodeAnalysis code
Dr. Philip J Clare, PhD

Biostatistician at the Prevention Research Collaboration, University of Sydney.