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.
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
)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.
A data frame or list returned by the combine_health_climate_data()
function, containing health outcome, population, and exposure data.
Character. The exposure variable term to evaluate (e.g.,"tmax" for
maximum temperature, "rainfall" for precipitation). Defaults to "tmax".
The fitted INLA model object returned by the run_inla_models() function.
Character. The spatial disaggregation level. Can take one of
the following values: "country", "region", or "district".
Numeric. Threshold above which relative risks (RR) are
considered attributable. Defaults to 1.
Integer. The year to filter to data to. Defaults to NULL.
Logical. Whether to aggregate results by year (TRUE) or
by year and month (FALSE). Defaults to FALSE.
Character. The type of disease that the case column refers
to. Must be one of "diarrhea" or "malaria".
Optional. Directory path to save the output metrics if
save_fig = TRUE
Logical. Whether to save the generated attribution metrics to file.
Default is FALSE.