Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Metabolic Disease in the United States: Trends, Risk Factors, and Spatial Epidemiology

A reproducible, three-part analysis of metabolic disease in the United States, built on federal public-health surveillance data from the CDC and the U.S. Census Bureau.

  • Part I — State-level trends (2011–2023). Estimates the trajectory of adult obesity prevalence by state and identifies the behavioral risk factors most strongly associated with it. (CDC BRFSS / DNPAO, dataset hn4x-zwk7.)
  • Part II — County-level spatial epidemiology. Examines the joint distribution of six metabolic conditions (obesity, diagnosed diabetes, coronary heart disease, stroke, hypertension, and high cholesterol) across approximately 3,100 counties and formally tests whether their geographic concentration — the "Diabetes Belt" — is statistically significant. (CDC PLACES, dataset swc5-untb.)
  • Part III — Confounding and robustness. Assesses whether the obesity–diabetes association persists after adjustment for county socioeconomic composition, and whether the spatial-clustering result is sensitive to the definition of the spatial weights matrix. (U.S. Census ACS; Moran's I under multiple weighting schemes.)

Author: Rohan Shirur

CI Python License: MIT

Data provenance. Each pipeline retrieves data directly from the CDC Socrata API (data.cdc.gov) and the U.S. Census API. Small synthetic fixtures — calibrated to published CDC estimates and, for the county data, to the documented geography of metabolic disease in the Southeast — are included so that the code, test suite, and continuous integration run without network access. Synthetic data is labeled as such throughout; the --live flag retrieves authentic estimates. Complete source documentation is provided in docs/DATA_DICTIONARY.md.


Overview

The project is organized around a single principle: each analytical claim is paired with a method appropriate to it, and the limitations of that method are stated explicitly. The table below summarizes the questions addressed and the corresponding approach.

Research question Method Inferential safeguard
How is adult obesity prevalence changing, and where most rapidly? Per-state ordinary least squares trend estimation Confidence interval reported for every state slope
Which risk factors are most strongly associated with obesity? Pooled regression with year fixed effects Standard errors clustered by state
How well can behavioral indicators predict state obesity prevalence? Ridge regression Leave-states-out cross-validation
How strongly are the metabolic conditions associated across counties? Population-weighted correlation Crude versus age-adjusted estimates handled explicitly
Which risk factors are associated with county diabetes prevalence? Population-weighted least squares with state fixed effects HC3 heteroskedasticity-robust standard errors; variance-inflation diagnostics
Is the geographic clustering of disease statistically significant? Global and local Moran's I Permutation-based inference (no normality assumption)
Does the obesity–diabetes association persist under socioeconomic adjustment? Nested regression (behavioral, then socioeconomic, then fixed-effects specifications) Attenuation of the coefficient tracked across specifications
Is the clustering result an artifact of the weights matrix? Moran's I under multiple weighting schemes k-nearest-neighbor, distance-band, and queen-contiguity weights compared

The spatial statistics are implemented directly in NumPy and validated against the PySAL reference implementation, with agreement to within 1e-9 (test_morans_i_matches_pysal).


Summary of results

The figures below are computed from the calibrated fixtures and are reproduced from authentic data when the pipeline is run with --live. Each result is cross-checked against published CDC estimates.

Part I — State-level trends

  • Mean state adult obesity prevalence increased by 0.61 percentage points per year (95% CI: 0.60–0.62) over 2011–2023, consistent with the approximately 0.6-point annual increase reported by the CDC.
  • Physical inactivity shows the strongest association with obesity: 0.82 percentage points of obesity per point of inactivity (95% CI: 0.69–0.96; p < 0.001).
  • Under leave-states-out cross-validation, behavioral indicators predict state obesity prevalence with R² = 0.63 and a mean absolute error of 2.0 percentage points.

Part II — County-level spatial epidemiology

  • The metabolic conditions are strongly associated across counties: obesity and diabetes, r = 0.83; diabetes and hypertension, r = 0.72; diabetes and coronary heart disease, r = 0.68.
  • In the county diabetes regression (population-weighted, state fixed effects, HC3-robust standard errors), obesity (+0.17, p < 0.001) and physical inactivity (+0.12, p < 0.001) are the leading correlates; the model explains 74% of between-county variance.
  • The Diabetes Belt is reproduced: counties with diabetes prevalence at or above 11% have a mean obesity prevalence of 34.6%, compared with 26.5% elsewhere — consistent in direction and magnitude with the published CDC contrast of 32.9% versus 26.1%.
  • Geographic clustering is highly significant: Global Moran's I is 0.61 for diabetes (p < 0.001), 0.88 for obesity, and 0.44 for coronary heart disease. Local Moran's I identifies a significant high-prevalence cluster across the Southeast and a significant low-prevalence cluster across the Mountain West.

Part III — Confounding and robustness

  • The obesity–diabetes association is robust to adjustment. Across nested specifications, the obesity coefficient declines by approximately 19% (from 0.27 unadjusted to 0.22 after adding behavioral controls, socioeconomic covariates, and state fixed effects) and remains highly significant (p < 0.001) — consistent with the original Diabetes Belt analysis, which attributed the excess regional risk to both modifiable and non-modifiable factors.
  • The socioeconomic profile of the belt is reproduced. Belt counties have higher poverty (21.8% versus 14.6%) and a larger African American population share (19.4% versus 9.5%) than the remainder of the country, consistent in direction and magnitude with the published CDC contrast of 23.8% versus 8.6%.
  • The clustering result is not an artifact of the weights matrix. Global Moran's I for diabetes remains in the range 0.53–0.61 (p < 0.001) across k-nearest-neighbor weights (k = 4, 6, 8, 12), a data-driven distance band, and queen contiguity.


County-level diagnosed diabetes prevalence. The Southeastern Diabetes Belt is clearly visible.


Left: local Moran's I (LISA) clusters. Right: Moran scatterplot, in which the slope equals Global Moran's I.


Left: the obesity coefficient across nested specifications (Part III). Right: Global Moran's I across weighting schemes (Part III).


Left: national obesity trend (Part I). Right: cross-condition correlation matrix (Part II).


Getting started

git clone https://github.com/rohans11/metabolic-trends.git
cd metabolic-trends
python -m venv .venv && source .venv/bin/activate   # optional
pip install -r requirements.txt

# Run all three parts using the offline fixtures (no network access required):
python -m src.run_pipeline --offline --all

# Run all three parts using authentic live data from the CDC and Census APIs:
python -m src.run_pipeline --live --all

# Run the state-level and county-level analyses independently:
python -m src.run_pipeline           --offline   # Part I: state-level trends
python -m src.run_spatial_pipeline   --offline   # Parts II–III: county-level analysis

# Run the test suite (offline and deterministic; includes the PySAL validation):
pytest -v
# Run the opt-in tests that query the live APIs:
RUN_LIVE_TESTS=1 pytest -v -k live

Results are written to outputs/: figures/ contains the trend plots, choropleths, LISA maps, and Moran scatterplots; tables/ contains the coefficient tables and full regression summaries; and summary.json and spatial_summary.json provide machine-readable summaries of the principal findings.

An annotated walkthrough of the full analysis is available in notebooks/analysis.ipynb, which has been executed with all outputs and figures embedded.


Repository structure

metabolic-trends/
├── src/
│   ├── data_acquisition.py      # Part I: BRFSS/DNPAO Socrata client (retry, caching, discovery)
│   ├── preprocessing.py         # Cleaning, Census-region labeling, panel construction
│   ├── analysis.py              # Trend estimation, clustered regression, cross-validated Ridge
│   ├── visualization.py         # State-level figures
│   ├── places_acquisition.py    # Part II: PLACES county client (measures pivoted to wide format)
│   ├── acs_acquisition.py       # Part III: Census ACS socioeconomic covariates
│   ├── cross_disease.py         # Correlations, diabetes regression, VIF, Belt analysis, nested models
│   ├── spatial_analysis.py      # Global and local Moran's I (NumPy; validated against PySAL)
│   ├── weights_robustness.py    # Part III: Moran's I across k-NN, distance-band, and queen weights
│   ├── spatial_viz.py           # Choropleths, LISA maps, Moran scatterplots, nested/robustness plots
│   ├── make_fixture.py          # Calibrated state-level fixture
│   ├── make_county_fixture.py   # Calibrated county-level fixture (health outcomes and ACS covariates)
│   ├── run_pipeline.py          # Part I driver (the --all flag also runs Parts II–III)
│   └── run_spatial_pipeline.py  # Parts II–III driver
├── tests/
│   ├── test_pipeline.py         # State-level tests, plus opt-in live-API tests
│   └── test_spatial.py          # Spatial and cross-disease tests, plus the PySAL validation
├── docs/DATA_DICTIONARY.md      # Complete schema, measure identifiers, methods, and caveats
├── data/raw/                    # Calibrated fixtures and county centroids (committed)
├── outputs/                     # Figures, tables, and summary files (committed)
├── .github/workflows/ci.yml     # Continuous integration across Python 3.10–3.12
├── requirements.txt
├── CITATION.cff
└── LICENSE

Methodology

Part I data. CDC DNPAO BRFSS estimates (hn4x-zwk7), restricted to the overall ("Total") stratification, 2011–2023. Obesity is defined as a self-reported body mass index of at least 30. The series begins in 2011 because a change in the BRFSS cellular-telephone sampling frame renders earlier estimates non-comparable.

Parts II–III data. CDC PLACES county estimates (swc5-untb), crude prevalence, produced by multilevel regression and poststratification of BRFSS and ACS data across approximately 3,100 counties. County records are joined to 2010 population-weighted county centroids for the construction of spatial weights, and to a FIPS-keyed county GeoJSON for choropleth mapping. Socioeconomic covariates are drawn from the U.S. Census American Community Survey five-year estimates.

Spatial analysis. Spatial weights are constructed using k-nearest-neighbor adjacency (k = 8), row-standardized. Global Moran's I is evaluated with conditional-permutation inference (999 permutations). Local Moran's I is reported with permutation-based pseudo p-values and high-high, low-low, high-low, and low-high quadrant classifications. The NumPy implementation reproduces the PySAL reference results to within 1e-9.

Validation. Part I is checked against four independently published CDC state estimates. Part II reproduces the published Diabetes Belt obesity contrast and the leading obesity–diabetes association. Part III reproduces the socioeconomic profile of the belt (poverty and racial composition) and confirms that the spatial result is stable across weighting schemes. Each validation check raises an explicit error if the computed values depart from expectation.


Limitations

  • Self-reported and model-based estimates. BRFSS obesity prevalence is known to underestimate directly measured (NHANES) prevalence, and PLACES county figures are model-based small-area estimates. Both are appropriate for comparison and for characterizing spatial structure, but not as absolute clinical prevalence rates.
  • Ecological design. All associations are estimated at the state or county level; inference about individual-level risk would constitute an ecological fallacy.
  • Association, not causation. The analysis does not employ a causal identification strategy. Even the socioeconomically adjusted coefficients are conditional associations rather than causal effects.
  • Cross-sectional county data. A single PLACES release represents one period; the county-level analysis therefore characterizes spatial structure rather than temporal change.
  • Uncertainty in covariates. The ACS covariates carry their own sampling error, which the diabetes regression treats as fixed — a deliberate simplification.
  • Provenance of reported figures. The values committed to this repository are computed from the calibrated fixtures; authentic estimates require running the pipeline with --live.

Planned extensions

  • Construction of a multi-year county panel from successive PLACES releases to support spatiotemporal modeling.
  • Spatial regression (spatial-lag and spatial-error specifications via spreg), incorporating the neighbor structure into the estimator rather than assessing it post hoc — the natural next step now that the robustness of the descriptive result has been established.
  • Formal mediation analysis decomposing the modifiable and non-modifiable components of the belt's excess risk, for which the nested models here serve as the descriptive foundation.
  • A mixed-effects specification with a state-level random intercept, as a principled alternative to fixed effects with clustered standard errors.

Citation

If you reference this work, please cite it as indicated in CITATION.cff:

Shirur, R. (2026). Metabolic Disease in the United States: Trends, Risk Factors, and Spatial Epidemiology. https://github.com/rohans11/metabolic-trends

License

Released under the MIT License; see LICENSE.

Acknowledgements

Data are drawn from the U.S. Centers for Disease Control and Prevention (the Division of Nutrition, Physical Activity, and Obesity, and the PLACES program) and the U.S. Census Bureau American Community Survey. County centroids are from the public btskinner/spatial dataset, and county boundary geometry from plotly/datasets. This project is independent and is not affiliated with, nor endorsed by, the CDC or the Census Bureau.

About

Reproducible analysis of U.S. metabolic disease: state obesity trends, county spatial epidemiology (Moran's I / LISA), and socioeconomic confounders, built on CDC BRFSS, PLACES, and Census ACS.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages