R in Health Decision Sciences
Introduction[edit  edit source]
Health decision sciences (HDS) is the field of study that involves improving the quality of decisions in the presence of uncertainty in the healthcare setting. HDS has the goal to allocate limited healthcare resources optimally. Since these health care decisions have substantial consequences it is important to communicate the uncertainties and tradeoffs related to these decisions with all healthcare professionals and (health) policy makers. HDS combines information from multiple disciplines, like epidemiology, health economics, biostatistics and computer science. HDS estimates the consequences of all the actions considered^{[1]}.
The most commonly used mathematical models in HDS are^{[2]} decision trees ^{[3]}, Markov models^{[4]}, and microsimulation^{[5]}.
R is a programming language that has been mostly used for statistical programming across many academic disciplines such as statistics and engineering. R has gained significant popularity in Health Decision Sciences over the past decade^{[6]}. A key characteristic of R is its vast number of packages that can extend the functionality of the programming language.
Academic groups promoting the use of R in HDS[edit  edit source]
At the 37th Annual North American Meeting of the Society for Medical Decision Making (SMDM) in St. Louis, MO, USA, a group of researchers and students created the Decision Analysis in R for Technologies in Health (DARTH) workgroup. The group is an international endeavor comprised of members with shared interests and a significant experience modeling in R from the University of Minnesota, the University of Pittsburgh, The Hospital for Sick Children, University of Toronto, and Erasmus University of Rotterdam. As part of DARTH’s agenda, they develop tutorials on how to implement decisionanalytic models using R.
Good coding practices[edit  edit source]
The workgroup on Github[edit  edit source]
DARTH's most up to date work can be found in the group's GitHub page.
Overview table[edit  edit source]
Category  Type  Package name  Description 

Model design  Markov Models  matrixStats

Functions that Apply to Rows and Columns of Matrices (and to Vectors). Highperforming functions operating on rows and columns of matrices. 
DTMCPack

Suite of functions related to discretetime discretestate Markov Chains: Functions for simulating and determining the properties of finite, discretetime, discrete state Markov chains.  
markovchain

Easy Handling Discrete Time Markov chains: Functions to create and analyze discrete time Markov chains.  
heemod

Health Economic Evaluation Modelling: Functions for Markov models for health economic evaluation, model comparison, sensitivity and probabilistic analysis.  
MDP  MDPtoolbox

Markov Decision Processes toolbox: Functions related to the resolution of discretetime Markov Decision Processes: finite horizon, value iteration, policy iteration, and linear programming algorithms.  
Microsimulation/Agentbased models  MILC

MIcrosimulation Lung Cancer (MILC) model: A continuous time microsimulation model example for predicting patient outcomes and describing the natural history of lung cancer.  
RNetLogo

Interface for Netlogo in R:An interface to access NetLogo from R. NetLogo is a multiagent programmable modeling environment available at https://ccl.northwestern.edu/netlogo/  
microsimulation

The package provides several approaches for microsimulation and eventbased, discrete event simulation.  
Probabilistic modeling and Bayesian hierarchical models  R2WinBUGS , R2OpenBUGS , R2jags, rstan ,

Integrate WinBUGS, OpenBUGS, JAGS and Stan with R: These packages make it possible to call a BUGS model, summarize inferences and convergence in a table and graph, and save the simulations in arrays for easy access in R.  
Dynamic transmission models (Compartmental Models)  deSolve

Differential equation solver: Functions to numerically solve a system of firstorder ordinary or partial differential equations.  
GillespieSSA and adaptivetau

Gillespie's Stochastic Simulation Algorithm (SSA):Several functions for stochastic simulation algorithms for generating simulated trajectories of finite population continuoustime model.  
EpiModel

Mathematical Modeling of Infectious Disease: Building mathematical models of infectious disease, including deterministic compartmental models, stochastic agentbased, and stochastic network models.  
statnet

Software Tools for the Statistical Analysis of Network Data: Functions for modeling, analyzing and visualizing network data.  
Parameter estimation  Analysis of patientlevel or aggregate data  survival

Survival Analysis: Survival analysis functions, including KaplanMeier, multistate curves and Cox models. 
flexsurv

Flexible Parametric Survival and MultiState Models: Flexible parametric models for timetoevent data, including spline models.  
msm

MultiState Markov and Hidden Markov Models in Continuous Time: Functions for fitting continuoustime Markov and hidden Markov multistate models to longitudinal data.  
mstate

Data Preparation, Estimation and Prediction in MultiState Models: Functions for data preparation, descriptives, hazard prediction in multistate models.  
SemiMarkov

MultiStates SemiMarkov Models: Functions for fitting multistate semiMarkov models to longitudinal data.  
TPmsm

Estimation of Transition Probabilities in Multistate Models: estimate transition probabilities for illnessdeath or threestate progressive disease model.  
HMM

Hidden Markov Models: Functions to setup, apply and make inference with discrete time and discrete space Hidden Markov Models.  
depmixS4

Dependent Mixture Models  Hidden Markov Models of GLMs and Other Distributions in S4:Functions to model dependent mixture models (mixed continuous or categorical time series data).  
lm and glm

Fitting (generalized) linear models: Used to perform (generalized) linear fit or regression analyses.  
nlme

Linear and Nonlinear Mixed Effects Models: randomeffect regression models.  
lme4

Linear MixedEffects Models.  
gee

Generalized Estimation Equation Solver: Generalized Estimation Equation Solver.  
AER

Applied Econometrics with R: Accompanies the book “Applied Econometrics with R”, SpringerVerlag, New York. {{ISBN9780387773162}}.  
ipw

Estimate Inverse Probability Weights: Functions to estimate the probability to receive the observed treatment, based on individual characteristics.  
Metaanalysis and evidence synthesis  RISmed

A set of tools to extract bibliographic content from the National Center for Biotechnology Information (NCBI) database directly.  
meta , metafor , rmeta

MetaAnalysis Package for R: A, such as fixed, random, and mixedeffects models.  
mvmeta

Multivariate and Univariate MetaAnalysis and MetaRegression: Collection of functions to perform fixed and randomeffects multivariate and univariate metaanalysis and metaregression.  
netmeta

Network MetaAnalysis using Frequentist Methods: network metaanalysis (frequentist).  
gemtc

Network MetaAnalysis Using Bayesian Methods: network metaanalysis (Bayesian).  
Direct analyses of public datasets  HMDHFDPlus

Read the data from the Human Fertility Database (HFD) and Human Fertility Databas (HFD) from the web into an R session as data.frame objects.  
demography

Forecasting mortality, fertility, migration and population data: Human Mortality Database (HMD); Functions for demographic analysis including lifetable calculations.  
SEER2R

Reading and writing Surveillance, Epidemiology, and End Results (SEER) datasets.  
Calibration/optimization  optimx

A Replacement and Extension of the optim(). optimization capabilities in R for multiple parameters.  
stats package (optim function)  Direct search algorithm (e.g., NelderMead, quasiNewton and conjugategradient).  
neldermead

R port of the Scilab neldermead module: Provides several direct search optimization algorithms based on the simplex method.  
genalg

R Based Genetic Algorithm optimization.  
DEoptim

Implements the differential evolution algorithm for global optimization of a realvalued function of a realvalued parameter vector.  
GenSA

R Functions for Generalized Simulated Annealing searches for global minimum in a nonlinear system.  
Bayesian calibration  MHadaptive

General Markov Chain Monte Carlo for Bayesian Inference using adaptive MetropolisHastings sampling:  
mcmc

Makrov Chain Monte Carlo: Simulates continuous distributions of random vectors using Markov chain Monte Carlo (MCMC).  
MCMCpack

Markov Chain Monte Carlo (MCMC) Package: Contains functions to perform Bayesian inference using posterior simulation for a number of statistical models.  
INLA

Used to solve solve models using Integrated nested Laplace approximation (INLA) which is a new approach to statistical inference for latent Gaussian Markov random field (GMRF)  
Probabilistic sampling from independent or joint distributions  core R (e.g., stats)  Standard distributions, such as univariate distributions and commonly used multivariate distributions.  
Model analysis and outputs  Probabilistic Analyses  MASS

Multivariate normal distributions; Functions and datasets to support Venables and Ripley, "Modern Applied Statistics with S" (4th edition, 2002). 
lca

Density function and random generation for Dirichlet distribution with parameter vector alpha.  
mvtnorm

Computes multivariate normal and t probabilities, quantiles, random deviates and densities.  
dirichlet

Functions to compute the density of or generate random deviates from the Dirichlet distribution.  
lhs

Latin Hypercube Samples: Provides a number of methods for using Latin Hypercube Samples.  
lattice

Trellis Graphics for R:A powerful and elegant highlevel data visualization system inspired by Trellis graphics.  
BCEA

Bayesian Cost Effectiveness Analysis: Conducts many postsimulation probabilistic analyses from a probabilistic sensitivity analysis dataset.  
Value of information analysis  foreach

Provides Foreach Looping Construct for R:extension of the standard for function to compute over multiple threads and increase speed of computation.  
parallel

Parallel computation in R: makes it possible to run multiple computational threads in parallel.  
Graphical outputs  ggplot2

An Implementation of the Grammar of Graphics: Widely used plotting package that combines base and lattice graphics: conditioning and shared axes are handled automatically.  
data.tree

Methods to create and plot hierarchical data structures. 
References[edit  edit source]
 ↑ "Decision making in Health and Medicine. Integrating Evidence and values". M.G.M.Hunink, M.C. Weinstein, E.Wittenberg. M.F.Drummond, J.S. Pliskin, J.B.Wong, P.P.Glasziou. Second edition. Cambridge University Press. 2014
 ↑ Roberts M, Russell LB, Paltiel AD, Chambers M, McEwan P, Krahn M. "Conceptualizing a model: A report of the ISPORSMDM modeling good research practices task force2". Med Decis Making. 2012;32(15):678–89.
 ↑ Detsky AS, Naglie G, Krahn MD, Redelmeier DA, Naimark D. "Primer on Medical Decision Analysis: Part 2—Building a Tree". Med Decis Making. 1997 Apr 1;17(2):126–35.
 ↑ Beck JR, Pauker SG. "The Markov process in medical prognosis". Med Decis Making. 1983;3(4):419–58.
 ↑ Krijkamp E, AlaridEscudero F, Enns EA, Jalal H, Hunink, MGM Pechlivanoglou P. "Microsimulation modeling for health decision sciences using R: A tutorial". Med Decis Making. 2018;38(3):40022.
 ↑ Jalal H, Pechlivanoglou P, Krijkamp E, AlaridEscudero F, Enns E, Hunink MGM. "An Overview of R in Health Decision Sciences". Med Decis Making. 2017;37(7):735–46.