Naimi Ashley I, Benkeser David, Rudolph Jacqueline E
From the Department of Epidemiology, Emory University, Atlanta, GA.
Department of Biostatistics, Emory University, Atlanta, GA.
Epidemiology. 2025 Sep 1;36(5):690-693. doi: 10.1097/EDE.0000000000001873. Epub 2025 Jun 13.
Simulation studies are used to evaluate and compare the properties of statistical methods in controlled experimental settings. In most cases, performing a simulation study requires knowledge of the true value of the parameter, or estimand, of interest. However, in many simulation designs, the true value of the estimand is difficult to compute analytically. Here, we illustrate the use of Monte Carlo integration to compute true estimand values in simple and more complex simulation designs. We provide general pseudocode that can be replicated in any software program of choice to demonstrate key principles in using Monte Carlo integration in two scenarios: a simple three-variable simulation where interest lies in the marginally adjusted odds ratio and a more complex causal mediation analysis where interest lies in the controlled direct effect in the presence of mediator-outcome confounders affected by the exposure. We discuss general strategies that can be used to minimize Monte Carlo error and to serve as checks on the simulation program to avoid coding errors. R programming code is provided illustrating the application of our pseudocode in these settings.
模拟研究用于在可控实验环境中评估和比较统计方法的性质。在大多数情况下,进行模拟研究需要了解感兴趣的参数或估计量的真实值。然而,在许多模拟设计中,估计量的真实值很难通过解析计算得出。在此,我们展示了如何使用蒙特卡罗积分来计算简单和更复杂模拟设计中的真实估计量值。我们提供了通用的伪代码,可在任何选定的软件程序中复制,以展示在两种情况下使用蒙特卡罗积分的关键原则:一种是简单的三变量模拟,关注的是边际调整后的比值比;另一种是更复杂的因果中介分析,关注的是在存在受暴露影响的中介 - 结果混杂因素的情况下的受控直接效应。我们讨论了可用于最小化蒙特卡罗误差以及作为对模拟程序的检查以避免编码错误的一般策略。提供了R编程代码,说明了我们的伪代码在这些设置中的应用。