Learn R Programming

⚠️There's a newer version (0.5.5) of this package.Take me there.

Overview

hesim is a modular and computationally efficient R package for health economic simulation modeling and decision analysis that provides a general framework for integrating statistical analyses with economic evaluation. The package supports cohort discrete time state transition models (DTSTMs), N-state partitioned survival models (PSMs), and individual-level continuous time state transition models (CTSTMs), encompassing both Markov (time-homogeneous and time-inhomogeneous) and semi-Markov processes. It heavily utilizes Rcpp and data.table, making individual-patient simulation, probabilistic sensitivity analysis (PSA), and incorporation of patient heterogeneity fast.

Features of the current version can be summarized as follows:

  • Cohort DTSTMs, N-state PSMs, and individual-level CTSTMs that encompass Markov and semi-Markov processes
  • Options to build models via mathematical expressions using nonstandard evaluation or directly from fitted statistical models
  • Parameter estimates from either an R based model or from an external source
  • Convenience functions for sampling model parameters from parametric distributions or via bootstrapping
  • Parameter uncertainty propagated with PSA
  • Modeling patient heterogeneity
  • Performing cost-effectiveness analyses and representing decision uncertainty from PSAs
  • Simulation code written in C++ to boost performance

Installation

# Install from CRAN:
install.packages("hesim")

# Install the most up to date development version from GitHub:
# install.packages("devtools")
devtools::install_github("hesim-dev/hesim")

Copy Link

Version

Install

install.packages('hesim')

Monthly Downloads

528

Version

0.3.1

License

GPL-3

Issues

Pull Requests

Stars

Forks

Maintainer

Devin Incerti

Last Published

June 2nd, 2020

Functions in hesim (0.3.1)

CtstmTrans

An R6 base class for continuous time state transition models
PsmCurves

Partitioned survival curves
StateVals

Model for state values
create_StateVals

Create a StateVals object
absorbing

Absorbing states
check_edata

Check data argument for create_input_mats
costs

Costs object
bootstrap

Bootstrap a statistical model
create_lines_dt

Create a data table of treatment lines
ce

A cost-effectiveness object
incr_effect

Incremental treatment effect
create_input_mats

Create input matrices
create_object_list

Form a list from ...
check.id_attributes

Input validation for class objects
expand.hesim_data

Expand hesim_data
fast_rgengamma

Random generation for generalized gamma distribution
qalys

Quality-adjusted life-years object
icea

Individualized cost-effectiveness analysis
icer_tbl

ICER table
hesim_survdists

List of survival distributions
rcat

Random generation for categorical distribution
id_attributes

Attributes for ID variables
mstate3_exdata

Example data for a 3-state multi-state model
input_mats

Input matrices for a statistical model
tpmatrix

Transition probability matrix
summarize_ce

Summarize costs and effectiveness
params_surv_list

Parameters of a list of survival models
mom_beta

Method of moments for beta distribution
mom_gamma

Method of moments for gamma distribution
params_surv

Parameters of a survival model
define_tparams

Define and evaluate transformed parameter expressions
multinom3_exdata

Example data for a 3-state multinomial model
partsurvfit

Partitioned survival regression object
surv_quantile

Survival quantiles
tpmatrix_names

Names for elements of a transition probability matrix
time_intervals

Time intervals
uv_rng

Generate variates for univariate distributions
tparams

Transformed parameter object
weibullNMA

Parameterization of the Weibull distribution for network meta-analysis
hesim

hesim: Health-Economic Simulation Modeling and Decision Analysis
hesim_data

Data for health-economic simulation modeling
IndivCtstmTrans

Transitions for an individual-level continuous time state transition model
psm4_exdata

Example data for a 4-state partitioned survival model
expand

Expand object
joined

Join statistical models at specified times
Psm

N-state partitioned survival model
rpwexp

Random generation for piecewise exponential distribution
sim_ev

Expected values
create_CohortDtstmTrans

Create CohortDtstmTrans object
create_params

Create a parameter object from a fitted model
create_CohortDtstm

Create CohortDtstm object
lm_list

List of lm objects
flexsurvreg_list

List of flexsurvreg objects
create_trans_dt

Create a data table of health state transitions
formula_list

List of formula objects
multinom_list

List of multinom objects
params

Parameter object
CohortDtstm

Cohort discrete time state transition model
params_lm

Parameters of a linear model
rdirichlet_mat

Random generation for multiple Dirichlet distributions
params_lm_list

Parameters of a list of linear models
CohortDtstmTrans

Transitions for a cohort discrete time state transition model
create_PsmCurves

Create PsmCurves object
create_IndivCtstmTrans

Create IndivCtstmTrans object
define_model

Define and evaluate model expression
define_rng

Define and evaluate random number generation expressions
rng_distributions

Random number generation distributions
tparams_mean

Predicted means
stateval_tbl

Table to store state value parameters
params_mlogit_list

Parameters of a list of multinomial logit models
params_joined_surv

Parameters of joined survival models
stateprobs

State probability object
params_mlogit

Parameters of a multinomial logit model
tparams_transprobs

Transition probabilities
params_joined_surv_list

Parameters of joined lists of survival models
IndivCtstm

Individual-level continuous time state transition model