Data specification — Demo
dataset
This repository contains a small demo dataset (CSV) and a
specification document describing the fields and provenance. The purpose
of this demo is to illustrate how a data package for diabetes-related
primary care metrics might be structured for sharing and
documentation.
Files included
Both CSV files are intentionally synthetic and contain dummy values
for demonstration only.
Derived outputs
data/derived_patient_status.csv
— patient-level summary generated by
scripts/derive_patient_status.py. Contains one row per
patient with computed BMI, weight category, blood pressure category, and
assumed heights. See the Scripts section below for details.
Processing workflow —
describes the steps and script used to produce the derived
dataset.
See also (downloadable):
How the data were obtained
This is simulated data created for demonstration. No real patient
data were used. Values were chosen to mimic plausible distributions and
column names commonly used in primary care diabetes datasets.
Data dictionary
- patient_id: Unique patient identifier (synthetic).
- age: Integer age in years.
- sex: ‘M’ or ‘F’.
- ethnicity: Broad ethnicity group.
- imd_quintile: Index of Multiple Deprivation quintile (1 = most
deprived, 5 = least deprived).
- date: ISO date of measurement (YYYY-MM-DD).
- hba1c_mmol_per_mol: HbA1c value in mmol/mol.
- bp_systolic: Systolic blood pressure in mmHg.
- bp_diastolic: Diastolic blood pressure in mmHg.
- weight_kg: Weight in kilograms (one decimal allowed).
The derived file contains the following columns (generated by the
script):
- patient_id: Unique patient identifier (matches input patients).
- sex: ‘M’ or ‘F’ (from input patients).
- ethnicity: Broad ethnicity group (from input patients).
- measurement_date: ISO date of the latest measurement for this
patient (YYYY-MM-DD).
- bp_systolic: Systolic blood pressure from the latest measurement
(mmHg).
- bp_diastolic: Diastolic blood pressure from the latest measurement
(mmHg).
- bp_category: Derived blood pressure classification: ‘high’ (systolic
≥ 140 or diastolic ≥ 90), ‘low’ (systolic < 90 or diastolic < 60),
or ‘normal’.
- weight_kg: Weight from the latest measurement (kg).
- height_cm: Assumed average height in centimetres based on sex and
ethnicity (demo-only assumptions).
- height_source: String indicating whether the height was assumed
using ‘assumed_by_sex_ethnicity’ or ‘assumed_by_sex’ (fallback).
- bmi: Computed Body Mass Index (weight_kg / height_m²), rounded to 1
decimal place.
- weight_category: Derived weight classification from BMI:
‘underweight’ (BMI < 18.5), ‘normal’ (18.5 ≤ BMI < 25),
‘overweight’ (25 ≤ BMI < 30), or ‘obese’ (BMI ≥ 30).
Provenance and processing
notes
- Synthetic generation: values were hand-crafted to be plausible and
do not correspond to any real individual.
- No identifying information is present.
How to access
the data from the published site
When this repository’s data specification is published to GitHub
Pages (via the manual workflow Publish data specification),
a static site is created containing this document and the
data/ folder. Links on the published page point to the CSV
files here:
You can click these links on the published site to download or view
the raw CSV files.
License and reuse
This demo dataset is provided for educational/demonstration purposes.
You may reuse the data and documentation freely.
Repository owner: Ricky Olivier (ricky-lv426).