Adding a New Country to epicR
AddingNewCountry.RmdIntroduction
EPIC (Evaluation Platform in COPD) was originally developed for the Canadian healthcare context. However, the model’s architecture supports adaptation to different countries and healthcare systems through jurisdiction-specific configuration files. This vignette explains how to add a new country to epicR.
Overview of the Configuration System
epicR uses JSON configuration files to store country-specific parameters. These files contain all the epidemiological, demographic, economic, and healthcare system parameters needed to run the model for a specific jurisdiction.
Step-by-Step Guide to Adding a New Country
Step 1: Create the Configuration File
Create a new JSON configuration file for your country in the
inst/config/ directory:
# Example: Adding Germany
file_name <- "inst/config/config_germany.json"Step 2: Copy the Template Structure
Start by copying the structure from an existing configuration file. You can use the US template as a starting point:
# Read the US template
us_config <- jsonlite::fromJSON("inst/config/config_us.json")
# Modify for Germany
germany_config <- us_config
germany_config$jurisdiction <- "germany"
# Save the template
jsonlite::write_json(germany_config, "inst/config/config_germany.json",
pretty = TRUE, auto_unbox = TRUE)Step 3: Parameter Categories to Configure
The configuration file contains several major parameter categories that need country-specific data:
3.1 Global Parameters
{
"global_parameters": {
"age0": 40,
"time_horizon": 20,
"discount_cost": 0.03,
"discount_qaly": 0.03,
"closed_cohort": 0
}
}Required data: - Discount rates for costs and QALYs (country-specific economic guidelines)
3.2 Demographics and Population
{
"agent": {
"p_female": 0.51,
"height_0_betas": [...],
"weight_0_betas": [...],
"p_prevalence_age": [...],
"p_bgd_by_sex": {
"male": [...],
"female": [...]
}
}
}Required data sources: - Population demographics: National statistics office - Age pyramid: Current population by age group - Life tables: Age and sex-specific mortality rates - Anthropometric data: Height and weight distributions by age and sex
3.3 Smoking Patterns
{
"smoking": {
"logit_p_current_smoker_0_betas": [...],
"minimum_smoking_prevalence": 0.12,
"mortality_factor_current": [...],
"mortality_factor_former": [...]
}
}Required data sources: - Smoking prevalence: National health surveys - Smoking-related mortality: Meta-analyses or national studies - Smoking cessation rates: Longitudinal studies
3.4 COPD Epidemiology
{
"COPD": {
"logit_p_COPD_betas_by_sex": {
"male": [...],
"female": [...]
},
"ln_h_COPD_betas_by_sex": {
"male": [...],
"female": [...]
}
}
}Required data sources: - COPD prevalence: Spirometry-based population studies - COPD incidence: Longitudinal cohort studies - Risk factors: Smoking, age, sex associations
3.5 Healthcare Costs
{
"cost": {
"bg_cost_by_stage": [...],
"exac_dcost": [...],
"cost_gp_visit": 85.50,
"cost_outpatient_diagnosis": 125.50,
"cost_smoking_cessation": 485.25
}
}Required data sources: - Healthcare unit costs: National fee schedules or health economics studies - COPD treatment costs: Health administrative data or costing studies - Currency: Convert to local currency or standardize to USD/EUR
Step 4: Data Collection Strategy
Essential Data Sources
-
National Statistics Offices
- Population demographics
- Life tables
- Health surveys
-
Health Administrative Databases
- Healthcare utilization
- Treatment costs
- Disease prevalence
-
Published Literature
- Disease-specific studies
- Health economics evaluations
- Epidemiological studies
-
International Databases
- WHO Global Health Observatory
- OECD Health Statistics
- Global Burden of Disease Study
Step 5: Parameter Estimation
When direct data is not available, parameters can be estimated using:
5.1 Regression Models
# Example: Estimating COPD prevalence coefficients
# Using logistic regression on survey data
model <- glm(copd ~ age + sex + smoking_status + pack_years,
data = survey_data, family = binomial())
coefficients(model)Step 6: Testing the New Configuration
Once you have populated the configuration file:
Step 7: Documentation
Create documentation for your new country configuration:
7.1 Data Sources Documentation
# Create a data sources file
data_sources <- list(
demographics = "German Federal Statistical Office, 2023",
copd_prevalence = "BOLD Study Germany, 2022",
healthcare_costs = "German Health Economics Association, 2023"
)Example: Adding Germany
Here’s a simplified example of adding Germany to epicR:
# 1. Create base configuration
germany_config <- list(
jurisdiction = "germany",
global_parameters = list(
age0 = 40,
time_horizon = 20,
discount_cost = 0.03, # German health economics guidelines
discount_qaly = 0.03,
closed_cohort = 0
),
agent = list(
p_female = 0.507, # German Federal Statistical Office 2023
# ... other parameters
),
cost = list(
cost_gp_visit = 25.50, # German fee schedule 2023
cost_outpatient_diagnosis = 85.40,
# ... other costs
)
# ... other parameter categories
)
# 2. Save configuration
jsonlite::write_json(germany_config,
"inst/config/config_germany.json",
pretty = TRUE, auto_unbox = TRUE)
# 3. Test the configuration
library(epicR)
input <- get_input(jurisdiction = "germany")Contributing Your Configuration
If you’ve successfully created a configuration for a new country:
- Validate thoroughly using local data
- Document data sources and methods
- Consider contributing to the epicR project
- Share with the community for peer review
Conclusion
Adding a new country to epicR requires substantial data collection and parameter estimation, but the modular configuration system makes this process systematic and reproducible. The key is to ensure high-quality, country-specific data while maintaining the model’s scientific rigor.
For questions or assistance with adding a new country, consider: - Reviewing published adaptations of EPIC - Consulting with local health economists - Engaging with the epicR development community - Collaborating with researchers who have local data access