Skip to content
Steve Bellan edited this page May 15, 2014 · 13 revisions

Welcome to the AcuteRetroSim wiki!

This wiki provides the supporting R code and data for the following manuscript:

Bellan SE, Dushoff J, Galvani AP, Meyers LA (in review). HIV-1 acute phase infectivity has been substantially overestimated.

#1 Generating couple relationship histories

  • CopulaRelationshipModel-FigS1.R fits multivariate normal copula models to five relationship history variables from the Ugandan AIS 2004-2005 and DHS 2011 surveys (time of sexual activity before couple formation for both partners, date of couple formation, age of each partner at sexual debut)

  • Inputs required: Uganda AIS/DHS data (UgandaDHS2011.Rdata), UNAIDS prevalence curves (epic.Rdata), Weibull survival curve fit to CASCADE data (csurv.Rdata), estimated transmission rates from fitting couples model to DHS data (see Bellan et al. (2013); pars.arr.ac.Rdata)

  • Note: 2004-2005 AIS not provided in this repository because it is restricted, please contact the Ugandan Ministry of Health for access. Nearly identical results can be achieved using just the 2011 DHS data set.

#2 Simulating couple cohorts

  • SimulationFunctions.R provides several flexible functions for simulating cohorts of couples with relationship histories characteristic of Uganda (see step one above).

  • SimulationStarter.R sources these functions, and for a set of input parameters simulates a cohort.

  • RakMK.R builds a control file to send to the cluster to run several thousand simulations, each with different hazard profiles across the various disease stages (acute, chronic, late, AIDS) and different amounts of heterogeneity.

  • The control file RakAcute.txt is then submitted to the cluster (in our case Lonestar at the Texas Advanced Computing Center), which runs the simulations and stores the results in the specified directory set up.

#3 Simulating and analyzing retrospective cohorts

  • RakaiCohortSimulator.R takes as input a simulated couple population from above and reduces it to a retrospective cohort using the same study design as the original Rakai retrospective cohort.

  • This same script also applies the Wawer et al. (2005) and Hollingsworth et al. (2008) analyses to the retrospective cohort generated either from a simulated couple population or from the original data set.

  • The functions used to both generate and analyze retrospective cohorts are sourced from RakFunctions.R. this script also creates the original Rakai data set.

  • FitRakMK.R creates a control file (FitRak.txt) to be sent to the cluster, with a call to RakaiCohortSimulator.R for each simulation created in step #2 above.

  • RakaiCohortSimulator.R can also generate a retrospective cohorts using the Hollingsworth model (i.e. because this is a fully specified probability model, we can also use it to generate data). HollTestFit.R creates a control file to be submitted to the cluster that will both simulate cohorts using the Hollingsworth model and also fit them with the Hollingsworth model.

#4 Interpreting results

  • RakFitSummary.R compiles both the Wawer and Hollingsworth Model fits to each simulation produced by the submission of FitRak.txt to the cluster.

  • It also creates comprehensive plots showing the estimated vs. true EHM[acute] for all parameters simulated including both median and confidence/credible intervals. These plots help build intuition for the results but are not given in the final manuscript because of their complexity.

  • Instead, TrueVsEst-Fig4.R creates Figure 4, a more easily understandable summary of the four different biases that affect these estimation processes.

  • revisedCIs-Fig5.R then creates figure 5, i.e. our revised confidence intervals on EHM[acute].

Clone this wiki locally