darthpack is an R package that showcases the Decision Analysis in R for Technologies in Health (DARTH) coding framework to construct model-based cost-effectiveness analysis in R. The main website of darthpack can be found here.
darthpack is part of the following manuscript:
Version included in the published paper. The article above describes darthpack release v0.1.1 (package version 0.1.0), archived in Zenodo under DOI 10.5281/zenodo.3445451. Cite that DOI, and use that release, to reproduce the results reported in the paper. Later releases fix defects in the framework and change some of the cost-effectiveness results; see the NEWS file.
Each release has its own Zenodo DOI, and one further DOI covers the deposit as a whole:
| Release | Zenodo record | DOI to cite |
|---|---|---|
| v0.2.0 (current) | zenodo.org/records/22740474 | 10.5281/zenodo.22740474 |
| v0.1.1 — described in the paper | zenodo.org/records/3445451 | 10.5281/zenodo.3445451 |
| v0.1.0 | zenodo.org/records/3445448 | 10.5281/zenodo.3445448 |
| all versions | always opens the newest release | 10.5281/zenodo.3445447 |
The first three are version DOIs, each permanently tied to one release. The last is Zenodo’s concept DOI: it deliberately forwards to whichever release is newest, so it opens a different record number as new releases appear. Cite it for darthpack in general, and a version DOI when you need a specific release. The DOI badge at the top of this page points to the concept DOI.
Version 0.2.0 is a new and improved version of the framework. It corrects a number of defects in the framework functions – including a log-likelihood bug that corrupted Bayesian calibration whenever a parameter set could not be evaluated, discount rates that were applied to the wrong outcome in calculate_ce_out(), a generate_psa_params() that ignored both its n_sim and its seed argument, and a transition-array check that passed invalid matrices – and it adds input validation so that common mistakes, such as a misspelled parameter name, now raise an error instead of silently returning results for the base case. The test suite grew from 27 to 294 assertions and R CMD check now passes cleanly.
The calibration is unchanged: re-running the IMIS calibration reproduces the published posterior distribution bit-for-bit, and the framework functions return the same values as version 0.1.0 at the parameters shipped with the package. All results in data/, output/, figs/ and tables/ have been regenerated by running analysis/_master.R against the fixed code, so every committed figure and table is now what the code in this repository actually produces. The deterministic cost-effectiveness table changed the most, because it had been generated by an older version of calculate_ce_out() and never refreshed; its ICER now agrees with the probabilistic one to within Monte Carlo error, where the two previously differed by 29%. The NEWS file describes every change.
To learn more on Markov/cohort state-transition model in R, we recommend reading our introductory tutorial on time-independent cSTMs in R:
our intermediate tutorial on time-dependent cohort state-transition models (cSTMs) in R:
and understanding the use of multidimensional arrays to represent cSTM dynamics in R described in:
To model individual-level rather than cohort dynamics, we recommend our tutorial on microsimulation, also known as individual-based state-transition models (iSTMs), in R:
and, for simulating individual-level state-transition models in continuous time, our tutorial on discrete event simulation (DES) in R:
devtools to install darthpack as a package and modify it to generate your own package
# Install release version from CRAN
install.packages("devtools")
# Or install development version from GitHub
# devtools::install_github("r-lib/devtools")pkgdown to publish darthpack or your own darthpack-based repository or package as a website (optional)
# Install release version from CRAN
install.packages("pkgdown")
# Or install development version from GitHub
# devtools::install_github("r-lib/pkgdown")darthpack repository could be used in at least three different ways:
darthpack GitHub repositorydarthpack
The main website of the package could be found in: https://darth-git.github.io/darthpack/
darthpack GitHub repository, navigate to the main page of the repository (https://github.com/DARTH-git/darthpack).darthpack.Rproj.dampack is on CRAN, but IMIS, used by the calibration component, has been archived and has to be installed from the CRAN archive:
install.packages("dampack")
devtools::install_version("IMIS", version = "0.1", repos = "https://cloud.r-project.org")devtools::load_all(".")
darthpack GitHub repository, navigate to the main page of the repository (https://github.com/DARTH-git/darthpack).darthpack.Rproj.dampack is on CRAN, but IMIS, used by the calibration component, has been archived and has to be installed from the CRAN archive:
install.packages("dampack")
devtools::install_version("IMIS", version = "0.1", repos = "https://cloud.r-project.org")devtools::load_all(".")
darthpack from GitHub with:
devtools::install_github("DARTH-git/darthpack")Once the framework has been modified and updated to your specific needs, run pkgdown from the package directory each time you release your package:
pkgdown::build_site()For a more detailed description on how to quickly and easily build a website for your package, please go to https://github.com/r-lib/pkgdown and the pkgdown documentation at https://pkgdown.r-lib.org.