Longitudinal_Mediation

For the simulation study (e.g., Case 1), run the following 3 files in parallel on the cluster

Sim_Out.R
Sim_Med.R
Sim_Cov.R

and run

Effect.R

to summarize the posterior samples. The simulated_data folder only contains part of 400 datasets (due to size limitations).

For the main analysis, we provide the dataset except the Medicare data (Main_Dataset_except_Medicare.RData). The same scripts (Sim_Out.R, Sim_Med.R and Sim_Cov.R) can be used.