In this episode, I will discuss how to easily perform a Monte Carlo Simulation in under 10 minutes using Microsoft Excel, Apple Numbers or Google Sheets.
What is Monte Carlo Simulation?
A Monte Carlo Simulation in the context of healthcare uses software to simulate thousands of patients from smaller sample sizes to provide a more robust prediction of an event. The term Monte Carlo is taken from a casino in Monaco and was used as a code word for the technique as it was used during the Manhattan Project.
Examples of Monte Carlo Simulations in pharmacy literature
Monte Carlo Simulations are commonly employed in pharmacokinetic studies of critically ill patients. In a recent study, 8 patients with cystic fibrosis being treated with ceftaroline each had two blood levels of ceftaroline drawn. From these 16 blood levels, patient-specific pharmacokinetic properties were estimated. From these properties, 10,000 simulated patients were evaluated to determine the pharmacodynamic probability of target attainment for ceftaroline in adults with cystic fibrosis.
The alternate dosing of meropenem at 500 mg IV q6 hours advocated by Nebraska Medicine relies on Monte Carlo Simulation of the probability of target attainment.
Cost-effectiveness studies also commonly use Monte Carlo Simulations. A recent study evaluating the cost-effectiveness of histamine-2 receptor antagonists (H2RAs) vs proton pump inhibitors (PPIs) for stress ulcer prevention used Monte Carlo Simulation. The authors created a decision analytic model that used data published in various sources to determine the probability of effectiveness, adverse effects, and mortality for H2RAs and PPIs. Based on this model, 10,000 patients were simulated to determine the cost effectiveness of each therapy.
Monte Carlo analyses have also been used in several studies as a way to simulate missing patient data.
Why perform a Monte Carlo Simulation?
In the absence of large studies, or in scenarios such as critical illness when data can be hard to obtain, Monte Carlo Simulations can be useful. Assuming the initial pharmacokinetic data used to create the model for the simulation is valid, Monte Carlo Simulations can be used in lieu of performing multiple studies of different dosing regimens in the same population.
Limitations
As with any other model, a Monte Carlo Simulation is only as good as the data used to create the model. A small initial data set to determine model properties is not as robust as a large data set.
How to use Microsoft Excel, Apple Numbers or Google Sheets to perform a Monte Carlo
I have used Monte Carlo Simulations in two recent episodes: In episode 195 to evaluate the probability of allometric vancomycin dosing achieving a target AUC:MIC ratio, and episode 186 to evaluate the risk of anesthetic awareness when giving rocuronium before ketamine (rocketamine) in rapid sequence intubation. In each of these episodes, I used a Monte Carlo Simulation to take an “educated guess” and repeat the guess 5000 times to check the probability that it was correct. In the absence of published data to answer a clinical question, I think that 5000 guesses with a Monte Carlo Simulation are better than just one.
Simple Monte Carlo Simulations can be performed using Microsoft Excel, Apple Numbers or Google Sheets. There are two main formulas that can be used to simulate patient data. RANDBETWEEN and RAND.
RANDBETWEEN(x,y) returns a random integer number between the numbers you specify. I use this formula if I want to simulate a patient value that falls anywhere within a normal range. A lab value such as serum creatinine is a good example of when RANDBETWEEN can be used. Because this formula only works for integers (whole numbers) you may need to get a little creative. For the serum creatinine example, if I want my simulated patients to have a random serum creatinine between 0.6 and 2.5 mg/dL I will use the RANDBETWEEN(6,25) formula to return a random integer between 6 and 25. Then I will dive this integer by 10 to get my random serum creatinine result.
Sometimes the value you want your simulated patient to have is based on an average and standard deviation for a population. To accomplish this in Excel you will need to combine the RAND formula with the NORMINV formula. This will ensure that your simulated patient values fall within a normal distribution that has the mean and standard deviation you specify. For example, to simulate patient weights around a mean of 80 kg with a standard deviation of 20 kg, the formula would look like this: NORMINV(RAND(),80,20). Be aware when you do this that a small percentage of your simulated patients will end up having physiologically improbable values and you may need to exclude them from your analysis.
Once you set up your formulas in Microsoft Excel, Apple Numbers or Google Sheets, completing your Monte Carlo Simulation is as simple as clicking and dragging your formulas down as many rows as you want to simulate patients for.
In my free download area, I’ve provided a template of a Monte Carlo Simulation that simulates 100 male patients and provides the probability that 1 gram IV q12 hours of vancomycin is enough to achieve an AUC:MIC ratio of 500 for an MIC of 1. If you don’t already have a free account on pharmacyjoe.com, sign up to download this free template. There are only 6 columns used in this spreadsheet to get the answer. Once you understand this easy template on how to run a Monte Carlo Simulation you will be able to quickly create a simulation of your own.
If you like this post, check out my book – A Pharmacist’s Guide to Inpatient Medical Emergencies: How to respond to code blue, rapid response calls, and other medical emergencies.
Leave a Reply