Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand All @@ -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"
Expand All @@ -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"
Expand All @@ -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"
Expand Down
8 changes: 5 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
20 changes: 18 additions & 2 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -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).
Expand All @@ -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
Expand Down
5 changes: 3 additions & 2 deletions R/Functions.R
Original file line number Diff line number Diff line change
Expand Up @@ -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.
#'
Expand Down
6 changes: 3 additions & 3 deletions R/Functions_cSTM_time_indep.R
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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).

Expand Down
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.

Expand Down
Loading