P1 analytic cohort

P1 — Analytic cohort

Week 3 · applies L2 (Analytic data) · optional and ungraded — no separate deadline, nothing to submit; M1 is assembled from these five increments Keep in your group GitHub repo: a script that rebuilds the cohort + a flow table + a short P1_notes.md.

The question this week

Can you rebuild your paper’s analytic cohort from the raw source data, and account for every person who is included or excluded? Rebuilding the sample is the first result — everything downstream depends on getting this right.

What to do

  1. Find the source files. List every raw data file (and version/cycle) your paper’s cohort is built from, and the key you merge on.
  2. Reconstruct eligibility. Translate the paper’s inclusion/exclusion criteria and exposure/outcome definitions into code. Build the exposure and link the outcome.
  3. Make a flow table. Report N after each exclusion step, ending at your analytic N.
  4. Compare to the paper and explain the gap. State your N vs the paper’s. Trace any difference to a specific decision. Do not tune your code to hit the paper’s number.

Deliverable

Worked example — MASLD/NHANES demonstration

What good looks like

Be ready to defend (M3)

“Show me one person who is in your cohort but not the paper’s — and tell me why.”

AI co-pilot note

A co-pilot will happily write code that filters until N equals the paper’s number. That is the exact failure this increment tests. You must be able to show the funnel and defend each cut.

Lab → project handoff

You are applying L2 (Analytic data) — multi-source download, merge, cleaning, eligibility, and exposure/outcome construction (EpiMethods accessingE3 and accessingE2). Same moves, your paper’s data.