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.4.1

License

GPL-3

Issues

Pull Requests

Stars

Forks

Maintainer

Devin Incerti

Last Published

October 5th, 2020

Functions in hesim (0.4.1)

Psm

N-state partitioned survival model
StateVals

Model for state values
IndivCtstmTrans

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

Partitioned survival curves
CohortDtstmTrans

Transitions for a cohort discrete time state transition model
CohortDtstm

Cohort discrete time state transition model
IndivCtstm

Individual-level continuous time state transition model
CtstmTrans

An R6 base class for continuous time state transition models
ce

A cost-effectiveness object
create_PsmCurves

Create PsmCurves object
create_StateVals

Create a StateVals object
create_trans_dt

Create a data table of health state transitions
cea

Cost-effectiveness analysis
create_IndivCtstmTrans

Create IndivCtstmTrans object
create_input_mats

Create input matrices
create_lines_dt

Create a data table of treatment lines
create_CohortDtstmTrans

Create CohortDtstmTrans object
id_attributes

Attributes for ID variables
icer_tbl

ICER table
define_model

Define and evaluate model expression
disprog

Disease progression object
joined

Join statistical models at specified times
lm_list

List of lm objects
params_surv_list

Parameters of a list of survival models
params_surv

Parameters of a survival model
costs

Costs object
create_object_list

Form a list from ...
tpmatrix_names

Names for elements of a transition probability matrix
qalys

Quality-adjusted life-years object
rcat

Random generation for categorical distribution
params_joined_surv_list

Parameters of joined lists of survival models
params_joined_surv

Parameters of joined survival models
create_CohortDtstm

Create CohortDtstm object
bootstrap

Bootstrap a statistical model
absorbing

Absorbing states
hesim_data

Data for health-economic simulation modeling
hesim

hesim: Health-Economic Simulation Modeling and Decision Analysis
multinom_list

List of multinom objects
define_rng

Define and evaluate random number generation expressions
uv_rng

Generate variates for univariate distributions
expand

Expand object
create_params

Create a parameter object from a fitted model
check.id_attributes

Input validation for class objects
check_edata

Check data argument for create_input_mats
formula_list

List of formula objects
input_mats

Input matrices for a statistical model
flexsurvreg_list

List of flexsurvreg objects
incr_effect

Incremental treatment effect
rdirichlet_mat

Random generation for multiple Dirichlet distributions
rng_distributions

Random number generation distributions
icea

Individualized cost-effectiveness analysis
mstate3_exdata

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

List of survival distributions
multinom3_exdata

Example data for a 3-state multinomial model
params_lm

Parameters of a linear model
rpwexp

Random generation for piecewise exponential distribution
weibullNMA

Parameterization of the Weibull distribution for network meta-analysis
sim_ev

Expected values
tpmatrix

Transition probability matrix
stateprobs

State probability object
params

Parameter object
tpmatrix_id

Transition probability matrix IDs
stateval_tbl

Table to store state value parameters
params_lm_list

Parameters of a list of linear models
partsurvfit

Partitioned survival regression object
define_tparams

Define and evaluate transformed parameter expressions
expand.hesim_data

Expand hesim_data
params_mlogit

Parameters of a multinomial logit model
mom_beta

Method of moments for beta distribution
fast_rgengamma

Random generation for generalized gamma distribution
mom_gamma

Method of moments for gamma distribution
params_mlogit_list

Parameters of a list of multinomial logit models
tparams_mean

Predicted means
tparams_transprobs

Transition probabilities
psm4_exdata

Example data for a 4-state partitioned survival model
surv_quantile

Survival quantiles
time_intervals

Time intervals
summarize_ce

Summarize costs and effectiveness
tparams

Transformed parameter object