Skip to content

Commit ed329f5

Browse files
authored
Merge pull request #27 from dom-muston/main
Update for CRAN
2 parents 7b2bab0 + 1359424 commit ed329f5

11 files changed

+514
-465
lines changed

DESCRIPTION

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
Package: dynamicpv
2-
Title: Evaluates Present Values and Cost-Effectiveness with Dynamic Pricing and Uptake
3-
Version: 0.4.0
2+
Title: Evaluates Present Values and Health Economic Models with Dynamic Pricing and Uptake
3+
Version: 0.4.1
44
Authors@R: c(
55
person("Dominic", "Muston", , "dominic.muston@msd.com", role = c("aut", "cre"),
66
comment = c(ORCID = "0000-0003-4876-7940")),
77
person("John", "Blischak", role = c("ctb"),
88
comment = c(ORCID = "0000-0003-2634-9879")),
99
person("Merck & Co., Inc., Rahway, NJ, USA and its affiliates", role = c("cph", "fnd"))
1010
)
11-
Description: Evaluates present values and cost-effectiveness with dynamic pricing and uptake.
11+
Description: The goal of 'dynamicpv' is to provide a simple way to calculate (net) present values and outputs from health economic models (especially cost-effectiveness and budget impact) in discrete time that reflect dynamic pricing and dynamic uptake. Dynamic pricing is also known as life cycle pricing; dynamic uptake is also known as multiple or stacked cohorts, or dynamic disease prevalence. Shafrin (2024) <doi:10.1515/fhep-2024-0014> provides an explanation of dynamic value elements, in the context of Generalized Cost Effectiveness Analysis, and Puls (2024) <doi:10.1016/j.jval.2024.03.006> reviews challenges of incorporating such dynamic value elements. This package aims to reduce those challenges.
1212
License: GPL (>= 3)
1313
URL: https://MSDLLCpapers.github.io/dynamicpv/, https://github.com/MSDLLCpapers/dynamicpv
1414
BugReports: https://github.com/MSDLLCpapers/dynamicpv/issues

NEWS.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# dynamicpv 0.4.1
2+
3+
* Revised vignettes
4+
* Extended description for CRAN readiness
5+
16
# dynamicpv 0.4.0
27

38
* Converted S7 classes and methods to S3

README.Rmd

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,23 @@ knitr::opts_chunk$set(
2121
[![Codecov test coverage](https://codecov.io/gh/MSDLLCpapers/dynamicpv/graph/badge.svg)](https://app.codecov.io/gh/MSDLLCpapers/dynamicpv)
2222
<!-- badges: end -->
2323

24-
The goal of *dynamicpv* is to evaluate present values and cost-effectiveness with dynamic pricing and uptake.
24+
The goal of 'dynamicpv' is to provide a simple way to calculate (net) present values and outputs from health economic models (especially cost-effectiveness and budget impact) in discrete time that reflect dynamic pricing and dynamic uptake.
2525

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.
26+
Dynamic pricing is also known as life cycle pricing; dynamic uptake is also known as multiple or stacked cohorts, or dynamic disease prevalence. [Shafrin (2024)](https://doi.org/10.1515/fhep-2024-0014) provides an explanation of dynamic value elements, in the context of Generalized Cost Effectiveness Analysis, and [Puls (2024)](https://doi.org/10.1016/j.jval.2024.03.006) reviews challenges of incorporating such dynamic value elements. This package aims to reduce those challenges.
27+
28+
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 and dynamic pricing. 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.
2729

2830
## Installation
2931

30-
You can install the development version of *dynamicpv* from [GitHub](https://github.com/) as follows. (The package was previously known as *dynacem*, but *dynamicpv* better reflects the package's intent.)
32+
The package should shortly be available on [CRAN](https://cran.r-project.org/web/packages/index.html). Installing from here is simplest, once available.
33+
34+
```{r inst_cran}
35+
#| eval: false
36+
# CRAN installation - when available
37+
install.packages("dynamicpv")
38+
```
39+
40+
You can install the development version of *dynamicpv* from [GitHub](https://github.com/) as follows.
3141

3242
```{r instal1}
3343
#| eval: false
@@ -63,11 +73,11 @@ library(tidyr)
6373

6474
There are four vignettes provided.
6575

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.
76+
1. The [Mathematical Framework](https://msdllcpapers.github.io/dynamicpv/articles/math-framework.html) vignette (`vignette("math-framework")`) describes the motivation and mathematical framework behind this package.
6777

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.
78+
2. The [Net Present Value](https://msdllcpapers.github.io/dynamicpv/articles/net-present-value.html) vignette (`vignette("net-present-value")`) describes how the package can be used to derive Net Present Values of simple cashflows with dynamic pricing and/or dynamic uptake.
6979

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.
80+
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.
7181

7282
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.
7383

README.md

Lines changed: 34 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -12,24 +12,41 @@ experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](h
1212
coverage](https://codecov.io/gh/MSDLLCpapers/dynamicpv/graph/badge.svg)](https://app.codecov.io/gh/MSDLLCpapers/dynamicpv)
1313
<!-- badges: end -->
1414

15-
The goal of *dynamicpv* is to evaluate present values and
16-
cost-effectiveness with dynamic pricing and uptake.
15+
The goal of ‘dynamicpv’ is to provide a simple way to calculate (net)
16+
present values and outputs from health economic models (especially
17+
cost-effectiveness and budget impact) in discrete time that reflect
18+
dynamic pricing and dynamic uptake.
19+
20+
Dynamic pricing is also known as life cycle pricing; dynamic uptake is
21+
also known as multiple or stacked cohorts, or dynamic disease
22+
prevalence. [Shafrin (2024)](https://doi.org/10.1515/fhep-2024-0014)
23+
provides an explanation of dynamic value elements, in the context of
24+
Generalized Cost Effectiveness Analysis, and [Puls
25+
(2024)](https://doi.org/10.1016/j.jval.2024.03.006) reviews challenges
26+
of incorporating such dynamic value elements. This package aims to
27+
reduce those challenges.
1728

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

2737
## Installation
2838

39+
The package should shortly be available on
40+
[CRAN](https://cran.r-project.org/web/packages/index.html). Installing
41+
from here is simplest, once available.
42+
43+
``` r
44+
# CRAN installation - when available
45+
install.packages("dynamicpv")
46+
```
47+
2948
You can install the development version of *dynamicpv* from
30-
[GitHub](https://github.com/) as follows. (The package was previously
31-
known as *dynacem*, but *dynamicpv* better reflects the package’s
32-
intent.)
49+
[GitHub](https://github.com/) as follows.
3350

3451
``` r
3552
# Install devtools package if not already installed
@@ -65,23 +82,20 @@ library(tidyr)
6582

6683
There are four vignettes provided.
6784

68-
1. The [Dynamic
69-
Pricing](https://msdllcpapers.github.io/dynamicpv/articles/dynamic-pricing.html)
70-
vignette (`vignette("dynamic-pricing")`) describes how present
71-
values may be calculated in the package from a payoff vector,
72-
allowing for the prices of the resources costed to be dynamic.
85+
1. The [Mathematical
86+
Framework](https://msdllcpapers.github.io/dynamicpv/articles/math-framework.html)
87+
vignette (`vignette("math-framework")`) describes the motivation and
88+
mathematical framework behind this package.
7389

74-
2. The [Dynamic
75-
Uptake](https://msdllcpapers.github.io/dynamicpv/articles/dynamic-uptake.html)
76-
vignette (`vignette("dynamic-uptake")`) explores further how present
77-
values can be derived allowing for dynamic uptake. This is in
78-
contrast to the non-dynamic approach of calculating a present value
79-
for a single cohort of patients. This is analogous to the use by
80-
general insurance actuaries of run-off triangles.
90+
2. The [Net Present
91+
Value](https://msdllcpapers.github.io/dynamicpv/articles/net-present-value.html)
92+
vignette (`vignette("net-present-value")`) describes how the package
93+
can be used to derive Net Present Values of simple cashflows with
94+
dynamic pricing and/or dynamic uptake.
8195

8296
3. The [Cost-Effectiveness
8397
Applications](https://msdllcpapers.github.io/dynamicpv/articles/cost-effectiveness-applications.html)
84-
(`vignette(cost-effectiveness-applications")`) vignette describes
98+
(`vignette("cost-effectiveness-applications")`) vignette describes
8599
how, given a static cost-effectiveness model (single cohort, prices
86100
constant in real terms), Incremental Cost-Effectiveness Ratios may
87101
be calculated that allow for dynamic pricing and/or dynamic uptake.

man/dynamicpv-package.Rd

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

vignettes/budget-impact-applications.Rmd

Lines changed: 54 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,35 @@ knitr::knit_hooks$set(
2828
)
2929
```
3030

31-
## Set-up
31+
## Introduction
32+
33+
Our objective is to evaluate the budget impact of introducing a new intervention, assuming static or dynamic pricing. Uptake in budget impact models is already modeled in a dynamic fashion.
34+
35+
## Methods and Assumptions
36+
37+
### General assumptions
38+
39+
Budget impact models conventionally have no discounting and a shorter time horizon than cost-effectiveness models, so we will use a time horizon of 5 years here and a discount rate of 0\%. We will compute a budget impact model using current pricing (per convention) as well as by using dynamic pricing according to the assumptions previously set.
40+
41+
### Dynamic pricing
42+
43+
To recap, we had the following assumptions concerning pricing, with a date of calculation of 2025-09-01.
44+
45+
- Costs are assumed to increases in line with general inflation (2.5% per year), except for effects on drug acquisition costs due to LoEs.
46+
- The LoE for the SoC is assumed to occur first, at 2028-01-01, after which there is anticipated to be a 70% reduction in prices over one year.
47+
- The new intervention has an LoE occuring three years later, at 2031-01-01, after which there would be a 50% reduction in prices over one year.
48+
49+
### Dynamic uptake
50+
51+
We had the following assumptions concerning patient uptake.
52+
53+
- Only newly incident patients with the cancer being modeled would be eligible for the new treatment. Existing/prevalent patients with the condition would not be eligible.
54+
- The disease incidence is 1 patient per week.
55+
- Among these patients, were the new intervention to be made available, uptake of the new intervention would be expected to rise linearly from 0% to 100% after 2 years.
56+
57+
## Implementation
58+
59+
### Set-up
3260

3361
First we load the packages necessary for this vignette.
3462

@@ -266,7 +294,6 @@ prices_dyn_soc <- pricetib$dyn_soc
266294
prices_dyn_new <- pricetib$dyn_new
267295
```
268296

269-
270297
```{r dynuptake, include=FALSE}
271298
# Time for uptake to occur
272299
uptake_years <- 2
@@ -304,25 +331,7 @@ hemout_new <- payoffs |> dplyr::filter(int=="new")
304331
head(hemout_new)
305332
```
306333

307-
Then let us suppose we have the same cost-effectiveness model and variables as set-up in `vignette("cost-effectiveness-applications")`.
308-
309-
## Methods
310-
311-
The package allows us the ability to derive budget impact model calculations consistent with the cost-effectiveness model shown previously.
312-
313-
To recap, we had the following assumptions concerning pricing, with a date of calculation of 2025-09-01.
314-
315-
- Costs are assumed to increases in line with general inflation (2.5% per year), except for effects on drug acquisition costs due to LoEs.
316-
- The LoE for the SoC is assumed to occur first, at 2028-01-01, after which there is anticipated to be a 70% reduction in prices over one year.
317-
- The new intervention has an LoE occuring three years later, at 2031-01-01, after which there would be a 50% reduction in prices over one year.
318-
319-
We had the following assumptions concerning patient uptake.
320-
321-
- Only newly incident patients with the cancer being modeled would be eligible for the new treatment. Existing/prevalent patients with the condition would not be eligible.
322-
- The disease incidence is 1 patient per week.
323-
- Among these patients, were the new intervention to be made available, uptake of the new intervention would be expected to rise linearly from 0% to 100% after 2 years.
324-
325-
Budget impact models conventionally have no discounting and a shorter time horizon than cost-effectiveness models, so we will use a time horizon of 5 years here and a discount rate of 0\%. We will compute a budget impact model using current pricing (per convention) as well as by using dynamic pricing according to the assumptions previously set.
334+
The underlying health economic model is built as described in `vignette("cost-effectiveness-applications")`. We require additional coding for the budget impact evaluation.
326335

327336
```{r bimshare}
328337
# BIM settings
@@ -423,14 +432,30 @@ with1_new_othcost <- dynpv(
423432
budget_with1_soc <- with1_soc_daqcost + with1_soc_othcost
424433
budget_with1_new <- with1_new_daqcost + with1_new_othcost
425434
budget_with1 <- budget_with1_soc + budget_with1_new
435+
```
436+
437+
Note the warning provided by `dynamicpv`. This is because the uptake vector for SoC, when trimmed of zeroes after uptake stops, has a different (shorter) length than the uptake vector for the new intervention. The calculation is still correct. However, the function is flagging for the user the different uptake vectors being used for different present value calculations.
438+
439+
```{r warnlength}
440+
# The uptake vector for the new intervention is long
441+
length(trim_vec(uptake_new))
442+
443+
# The uptake vector for the SoC is short, once trimmed of excess zeros
444+
length(trim_vec(uptake_soc))
445+
```
446+
447+
The budgetary costs in the world with the new intervention are $`r total(budget_with1)`, comprising $`r total(budget_with1_soc)` in respect of the costs of `r uptake(budget_with1_soc)` patients being treated with the SoC, and $`r total(budget_with1_new)` in respect of the costs of `r uptake(budget_with1_new)` patients being treated with the SoC.
426448

449+
```{r bim_iwith1}
427450
# Budget impact
428451
bi1_soc <- budget_with1_soc - budget_wout1_soc
429452
bi1_new <- budget_with1_new
430453
bi1 <- budget_with1 - budget_wout1
454+
455+
summary(bi1)
431456
```
432457

433-
The budgetary costs in the world with the new intervention are $`r total(budget_with1)`, comprising $`r total(budget_with1_soc)` in respect of the costs of `r uptake(budget_with1_soc)` patients being treated with the SoC, and $`r total(budget_with1_new)` in respect of the costs of `r uptake(budget_with1_new)` patients being treated with the SoC. The total budget impact is $`r total(bi1)`, representing an increase of `r total(bi1)/total(budget_wout1) *100`%.
458+
The total budget impact is $`r total(bi1)`, representing an increase of `r total(bi1)/total(budget_wout1) *100`%.
434459

435460
### Dynamic prices
436461

@@ -490,14 +515,20 @@ with2_new_othcost <- with1_new_othcost
490515
budget_with2_soc <- with2_soc_daqcost + with2_soc_othcost
491516
budget_with2_new <- with2_new_daqcost + with2_new_othcost
492517
budget_with2 <- budget_with2_soc + budget_with2_new
518+
```
519+
520+
Notice that there is a similar warning as earlier. The budgetary costs in the world with the new intervention are $`r total(budget_with2)`, comprising $`r total(budget_with2_soc)` in respect of the costs of `r uptake(budget_with2_soc)` patients being treated with the SoC, and $`r total(budget_with2_new)` in respect of the costs of `r uptake(budget_with2_new)` patients being treated with the new treatment.
493521

522+
```{r bim_iwith2}
494523
# Budget impact
495524
bi2_soc <- budget_with2_soc - budget_wout2_soc
496525
bi2_new <- budget_with2_new
497526
bi2 <- budget_with2 - budget_wout2
527+
528+
summary(bi2)
498529
```
499530

500-
The budgetary costs in the world with the new intervention are $`r total(budget_with2)`, comprising $`r total(budget_with2_soc)` in respect of the costs of `r uptake(budget_with2_soc)` patients being treated with the SoC, and $`r total(budget_with2_new)` in respect of the costs of `r uptake(budget_with2_new)` patients being treated with the new treatment. The total budget impact is $`r total(bi2)`, representing an increase of `r total(bi2)/total(budget_wout2) *100`%.
531+
The total budget impact is $`r total(bi2)`, representing an increase of `r total(bi2)/total(budget_wout2) *100`%.
501532

502533
### Summary
503534

0 commit comments

Comments
 (0)