Skip to content

docs(labels): refresh stale observed-value statistics in survey_documentation - #114

Open
elleggert wants to merge 1 commit into
mainfrom
docs/refresh-survey-stats
Open

docs(labels): refresh stale observed-value statistics in survey_documentation#114
elleggert wants to merge 1 commit into
mainfrom
docs/refresh-survey-stats

Conversation

@elleggert

@elleggert elleggert commented Jul 25, 2026

Copy link
Copy Markdown
Collaborator

While working through reviewer comments on the paper I went to verify the cholesterol figures in data/labels/survey_documentation/ and found the numbers there don't match the released dataset. That docs snapshot predates several label-preparation steps, so 18 pages publish statistics that no longer describe the data we ship.

This PR regenerates those blocks. Nothing else.

What changed

Regenerated from the released full-cohort label files — last_labels.json (md5 521c157a…) and context_labels.json (md5 220f5946…), the same bytes served by the public bundle. Per page, only these are rewritten:

  • the **Total observations** / type-enforced / unique / raw types line
  • the **Type-enforcement rejections** line
  • the | stat | value | table
  • the **Top N most frequent values** table
  • the _Generated …_ provenance footer

Prose, ## Source, ## Question, ## Answer options, ## Git history and ## Notes are byte-identical. The diff contains no line outside those five kinds.

Representative corrections

Variable Published Released data
Watch_BasalEnergyBurned min −4666 kcal 500.3
Watch_RespiratoryRate min −1, max 106 5, 39
Watch_HeartRateVariabilitySDNN min 0.002341 ms 5.18
WeightKilograms min/max 30 / 300 (slider clamps) 31.3 / 223.6
BMI_values max 125 58.04
age median 32 39 (de-identified birthdates)
Watch_VO2Max max 99 59.89
TotalCholesterol median 9.49 4.55 mmol/L
Hdl / Ldl median 2.77 / 5.61 1.32 / 2.61 mmol/L

Full list of touched pages: BMI_values, WeightKilograms, Hdl, Ldl, SystolicBloodPressure, TotalCholesterol, framingham_risk, age, Watch_BasalEnergyBurned, Watch_HeartRateVariabilitySDNN, Watch_RespiratoryRate, Watch_RestingHeartRate, Watch_StandTime, Watch_VO2Max, Watch_WalkingHeartRateAverage, vigorous_act, sleep_time, happiness.

One additional one-word change, called out explicitly: cardiometabolic_labs/summary.md described TotalCholesterol as (mg/dL), which the refreshed statistics in the same PR directly contradict. Changed to (mmol/L).

Scope / non-goals

  • No data, code or API change. The released dataset is unaffected — it was already correct; only these markdown pages were stale.
  • Nothing outside survey_documentation/. The bundle-side docs (data/labels/README.md, RELEASE_NOTES.md, which live in Google Drive and the Dataverse deposits) carry no per-variable statistics, so no dataset re-version is needed.
  • Pages with categorical/ordinal value tables were checked and are unaffected.

…entation

The per-variable pages under data/labels/survey_documentation/ carry an
"Observed values" block generated on 2026-04-28 from a pre-release snapshot
of the label files (last_labels.json md5 0f65e8fe…). That snapshot predates
several label-preparation steps, so 18 pages published statistics that no
longer describe the released data.

Regenerated those 18 blocks from the released full-cohort label files
(last_labels.json md5 521c157a…, context_labels.json md5 220f5946…).
Only the observation counts, stat table, top-N table and provenance footer
are rewritten; all prose, source references, git-history and notes sections
are untouched.

Representative corrections:
  Watch_BasalEnergyBurned   min -4666      -> 500.3   (kcal, was negative)
  Watch_RespiratoryRate     min -1, max 106 -> 5, 39  (breaths/min)
  Watch_HRVSDNN             min 0.002341   -> 5.18    (ms)
  WeightKilograms           min/max 30/300 -> 31.3/223.6 (slider clamps gone)
  BMI_values                max 125        -> 58.04
  age                       median 32      -> 39      (de-identified birthdates)
  TotalCholesterol          median 9.49    -> 4.55    (mmol/L)
  Hdl / Ldl                 median 2.77 / 5.61 -> 1.32 / 2.61 (mmol/L)

Also corrects the unit shown for TotalCholesterol in the cardiometabolic_labs
summary table (mg/dL -> mmol/L), which the refreshed statistics contradict.

No code, data or API behaviour changes.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@elleggert

Copy link
Copy Markdown
Collaborator Author

Short version of what this does and how it was checked.

What we did. The Observed values block on these pages was generated on 2026-04-28 from a pre-release snapshot of the label files and never regenerated, so 18 pages published statistics that don't describe the data we ship. Regenerated those blocks from the released label files (last_labels.json md5 521c157a…, context_labels.json md5 220f5946…). Per page only the counts line, rejections line, stat table, top-N table and provenance footer are rewritten — prose, source references, git history and notes are byte-identical.

How we checked it. Every number was re-derived a second time through an independent code path (numpy percentiles, ddof=1) and diffed against what's committed here: 18/18 pages reproduce exactly — every stat cell, count, unique and Top N header, with all 18 footers citing the md5s of the files actually read.

Cross-checked against labels_wide.parquet, a separate release artifact written by a separate pipeline step: 10 of 18 match it exactly (same n, same sorted values to 1e-9) — BMI_values, WeightKilograms, Hdl, Ldl, SystolicBloodPressure, TotalCholesterol, framingham_risk, age, vigorous_act, sleep_time. The remaining 8 (the seven Watch_* metrics and happiness) cannot match by construction: labels_wide.parquet holds one row per user, while these variables store a per-user series and the doc block summarizes every observation — the same convention the original generator used.

Also confirmed no label-name collisions between last_labels.json and context_labels.json for these 18, so there is no ambiguity about which file each page reads.

On the large count drops (TotalCholesterol 9,937 → 3,558, SystolicBloodPressure 9,867 → 3,691, age 57,939 → 11,893): these reflect the release deduplicating clinical targets to one record per user, not a counting change here — which is why labels_wide.parquet matches those pages at exactly the user count.

Scope: docs only. 19 markdown files, all under data/labels/survey_documentation/; no code, no data, no API change. The released dataset was already correct — only these pages were stale.

@elleggert
elleggert requested a review from NarayanSchuetz July 25, 2026 12:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant