-
Notifications
You must be signed in to change notification settings - Fork 17
/
README.Rmd
103 lines (88 loc) · 5.73 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
---
output: github_document
always_allow_html: true
---
# Health economic simulation modeling <img src="man/figures/logo.png" align="right" width="90" />
<!-- badges: start -->
[![CRAN_Status_Badge](https://www.r-pkg.org/badges/version/hesim)](https://cran.r-project.org/package=hesim)
[![R build status](https://github.com/hesim-dev/hesim/workflows/R-CMD-check/badge.svg)](https://github.com/hesim-dev/hesim/actions)
[![Coverage Status](https://codecov.io/gh/hesim-dev/hesim/branch/master/graph/badge.svg)](https://app.codecov.io/gh/hesim-dev/hesim)
<!-- badges: end -->
## 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](https://hesim-dev.github.io/hesim/) from CRAN or the most up to date development version from GitHub.
```{r, eval = FALSE}
# Install from CRAN:
install.packages("hesim")
# Install the development version from GitHub:
# install.packages("devtools")
devtools::install_github("hesim-dev/hesim")
```
## Getting started
There are two good places to start:
1. The [Introduction to `hesim`](https://hesim-dev.github.io/hesim/articles/intro.html) article provides a quick introduction.
2. Our [preprint](https://arxiv.org/abs/2102.09437) describes the package (including mathematical details) more thoroughly.
You might also want to explore our example analyses which can be found in the preprint and web articles. They are summarized in the table below, with some drawn from the [Decision Modeling for Health Economic Evaluation](https://www.herc.ox.ac.uk/downloads/decision-modelling-for-health-economic-evaluation) textbook. Key areas of focus are the (i) statistical models of disease progression (in terms of the baseline risk and relative treatment effects) and (ii) the available data (either individual patient data (IPD) or aggregate-level data).
```{r echo = FALSE, message = FALSE, warning = FALSE}
library("knitr")
library("kableExtra")
level <- c("Cohort", "Cohort", "Cohort", "Cohort", "Individual", "Individual", "Cohort")
links <- c(
rep("https://arxiv.org/pdf/2102.09437", 3),
"https://hesim-dev.github.io/hesim/articles/markov-cohort.html",
"https://hesim-dev.github.io/hesim/articles/markov-inhomogeneous-cohort.html",
"https://hesim-dev.github.io/hesim/articles/mlogit.html",
"https://hesim-dev.github.io/hesim/articles/markov-inhomogeneous-indiv.html",
"https://hesim-dev.github.io/hesim/articles/mstate.html",
"https://hesim-dev.github.io/hesim/articles/psm.html"
)
name <- c(
"Preprint 4.1", "Preprint 4.2", "Preprint 4.3",
"Simple Markov cohort", "Time inhomogeneous Markov (cohort)", "Multinomial logit",
"Time inhomogeneous Markov (individual)", "Semi-Markov multi-state", "4-state PSM"
)
name <- cell_spec(name, link = links)
model <- c("iCTSTM", "PSM", "cDTSTM", "cDTSTM", "cDTSTM", "cDTSTM", "iCTSTM", "iCTSTM", "PSM")
num <- 1:length(model)
application <- c(rep("Oncology", 3),"HIV", "Hip replacement", "Generic", "Hip replacement", "Generic", "Oncology")
dismod1 <- c("Multi-state model", "Survival models", "Multi-state model (panel data)",
"Multinomial", "Custom", "Multinomial logit", "Custom", "Multi-state model",
"Survival models")
dismod2 <- c("Coefficient (AFT)", "Coefficient (AFT)" , "RR",
"RR", "Coefficient (HR)", "Coefficient (OR)", "Coefficient (HR)",
"Coefficient (AFT)", "Coefficient (AFT)")
data1 <- c(rep("IPD", 3), "Aggregate", "Aggregate", "IPD", "Aggregate", "IPD", "IPD")
data2 <- c("IPD", rep("Aggregate", 2), "Aggregate", "Aggregate", "IPD", "Aggregate",
"IPD", "IPD")
tbl <- cbind(num, name, model, dismod1, data1, dismod2, data2, application)
colnames(tbl) <- c("", "Name", "Model",
rep(c("Disease model", "Disease data"), 2),
"Application")
rownames(tbl) <- 1:nrow(tbl)
kable(tbl, row.names = FALSE, escape = FALSE) %>%
kable_styling() %>%
add_header_above(c(rep("", 3), "Baseline risk" = 2, "Treatment effect" = 2, "")) %>%
column_spec(2, width = "15em") %>%
footnote(general = paste0(
"iCTSTM = Individual-level continuous time state transition model; ",
"PSM = partitioned survival model; ",
"cDTSTM = Cohort discrete time state transition model. ",
"AFT = accelerated failure time; RR = relative risk; HR = hazard ratio; OR = odds ratio. ",
"IPD = individual patient data. "),
footnote_as_chunk = TRUE)
```
## Citing hesim
If you use `hesim`, please cite as follows:
```{r, echo = FALSE, comment = ""}
citation("hesim")
```