Skip to main content
American Journal of Epidemiology logoLink to American Journal of Epidemiology
. 2017 Jun 30;186(2):146–148. doi: 10.1093/aje/kwx090

Invited Commentary: Agent-Based Models—Bias in the Face of Discovery

Katherine M Keyes *, Melissa Tracy, Stephen J Mooney, Aaron Shev, Magdalena Cerdá
PMCID: PMC5860003  PMID: 28673036

Abstract

Agent-based models (ABMs) have grown in popularity in epidemiologic applications, but the assumptions necessary for valid inference have only partially been articulated. In this issue, Murray et al. (Am J Epidemiol. 2017;186(2):131–142) provided a much-needed analysis of the consequence of some of these assumptions, comparing analysis using an ABM to a similar analysis using the parametric g-formula. In particular, their work focused on the biases that can arise in ABMs that use parameters drawn from distinct populations whose causal structures and baseline outcome risks differ. This demonstration of the quantitative issues that arise in transporting effects between populations has implications not only for ABMs but for all epidemiologic applications, because making use of epidemiologic results requires application beyond a study sample. Broadly, because health arises within complex, dynamic, and hierarchical systems, many research questions cannot be answered statistically without strong assumptions. It will require every tool in our store of methods to properly understand population dynamics if we wish to build an evidence base that is adequate for action. Murray et al.'s results provide insight into these assumptions that epidemiologists can use when selecting a modeling approach.

Keywords: agent-based models, causal inference, decision analysis, individual-level models, mathematical models, medical decision making, Monte Carlo methods, parametric g-formula


In this issue of the Journal, Murray et al. (1) have provided a quantitative demonstration of the potential for bias when researchers use parameters from data collected in one population and apply those same parameters to another population to estimate causal effects. As Murray et al. note, when the distribution of causes underlying the observed effects differs across populations, simulations that transport parameters from one population to another may yield biased estimates.

This demonstration is an important contribution to an ongoing discussion in the pages of the Journal. In 2015, Marshall and Galea (2) described the conditions under which agent-based models (ABMs) can be used for causal inference, arguing that under data structures for which there is a high degree of interference between units and nonindependence of observations, ABMs can be creatively used to simulate counterfactual scenarios. In a commentary on that work, Hernán (3) suggested that many epidemiologists might be uncomfortable with the strong assumptions needed in order to draw causal inferences from ABMs. He suggested that use of the parametric g-formula might offer an attractive middle-ground between traditional epidemiologic techniques and ABMs, because the g-formula has some of the same mechanics underlying estimation and can handle many of the complex data structures for which ABMs are often justified, but researchers most often stick to a single data set, bypassing issues that arise from transportability. To our knowledge, however, no one to date had directly compared the 2 approaches for the same research question.

Murray et al. have now begun to fill that gap, estimating the causal effect of antiretroviral therapy on 12-month mortality among a simulated sample of persons who have human immunodeficiency virus (HIV). Two important take-home messages arise from this work, both of which relate more generally to prior criticisms of ABMs. The first message is that when 2 populations have different underlying outcome risks or distributions of unmeasured confounders, transporting estimates from one population to another will result in bias. The second message is that ABMs may not be as adept at accounting for time-dependent confounding and mediation as the g-formula, unless parameterized to replicate the g-formula (as was done in Murray et al.'s first ABM). Hence, collider bias is more of a risk in the ABM unless the distributions of the common causes of the outcome and time-dependent confounders affected by earlier treatment are known and adjusted, which in practice is unlikely.

The first message—that transportability of causal effect estimates requires strong, often dubious, and frequently untestable assumptions—has been discussed extensively in the epidemiologic literature (47), yet in our opinion, this message cannot be repeated often enough. A fundamental conundrum of the epidemiologic approach is that transportability requires strong assumptions, yet no effect estimate has consequence until it is transported to a new population (8, 9) (with the exception of particularly focused applications such as evaluating harms that occurred in the past for the purpose of deciding attribution of cause for legal cases). That is, clinicians, public health authorities, and legislative bodies alike make decisions regarding future outcomes using data from past populations—implicitly transporting results.

Murray et al.'s work eloquently demonstrates the hazard of making unjustified transportability assumptions. As they highlighted, the utility of simulation model results, including ABM simulations, relies on the ability of the input parameters to apply within the population of interest. This important point is critical to the notion that ABMs offer an analytical approach to fundamental problems of exchangeability between exposed and unexposed populations (2, 10). That is, although ABMs can simulate counterfactual scenarios wherein the same (simulated) population is both exposed and unexposed, allowing randomized controlled trials that change only the treatment under consideration, these counterfactual contrasts are between simulated populations and rest on the (almost certainly incorrect) assumption that the simulated population perfectly represents the real-world population. Rather than analyze a single data set, modelers specify the magnitude of effect that an intervention will have on the treated population, variations in the effect size across subgroups, length of the effect, and many other details of the process through which an intervention works. Where do these estimates come from? In a desirable scenario, they are derived from the best available evidence—systematic reviews, meta-analyses, and randomized trials—but these sources themselves are often subject to problems of exchangeability (and hence likely time-dependent confounding). ABMs are only as good as the data that are used to parameterize them, and they have been justly criticized in the literature because a lack of acknowledgement regarding this limitation (11, 12). Murray et al. add to this literature by noting that not only do the input parameters need to avoid violations of exchangeability, but that violations of transportability can also lead to violations of exchangeability.

The second message should also be considered by all epidemiologists—not just agent-based modelers. Collider bias and unmeasured confounding of time-varying exposures can occur in all data analysis, especially when using evidence for action. When we obtain results that suggest that an exposure or treatment will have an influence on an outcome, we often use that evidence to justify intervention beyond the study sample. Indeed, that is our charge as public health practitioners. Yet inference beyond the study sample, whether the sample initially existed in silico or in flesh and blood, is subject to a wide range of potential assumption violations that can render our best efforts fraught with error. Murray et al. show that in the context of time-dependent confounding, ABMs may generate biased estimates of treatment effects in nontransparent ways, by treating parameters of past treatment obtained from one population as causal effects in a completely different population. By highlighting this point, the work of Murray et al. invites us to think carefully about how we could use sensitivity analyses within the agent-based modeling framework to bring such potential assumption violations to light, and to test the extent to which they might bias the estimation of exposure or treatment effects. Indeed, although sometimes treated like an afterthought, sensitivity analyses are a critical step in the agent-based modeling process. In the spirit of Murray et al.'s work, we call for more guidance among epidemiologists regarding the necessary scope of these sensitivity analyses, including looking to best practices used in other disciplines.

More generally, as interest in agent-based modeling grows, many scholars have rightly begun to question the assumptions, utility, and validity of ABMs (11, 13). As Murray et al.'s results demonstrate, these criticisms are targeted not at the method itself, which nearly perfectly estimates the simulated effect when used without violating transportability assumptions, but at implementations that rely on questionable results to parameterize ABMs or ignore assumption violations. Indeed, ABMs can be viewed as methods to identify a set of plausible assumptions that produce, through simulation, a system matching the real world we observed. However, there is a paradox in this approach: In order to simulate a system correctly, we need to know a lot about the system, but we use ABMs precisely because we don't know enough about the system. ABMs therefore must make assumptions about how the system works, which is of the greatest utility when the assumptions are simple and the system is complex. However, problems can quickly arise as the number and complexity of assumptions increase.

What is the way forward? We suggest that epidemiologists embrace both ABMs and the g-formula, and that epidemiologic training must focus on understanding the assumptions underlying model building and the resulting limitations on inference from models. Health is produced by interacting systems at multiple levels, and by attempting to model these systems rigorously and skeptically, we derive insight into the appropriate levers to improve population health. Some important decisions regarding population health, such as when HIV-infected individuals should start highly active antiretroviral therapy, involve little interference between units and are well-suited to the g-formula (14). Others—including the cost-effectiveness of human papilloma virus vaccination strategies (15) and the interplay between obesity, social networks, and weight-based stigma (16)—require information about group dynamics that may be better suited to ABMs.

We suggest that an epidemiologist selecting a modeling approach might consider the following analogy: The parametric g-formula is like a late model sedan—perhaps a long-range, electric luxury car—offering a high-technology yet practical way to get from point A to point B over established roads. By contrast, an ABM is an off-road vehicle, capable not only of following the same roads as the luxury car (albeit less comfortably) but also of taking riskier excursions into uncharted territories where the wheels might fall off. Epidemiologists whose scientific questions can be answered within the constraints of the g-formula can avoid hazardous and unsupported assumptions with a g-formula approach. By contrast, epidemiologists whose questions require stronger assumptions must accept the consequent inferential hazards.

We celebrate the contribution that Murray et al. have made in showing the necessity of laying bare the assumptions that are violated in ABMs. Furthermore, we concur that developing tools that enable us to probe those violations in terms of magnitude, direction, and impact can provide a service to science that will be both methodological and substantive. Such tools will be methodological in the sense that they can show how much bias there may be in our observational and trial estimates, what challenges exist in transporting those estimates beyond the study sample (which we need to do in order to actually use evidence to intervene), and how we can combine data from multiple sources, literatures, and disciplines in novel ways. The tools will be substantive in the sense that we will be increasingly able to generate results that capitalize on the vast amounts of scientific literature in a particular area in order to draw conclusions about the range of potential effects of various treatments, considered in isolation or in combination. Ultimately, ABMs can generate a sense of how effective a treatment would need to be in order to have an influence on population health, and how good the data that we have are at providing the insight needed to answer that question.

In summary, we risk incorrect inference when a model is parameterized incorrectly. As the famous (to the point of cliché) George Box quote “all models are wrong, but some are useful” (17) reminds us, all models are, to some extent, parameterized incorrectly. In ABMs, for which we often rely on data from many different contexts, populations, and study designs to inform parameterization, the risk of parameterization error is much higher. Murray et al. have done a substantial service for the field by outlining exactly how such risks can occur and quantifying the striking magnitude of potential error. This error is concerning, and yet we are stuck with it. Ultimately, health in populations arises from a complex system, and there are differences between the populations on which we want to intervene and the populations that we have studied. Individuals have dynamic relationships; disease progression and transmission can exhibit nonlinearity and feedback loops; and social, political, and other structures can create correlation in the outcome based on time and space. It will require every tool among our methods to properly understand these dynamics if we wish to build an evidence base that is adequate for action. We hope that as agent-based approaches gain more popularity, modelers incorporate these important insights regarding the potential for bias and assumption violation so that ABMs can be utilized as part of public health practice.

ACKNOWLEDGMENTS

Author affiliations: Department of Epidemiology, Mailman School of Public Health, Columbia University, New York, New York (Katherine M. Keyes); Department of Epidemiology and Biostatistics, University at Albany–State University of New York, Albany, New York (Melissa Tracy); Harborview Injury Prevention and Research Center, University of Washington, Seattle, Washington (Stephen J. Mooney); and Department of Emergency Medicine, School of Medicine, University of California, Davis, Sacramento, California (Aaron Shev, Magdalena Cerdá).

Funding for this work was provided by the National Institutes of Health (grants K01DA030449, K01AA02151, R21AA021909, 1R21DA041154-01, and 5T32HD057822).

Conflict of interest: none declared.

REFERENCES

  • 1. Murray EJ, Robins JM, Seage GR 3rd, et al. A comparison of agent-based models and the parametric g-formula for causal inference. Am J Epidemiol. 2017;186(2):131–142. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 2. Marshall BD, Galea S. Formalizing the role of agent-based modeling in causal inference and epidemiology. Am J Epidemiol. 2015;181(2):92–99. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 3. Hernán MA. Invited commentary: agent-based models for causal inference—reweighting data and theory in epidemiology. Am J Epidemiol. 2015;181(2):103–105. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 4. Hernán MA, VanderWeele TJ. Compound treatments and transportability of causal inference. Epidemiology. 2011;22(3):368–377. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 5. Petersen ML. Compound treatments, transportability, and the structural causal model: the power and simplicity of causal graphs. Epidemiology. 2011;22(3):378–381. [DOI] [PubMed] [Google Scholar]
  • 6. Pearl J, Bareinboim E Transportability of causal and statistical relations: A formal approach. In: Proceedings of the 25th AAAI Conference on Artificial Intelligence Menlo Park, CA: AAAI Press; 2011:247–154. [Google Scholar]
  • 7. Pearl J, Bareinboim E. External validity: from do-calculus to transportability across populations. Stat Sci. 2014;29(4):579–595. [Google Scholar]
  • 8. Westreich D, Edwards JK, Rogawski ET, et al. Causal impact: epidemiological approaches for a public health of consequence. Am J Public Health. 2016;106(6):1011–1012. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 9. Schwartz S, Carpenter KM. The right answer for the wrong question: consequences of type III error for public health research. Am J Public Health. 1999;89(8):1175–1180. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 10. El-Sayed AM, Scarborough P, Seemann L, et al. Social network analysis and agent-based modeling in social epidemiology. Epidemiol Perspect Innov. 2012;9(1):1. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 11. Naimi AI. Commentary: integrating complex systems thinking into epidemiologic research. Epidemiology. 2016;27(6):843–847. [DOI] [PubMed] [Google Scholar]
  • 12. Poole C. Commentary: some thoughts on consequential epidemiology and causal architecture. Epidemiology. 2017;28(1):6–11. [DOI] [PubMed] [Google Scholar]
  • 13. Diez Roux AV. Invited commentary: the virtual epidemiologist—promise and peril. Am J Epidemiol. 2015;181(2):100–102. [DOI] [PubMed] [Google Scholar]
  • 14. Westreich D, Cole SR, Young JG, et al. The parametric g-formula to estimate the effect of highly active antiretroviral therapy on incident AIDS or death. Stat Med. 2012;31(18):2000–2009. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 15. Jit M, Brisson M, Laprise JF, et al. Comparison of two dose and three dose human papillomavirus vaccine schedules: cost effectiveness analysis based on transmission model. BMJ. 2015;350:g7584. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 16. Mooney SJ, El-Sayed AM. Stigma and the etiology of depression among the obese: an agent-based exploration. Soc Sci Med. 2016;148:1–7. [DOI] [PubMed] [Google Scholar]
  • 17. Box GE, Hunter JS, Hunter WG. Statistics for Experimenters. 2nd ed Hoboken, NJ: John Wiley & Sons; 2005. [Google Scholar]

Articles from American Journal of Epidemiology are provided here courtesy of Oxford University Press

RESOURCES