Published May 30, 2026 | Version v1
Software Open

R Analysis Code for "Food Inflation, Nutrition Behavior, Food Insecurity, and Anxiety: A Bayesian Network Analysis Among Turkish Adults"

  • 1. ROR icon Bandırma Onyedi Eylül University
  • 2. ROR icon Bursa Uludağ Üni̇versi̇tesi̇
  • 3. ROR icon Acıbadem University

Description

This repository contains the R analysis code for the study examining the relationships among food inflation–related nutritional behavior change, food insecurity, and anxiety in 1,042 Turkish adults using a Conditional Gaussian Bayesian Network. The code covers the full analytic pipeline: Gaussian Mixture Model categorization of the EFINUB Food Consumption subscale, descriptive and group-comparison statistics, bootstrap-averaged Bayesian Network structure learning, Markov blanket analysis, conditional probability queries, what-if policy scenarios, sample representativeness checks, and the sensitivity and diagnostic analyses conducted during peer review (continuous-versus-categorized network comparison, conditional Gaussian assumption diagnostics, and bootstrap-threshold justification). Participant-level survey data are not included because the governing ethics approval does not permit public sharing of the questionnaire data; the code is released to allow full inspection and reproduction of the analytic workflow. Analyses were run in R 4.5.2; package versions are documented in the manuscript's Supplementary Material.

Technical info (English)

Description of files

This deposit contains five R scripts covering the complete analytic workflow of the study. Participant-level survey data are not included, as the governing ethics approval does not permit public sharing of the questionnaire data; the scripts expect a data file (veriler.xlsx) that is not distributed here.

analiz.R — Main analysis pipeline. Performs variable preparation, scale reliability assessment, and the core Conditional Gaussian Bayesian Network analysis: bootstrap-averaged structure learning (Hill-Climbing algorithm, BIC-CG scoring, 1,000 resamples), model averaging at the 0.85 strength threshold, Markov blanket analysis, conditional probability queries (likelihood weighting, N = 50,000), the what-if policy intervention scenarios, and the gender-balanced sensitivity analysis.

GMM.R — Gaussian Mixture Model categorization of the EFINUB Food Consumption subscale into Low, Moderate, and High levels, including the component-selection diagnostics (number of components, variance structure, BIC/ICL, entropy) reported in Supplementary Tables S3–S4.

Table 1 analysis.R — Descriptive statistics and group comparisons for Table 1, including chi-square tests for categorical variables, Kruskal–Wallis H tests for continuous variables, Bonferroni-corrected post-hoc pairwise comparisons, effect sizes, and both mean ± SD and median (IQR) summaries.

samplingcheck.R — Sample representativeness checks comparing the study sample against national reference statistics (Supplementary Table S5).

AdditionalCodesForReviewer1Demands.R — Additional sensitivity and diagnostic analyses conducted during peer review. Includes the age-distribution and exclusion-flow checks, the comparison between the primary (GMM-categorized) network and a network in which the EFINUB Food Consumption subscale is retained as continuous (Supplementary Table S9), the conditional Gaussian assumption diagnostics based on marginal and conditional distributional properties (Supplementary Table S10), the data-driven bootstrap-threshold justification, and the computation of median/IQR values for Table 1.

All analyses were performed in R version 4.5.2. Key packages include bnlearn, mclust, psych, igraph, ggplot2, openxlsx, and parallel; full package versions are documented in the manuscript's Supplementary Material.

Files

Files (83.2 kB)

Name Size Download all
md5:31acedfef35ce424bc01a834c5416a34
16.8 kB Download
md5:fb4e587608bf526471a26208ca500ee9
44.4 kB Download
md5:ffbd37b780507887f59d892581d431e7
9.9 kB Download
md5:3416d6096b53623c3a08d4724e600bf3
7.1 kB Download
md5:a3646ff35eb8ea0a37760add9993c1ef
4.9 kB Download

Additional details

Software

Programming language
R