Maternal age, clinical timing, and gestational-age redistribution in U.S. natality records, 2016-2024
This repository contains analysis code and derived non-identifiable outputs for the manuscript "Maternal Age, Clinical Timing, and Secular Redistribution of Gestational Age in U.S. Natality Records, 2016-2024." The study used public-use U.S. National Center for Health Statistics natality records and public aggregate Statistics Canada tables to evaluate secular redistribution of gestational age, maternal-age composition, age-specific rate change, and clinical-timing attenuation.
data/
README.md Data placement and provenance notes
raw/ Untracked raw source ZIPs and extracts
processed/ Untracked large derived model-cell file
docs/ Analysis plans, codebooks, feasibility notes
figures/ Generated figures
manuscript/ Manuscript sources and LaTeX table outputs
references/ Public reference documentation
reports/ Reproducibility and artifact reports
scripts/ Analysis and artifact-generation scripts
tables/ Generated CSV outputs
Raw NCHS natality public-use files and Statistics Canada aggregate tables are not redistributed in this repository. They are publicly available from their original sources. This repository provides analysis scripts, documentation, and derived non-identifiable outputs needed to reproduce the manuscript tables and figures after downloading the source data.
Large source files are not tracked in git. Place public-use NCHS natality ZIP files and StatCan ZIP files in data/raw/ as described in data/README.md. The large derived file data/processed/model_cells.csv is also not tracked. Regenerate it from the raw NCHS inputs with scripts/01_nchs_analysis_all_years.py.
Install dependencies with:
python -m venv .venv
.\.venv\Scripts\Activate.ps1
python -m pip install -r requirements.txtConda users can instead run:
conda env create -f environment.yml
conda activate preterm-reproRun from the repository root:
python scripts\01_nchs_analysis_all_years.py
python scripts\02_canada_statcan_aggregate.py
python scripts\03_build_latex_tables_updated.py
python scripts\05_diagnostics_and_corrections.py
python scripts\06_regenerate_figures.py
python scripts\07_requested_artifacts_no_manuscript.py
python scripts\08_generate_cohort_missingness_and_compact_outputs.py
python scripts\09_sensitivity_covariate_audit.pySee REPRODUCIBILITY.md for details.
tables/: primary generated CSV outputs.tables/requested_artifacts/: denominator accounting, staged model tables, cohort characteristics, missingness, decomposition values, and attenuation values.tables/sensitivity_audit/: sensitivity covariate availability, distributions, and staged model summaries.figures/: generated manuscript and analysis figures.figures/requested_artifacts/figure_decomposition_and_attenuation.pdf: simple two-panel decomposition and attenuation chart.
Code is released under the MIT License. Derived tables, figures, and documentation are released under the Creative Commons Attribution 4.0 International License (CC BY 4.0). See LICENSE and LICENSE-DATA-DOCS for details.
Pereira A. Maternal age, clinical timing, and secular redistribution of gestational age in U.S. natality records, 2016-2024. Analysis repository. 2026.
- Manuscript source files are not part of the automated compute-only artifact script.
- Unknown categories are retained in grouped model covariates where documented in the generated missingness table.
- Race/ethnicity, maternal morbidity, ART/infertility treatment, individual socioeconomic position, and environmental exposure are not safely available from the current model-cell file.