Learn R Programming

climatehealth (version 1.0.0)

run_inla_models: Run models of increasing complexity in INLA: Fit a baseline model including spatiotemporal random effects.

Description

: Create and run multiple INLA (Integrated Nested Laplace Approximation) models to the dataset, evaluates them using DIC (Deviance Information Criterion), and identifies the best-fitting model.

Usage

run_inla_models(
  combined_data,
  basis_matrices_choices,
  inla_param,
  max_lag,
  nk,
  case_type,
  output_dir = NULL,
  save_model = FALSE,
  family = "nbinomial",
  config = FALSE
)

Value

A list containing the model, baseline_model, and the dic_table.

Arguments

combined_data

A dataframe resulting from combine_health_climate_data() function.

basis_matrices_choices

A character vector specifying the basis matrix parameters to be included in the model. Possible values are tmax, and rainfall.

inla_param

A character vector specifying the confounding exposures to be included in the model. Possible values are tmax,tmin, rainfall, r_humidity, runoff, ndvi, Etc.

case_type

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

output_dir

Character. The path to save model output to. Defaults to NULL.

save_model

Boolean. Whether to save the results as a CSV. Defaults to FALSE.

family

Character. The probability distribution for the response variable. The user may also have the possibility to choose nbinomial for a negative binomial distribution. Defaults topoisson.

config

Boolean. Enable additional model configurations. Defaults to FALSE.