Bayesian spatio-temporal models for analyzing preventable hospitalizations due to type 2 diabetes mellitus in Costa Rica, 2019–2024
Published 2026-09-09
Keywords
- Diabetes Mellitus, Type 2, Primary Health Care, Bayes Theorem, Hosptalization, Spatio-Temporal Analysis.

This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
How to Cite
Abstract
Objective: To analyze the risk of avoidable hospitalizations due to type 2 diabetes mellitus (DM2) within the Costa Rican Social Security Fund (CCSS) during the period 2019–2024 using Bayesian hierarchical spatio-temporal models.
Methods: A longitudinal ecological study was conducted using data from the Health Services Performance Evaluation of health areas and hospital discharge records for DM2 (ICD-10: E11). Bayesian spatio-temporal models were fitted using the Integrated Nested Laplace Approximation (INLA) approach, incorporating structured and unstructured spatial effects as well as temporal dependence. Model selection was based on the Deviance Information Criterion (DIC) and the Watanabe–Akaike Information Criterion (WAIC). The association between avoidable hospitalizations due to DM2 and geographic, temporal, clinical, and community-level factors was assessed.
Results: The best-fitting model corresponded to a BYM2 spatial structure and included suboptimal glycemic control, obesity, rural population, and primary health care (PHC) coverage as covariates. All variables showed positive and statistically significant associations with hospitalization risk. Rural population exhibited the largest relative effect, followed by PHC coverage, suboptimal glycemic control, and obesity. The spatio-temporal analysis revealed a reduction in the number of health areas classified as high risk by 2024; however, several areas remained at elevated risk, including Coto Brus, Golfito, Limón, Quepos, and Turrialba-Jiménez.
Conclusions: Avoidable hospitalizations due to DM2 showed heterogeneous spatial patterns and were associated with individual, community, and health service-related factors. Bayesian spatio-temporal models constitute a useful tool for identifying priority areas and supporting decision-making aimed at improving the effectiveness of primary health care and DM2 management.
References
- Vargas W. Atención primaria de salud en acción: su contexto histórico, naturaleza y organización en Costa Rica. San José: EDNASSS–CCSS; 2006.
- Morera M, Aparicio A. En Costa Rica una de cada diez hospitalizaciones es evitable. Rev Costarric Salud Pública. 2011;20(1):1–4.
- Peritó S, Delgado E. Hospitalizaciones evitables. ¿Quién soporta la carga de la prueba? Gac Sanit. 2003;17(5):419–25.
- Morera M. Modelos bayesianos espacio-temporales aplicados a las hospitalizaciones por problemas de salud susceptibles de cuidados ambulatorios en Costa Rica [Tesis doctoral]. Las Palmas de Gran Canaria: Universidad de Las Palmas de Gran Canaria; 2010.
- Asmarian N, Ayatollahi SMT, Sharafi Z, Zare N. Bayesian spatial joint model for disease mapping of zero-inflated data with R-INLA: a simulation study and an application to male breast cancer in Iran. Int J Environ Res Public Health [Internet]. 2019;16(22):4460. Disponible en: https://pubmed.ncbi.nlm.nih.gov/31766251/ DOI: https://doi.org/10.3390/ijerph16224460
- Organización Panamericana de la Salud. Atención primaria de salud [Internet]. Washington, D.C.: OPS; s.f. Disponible en: https://www.paho.org/es/temas/atencion-primaria-salud
- Correa JC, Barrera CJ. Introducción a la estadística bayesiana. Medellín: Instituto Tecnológico Metropolitano; 2018.
- Alcalde M. Modelos jerárquicos bayesianos [Trabajo de fin de grado]. Zaragoza: Universidad de Zaragoza; 2022.
- Mirás B. Modelo espacial bayesiano para la estimación de la invalidez en España con la metodología INLA [Trabajo fin de máster]. Madrid: Universidad Carlos III de Madrid; 2019.
- Moraga P. Datos de salud geoespacial: modelado y visualización con R-INLA y Shiny. Boca Raton: Chapman & Hall/CRC; 2019.
- Moraga P. Spatial statistics for data science: theory and practice with R. Boca Raton: Chapman & Hall/CRC; 2023. DOI: https://doi.org/10.1201/9781032641522
- Benavides S, Artavia ML. Asimetrías en el desarrollo de los territorios de Costa Rica. Atl Rev Econ [Internet]. 2018;1(1). Disponible en: https://www.aroec.org/ojs/index.php/ARoEc/article/view/28
- Kim H, Lim H. Comparison of Bayesian spatio-temporal models for chronic diseases. J Data Sci [Internet]. 2010;8(2):189–211. Disponible en: https://jds-online.org/journal/JDS/article/914/info DOI: https://doi.org/10.6339/JDS.2010.08(2).581
- R Core Team. R: A language and environment for statistical computing [Internet]. Vienna: R Foundation for Statistical Computing; 2024. Disponible en: https://www.R-project.org
- Posit Software. RStudio: Integrated development environment for R [Internet]. Posit Software, PBC; 2024. Disponible en: https://posit.co
- Wickham H, François R, Henry L, Müller K. dplyr: A grammar of data manipulation [Internet]. CRAN; 2024. Disponible en: https://CRAN.R-project.org/package=dplyr
- Wickham H, Girlich M. tidyr: Tidy messy data [Internet]. CRAN; 2024. Disponible en: https://CRAN.R-project.org/package=tidyr
- Wickham H. ggplot2: Elegant graphics for data analysis [Internet]. New York: Springer-Verlag; 2016. Disponible en: https://ggplot2.tidyverse.org DOI: https://doi.org/10.1007/978-3-319-24277-4_9
- Gohel D, Skintzos P. flextable: Functions for tabular reporting [Internet]. CRAN; 2024. Disponible en: https://CRAN.R-project.org/package=flextable
- Bivand R. spdep: Spatial dependence: Weighting schemes, statistics and models [Internet]. CRAN; 2024. Disponible en: https://CRAN.R-project.org/package=spdep
- Pebesma E. Simple features for R: Standardized support for spatial vector data. R J [Internet] 2018;10(1):439–46. Disponible en: https://journal.r-project.org/articles/RJ-2018-009/index.html DOI: https://doi.org/10.32614/RJ-2018-009
- Rue H, Martino S, Chopin N. Approximate Bayesian inference for latent Gaussian models by using Integrated Nested Laplace approximations. J R Stat Soc Ser B Stat Methodol [Internet] 2009;71(2):319–92. Disponible en: https://doi.org/10.1111/j.1467-9868.2008.00700.x DOI: https://doi.org/10.1111/j.1467-9868.2008.00700.x
