Repository navigation
Keep calculate_icers() fully incremental; add calculate_cers_ref() for comparisons with a reference strategy (#209) - #261
Merged
Conversation
… DESCRIPTION DESCRIPTION declares R (>= 4.1.0), but no job ran R 4.1: oldrel-1 and the min-deps job use current R. The min-deps job now has a matrix entry that reads the R bound from DESCRIPTION and checks the package on that version with the minimum package versions.
…or repositories R 4.1 on ubuntu-latest (Ubuntu 26) failed while resolving dependencies: the Bioconductor 3.14 repositories pak adds for R 4.1 are unreachable, and the package manager has no R 4.1 binaries for Ubuntu 26. dampack uses no Bioconductor packages.
The new minimum-R CI job could not install the dependencies on R 4.1.0: 'triangle: Needs R >= 4.1.3'. Raise the declared bound to what installs from CRAN, and let the job confirm that nothing else needs a newer R.
R CMD check warns 'Dependence on R version 4.1.3 not with patchlevel 0', which CRAN does not accept. On R 4.1.3 every other check passed.
CI: test the minimum R version declared in DESCRIPTION
…s in vignettes (#219) R CMD check reported an installed size of 6.0 MB (data 3.5 MB, doc 2.0 MB). CRAN flags packages over 5 MB. - LazyDataCompression: xz. The same PSA samples are stored three times in the lazy-load database (cancer_psa_data, and the superseded example_psa and example_psa_obj rebuilt from it at install), so the compression matters: data 3.5 -> 2.8 MB. Loaded objects identical. - Vignette figures use ragg_png (ragg in Suggests; falls back to png without it): same resolution, about 22% smaller PNGs. doc 2.0 -> 1.6 MB. Installed size 6.0 -> 4.8 MB ("checking installed package size ... OK"); tarball 2.83 -> 2.51 MB.
Bring the installed size under CRAN's 5 MB limit: xz lazy data, ragg vignette figures (#219)
…e and links (#217) - README.md is now generated from README.Rmd (devtools::build_readme()); README.Rmd is build-ignored, README.md and its one figure (man/figures/README-ceac-1.png, ragg, 48 KB) are kept for GitHub, CRAN and pkgdown. - New sections: why dampack (statement of need), what it does, a runnable example with cancer_psa_data (calculate_icers_psa() output and a CEAC figure), learn more (website, reference, articles in reading order, news), citation, getting help and contributing (issues, CONTRIBUTING, code of conduct). CRAN status badge added. - Kept: installation (now with remotes), the macOS locale tip, funding, the DARTH team. - The team section listed David Garibay as CRAN maintainer; Fernando is maintainer since #245.
README.Rmd: statement of need, feature overview, minimal example and links (#217)
With log_y = TRUE (the default), the y breaks came from number_ticks(), which spaces them evenly. On a log axis they bunched up at the top and left the lower curves without labels. Use scales::breaks_log(n_y_ticks) unless ybreaks is given.
…019 paper - 'What it does' names CEACs with the CEAF and expected loss curves (ELCs), and cites Alarid-Escudero et al. (2019), doi:10.1016/j.jval.2019.02.008. - The example shows, with numbers computed from cancer_psa_data, that the strategy most likely to be cost-effective (Surgery at $50,000/QALY) is not the optimal one (Chemo), which is why the CEAC needs its frontier. - New 'Expected loss curves' subsection and figure: foregone benefit, optimal strategy and EVPI in one figure. A hidden check confirms the optimal strategy's expected loss equals calc_evpi() at that threshold. - The full reference is listed under Citation.
plot.exp_loss(): readable labels on the log-scale y axis
README: the acceptability frontier and expected loss curves (Alarid-Escudero et al., 2019)
…rom dampack output - Sticker (option I): CEACs with the CEAF above the expected loss curves of cancer_psa_data, on one WTP axis; both frontiers switch from Radio to Chemo at $40,000 (dotted line). viridis option D colours (col = "access"), JetBrains Mono wordmark. - man/figures/logo.png (240 x 278, 17 KB) in the README header and on the pkgdown home page. - pkgdown/favicon/: favicon.svg/.ico/96px, apple-touch-icon, web manifest, from an ELC-only icon without text that stays legible at 16-32 px. - logo/: make_hex.R (SVGs from ceac() and calc_exp_loss()), render.sh (PNGs, favicons), README.md, the SVGs and a 600 dpi print PNG. logo/ is build-ignored.
Add the dampack hex logo and site favicons
…tion EVSI - 'What it does' credits the methods: EVPPI from regression metamodels (Strong et al. 2014; Jalal and Alarid-Escudero 2018) and EVSI with the Gaussian approximation approach (Jalal and Alarid-Escudero 2018, doi:10.1177/0272989X17715627), both from the existing PSA sample. - New 'Value of research: EVPPI and EVSI from one PSA' section with a runnable example on cancer_psa_data (EVPI, EVPPI of two failure probabilities, EVSI by study size), with numbers computed inline and a hidden check that EVSI rises with n and EVSI < EVPPI < EVPI. - The Gaussian approximation paper is listed under Citation.
README: regression-metamodel EVPPI and Gaussian-approximation EVSI (Jalal and Alarid-Escudero, 2018)
# Conflicts: # NEWS.md
…r comparisons with a reference As agreed at the DARTH meeting of Nov 17, 2026: - Remove ref_str from calculate_icers(), print.icers(), plot.icers(), calculate_icers_psa() and summary.psa(). They keep wtp/nhb (NMB, NHB) and currency. - plot.icers(incremental = TRUE) puts the first non-dominated strategy at the origin. - New calculate_cers_ref() and calculate_cers_ref_psa(), with print() and plot() methods, compare every strategy with a reference strategy, citing the NICE, CDA-AMC and Zorginstituut Nederland guidelines. - basic_cea vignette section, README bullet, pkgdown reference group. Co-Authored-By: Claude <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## 209-reference-strategy-core #261 +/- ##
===============================================================
+ Coverage 93.83% 93.92% +0.08%
===============================================================
Files 18 19 +1
Lines 2028 2073 +45
===============================================================
+ Hits 1903 1947 +44
- Misses 125 126 +1
🚀 New features to boost your workflow:
|
Contributor
|
In the future, can PR be more focused on the specific issue? This PR has far too many things going on |
mbkauf
requested changes
Nov 18, 2026
mbkauf
left a comment
Contributor
There was a problem hiding this comment.
- Move
check_ref_str()from icers.R to cers_ref.R
Co-Authored-By: Claude <noreply@anthropic.com>
Collaborator
Author
|
Thanks, @mbkauf. |
feralaes
added a commit
that referenced
this pull request
Nov 18, 2026
…to 212-examples; drop the ref_str examples Co-Authored-By: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR implements what we agreed at the DARTH meeting on Nov 17. It goes into the #227 branch, so #227 then carries the revised design.
What changes
calculate_icers()stays fully incremental, with no reference strategy.ref_stris removed fromcalculate_icers(),print.icers(),plot.icers(),calculate_icers_psa()andsummary.psa().summary.psa()is back to itsmainversion.wtp/nhb, which add the strategies' ownNMB/NHB(Add NMB and iNBM to calc_icer #200), andcurrency.plot.icers(incremental = TRUE)plots the incremental cost-effectiveness plane. The first non-dominated strategy (the least costly strategy on the frontier) sits at (0, 0). The optionalwtpline goes through that strategy.New:
calculate_cers_ref()andcalculate_cers_ref_psa(), which compare every strategy with a reference strategy chosen by the user. Columns:Inc_CostandInc_Effectversus the reference.CER, the cost-effectiveness ratio versus the reference.Status: Reference / Dominant / Dominated / More costly, more effective / Less costly, less effective / Equivalent.wtp:NMBandInc_NMB(nhb = TRUEalso addsNHBandInc_NHB).The reference comes first, then the other strategies by increasing cost. This answers the row-order question from the review.
The PSA version adds, with
uncertainty = TRUE:Prop_NE/Prop_SE/Prop_SW/Prop_NW: the share of samples in each quadrant.Prop_CE(withwtp): the share of samples that are cost-effective versus the reference.print()andplot()methods for the newcers_refclass:lines =overrides this.Guidelines cited in the help page and in a new section of
vignette("basic_cea"):The vignette uses the HIV screening example to show why the reference comparison complements the incremental analysis rather than replacing it. Annual screening has a CER of $80,941/QALY versus the status quo, so it looks cost-effective at $100,000/QALY. Yet it is strongly dominated by screening every 3 years.
Kept from the earlier work:
plot.psa(ref_str = ), which predates Fully incremental calculate_icers() with NMB and an incremental plot, plus calculate_cers_ref() for comparisons with a reference strategy (#209, #200) #227.drop = FALSEfix.Also updated: NEWS, a README bullet, and a new pkgdown reference group, "Comparisons with a reference strategy".
Checks
R CMD check --as-cran: 0 errors, 0 warnings. The only NOTE is a hidden.gitfile, which comes from running the check in a git worktree.lintr::lint_package(): 0 lints.tests/testthat/test_cers_ref.Rcover:calculate_icers(),calculate_icers_psa()andsummary.psa()no longer takeref_str.test_reference_plots.Rcovers the incrementalplot.icers()and the star plot.Follow-up
#252 (examples) adds examples that use the removed
ref_strarguments. I'll update it once this is merged.🤖 Generated with Claude Code