View source: R/apply_discounting.R
| apply_discounting | R Documentation |
The apply_discounting function is designed to calculate the net present value of future costs or effects using a constant discount rate, following the Dutch guidelines for economic evaluations in health care. (section 2.6.1.2 version 2024). Here's a breakdown of how the function works:
apply_discounting(
values,
discount_rate = c("costs", "effects"),
times,
aggregate = FALSE,
digits = NULL
)
values |
A numeric (vector of) costs or effects over time (one value per period). |
discount_rate |
Specifies the discount rate to be used. Acceptable values are: "costs" (0.03), "effects" (0.015), or a custom numeric value such as 0.04. |
times |
A numeric (vector of) time points indicating the time used for the discounting. The length must match the length of the values vector. Since the default discounting is annual, the time points should be in years. The length of this vector should be the same as the length of the |
aggregate |
A logical: indicating whether to sum the discounted values. Default is FALSE. |
digits |
A numeric value to indicate the number of digits to round the value. Default is 3 digits |
This function ensures consistent application of discount rates in cost-effectiveness analyses, in line with Dutch guidelines. Custom rates can be specified when needed.
# NO Discounting in First Year (t starts at 0)
# constant cost of 100 for 3 years
apply_discounting(values = rep(100, 3), discount_rate = "costs", times = c(0, 1, 2))
# WITH discounting in first year (t starts at 1)
# Constant cost of 100 for 3 years,
apply_discounting(values = rep(100, 3),
discount_rate = "costs",
times = c(1, 2, 3))
# Present value of 100 euro in 3 years
apply_discounting(values = 100, discount_rate = "costs", times = 3)
# Custom Discount Rate
# discount rate of 4%, no discounting in first year
apply_discounting(values = rep(100, 3),
discount_rate = 0.04,
times = c(0, 1, 2))
# This will give you a messages to inform you about the different discount rate
# Same applies to utility values
# Utility values with aggregation - NO discounting in first year
apply_discounting(values = c(0.98, 0.82, 0.79),
discount_rate = "effect",
times = c(0, 1, 2),
aggregate = TRUE, digits = 3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.