| Title: | Technology Appraisal Toolbox for Health Economic Evaluations in the Netherlands |
|---|---|
| Description: | Functions to support economic modelling in R based on the methods of the Dutch guideline for economic evaluations in healthcare <https://www.zorginstituutnederland.nl/documenten/2024/01/16/richtlijn-voor-het-uitvoeren-van-economische-evaluaties-in-de-gezondheidszorg>, CBS data <https://www.cbs.nl/>, and OECD data <https://www.oecd.org/en.html>. |
| Authors: | Stijn Peeters [aut, cre] (ORCID: <https://orcid.org/0009-0004-3684-3584>), Eline Krijkamp [aut] (ORCID: <https://orcid.org/0000-0003-3970-2205>), Frederick Thielen [aut] (ORCID: <https://orcid.org/0000-0002-0312-5891>) |
| Maintainer: | Stijn Peeters <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 1.0.0 |
| Built: | 2026-05-25 06:21:41 UTC |
| Source: | https://github.com/cran/tatooheene |
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 )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)# 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)
This data structure with several lists and vectors collecting a subset of the model outputs from the Sick-Sicker model intended for demonstrating the discounting in this package. The full model is described in the DARTH “Sick-Sicker” example. Source code can be found here: https://github.com/DARTH-git/cohort-modeling-tutorial-intro
data_model_output_sick_sickerdata_model_output_sick_sicker
An object of class list of length 9.
For the full reference read: Alarid-Escudero F, Krijkamp EM, Enns EA, Yang A, Hunink MGM, Pechlivanoglou P, Jalal H. An Introductory Tutorial on Cohort State-Transition Models in R Using a Cost-Effectiveness Analysis Example. Medical Decision Making, 2023;43(1):3-20. https://doi.org/10.1177/0272989X221103163
These data can be used for demonstrating how to apply some of the package functions like discounting for the results of a model-based cost-effectiveness model.
#' @format A list with the following components
Annual transition matrix for sick-sicker model.
Monthly transition matrix for sick-sicker model.
Half-cycle correction weights for annual model.
Half-cycle correction weights for monthly model.
Names of the intervention strategies used in the model.
Annual utilities for each health state.
Monthly utilities for each health state.
Annual costs for each health state.
Monthly costs for each health state.
# Load the dataset data("data_model_output_sick_sicker.rda") # Load list in global environment list2env(data_model_output_sick_sicker, envir = .GlobalEnv) # Explore the available objects ls(pattern = "l_|v_") # View names of health states v_names_str # Inspect the first few cycles of the annual Markov trace for the first strategy head(l_m_M_annual[[1]]) # Compare dimensions of annual and monthly traces dim(l_m_M_annual[[1]]) dim(l_m_M_monthly[[1]]) # Apply the half cycle correction ## Loop through each strategy and calculate total utilities and costs ---- v_tot_qaly <- v_tot_cost <- c() for (i in 1:length(v_names_str)) { v_u_str <- l_u_monthly[[i]] # select the vector of state utilities for the i-th strategy v_c_str <- l_c_monthly[[i]] # select the vector of state costs for the i-th strategy ###* Expected QALYs and costs per cycle ##* Vector of QALYs and Costs #* Apply state rewards v_qaly_str <- l_m_M_monthly[[i]] %*% v_u_str # sum the utilities of all states for each cycle v_cost_str <- l_m_M_monthly[[i]] %*% v_c_str # sum the costs of all states for each cycle ###* Total expected QALYs and costs per strategy and apply half-cycle correction (if applicable) #* QALYs v_tot_qaly[i] <- t(v_qaly_str) %*% v_wcc_monthly #* Costs v_tot_cost[i] <- t(v_cost_str) %*% v_wcc_monthly }# Load the dataset data("data_model_output_sick_sicker.rda") # Load list in global environment list2env(data_model_output_sick_sicker, envir = .GlobalEnv) # Explore the available objects ls(pattern = "l_|v_") # View names of health states v_names_str # Inspect the first few cycles of the annual Markov trace for the first strategy head(l_m_M_annual[[1]]) # Compare dimensions of annual and monthly traces dim(l_m_M_annual[[1]]) dim(l_m_M_monthly[[1]]) # Apply the half cycle correction ## Loop through each strategy and calculate total utilities and costs ---- v_tot_qaly <- v_tot_cost <- c() for (i in 1:length(v_names_str)) { v_u_str <- l_u_monthly[[i]] # select the vector of state utilities for the i-th strategy v_c_str <- l_c_monthly[[i]] # select the vector of state costs for the i-th strategy ###* Expected QALYs and costs per cycle ##* Vector of QALYs and Costs #* Apply state rewards v_qaly_str <- l_m_M_monthly[[i]] %*% v_u_str # sum the utilities of all states for each cycle v_cost_str <- l_m_M_monthly[[i]] %*% v_c_str # sum the costs of all states for each cycle ###* Total expected QALYs and costs per strategy and apply half-cycle correction (if applicable) #* QALYs v_tot_qaly[i] <- t(v_qaly_str) %*% v_wcc_monthly #* Costs v_tot_cost[i] <- t(v_cost_str) %*% v_wcc_monthly }
Compute the annuity factor and the annual depreciation-and-interest charge for medical equipment, following Section 7.3 of the Dutch costing manual; k = annual depreciation and interest expense jaarlijkse afschrijvings- en rentekosten
Let V be replacement value, R the salvage value, n the amortisation period (years), and i the interest rate (per year). The annuity factor is:
#' The annual charge k is:
depreciation_interest( v_replace_val, r_salvage_val, n_amortisation_period = 10, i_interest_rt = 0.025, output = c("dataframe", "annuity_factor", "annual_cost") )depreciation_interest( v_replace_val, r_salvage_val, n_amortisation_period = 10, i_interest_rt = 0.025, output = c("dataframe", "annuity_factor", "annual_cost") )
v_replace_val |
V: vervangingswaarde; replacement value (numeric scalar, > 0) |
r_salvage_val |
R: restwaarde; salvage (residual) value at end of period (numeric scalar, >= 0) |
n_amortisation_period |
n: afschrijvingstermijn; amortisation period in years (numeric scalar, > 0) |
i_interest_rt |
i: rentepercntage; annual interest rate as a decimal (numeric scalar, >= 0) |
output |
One of |
If output = "dataframe": a data.frame with two columns:
Annuity factor and Yearly depreciation and interest costs.
If output = "annuity_factor": a single numeric (the annuity factor).
If output = "annual_cost": a single numeric (the annual charge k).
# Both values as a data frame (defaults: n=10, i=2.5%) depreciation_interest(v_replace_val = 50000, r_salvage_val = 5000) # Only the annuity factor depreciation_interest(50000, 5000, output = "annuity_factor") # Only the annual charge (k) depreciation_interest(50000, 5000, output = "annual_cost") # Zero interest (uses the i -> 0 limit): a = n, k = (V - R)/n depreciation_interest(50000, 5000, n_amortisation_period = 8, i_interest_rt = 0, output = "dataframe")# Both values as a data frame (defaults: n=10, i=2.5%) depreciation_interest(v_replace_val = 50000, r_salvage_val = 5000) # Only the annuity factor depreciation_interest(50000, 5000, output = "annuity_factor") # Only the annual charge (k) depreciation_interest(50000, 5000, output = "annual_cost") # Zero interest (uses the i -> 0 limit): a = n, k = (V - R)/n depreciation_interest(50000, 5000, n_amortisation_period = 8, i_interest_rt = 0, output = "dataframe")
A subset data frame of Consumentenprijzen; prijsindex 2015=100 from CBS. Identifier: 83131NED
df_cpi_combineddf_cpi_combined
df_cpi_combinedA data frame with 11 rows and 8 columns:
Year from in case of two consecutive years
Year ending in case of two consecutive years
Percentage change in case of two consecutive years
Factor for multiplication in case of two consecutive years
Year starting from, in the case of a range, the year up to the maximum year
Year ending in case of a range, the year up to the maximum year
Percentage for multiplication in case of a range, the year up to the maximum year
Factor for multiplication in case of a range, the year up to the maximum year
https://www.cbs.nl/nl-nl/cijfers
A subset data frame of job vacancies; SBI 2008; by economic activity and company size from CBS. Identifier: 80472NED
df_fpdf_fp
df_fpA data frame with 27 rows and 7 columns:
Year
Vervulde vacatures
Openstaande vacatures
Calculation of the friction period in days
Calculation of the friction period in weeks
Calculation of the 5 year average friction period in days
Calculation of the 5 year average friction period in weeks
https://www.cbs.nl/nl-nl/cijfers
A subset data frame of the OECD data set containing the Purchasing Power Parity (PPP) data.
df_pppdf_ppp
df_pppA data frame with 64 rows and 2 columns:
Year of PPP
Purchase Power Parity
Complete data of reference values from the costing manual
df_ref_pricesdf_ref_prices
df_ref_pricesA data frame with 160 rows and 7 columns:
Care domain, for example medical services
Service category such as nursing, intensive care or day treatment
Description of the care unit or service
Short variable name used in the package
Reference price for the year 2022
Reference price for the year 2023
Reference price for the year 2024
Return friction periods from the internal CBS-based table.
friction_period( year = NULL, units = "weeks", avg = "5yr", output = c("tibble", "value"), data = tatooheene::df_fp )friction_period( year = NULL, units = "weeks", avg = "5yr", output = c("tibble", "value"), data = tatooheene::df_fp )
year |
Integer vector of years to return. If |
units |
One or more of |
avg |
One or more of |
output |
Either |
data |
Data source (mainly for testing); default is |
A tibble when output = "tibble", or a single numeric when output = "value".
# All years, 5-year average in weeks (default) friction_period() # Specific year (2019), weeks 5-year average friction_period(year = 2019) # Days (1-year) for multiple years friction_period(year = 2018:2020, units = "days", avg = "1yr") # Single numeric value (requires one year + one combo) friction_period(year = 2019, units = "weeks", avg = "5yr", output = "value")# All years, 5-year average in weeks (default) friction_period() # Specific year (2019), weeks 5-year average friction_period(year = 2019) # Days (1-year) for multiple years friction_period(year = 2018:2020, units = "days", avg = "1yr") # Single numeric value (requires one year + one combo) friction_period(year = 2019, units = "weeks", avg = "5yr", output = "value")
This function downloads the Purchasing Power Parity (PPP) factor values for the Netherlands from the OECD website per year in International Dollar (Int$).
nl_ppp(year = "all")nl_ppp(year = "all")
year |
The year of which the PPP factor should be downloaded, multiple years are possible, default is the whole dataset. |
A dataframe or value with the PPP factor values for the specified years.
# Example usage of the nl_ppp function nl_ppp(year = 2019)# Example usage of the nl_ppp function nl_ppp(year = 2019)
This function provides the Consumer Price Index (CPI) for a given year range both in a factor or dataframe based on CBS data and further described in 2.6.1.1 of the Dutch EE guideline
nl_price_index( start_year = 2013, end_year = 2023, output = c("table", "factor") )nl_price_index( start_year = 2013, end_year = 2023, output = c("table", "factor") )
start_year |
start year for CPI output table or factor |
end_year |
End year for CPI output table or factor |
output |
Which output we would like to see. "factor": is the factor from start to end year, "table" is the table of all CPIs from start to end year |
Dataframe or factor with CPI data from start year to end year
# Example usage of the nl_price_index function # Get the CPI factor from 2013 to 2023 nl_price_index(start_year = 2013, end_year = 2023, output = "factor") # Get the CPI table from 2013 to 2023 nl_price_index(start_year = 2013, end_year = 2023, output = "table")# Example usage of the nl_price_index function # Get the CPI factor from 2013 to 2023 nl_price_index(start_year = 2013, end_year = 2023, output = "factor") # Get the CPI table from 2013 to 2023 nl_price_index(start_year = 2013, end_year = 2023, output = "table")
This function downloads the Reference prices of the Dutch Costing Manual for one or multiple years. The prices are available in Euro (EUR) or International Dollar (INT$).
nl_ref_prices( year = "all", domain = "all", category = "all", unit = "all", short_unit = "all", currency = c("EUR", "INT$") )nl_ref_prices( year = "all", domain = "all", category = "all", unit = "all", short_unit = "all", currency = c("EUR", "INT$") )
year |
The year of which the reference price should be downloaded, multiple years are possible, default is the whole dataset |
domain |
The domain of prices that should be included (one or more categories), default is including all categories |
category |
The category of prices that should be included (one or more categories), default is including all categories |
unit |
The reference price that should be included (one or multiple reference prices), default is including the whole dataframe |
short_unit |
The short variable name that should be included (one or more short variables), default is including all |
currency |
The currency of the output of the prices. A decision can be made between EUR and INT$, the default is EUR. |
A dataframe or value with the Medical Reference price(s) of the Dutch Costing Manual for the specified years
# Example usage of the nl_med_prices function # Calculate for year 2024 with the category Nursing nl_ref_prices(year = "2024", category = "Nursing") # Calculate for year 2022 and 2023 the category Nursing nl_ref_prices(year = c(2022,2023), category = "Nursing") # Calculate for year 2022 with the category Nursing in INT$ nl_ref_prices(year = "2022", category = "Nursing" , currency = "INT$")# Example usage of the nl_med_prices function # Calculate for year 2024 with the category Nursing nl_ref_prices(year = "2024", category = "Nursing") # Calculate for year 2022 and 2023 the category Nursing nl_ref_prices(year = c(2022,2023), category = "Nursing") # Calculate for year 2022 with the category Nursing in INT$ nl_ref_prices(year = "2022", category = "Nursing" , currency = "INT$")
bookdown reports
This function writes pretty prices in
bookdown reports. The function uses the formatC() function to format the number and adds the currency to the end of the number.
pretty_price(x, digits = 2, currency = "EUR", ...)pretty_price(x, digits = 2, currency = "EUR", ...)
x |
A number to be printed |
digits |
Number of digits |
currency |
The name of the currency |
... |
Extra arguments for |
A pretty price with the currency
# Example usage of the pretty_price function pretty_price(1000, currency = "EUR")# Example usage of the pretty_price function pretty_price(1000, currency = "EUR")