Comparison of methods of adjusting for time-varying confounding under misspecification – A Monte-Carlo simulation study

Stata and R Analysis Code

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

The Stata code creates a series of quasi-random datasets 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 Google Compute clusters, using a Linux OS (in order to run the syntax on a Windows-based machine, some changes to the way parallel processing is required (because Windows is not compatible with ‘FORK’).

Two types of standard error estimates were used, so two sets of analysis code are included. The first calculates standard errors using bootstrapping. The second calculates model-based standard errors, using influence curves for TMLE.

DescriptionGithub codeDownload code
S1 - Data creation Stata CodeData creation codeDownload code
S2 - Analysis with bootstrap SEs - R CodeAnalysis code - BootstrapDownload code
S3 - Analysis with model-based/influence curve SEs - R CodeAnalysis code - AlternativeDownload code
Dr. Philip J Clare, PhD

Biostatistician at the Prevention Research Collaboration, University of Sydney.