Learn R Programming

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

Health economic simulation modeling

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-level simulation, probabilistic sensitivity analysis (PSA), and incorporation of patient heterogeneity fast.

Features of the current version can be summarized as follows:

  • Cohort DTSTMs, individual-level CTSTMs, and N-state PSMs that encompass Markov and semi-Markov processes
  • Options to build models directly from fitted statistical models or by defining them in terms of expressions
  • 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

You can install the current release from CRAN or the most up to date development version from GitHub.

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

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

Copy Link

Version

Install

install.packages('hesim')

Monthly Downloads

511

Version

0.5.0

License

GPL-3

Issues

Pull Requests

Stars

Forks

Maintainer

Devin Incerti

Last Published

February 17th, 2021

Functions in hesim (0.5.0)

CtstmTrans

An R6 base class for continuous time state transition models
check.id_attributes

Input validation for class objects
check_edata

Check data argument for create_input_mats
PsmCurves

Partitioned survival curves
StateVals

Model for state values
create_object_list

Form a list from ...
as_pfs_os

Convert multi-state data to PFS and OS data
CohortDtstm

Cohort discrete time state transition model
autoplot.stateprobs

Plot state probabilities
ce

A cost-effectiveness object
disprog

Disease progression object
create_params

Create a parameter object from a fitted model
expand

Expand object
create_CohortDtstmTrans

Create CohortDtstmTrans object
icer_tbl

ICER table
icer

Incremental cost-effectiveness ratio
IndivCtstmTrans

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

N-state partitioned survival model
input_mats

Input matrices for a statistical model
joined

Join statistical models at specified times
params_surv

Parameters of a survival model
create_IndivCtstmTrans

Create IndivCtstmTrans object
params_surv_list

Parameters of a list of survival models
autoplot.survival

Plot survival curves
bootstrap

Bootstrap a statistical model
absorbing

Absorbing states
apply_rr

Apply relative risks to transition probability matrices
cea

Cost-effectiveness analysis
as_array3

Convert between 2D tabular objects and 3D arrays
as.data.table.tparams_transprobs

Coerce to data.table
costs

Costs object
define_rng

Define and evaluate random number generation expressions
flexsurvreg_list

List of flexsurvreg objects
fast_rgengamma

Random generation for generalized gamma distribution
CohortDtstmTrans

Transitions for a cohort discrete time state transition model
id_attributes

Attributes for ID variables
plot_evpi

Plot expected value of perfect information
create_input_mats

Create input matrices
expand.hesim_data

Expand hesim_data
create_CohortDtstm

Create CohortDtstm object
create_lines_dt

Create a data table of treatment lines
psm4_exdata

Example data for a 4-state partitioned survival model
expmat

Matrix exponential
define_tparams

Define and evaluate transformed parameter expressions
incr_effect

Incremental treatment effect
mom_gamma

Method of moments for gamma distribution
stateval_tbl

Table to store state value parameters
mstate3_exdata

Example data for a reversible 3-state multi-state model
qmatrix.msm

Transition intensity matrix from msm object
qmatrix.matrix

Transition intensity matrix from tabular object
create_PsmCurves

Create PsmCurves object
hesim_survdists

List of survival distributions
rpwexp

Random generation for piecewise exponential distribution
icea

Individualized cost-effectiveness analysis
params_mlogit

Parameters of a multinomial logit model
tpmatrix_id

Transition probability matrix IDs
tpmatrix_names

Names for elements of a transition probability matrix
summarize_ce

Summarize costs and effectiveness
create_StateVals

Create a StateVals object
lm_list

List of lm objects
mom_beta

Method of moments for beta distribution
onc3p

Multi-state panel oncology data for 3-state model
params_mlogit_list

Parameters of a list of multinomial logit models
set_labels

Set value labels
params_joined_surv_list

Parameters of joined lists of survival models
multinom_list

List of multinom objects
plot_ceac

Plot cost-effectiveness acceptability curve
multinom3_exdata

Example data for a 3-state multinomial model
hesim

hesim: Health Economic Simulation Modeling and Decision Analysis
params_joined_surv

Parameters of joined survival models
hesim_data

Data for health economic simulation modeling
rcat

Random generation for categorical distribution
sim_ev

Expected values
partsurvfit

Partitioned survival regression object
summary.ce

Summary method for cost-effectiveness object
plot_ceaf

Plot cost-effectiveness acceptability frontier
params

Parameter object
plot_ceplane

Plot cost-effectiveness plane
reexports

Objects exported from other packages
rng_distributions

Random number generation distributions
tparams

Transformed parameter object
stateprobs

State probability object
tparams_mean

Predicted means
surv_quantile

Survival quantiles
survival

Survival object
rdirichlet_mat

Random generation for multiple Dirichlet distributions
time_intervals

Time intervals
uv_rng

Generate variates for univariate distributions
weibullNMA

Parameterization of the Weibull distribution for network meta-analysis
create_trans_dt

Create a data table of health state transitions
get_labels

Get value labels
define_model

Define and evaluate model expression
formula_list

List of formula objects
normboot

Draw parameters of statistical model from multivariate normal distribution
params_lm

Parameters of a linear model
onc3

Multi-state oncology data for 3-state model
params_lm_list

Parameters of a list of linear models
qalys

Quality-adjusted life-years object
qmatrix

Transition intensity matrix
tparams_transprobs

Transition probabilities
tpmatrix

Transition probability matrix
IndivCtstm

Individual-level continuous time state transition model