Package: GHRmodel 0.1.1

Carles Milà

GHRmodel: Bayesian Hierarchical Modelling of Spatio-Temporal Health Data

Supports modeling health outcomes using Bayesian hierarchical spatio-temporal models with complex covariate effects (e.g., linear, non-linear, interactions, distributed lag linear and non-linear models) in the 'INLA' framework. It is designed to help users identify key drivers and predictors of disease risk by enabling streamlined model exploration, comparison, and visualization of complex covariate effects. See an application of the modelling framework in Lowe, Lee, O'Reilly et al. (2021) <doi:10.1016/S2542-5196(20)30292-8>.

Authors:Carles Milà [aut, cre], Giovenale Moirano [aut], Anna B. Kawiecki [aut], Rachel Lowe [aut]

GHRmodel_0.1.1.tar.gz
GHRmodel_0.1.1.tar.gz(r-4.7-any)GHRmodel_0.1.1.tar.gz(r-4.6-any)
GHRmodel_0.1.1.tgz(r-4.6-emscripten)
manual.pdf |manual.html
DESCRIPTION |NEWS
card.svg |card.png
GHRmodel/json (API)

# Install 'GHRmodel' in R:
install.packages('GHRmodel', repos = c('https://cran.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/bsc-es/ghrtools/issues

Datasets:
  • dengue_MS - Dengue cases from the "Mato Grosso do Sul" state of Brazil
  • dengue_SP - Dengue cases from the "São Paulo" state of Brazil
  • map_MS - Administrative Map for Municipalities in the Mato Grosso do Sul

On CRAN:

Conda:

3.48 score 10 scripts 258 downloads 27 exports 40 dependencies

Last updated from:d994990ac7. Checks:4 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-devel-x86_64OK297
source / vignettesOK239
linux-release-x86_64OK190
wasm-releaseOK174

Exports:as_GHRformulascov_addcov_interactcov_multicov_nlcov_unicov_varyingcrossbasis_inlacrosspred_inlaextract_namesfit_modelsget_covariateslag_covonebasis_inlaplot_coef_crosspredplot_coef_linplot_coef_nlplot_coef_varyingplot_fitplot_gofplot_ppdplot_rerank_modelssample_ppdstack_modelssubset_modelswrite_inla_formulas

Dependencies:clicolorspacecowplotcpp11dlnmdplyrfarvergenericsggplot2GHRexploregluegtableisobandlabelinglatticelifecyclelubridatemagrittrMatrixmgcvnlmepillarpkgconfigpurrrR6RColorBrewerrlangS7scalesstringistringrtibbletidyrtidyselecttimechangetsModelutf8vctrsviridisLitewithr

Complex Covariate Structures
Overview | GHRmodel formula helper functions | 0. Prepare data | Load libraries | Data pre-processing | Spatial data and graphs | Pre-process covariates | Lagged covariates | Define priors | Example 1: GHRmodel helper functions | 1. Model development | Select variables | Linear covariates | Non-linear covariates | Non-linear covariates replicated by group | Covariates for multivariate models | Add a covariate to all covariate lists | Interacting covariates | Varying covariates | Varying vs. Replicated Effects in INLA | Write INLA-compatible model formulas | 2. Model fitting | 3. Model evaluation | Interaction effects | Varying linear coefficients | Replicated nonlinear coefficients | Example 2: INLA-compatible formulas | References

Last update: 2025-11-07
Started: 2025-10-21

Distributed Lag Nonlinear Models
Overview | Example: DLNMs in GHRmodel | 0. Prepare data | Load libraries | Data pre-processing | Spatial data and graphs | 1. Model development | One-dimensional basis matrix | Cross-basis matrix | Model formulas including DLNM terms | 2. Fit DLNMs with INLA | 3. DLNM output | One-basis terms | Cross-basis terms | References

Last update: 2025-11-07
Started: 2025-10-21

GHRmodel overview
Overview | Installation | Data requirements | Methodology | GHRmodel structure | 1. Model development | 2. Model fitting | 3. Model evaluation | GHRmodel workflow | 0. Data | Dataset description | Data pre-processing | Spatial data and graphs | Create lagged covariates | Write covariates | Write formulas | Rank models | Posterior predictive checks | Goodness-of-fit metrics | Fitted vs. Observed | Covariate effects | Evaluate random effects | 4. Iterative model selection | Subset models | Extract covariates | Add an additional covariate | Fit new models | Combine models | Evaluate combined models | References

Last update: 2025-11-07
Started: 2025-10-21

Readme and manuals

Help Manual

Help pageTopics
Convert R-INLA Model Formulas into a GHRformulas Objectas_GHRformulas
Add Covariates to All Combinationscov_add
Generate Interaction Terms Between Covariatescov_interact
Create Covariate Combinations Across Groupscov_multi
Create Non-Linear Effects for INLAcov_nl
Build Univariable Covariate Setscov_uni
Create Spatially or Temporally Varying Effects for INLAcov_varying
Create a Two-Dimensional INLA-compatible Cross-basis Matrixcrossbasis_inla
Generate DLNM Predictions from 'GHRmodels' Objectscrosspred_inla
Dengue cases from the "Mato Grosso do Sul" state of Brazildengue_MS
Dengue cases from the "São Paulo" state of Brazildengue_SP
Extract Covariate Namesextract_names
Fit Multiple INLA Modelsfit_models
Retrieve Covariates from a 'GHRmodels' Object as a List of Character Vectorsget_covariates
Generate lagged variables for one or more lagslag_cov
Administrative Map for Municipalities in the Mato Grosso do Sulmap_MS
Create a One-Dimensional Basis for INLAonebasis_inla
Plot 'crosspred' Objects: Overall, Slices, or Heatmapplot_coef_crosspred
Produce a Forest Plot of Linear Covariates from a 'GHRmodels' Objectplot_coef_lin
Plot Nonlinear Effects from a 'GHRmodels' Objectplot_coef_nl
Produce a Forest Plot for a Spatially or Temporally Varying Effects from a 'GHRmodels' object.plot_coef_varying
Plot Observed vs. Fitted Casesplot_fit
Plot Models by Goodness-of-Fitplot_gof
Plot Posterior Predictive Densities Versus Observed Dataplot_ppd
Plot Random Effectsplot_re
Rank Models by Goodness-of-Fitrank_models
Sample from the Posterior Predictive Distributionsample_ppd
Merge GHRmodelsstack_models
Subset 'GHRmodels' Objectssubset_models
Generate INLA-compatible Model Formulaswrite_inla_formulas