Skip to content

Commit a784cc1

Browse files
authored
Merge pull request #22 from dom-muston/main
Repo name and other minor changes
2 parents 91a9bd7 + 021b063 commit a784cc1

File tree

6 files changed

+52
-29
lines changed

6 files changed

+52
-29
lines changed

.github/workflows/R-CMD-check.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,6 @@ jobs:
4444
with:
4545
extra-packages: any::rcmdcheck
4646
needs: check
47-
# Newly added line suggested by Github Copilot - cache instead of cache-key
48-
cache: ${{ runner.os }}-r-deps
4947

5048
- uses: r-lib/actions/check-r-package@v2
5149
with:

DESCRIPTION

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ Authors@R: c(
88
)
99
Description: Evaluates present values and cost-effectiveness with dynamic pricing and uptake.
1010
License: GPL (>= 3)
11-
URL: https://MSDLLCpapers.github.io/dynacem/, https://github.com/MSDLLCpapers/dynacem
12-
BugReports: https://github.com/MSDLLCpapers/dynacem/issues
11+
URL: https://MSDLLCpapers.github.io/dynamicpv/, https://github.com/MSDLLCpapers/dynamicpv
12+
BugReports: https://github.com/MSDLLCpapers/dynamipv/issues
1313
Encoding: UTF-8
1414
Roxygen: list(markdown = TRUE)
1515
RoxygenNote: 7.3.3

README.Rmd

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ knitr::opts_chunk$set(
1717

1818
<!-- badges: start -->
1919
[![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html#experimental)
20-
[![R-CMD-check](https://github.com/MSDLLCpapers/dynacem/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/MSDLLCpapers/dynacem/actions/workflows/R-CMD-check.yaml)
21-
[![Codecov test coverage](https://codecov.io/gh/MSDLLCpapers/dynacem/graph/badge.svg)](https://app.codecov.io/gh/MSDLLCpapers/dynacem)
20+
[![R-CMD-check](https://github.com/MSDLLCpapers/dynamicpv/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/MSDLLCpapers/dynamicpv/actions/workflows/R-CMD-check.yaml)
21+
[![Codecov test coverage](https://codecov.io/gh/MSDLLCpapers/dynamicpv/graph/badge.svg)](https://app.codecov.io/gh/MSDLLCpapers/dynamicpv)
2222
<!-- badges: end -->
2323

2424
The goal of *dynamicpv* is to evaluate present values and cost-effectiveness with dynamic pricing and uptake.
2525

26-
Through the [dynpv()](https://msdllcpapers.github.io/dynacem/reference/dynpv.html) function, the package provides calculations of the present values of costs, life years, QALYs or other payoffs allowing for dynamic uptake (also known as multiple cohorts) and dynamic pricing (also known as life-cycle). The starting point is a conventional cohort cost-effectiveness model, such as one computed using the [heemod](https://cran.r-project.org/package=heemod) package.
26+
Through the [dynpv()](https://msdllcpapers.github.io/dynamicpv/reference/dynpv.html) function, the package provides calculations of the present values of costs, life years, QALYs or other payoffs allowing for dynamic uptake (also known as multiple cohorts) and dynamic pricing (also known as life-cycle). The starting point is a conventional cohort cost-effectiveness model, such as one computed using the [heemod](https://cran.r-project.org/package=heemod) package.
2727

2828
## Installation
2929

@@ -34,15 +34,15 @@ You can install the development version of *dynamicpv* from [GitHub](https://git
3434
# Install devtools package if not already installed
3535
install.packages("devtools")
3636
37-
# Install dynamicpv using pak, from MSD's dynacem repository
38-
pak::pak("MSDLLCpapers/dynacem")
37+
# Install dynamicpv using pak from MSD repository
38+
pak::pak("MSDLLCpapers/dynamicpv")
3939
```
4040

4141
Note that the above does not install vignettes. Vignettes may be viewed on the [package website](https://msdllcpapers.github.io/dynacem) or by instead running the following.
4242

4343
```{r instal2}
4444
#| eval: false
45-
devtools::install_github("MSDLLCpapers/dynacem", build_vignettes=TRUE)
45+
devtools::install_github("MSDLLCpapers/dynamicpv", build_vignettes=TRUE)
4646
```
4747

4848
You should then load the package, alongside some other packages used here.
@@ -63,11 +63,11 @@ library(tidyr)
6363

6464
There are four vignettes provided.
6565

66-
1. The [Dynamic Pricing](https://msdllcpapers.github.io/dynacem/articles/dynamic-pricing.html) vignette (`vignette("dynamic-pricing")`) describes how present values may be calculated in the package from a payoff vector, allowing for the prices of the resources costed to be dynamic.
66+
1. The [Dynamic Pricing](https://msdllcpapers.github.io/dynamicpv/articles/dynamic-pricing.html) vignette (`vignette("dynamic-pricing")`) describes how present values may be calculated in the package from a payoff vector, allowing for the prices of the resources costed to be dynamic.
6767

68-
2. The [Dynamic Uptake](https://msdllcpapers.github.io/dynacem/articles/dynamic-uptake.html) vignette (`vignette("dynamic-uptake")`) explores further how present values can be derived allowing for dynamic uptake. This is in contrast to the non-dynamic approach of calculating a present value for a single cohort of patients. This is analogous to the use by general insurance actuaries of run-off triangles.
68+
2. The [Dynamic Uptake](https://msdllcpapers.github.io/dynamicpv/articles/dynamic-uptake.html) vignette (`vignette("dynamic-uptake")`) explores further how present values can be derived allowing for dynamic uptake. This is in contrast to the non-dynamic approach of calculating a present value for a single cohort of patients. This is analogous to the use by general insurance actuaries of run-off triangles.
6969

70-
3. The [Cost-Effectiveness Applications](https://msdllcpapers.github.io/dynacem/articles/cost-effectiveness-applications.html) (`vignette(cost-effectiveness-applications")`) vignette describes how, given a static cost-effectiveness model (single cohort, prices constant in real terms), Incremental Cost-Effectiveness Ratios may be calculated that allow for dynamic pricing and/or dynamic uptake. This is illustrated by taking an example three-state partitioned survival model of a new intervention for an oncology indication compared to standard of care, with stated assumptions for how pricing and uptake may be dynamic. Nominal and Real ICERs are plotted over time, illustrating the impact of the loss of exclusivity points for each intervention.
70+
3. The [Cost-Effectiveness Applications](https://msdllcpapers.github.io/dynamicpv/articles/cost-effectiveness-applications.html) (`vignette(cost-effectiveness-applications")`) vignette describes how, given a static cost-effectiveness model (single cohort, prices constant in real terms), Incremental Cost-Effectiveness Ratios may be calculated that allow for dynamic pricing and/or dynamic uptake. This is illustrated by taking an example three-state partitioned survival model of a new intervention for an oncology indication compared to standard of care, with stated assumptions for how pricing and uptake may be dynamic. Nominal and Real ICERs are plotted over time, illustrating the impact of the loss of exclusivity points for each intervention.
7171

72-
4. The [Budget Impact Applications](https://msdllcpapers.github.io/dynacem/articles/budget-impact-applications.html) (`vignette("budget-impact-applications")`) vignette describes how, given a static cost-effectiveness model (single cohort, prices constant in real terms) and dynamic uptake, a budget impact can be readily calculated. The calculations are repeated with the dynamic pricing assumptions to illustrate how easily this can be done, and examine the differences between a budget impact assessment with and without dynamic pricing.
72+
4. The [Budget Impact Applications](https://msdllcpapers.github.io/dynamicpv/articles/budget-impact-applications.html) (`vignette("budget-impact-applications")`) vignette describes how, given a static cost-effectiveness model (single cohort, prices constant in real terms) and dynamic uptake, a budget impact can be readily calculated. The calculations are repeated with the dynamic pricing assumptions to illustrate how easily this can be done, and examine the differences between a budget impact assessment with and without dynamic pricing.
7373

_pkgdown.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
url: https://MSDLLCpapers.github.io/dynacem/
22
template:
33
bootstrap: 5
4+
math-rendering: mathjax
45

56
reference:
67
- title: Key functions and datasets

man/dynamicpv-package.Rd

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vignettes/cost-effectiveness-applications.Rmd

Lines changed: 36 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -425,56 +425,61 @@ head(hemout_new)
425425
With non-dynamic uptake, we use `uptakes`=`uptake_single`=1. Drug acquisition costs are constant in real terms (`prices=prices_static`) and are discounted at the risk-free real rate (`discrate=disc_cycle`). Other costs rise in line with general price inflation (`prices=prices_oth`) and are discounted at nominal discount rates (`discrate=nomdisc_cycle`). QALYs are not affected by price inflation (`prices=prices_static`) and are discounted at the risk-free real rate (`discrate=disc_cycle`).
426426

427427
```{r scen1}
428-
# SOC
428+
# SOC, costs other than drug acquisition
429429
s1_soc_othcost <- dynamicpv::dynpv(
430430
uptakes = uptake_single,
431431
payoffs = hemout_soc$cost_nondaq_rup,
432432
prices = prices_oth,
433433
discrate = nomdisc_cycle
434434
)
435435
436+
# SOC, drug acquisition costs
436437
s1_soc_daqcost <- dynamicpv::dynpv(
437438
uptakes = uptake_single,
438439
payoffs = hemout_soc$cost_daq_soc_rup,
439440
prices = prices_static,
440441
discrate = disc_cycle
441442
)
442443
444+
# SOC, total costs
443445
s1_soc_cost <- s1_soc_daqcost + s1_soc_othcost
444446
447+
# SOC, QALYs
445448
s1_soc_qaly <- dynamicpv::dynpv(
446449
uptakes = uptake_single,
447450
payoffs = hemout_soc$qaly_rup,
448451
prices = prices_static,
449452
discrate = disc_cycle
450453
)
451454
452-
# New intervention
453-
455+
# New intervention, costs other than drug acquisition
454456
s1_new_othcost <- dynamicpv::dynpv(
455457
uptakes = uptake_single,
456458
payoffs = hemout_new$cost_nondaq_rup,
457459
prices = prices_oth,
458460
discrate = nomdisc_cycle
459461
)
460462
463+
# New intervention, drug acquisition costs
461464
s1_new_daqcost <- dynamicpv::dynpv(
462465
uptakes = uptake_single,
463466
payoffs = hemout_new$cost_daq_new_rup,
464467
prices = prices_static,
465468
discrate = disc_cycle
466469
)
467470
471+
# New intervention, total costs
468472
s1_new_cost <- s1_new_daqcost + s1_new_othcost
469473
474+
# New intervention, QALYs
470475
s1_new_qaly <- dynamicpv::dynpv(
471476
uptakes = uptake_single,
472477
payoffs = hemout_new$qaly_rup,
473478
prices = prices_static,
474479
discrate = disc_cycle
475480
)
476481
477-
# Incrementals
482+
# Incremental costs, QALYs, and ICER
478483
s1_icost <- total(s1_new_cost) - total(s1_soc_cost)
479484
s1_iqaly <- total(s1_new_qaly) - total(s1_soc_qaly)
480485
s1_icer <- s1_icost / s1_iqaly
@@ -487,31 +492,38 @@ These results show that the new intervention is associated with $`r s1_icost` in
487492
The costs of drug acquisition in each arm differ in Scenario 2 through applying the relevant dynamic price index (`prices_dyn_soc` and `prices_dyn_new`), with discounting at nominal rates (`discrate = nomdisc_cycle`). Otherwise costs and QALYs are unchanged from Scenario 1.
488493

489494
```{r calc_scen2}
490-
# SOC
495+
# SOC, costs other than drug acquisition are unchanged
491496
s2_soc_othcost <- s1_soc_othcost
492497
498+
# SoC, drug acquisition costs
493499
s2_soc_daqcost <- dynamicpv::dynpv(
494500
uptakes = uptake_single,
495501
payoffs = hemout_soc$cost_daq_soc_rup,
496502
prices = prices_dyn_soc,
497503
discrate = nomdisc_cycle
498504
)
499505
506+
# SoC, total costs
500507
s2_soc_cost <- s2_soc_daqcost + s2_soc_othcost
501-
s2_soc_qaly <- s1_soc_qaly
502508
503-
# New intervention
509+
# SoC, QALYs are unchanged
510+
s2_soc_qaly <- s1_soc_qaly
504511
512+
# New intervention, costs other than drug acquisition are unchanged
505513
s2_new_othcost <- s1_new_othcost
506514
515+
# New intervention, drug acquisition costs
507516
s2_new_daqcost <- dynamicpv::dynpv(
508517
uptakes = uptake_single,
509518
payoffs = hemout_new$cost_daq_new_rup,
510519
prices = prices_dyn_new,
511520
discrate = nomdisc_cycle
512521
)
513522
523+
# New intervention, total costs
514524
s2_new_cost <- s2_new_daqcost + s2_new_othcost
525+
526+
# New intervention, QALYs are unchanged
515527
s2_new_qaly <- s1_new_qaly
516528
517529
# Incrementals
@@ -527,47 +539,53 @@ Under scenario 2, the new intervention has an incremental cost-effectiveness of
527539
The calculation for Scenario 3 is the same as for Scenario 1 except for dynamic uptake, which is handled by setting `uptakes = uptake_multi`.
528540

529541
```{r calc_scen3}
530-
# SOC
542+
# SOC, costs other than drug acquisition
531543
s3_soc_othcost <- dynamicpv::dynpv(
532544
uptakes = uptake_multi,
533545
payoffs = hemout_soc$cost_nondaq_rup,
534546
prices = prices_oth,
535547
discrate = nomdisc_cycle
536548
)
537549
550+
# SoC, drug acquisition costs
538551
s3_soc_daqcost <- dynamicpv::dynpv(
539552
uptakes = uptake_multi,
540553
payoffs = hemout_soc$cost_daq_soc_rup,
541554
prices = prices_static,
542555
discrate = disc_cycle
543556
)
544557
558+
# SoC, total costs
545559
s3_soc_cost <- s3_soc_daqcost + s3_soc_othcost
546560
561+
# SoC, QALYs
547562
s3_soc_qaly <- dynamicpv::dynpv(
548563
uptakes = uptake_multi,
549564
payoffs = hemout_soc$qaly_rup,
550565
prices = prices_static,
551566
discrate = disc_cycle
552567
)
553568
554-
# New intervention
569+
# New intervention, costs other than drug acquisition
555570
s3_new_othcost <- dynamicpv::dynpv(
556571
uptakes = uptake_multi,
557572
payoffs = hemout_new$cost_nondaq_rup,
558573
prices = prices_oth,
559574
discrate = nomdisc_cycle
560575
)
561576
577+
# New intervention, drug acquisition costs
562578
s3_new_daqcost <- dynamicpv::dynpv(
563579
uptakes = uptake_multi,
564580
payoffs = hemout_new$cost_daq_new_rup,
565581
prices = prices_static,
566582
discrate = disc_cycle
567583
)
568584
585+
# New intervention, total costs
569586
s3_new_cost <- s3_new_daqcost + s3_new_othcost
570587
588+
# New intervention, QALYs
571589
s3_new_qaly <- dynamicpv::dynpv(
572590
uptakes = uptake_multi,
573591
payoffs = hemout_new$qaly_rup,
@@ -588,32 +606,38 @@ Under scenario 3, the new intervention has an incremental cost-effectiveness of
588606
The costs of drug acquisition in each arm differ in Scenario 4 from Scenario 3 through applying the relevant dynamic price index (`prices_dyn_soc` and `prices_dyn_new`). Otherwise costs and QALYs are unchanged from Scenario 3.
589607

590608
```{r calc_scen4}
591-
# SOC
609+
# SOC, costs other than drug acquisition are unchanged
592610
s4_soc_othcost <- s3_soc_othcost
593611
612+
# SoC, drug acquisition costs
594613
s4_soc_daqcost <- dynamicpv::dynpv(
595614
uptakes = uptake_multi,
596615
payoffs = hemout_soc$cost_daq_soc_rup,
597616
prices = prices_dyn_soc,
598617
discrate = nomdisc_cycle
599618
)
600619
620+
# SoC, total costs
601621
s4_soc_cost <- s4_soc_daqcost + s4_soc_othcost
602622
623+
# SoC, QALYs are unchanged
603624
s4_soc_qaly <- s3_soc_qaly
604625
605-
# New intervention
606-
626+
# New intervention, costs other than drug acquisition are unchanged
607627
s4_new_othcost <- s3_new_othcost
608628
629+
# New intervention, drug acquisition costs
609630
s4_new_daqcost <- dynamicpv::dynpv(
610631
uptakes = uptake_multi,
611632
payoffs = hemout_new$cost_daq_new_rup,
612633
prices = prices_dyn_new,
613634
discrate = nomdisc_cycle
614635
)
615636
637+
# New intervention, total costs
616638
s4_new_cost <- s4_new_daqcost + s4_new_othcost
639+
640+
# New intervention, QALYs
617641
s4_new_qaly <- s3_new_qaly
618642
619643
# Incrementals

0 commit comments

Comments
 (0)