From 41d2909fb0583e1d7984f4252fd34f8388fabc7b Mon Sep 17 00:00:00 2001 From: Fernando Alarid-Escudero Date: Tue, 10 Nov 2026 10:02:06 -0800 Subject: [PATCH] Release v0.3.1: point to darthtools 0.4.1 fix, add ORCIDs, correct weight-sum wording - README and the PSA wrapper comment now point to darthtools v0.4.1, which fixes the same gen_wcc() indexing error (DARTH-git/darthtools#16). The tutorial keeps its local gen_wcc() so it still runs without darthtools. - Correct the description of the old weights: they summed to n - 2/3 for even n and n - 1/3 for odd n. - Add ORCIDs for Fernando Alarid-Escudero and Alan Yang to CITATION.cff and DESCRIPTION. - Bump version to 0.3.1. --- CITATION.cff | 6 +++++- DESCRIPTION | 8 +++++--- NEWS.md | 20 ++++++++++++++++++-- R/Functions.R | 5 +++-- R/Functions_cSTM_time_indep.R | 6 +++--- README.Rmd | 4 ++-- README.md | 7 ++++--- 7 files changed, 40 insertions(+), 16 deletions(-) diff --git a/CITATION.cff b/CITATION.cff index fe5bd0f..1cb663c 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -6,7 +6,7 @@ type: software title: >- R Code for An Introductory Tutorial on Cohort State-Transition Models in R Using a Cost-Effectiveness Analysis Example -version: 0.3.0 +version: 0.3.1 date-released: "2026-11-10" license: MIT repository-code: "https://github.com/DARTH-git/cohort-modeling-tutorial-intro" @@ -26,6 +26,7 @@ authors: - family-names: Alarid-Escudero given-names: Fernando email: falarid@stanford.edu + orcid: "https://orcid.org/0000-0001-5076-1172" - family-names: Krijkamp given-names: Eline orcid: "https://orcid.org/0000-0003-3970-2205" @@ -34,6 +35,7 @@ authors: orcid: "https://orcid.org/0000-0003-0693-7358" - family-names: Yang given-names: Alan + orcid: "https://orcid.org/0000-0002-0344-6812" - family-names: Hunink given-names: M.G. Myriam orcid: "https://orcid.org/0000-0002-2942-2798" @@ -58,6 +60,7 @@ preferred-citation: authors: - family-names: Alarid-Escudero given-names: Fernando + orcid: "https://orcid.org/0000-0001-5076-1172" - family-names: Krijkamp given-names: Eline orcid: "https://orcid.org/0000-0003-3970-2205" @@ -66,6 +69,7 @@ preferred-citation: orcid: "https://orcid.org/0000-0003-0693-7358" - family-names: Yang given-names: Alan + orcid: "https://orcid.org/0000-0002-0344-6812" - family-names: Hunink given-names: M.G. Myriam orcid: "https://orcid.org/0000-0002-2942-2798" diff --git a/DESCRIPTION b/DESCRIPTION index 501040a..c338cb0 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,16 +1,18 @@ Type: Project Package: cohortModelingTutorialIntro Title: R Code for An Introductory Tutorial on Cohort State-Transition Models in R -Version: 0.3.0 +Version: 0.3.1 Date: 2026-11-10 Authors@R: c( person("Fernando", "Alarid-Escudero", email = "falarid@stanford.edu", - role = c("aut", "cre")), + role = c("aut", "cre"), + comment = c(ORCID = "0000-0001-5076-1172")), person("Eline", "Krijkamp", role = "aut", comment = c(ORCID = "0000-0003-3970-2205")), person("Eva A.", "Enns", role = "aut", comment = c(ORCID = "0000-0003-0693-7358")), - person("Alan", "Yang", role = "aut"), + person("Alan", "Yang", role = "aut", + comment = c(ORCID = "0000-0002-0344-6812")), person("M.G. Myriam", "Hunink", role = "aut", comment = c(ORCID = "0000-0002-2942-2798")), person("Petros", "Pechlivanoglou", role = "aut", diff --git a/NEWS.md b/NEWS.md index 61ae8db..b18210f 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,19 @@ +# cohort-modeling-tutorial-intro 0.3.1 (2026-11-10) + +## Documentation + +* `darthtools` v0.4.1 fixes the same `gen_wcc()` indexing error + ([DARTH-git/darthtools#16](https://github.com/DARTH-git/darthtools/pull/16)). + The README and code comments now point to it. The tutorial keeps its own + copy of `gen_wcc()` in `R/Functions.R`, so it still runs without + `darthtools`. +* Corrected the description of the old weights in NEWS.md and in the + `gen_wcc()` documentation: they summed to n - 2/3 for an even number of + cycles and to n - 1/3 for an odd number (such as the tutorial's 75), not + always to n - 2/3. +* Added ORCIDs for Fernando Alarid-Escudero and Alan Yang to `CITATION.cff` + and `DESCRIPTION`. + # cohort-modeling-tutorial-intro 0.3.0 (2026-11-10) This release fixes a bug in the Simpson's 1/3rd within-cycle correction (WCC). @@ -9,8 +25,8 @@ not its conclusions. * `gen_wcc(method = "Simpson1/3")` (`R/Functions.R`) assigned the 4/3 and 2/3 weights by position in the 1-based R vector instead of by time t = 0, 1, ..., n. It returned `1/3, 2/3, 4/3, 2/3, ..., 1/3` instead of - `1/3, 4/3, 2/3, 4/3, ..., 1/3`, so the weights summed to n - 2/3 instead - of n. For example, `gen_wcc(4)` integrated f(t) = 1 over [0, 4] as 3.33 + `1/3, 4/3, 2/3, 4/3, ..., 1/3`, so the weights summed to n - 2/3 (even n) + or n - 1/3 (odd n) instead of n. For example, `gen_wcc(4)` integrated f(t) = 1 over [0, 4] as 3.33 instead of 4. Weights are now indexed by time (closes #2). The same error is in the WCC description, the equation and the diff --git a/R/Functions.R b/R/Functions.R index 03995c0..94db172 100644 --- a/R/Functions.R +++ b/R/Functions.R @@ -314,8 +314,9 @@ format_table_cea <- function(table_cea) { #' @note Versions of this repository up to v0.2.1 (and \code{darthtools} up to #' v0.4.0) assigned the 4/3 and 2/3 Simpson weights by vector position instead #' of by time, producing \eqn{[1/3, 2/3, 4/3, \ldots, 1/3]}, whose weights sum -#' to \eqn{n_T - 2/3} instead of \eqn{n_T}. This was fixed in v0.3.0. See -#' NEWS.md. We thank Lauren N. Steimle (Georgia Institute of Technology) and +#' to \eqn{n_T - 2/3} (even \eqn{n_T}) or \eqn{n_T - 1/3} (odd \eqn{n_T}) +#' instead of \eqn{n_T}. This was fixed in v0.3.0 (and in \code{darthtools} +#' v0.4.1). See NEWS.md. We thank Lauren N. Steimle (Georgia Institute of Technology) and #' GitHub user ambtnhlr, who independently identified and reported this error #' and proposed the correction. #' diff --git a/R/Functions_cSTM_time_indep.R b/R/Functions_cSTM_time_indep.R index 60efef9..03b945c 100644 --- a/R/Functions_cSTM_time_indep.R +++ b/R/Functions_cSTM_time_indep.R @@ -228,9 +228,9 @@ calculate_ce_out <- function(l_params_all, n_wtp = 100000){ # User defined v_dwe <- 1 / ((1 + d_e * cycle_length) ^ (0:n_cycles)) ## Within-cycle correction (WCC) using Simpson's 1/3 rule - #* Uses `gen_wcc()` from "R/Functions.R" (fixed in v0.3.0). Do not switch to - #* `darthtools::gen_wcc()` until darthtools > 0.4.0, which has the same - #* indexing bug (see NEWS.md). + #* Uses `gen_wcc()` from "R/Functions.R" (fixed in v0.3.0), so the tutorial + #* runs without darthtools. `darthtools::gen_wcc()` is identical from + #* darthtools v0.4.1; earlier versions have the indexing bug (see NEWS.md). v_wcc <- gen_wcc(n_cycles = n_cycles, method = "Simpson1/3") # vector of wcc diff --git a/README.Rmd b/README.Rmd index 6d3d69b..db90da8 100644 --- a/README.Rmd +++ b/README.Rmd @@ -76,7 +76,7 @@ install.packages("dampack") # from CRAN remotes::install_github("DARTH-git/darthtools") # from GitHub ``` -**Note:** `darthtools` up to v0.4.0 has the same Simpson's 1/3rd indexing error as this repository had. Use the corrected `gen_wcc()` in `R/Functions.R` until a fixed `darthtools` is released. +**Note:** `darthtools` up to v0.4.0 has the same Simpson's 1/3rd indexing error as this repository had. It is fixed in [`darthtools` v0.4.1](https://github.com/DARTH-git/darthtools/releases/tag/v0.4.1). If you use `darthtools::gen_wcc()`, update to v0.4.1 or later. We recommend becoming familiar with the [DARTH](https://darthworkgroup.com) coding framework described in @@ -88,7 +88,7 @@ You can cite the R code in this repository like this: "we based our analysis on > Alarid-Escudero F, Krijkamp EM, Enns EA, Yang A, Hunink MGM, Pechlivanoglou P, Jalal H. An Introductory Tutorial on Cohort State-Transition Models in R Using a Cost-Effectiveness Analysis Example. Medical Decision Making, 2023;43(1):3-20. https://doi.org/10.1177/0272989X221103163 -> Alarid-Escudero F, Krijkamp EM, Enns EA, Yang A, Hunink MGM, Pechlivanoglou P, Jalal H. R Code for An Introductory Tutorial on Cohort State-Transition Models in R Using a Cost-Effectiveness Analysis Example (Version v0.3.0). Zenodo. [10.5281/zenodo.5223092](https://doi.org/10.5281/zenodo.5223092). Last accessed DD Month YYYY. +> Alarid-Escudero F, Krijkamp EM, Enns EA, Yang A, Hunink MGM, Pechlivanoglou P, Jalal H. R Code for An Introductory Tutorial on Cohort State-Transition Models in R Using a Cost-Effectiveness Analysis Example (Version v0.3.1). Zenodo. [10.5281/zenodo.5223092](https://doi.org/10.5281/zenodo.5223092). Last accessed DD Month YYYY. If you adapted the code, write "Adapted from:" or "Based on" so readers know you modified it. For more on how and when to cite computer code, see [Writing Code (from the MIT Academic Integrity Handbook)](https://integrity.mit.edu/handbook/writing-code). diff --git a/README.md b/README.md index 91b614d..5f62b6e 100644 --- a/README.md +++ b/README.md @@ -106,8 +106,9 @@ remotes::install_github("DARTH-git/darthtools") # from GitHub ``` **Note:** `darthtools` up to v0.4.0 has the same Simpson’s 1/3rd -indexing error as this repository had. Use the corrected `gen_wcc()` in -`R/Functions.R` until a fixed `darthtools` is released. +indexing error as this repository had. It is fixed in [`darthtools` +v0.4.1](https://github.com/DARTH-git/darthtools/releases/tag/v0.4.1). If +you use `darthtools::gen_wcc()`, update to v0.4.1 or later. We recommend becoming familiar with the [DARTH](https://darthworkgroup.com) coding framework described in @@ -139,7 +140,7 @@ this repository” button gives the metadata from > Alarid-Escudero F, Krijkamp EM, Enns EA, Yang A, Hunink MGM, > Pechlivanoglou P, Jalal H. R Code for An Introductory Tutorial on > Cohort State-Transition Models in R Using a Cost-Effectiveness -> Analysis Example (Version v0.3.0). Zenodo. +> Analysis Example (Version v0.3.1). Zenodo. > [10.5281/zenodo.5223092](https://doi.org/10.5281/zenodo.5223092). Last > accessed DD Month YYYY.