vignettes/run_rhap.Rmd
run_rhap.Rmd
The primary function provided by this package is
calc_hap_impacts
, which is designed to estimate health
impacts attributable to household air pollution (HAP) under various
alternative scenarios simulated using the Global Change Analysis Model
(GCAM). This function streamlines the process of assessing
scenario-specific health outcomes by extracting relevant data from GCAM
databases or project files. These relevant data includes key
socioeconomic and environmental parameters, such as per capita GDP,
emissions of primary PM2.5, NOx, and VOCs, as well as per capita
floorspace. For more details on the methodology and assumptions
underlying the econometric model used in this calculation, refer to the
guide on “Fitting the
Econometric Model”.
The function calc_hap_impacts
connects to a GCAM
databases or project file using the rgcam package, designed to
extract and import GCAM results.
First, the function extracts direct air pollutant emissions from the residential sector for each simulated GCAM scenario, GCAM region, period, and pollutant. To estimate country-specific impacts, these emissions are processed and downscaled to the country level using a static downscaling approach. This approach leverages gas-specific country-level emissions data, specifically using 2017 emissions data from the Community Emissions Data System (CEDS), updated for the Global Burden of Disease - Major Air Pollution Sources projectCEDS-GBD. Additionally, the function applies transformations such as converting black carbon and organic carbon emissions into primary PM2.5 to ensure comprehensive pollutant accounting.
The function also extracts per capita floorspace, which is calculated endogenously in GCAM by region and period. This calculation relies on a Gompertz-type function calibrated with empirical data (Sampedro et al 2022), providing a income-driven estimate of future residential space per person.
For per capita GDP, the package loads projections from the SSP database version 3.0.1,updated in 2024. These GDP projections are scenario-specific, corresponding to the Shared Socioeconomic Pathways (SSPs). By default, the package utilizes SSP2 (“middle of the road”) projections. However, if the GCAM scenario name includes a different SSP designation (e.g., “Reference_SSP3”), the package automatically selects the appropriate SSP-specific GDP projections.
The function estimates health impacts attributable to household air pollution (HAP) using an econometric model that incorporates direct emissions from the residential sector (BC, OC, NOx, and VOC), per capita GDP, and per capita floorspace as covariates. The model is a fixed-effects model, estimated using cross-regional and multi-year panel data compiled from various different sources. Detailed information on the econometric model, including its formulation and data sources, is available in the dedicated vignette: “Fitting the Econometric Model”.
To improve accuracy, the health impact predictions incorporate a country-specific “bias adder” parameter, calculated as the difference between observed and estimated values in the final observed year (2019). This adjustment helps align model estimates with observed data for each country.
The package provides flexibility to calculate three distinct health impact metrics associated with HAP:
In addition to country-level estimates, the package offers an
optional feature to estimate health impacts by socioeconomic group
(e.g., income deciles) within each region. While it is recommended to
perform country-level calculations for consistency, this capability can
provide valuable insights into the distribution of health impacts across
population segments within regions. Such granularity can aid users in
understanding intra-regional disparities. This feature is activated by
setting by_gr = F
.
The function calculates health impacts—such as deaths, Years of Life
Lost (YLLs), or Disability-Adjusted Life Years (DALYs)—attributable to
household air pollution (HAP) for each country, time period, and GCAM
scenario. By using the normalized
parameter, users can
choose between producing results in absolute terms or as normalized
values (per 100,000 inhabitants), offering flexibility for different
analytical needs.
If saveOutput
is set to TRUE
, the function
writes the following csv files in the output/
sub-directory: [scenario]_HAP_HIAvar.csv
In addition, by setting map
to TRUE
, the
function generates damage maps, using the rmap package documented in the
following page. The function
also generates animations and individual figures.
This example demonstrates how to use the rhap
package to
estimate health impacts from GCAM outputs.
Follow the installation guide if you haven’t already.
devtools::load_all()
# Set your project and scenario names
my_prj_name <- "test_rhap.dat" # Name of the .dat project file (avoid spaces)
my_scen_name <- "Reference" # Name of the GCAM scenario to process (or vector of scenarios)
# Run the RHAP model
hap_damages <- calc_hap_impacts(
prj_name = my_prj_name,
scen_name = my_scen_name,
final_db_year = 2050,
saveOutput = TRUE,
map = FALSE,
anim = TRUE,
HIA_var = "deaths",
normalized = TRUE,
by_gr = FALSE
)
# Preview the results
head(hap_damages)
This code will generate a dataset of health impacts and, also produce a figure similar to the one shown below:
Premature deaths per 100.000 inhabitants attributable to household air pollution in 2050