Learn R Programming

climatehealth (version 1.0.0)

attribution_calculation: Calculate Attributable Metrics for Climate-Health Associations.

Description

Computes the attributable number, fraction, and rate of cases associated with specific exposure variables (e.g., temperature or rainfall) using fitted INLA models. The function estimates these metrics at the desired spatial aggregation level (country, region, or district) and optionally disaggregates by month or year.

Usage

attribution_calculation(
  data,
  param_term,
  model,
  level,
  param_threshold = 1,
  max_lag,
  nk,
  filter_year = NULL,
  group_by_year = FALSE,
  case_type,
  output_dir = NULL,
  save_csv = FALSE
)

Value

A tibble containing the following columns:

  • Grouping variables depending on the level and group_by_year settings.

  • MRT: Minimum risk temperature (or equivalent reference exposure).

  • AR_Number, AR_Number_LCI, AR_Number_UCI: Estimated, lower, and upper bounds of the attributable number of cases.

  • AR_Fraction, AR_Fraction_LCI, AR_Fraction_UCI: Estimated, lower, and upper bounds of the attributable fraction (%).

  • AR_per_100k, AR_per_100k_LCI, AR_per_100k_UCI: Estimated, lower, and upper bounds of the attributable rate per 100,000 population.

Arguments

data

A data frame or list returned by the combine_health_climate_data() function, containing health outcome, population, and exposure data.

param_term

Character. The exposure variable term to evaluate (e.g.,"tmax" for maximum temperature, "rainfall" for precipitation). Defaults to "tmax".

model

The fitted INLA model object returned by the run_inla_models() function.

level

Character. The spatial disaggregation level. Can take one of the following values: "country", "region", or "district".

param_threshold

Numeric. Threshold above which relative risks (RR) are considered attributable. Defaults to 1.

filter_year

Integer. The year to filter to data to. Defaults to NULL.

group_by_year

Logical. Whether to aggregate results by year (TRUE) or by year and month (FALSE). Defaults to FALSE.

case_type

Character. The type of disease that the case column refers to. Must be one of "diarrhea" or "malaria".

output_dir

Optional. Directory path to save the output metrics if save_fig = TRUE

save_csv

Logical. Whether to save the generated attribution metrics to file. Default is FALSE.