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

552

Version

0.3.0

License

GPL-3

Issues

Pull Requests

Stars

Forks

Maintainer

Devin Incerti

Last Published

May 25th, 2020

Functions in hesim (0.3.0)

IndivCtstm

Individual-level continuous time state transition model
CohortDtstmTrans

Transitions for a cohort discrete time state transition model
expand

Expand object
define_tparams

Define and evaluate transformed parameter expressions
ce

A cost-effectiveness object
check_edata

Check data argument for create_input_mats
define_model

Define and evaluate model expression
check.id_attributes

Input validation for class objects
costs

Costs object
define_rng

Define and evaluate random number generation expressions
icer_tbl

ICER table
create_CohortDtstm

Create CohortDtstm object
incr_effect

Incremental treatment effect
input_mats

Input matrices for a statistical model
params_surv

Parameters of a survival model
joined

Join statistical models at specified times
lm_list

List of lm objects
params_surv_list

Parameters of a list of survival models
multinom_list

List of multinom objects
params_lm

Parameters of a linear model
id_attributes

Attributes for ID variables
params

Parameter object
params_lm_list

Parameters of a list of linear models
create_CohortDtstmTrans

Create CohortDtstmTrans object
create_IndivCtstmTrans

Create IndivCtstmTrans object
rng_distributions

Random number generation distributions
rdirichlet_mat

Random generation for multiple Dirichlet distributions
flexsurvreg_list

List of flexsurvreg objects
create_lines_dt

Create a data table of treatment lines
create_object_list

Form a list from ...
mom_gamma

Method of moments for gamma distribution
mom_beta

Method of moments for beta distribution
create_PsmCurves

Create PsmCurves object
create_input_mats

Create input matrices
formula_list

List of formula objects
params_mlogit_list

Parameters of a list of multinomial logit models
params_mlogit

Parameters of a multinomial logit model
expand.hesim_data

Expand hesim_data
create_params

Create a parameter object from a fitted model
qalys

Quality-adjusted life-years object
time_intervals

Time intervals
summarize_ce

Summarize costs and effectiveness
rcat

Random generation for categorical distribution
rpwexp

Random generation for piecewise exponential distribution
tparams_mean

Predicted means
tpmatrix

Transition probability matrix
sim_ev

Expected values
tparams_transprobs

Transition probabilities
surv_quantile

Survival quantiles
fast_rgengamma

Random generation for generalized gamma distribution
tparams

Transformed parameter object
weibullNMA

Parameterization of the Weibull distribution for network meta-analysis
uv_rng

Generate variates for univariate distributions
create_trans_dt

Create a data table of health state transitions
hesim_survdists

List of survival distributions
icea

Individualized cost-effectiveness analysis
params_joined_surv_list

Parameters of joined lists of survival models
params_joined_surv

Parameters of joined survival models
tpmatrix_names

Names for elements of a transition probability matrix
psm4_exdata

Example data for a 4-state partitioned survival model
hesim_data

Data for health-economic simulation modeling
hesim

hesim: Health-Economic Simulation Modeling and Decision Analysis
stateprobs

State probability object
mstate3_exdata

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

Example data for a 3-state multinomial model
stateval_tbl

Table to store state value parameters
partsurvfit

Partitioned survival regression object
bootstrap

Bootstrap a statistical model
CtstmTrans

An R6 base class for continuous time state transition models
IndivCtstmTrans

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

Model for state values
PsmCurves

Partitioned survival curves
CohortDtstm

Cohort discrete time state transition model
absorbing

Absorbing states
Psm

N-state partitioned survival model
create_StateVals

Create a StateVals object