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 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语言编程代码,演示了我们的伪代码在这些场景中的具体应用。