dampack (development version)
New features
-
print.icers()prints a formatted ICER table, with options for the currency symbol and the number of digits (#184, #171). -
plot.psa()gains aref_strargument that plots the PSA on the incremental cost-effectiveness plane relative to a chosen reference strategy (#188). - Plotting functions now default to an accessible, colorblind-friendly palette (
col = "access", based on viridis). The previous palettes remain available ascol = "full"andcol = "bw". - Added
cancer_psa_data, PSA output from an illustrative model of three cancer treatments (chemotherapy, radiation, surgery). It is now the example dataset used throughout the examples, tests, and vignettes. - Added
df_example_psa_elc, a de-identified six-strategy PSA sample whose cost-effectiveness frontier switches optimal strategy three times. It is useful for exercising CEAC and expected loss curve functions, which behave differently when the frontier switches more than once (#180). - Added a package overview help page,
?dampack(#150).
Superseded
-
example_psaandexample_psa_objare superseded bycancer_psa_data, which contains the same PSA samples. Both remain available for backward compatibility and will be removed in dampack 2.0. They are now rebuilt fromcancer_psa_datawhen the package is installed, so the samples are stored only once.
Breaking changes
- Strategy names are now kept exactly as provided in
make_psa_obj(),create_dsa_oneway(),create_dsa_twoway(), and the objects built from them, so names such as “Standard of care” appear unchanged in tables and plot legends. Previously they were converted withmake.names()(toStandard.of.care) with a warning. Code that refers to the converted names must use the original ones, for examplepsa$cost[["Standard of care"]]instead ofpsa$cost$Standard.of.care. Strategy names must be unique and not missing or empty, and a wrong number of names now gives an informative error (#208). -
summary.ceac()renames its third output column fromcost_eff_strattooptimal_strategy. Code that refers to the old column name with$cost_eff_stratmust be updated (#173). - dampack now requires R 4.2.0 or later. Current versions of its dependencies need at least R 4.1.3 (triangle), and CRAN only accepts R bounds of the form x.y.0.
- dampack now requires ggplot2 3.5.0 or later and scales 1.3.0 or later, for ggplot2’s
transformargument andscales::new_transform()(#211).
Bug fixes
-
plot.exp_loss()with its default log-scale y axis (log_y = TRUE) now labels every order of magnitude. Its evenly spaced default breaks used to bunch up at the top of the log axis and leave the lower curves without any labels. - The
hund_strathelp page now describes the data (simulated costs and QALYs for 100 hypothetical strategies) and its columns, with an example. Typos in several help pages are fixed (#219). -
plot.psa(center = FALSE)no longer warns “No shared levels found betweennames(values)of the manual scale and the data’s fill values” when it is drawn. The fill scale is now added only when the center points that use it are. -
plot.owsa(col = "bw")now draws each strategy with its own line type; all strategies used to share one line type and could not be told apart (#176). -
metamodel()now names invalid parameters in its error message, including when called throughcalc_evppi()andcalc_evsi()(#177). -
gen_psa_samp()now accepts the documented"value, weight"parameterization for"bootstrap"distributions. It used to be dropped silently, which shifted the parameterization of every later parameter by one position. Samples from calls with a bootstrap parameter before other parameters will differ, because they are now correct. Unknown distributions or parameterizations, andparams,dists,parameterization_types, anddists_paramsof different lengths, now give informative errors instead of being dropped silently (#175). -
calculate_icers()with a single strategy now returns a validicersobject, with the same columns as for several strategies (Statusis"ND"and the incremental columns areNA), soplot()andprint()work on it (#183). - Plots that choose an accessible palette from the number of groups (
owsa_tornado(),owsa_opt_strat(),plot.twsa(), and the value-of-information plots) no longer fail on ggplot2 versions before 4.0 with “no applicable method for@applied to an object of class ‘ggplot_built’” (#198). -
calculate_icers()with no strategies now gives an informative error instead of “missing value where TRUE/FALSE needed”, and its documentation no longer describes a reference-strategy option that does not exist (#178). -
ceac(),calc_exp_loss(), and the expected value of perfect information no longer pick the optimal strategy at random among strategies whose net benefits differ by less than a relative 1e-5 (for example, a few dollars at a scale of $1,000,000).max.col()’s defaultties.method = "random"treated these as ties; comparisons are now exact, and exact ties go to the first strategy. Results for such near-tied strategies change and are now reproducible (#167). -
metamodel(), and the functions that use it (owsa()andtwsa()on a PSA,calc_evppi(),calc_evsi()), now work with strategy names that are not syntactically valid R names (#208). -
owsa_opt_strat()plots now draw one bar per range in which a strategy is optimal, and adjacent bars meet halfway between parameter values, so the bars line up with the switch points on the axis. Before, each bar covered only the values where its strategy was observed optimal (leaving gaps), and a strategy optimal in two separate ranges got a single bar spanning both. The data returned withreturn = "data"is unchanged (#67). -
summary.ceac()no longer returns duplicated, mislabeled, andNA-range rows when the cost-effectiveness frontier switches optimal strategy two or more times. It now returns one row per interval (#173). -
run_psa()no longer drops the first parameter of a PSA sample that was not created bygen_psa_samp(); it removes only thensampsample-number column thatgen_psa_samp()adds. WhenFUNfails on the PSA parameters,run_psa()now stops with “FUN is not well defined …” followed byFUN’s own error; that check never ran before (#174). - The y-axis label of the CEAC plot now correctly describes what is plotted (#165).
-
twsa()on adsa_twowayobject now works without an explicitoutcome; it used to fail with “‘arg’ must be of length 1” (#210). -
make_psa_obj()and the DSA constructors now name the columns ofother_outcomeafter the strategies, likecostandeffectiveness(#210). - When
FUNfails on the base case,run_owsa_det()andrun_twsa_det()now stop with “FUN is not well defined …” followed byFUN’s own error; that check never ran before (#210). -
plot.exp_loss(col = "bw")now useslsizefor the line width and no longer warns about an unused color scale (#210). -
owsa_tornado()no longer omits parameters whose minimum value is negative (#166). - Code hygiene throughout the package: progress bars in
run_owsa_det()andrun_twsa_det()are now closed, loops handle zero-length inputs (for example,calc_evpi()with an emptywtpreturns an empty result), deprecatedtrans/scales::trans_new()are replaced by ggplot2’stransformandscales::new_transform(),cor()is imported, and therdirichlet()documentation is fixed. Thanks to @IG-ABHINAV for this contribution (#211, #224). - Fixed a pointer in the PSA vignette to a vignette that no longer exists (#168).
-
citation("dampack")now returns a single, current entry built from the package’s DESCRIPTION; it used to also return a stale entry for version 1.0.1 (#213).
dampack 1.0.2.1000
CRAN release: 2024-09-30
New features
- Added
calculate_icers_psa(), which computes ICERs from a PSA object with uncertainty intervals (#160). -
plot.owsa()andplot.twsa()gain an argument to plot specific points, such as base-case values, on top of the default plot (#155). -
number_ticks()is now exported (#158).
dampack 1.0.1
CRAN release: 2021-05-30
Bug fixes
- Compatibility fix for ggplot2 3.3.1:
scale_fill_discrete()andscale_color_discrete()are now differentiated inadd_common_aes(). The previous version caused an error with ggplot2 3.3.1.
