Repository navigation
Reference strategy and quadrant shares in summary.psa() and calculate_icers_psa() (#209, #202) - #229
Merged
Conversation
…_icers_psa() - summary.psa() gains ref_str and wtp (after calc_sds). With ref_str it adds meanIncCost, meanIncEffect, and the share of PSA samples in each quadrant of the incremental CE plane (propNE, propSE, propSW, propNW; NA for the reference). With wtp it adds meanNMB, and with ref_str also meanIncNMB and propCostEffective (share of samples with a higher NMB than the reference) (#209, #202). - calculate_icers_psa() gains ref_str, wtp, and nhb, passed to calculate_icers(). With uncertainty = TRUE and ref_str, it adds 95% intervals of the sample-by-sample differences from the reference (Lower_95_/Upper_95_ for Inc_Cost_ref, Inc_Effect_ref, iNMB_ref). The icers class and attributes are now kept through the uncertainty joins. - print.icers(): every *_ref column belongs to the reference view. - Docs: escape % in roxygen. An unescaped % starts an Rd comment, which had silently truncated ?calculate_icers_psa ('whether or not 95') and ?predict.metamodel. calculate_icers_psa() output for existing calls is identical to main's (objects, class, and printed tables, with and without uncertainty). Part of #209. Closes #202
Base automatically changed from
209-reference-strategy-plots
to
209-reference-strategy-core
November 12, 2026 22:29
This was referenced Nov 12, 2026
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.
Third PR of the reference-strategy series (#209), covering the PSA summaries. It also adds the quadrant table requested in #202.
Part of #209. Closes #202 (WTP line in #228, quadrant table here).
Example
What changed
summary.psa()gainsref_strandwtp, aftercalc_sds. Columns follow its existing camelCase.ref_str, the differences from the reference are computed in every PSA sample (paired):meanIncCost,meanIncEffect.propNE,propSE,propSW,propNW: the share of samples in each quadrant of the incremental CE plane. NE is more effective and more costly; SE is more effective and not more costly (dominant); SW is not more effective and not more costly; NW is not more effective and more costly (dominated). The four shares sum to 1.NA.wtp:meanNMB. Withref_stras well,meanIncNMBandpropCostEffective, the share of samples in which the strategy has a higher NMB than the reference, i.e. lies below the WTP line.calculate_icers_psa()gainsref_str,wtpandnhb, passed tocalculate_icers().uncertainty = TRUEand a reference, it adds 95% intervals of the paired differences, placed next to each estimate:Lower_95_Inc_Cost_ref,Upper_95_Inc_Cost_ref, and the same forInc_Effect_refandiNMB_ref.icersclass and attributes are now kept through the uncertainty joins. Without that,print(x, ref = "reference")would not find the reference.print.icers(): every*_refcolumn now belongs to the reference view, so the intervals don't clutter the default table.%in roxygen starts an Rd comment. It had silently truncated two help pages:?calculate_icers_psaread "whether or not 95" and stopped, and?predict.metamodelwas cut off the same way. Both are fixed. I scanned the package and found no other cases.Please check: new column names
The column names are user-facing and weren't discussed on #209:
meanIncCost,meanIncEffect,propNE/propSE/propSW/propNW,meanNMB,meanIncNMB,propCostEffective, andLower_95_…_ref/Upper_95_…_ref. They follow the existing conventions of each function. Suggest changes before this merges, while renaming is still free.Tests
New
test_psa_reference.R:meanIncNMBandpropCostEffective.calculate_icers_psa(ref_str, wtp, nhb)equalscalculate_icers()on the PSA means.NA.Verification
calculate_icers_psa()is identical tomain's oncancer_psa_dataandpsa_cdiff, with and without uncertainty (objects, class, printed tables).summary.psa()is unchanged without the new arguments.R CMD check --as-cran: 0 errors, 0 warnings, 1 NOTE (the development version number).What's left of #209
A "Presenting results against a reference strategy" section in the
basic_ceavignette, with references. I'll open it as a small follow-up PR, after which #209 can close.