# Confidence Without Certainty - NHANES Prediabetes Example **Planimeter Kft.** Version 1.0.0 - 2026-09-24 This package contains the reproducible materials supporting the Planimeter methodological example **Confidence Without Certainty: Quantifying Prediabetes Risk in NHANES Data**. The project illustrates how a conventional point estimate can be reframed as a distribution of plausible values using nonparametric bootstrap resampling and a simple Bayesian beta-binomial model. ## What is included - `confidence_analysis_planimeter_v1.0.0.R` - reproduces the unweighted prevalence analysis, bootstrap distribution, Bayesian posterior summaries and six publication figures from the released compact dataset. - `confidence_data_preparation_planimeter_v1.0.0.R` - downloads the public NHANES 2017-2018 component files and rebuilds the compact analysis dataset. - `data/nhanes_prediabetes_analysis.csv` - analysis-ready participant-level dataset. - `reference/bootstrap_prevalence.csv` - 3,000 bootstrap prevalence estimates from the development run. - `reference/posterior_prevalence.csv` - 10,000 posterior draws from the development run. - `reference/confidence_summary.csv` - key numerical results from the development run. - `output/validation_checks.csv` - independent checks of the supplied numerical results. - `output/dataset_checks.csv` - basic data-integrity diagnostics. - `DATA_DICTIONARY.md` - description of the released fields. - `LICENSE_GPL-3.0.txt` - software license for the Planimeter R code. The `figures/` directory is populated when the main analysis script is executed. ## Data source and analysis population The source data are public NHANES 2017-2018 component files accessed by the `nhanesA` R package: - `DEMO_J` - Demographics - `GHB_J` - Glycohemoglobin - `BMX_J` - Body Measures The released analysis dataset contains **3,459 participants aged 40 years or older** with non-missing HbA1c and BMI. Prediabetes is defined for this methodological example as **HbA1c >= 5.7% and < 6.5%**. There are **1,304 participants** meeting that definition. The released compact dataset also retains NHANES MEC examination weights, masked variance pseudo-PSU codes and masked variance strata (`WTMEC2YR`, `SDMVPSU`, `SDMVSTRA`) for transparency and possible design-based sensitivity work. ## Validated results Using the supplied analysis-ready dataset and reference distributions: - Analysis sample: **3,459** participants. - Prediabetes cases: **1,304**. - Unweighted sample prevalence: **37.7%**. - Bootstrap 95% interval: **36.1% to 39.3%**. - Bayesian posterior median: **37.7%**. - Bayesian 95% credible interval: **36.1% to 39.3%**. - Posterior P(prevalence > 25%): **100.0%**. - Posterior P(prevalence > 30%): **100.0%**. - Posterior P(prevalence > 35%): **99.94%**. The validation table supplied in `output/validation_checks.csv` reproduces every value in `reference/confidence_summary.csv` from the released CSV files. ## Analysis structure The example proceeds in four stages: 1. A conventional unweighted point estimate is calculated from the analysed sample. 2. A participant-level nonparametric bootstrap with 3,000 resamples visualises sampling uncertainty. 3. A beta-binomial illustration uses a Beta(1,1) prior and 10,000 posterior draws to express uncertainty as a posterior distribution and threshold probabilities. 4. A bootstrap logistic model of prediabetes on BMI and age illustrates that uncertainty also applies to fitted risk curves. ## Important methodological scope This release intentionally preserves the original Insight analysis. It is a **methodological uncertainty-communication demonstration**, not a design-based national prevalence analysis. NHANES uses a complex multistage probability sample. The original Insight calculations do **not** use survey weights, strata or PSU information, and the simple beta-binomial model treats the analysed observations as if they were independent Bernoulli observations. Therefore the reported 37.7% should be described as the **unweighted prevalence in the analysed NHANES sample**, not as a formal estimate of U.S. population prevalence. The BMI risk curve is also illustrative. It is not a validated clinical prediction model and should not be interpreted causally or used for individual decision-making. ## Running the analysis Run the main script from the project root: ```text Confidence_Without_Certainty_Planimeter_v1.0.0/ |-- confidence_analysis_planimeter_v1.0.0.R |-- confidence_data_preparation_planimeter_v1.0.0.R |-- README.md |-- DATA_DICTIONARY.md |-- LICENSE_GPL-3.0.txt |-- data/ | `-- nhanes_prediabetes_analysis.csv |-- reference/ | |-- bootstrap_prevalence.csv | |-- posterior_prevalence.csv | `-- confidence_summary.csv |-- figures/ `-- output/ ``` Required R packages for the main analysis are `dplyr`, `ggplot2`, `readr`, `boot` and `scales`. The data-preparation script additionally requires `nhanesA` and an internet connection. ## License and AI disclosure The Planimeter R source code is released under the **GNU General Public License v3.0 or later (GPL-3.0-or-later)**. Generative AI was used as a support tool during drafting, code development, review and validation. The analytical design, interpretation, final materials and responsibility for the release remain with Planimeter Kft. The GNU GPL applies to the Planimeter R source code and does not replace or modify the terms that apply to source data distributed by NHANES/CDC. ## Important note The project is intended for education, methodological discussion and reproducibility. It is not a clinical decision tool and the sample-based prevalence reported here should not be presented as a survey-design-corrected national prevalence estimate.