Week2 nhanes and reading methods

Week 2 — Six questions for reading a Methods section

Duration: ~2.5 h (Tue, before the Thu lab)

Cap: 150 min. Markers below total 144, leaving ~6 minutes of slack.

The timing accounting changed on 2026-09-12. The previous version marked 122 minutes of content and left ~28 minutes unmarked as “the room’s”. That under-filled a 2.5-hour session and hid where the discussion actually goes. The markers below now include the interactive moments — the two vote-and-argue slides and the lab preview block — so the total is what happens in the room. See If you are running behind at the foot of this file for the drop order.

The lecture is one argument. The six questions are the spine; the NHANES anatomy is what the answers are made of, so the component files, variable names and join key are taught in full rather than gestured at. A dedicated preview block before the break puts Thursday’s actual L1 code on screen, so the lab is the execution of Tuesday’s lecture rather than a new topic.

Row-set discipline. Every quantitative slide names the analysis set it is quoting. Analysis set: defined here, then named on every slide that quotes one. The reconstruction has two, and they are not interchangeable: full reconstructed analytic file, N = 6,371 (what scripts 03–06 read) and locked mortality-linked cohort, N = 6,048 (the WTSAF2YR subset). Saying “N” without saying which is the error this course exists to catch.

Learning objectives

  1. Name the research goal a paper is pursuing — description, association, prognostic factor, prediction, or causal — and say what evidence that goal would require.
  2. Answer the six questions for a published study, and show where the paper leaves one of them under-specified.
  3. Locate any NHANES quantity a study uses: the component file, the variable name, and the join key — and write the nhanesA call that fetches it.
  4. Distinguish a design feature from missingness, and a row set from a cohort.
  5. Say what a crude-to-adjusted change does and does not establish.

Continuity


Frame · 10 minutes across the slides below

Slide 1 — Where we are in the project (3 min)

Slide 2 — Why the question comes before the data (3 min)

Slide 3 — The six questions (4 min)

  1. What is the research goal?
  2. Who is the population, and how is eligibility operationalised?
  3. What is the exposure / index factor, and the comparison?
  4. What is the outcome, time zero, and follow-up?
  5. What other variables enter the analysis, and what role are they supposed to play?
  6. What design and analysis features must be respected?

Q1 — What is the research goal? · 20 minutes across the slides below

Slide 4 — The paper states two aims, not one (4 min)

Slide 5 — Five goals the same variables can serve (4 min)

Research goal Scientific target in this example
Description What are the characteristics and mortality experience of each group?
Association Is phenotype statistically associated with subsequent mortality?
Prognostic factor Does phenotype inform mortality over and above other known factors?
Prediction How accurately can we predict an individual’s risk; does WHtR improve it?
Causal What would mortality have been under a specified change in central adiposity?

Slide 6 — Same variables, different analyses (4 min)

Slide 7 — Same variables, different evidence of success (4 min)

Slide 8 — HR + CI: what it is, and is not, evidence for (2 min)

Slide 9 — What does this paper most directly support? (2 min)


Q2 — Who is the population, and how is eligibility operationalised? · 18 minutes for the NHANES anatomy, 14 more after the break

Slide 10 — First: how NHANES is organised (5 min)

Slide 11 — Where the measurements and labs come from (4 min)

Concept NHANES variable Component
Participant ID SEQN every file — the merge key
Age, sex, race RIDAGEYR, RIAGENDR, RIDRETH3 DEMO
BMI, waist, height BMXBMI, BMXWAIST, BMXHT BMX
Triglycerides LBXTR TRIGLY
GGT LBXSGTSI BIOPRO
Glucose, HbA1c LBXGLU, LBXGH GLU, GHB
HDL cholesterol LBDHDD HDL
Blood pressure BPXSY1–4, BPXDI1–4 BPX

Slide 12 — Where the questionnaire, design and outcome come from (4 min)

Concept NHANES variable Component
BP / lipid medication BPQ050A, BPQ100D BPQ
Diabetes DIQ010, DIQ050, DIQ070 DIQ
Alcohol ALQ130, ALQ120Q, ALQ120U, ALQ121 ALQ
Survey design WTMEC2YR, WTSAF2YR, SDMVSTRA, SDMVPSU DEMO, TRIGLY
Mortality MORTSTAT, PERMTH_EXM, ELIGSTAT linked mortality file

Slide 13 — SEQN is the join key (5 min)


Thursday, previewed: L1 builds exactly this · 14 minutes across the slides below

This block is new. It exists because L1 is not “merge on SEQN” — it is a download, a join, a cycle loop, a stack, a rename, a derivation, a missingness inspection and a descriptive table. Showing the code before the lab turns Thursday into execution rather than a new topic, and every line on these four slides uses a name taught on Slides 10–13.

Slide 14 — L1 in one screen: two files, one key (4 min)

pacman::p_load(tidyverse, nhanesA, tableone, naniar)

demo <- nhanes("DEMO_H", translated = TRUE)   # 2013-2014 demographics
bmx  <- nhanes("BMX_H",  translated = TRUE)   # 2013-2014 body measures

merged <- full_join(demo, bmx, by = "SEQN")

Slide 15 — Then do it for every cycle (4 min)

cycles <- c("H", "I", "J")                     # 2013-14, 2015-16, 2017-18

all_cycles <- lapply(cycles, function(cy) {
  d <- nhanes(paste0("DEMO_", cy), translated = TRUE)
  b <- nhanes(paste0("BMX_",  cy), translated = TRUE)
  full_join(d, b, by = "SEQN") %>% mutate(cycle = cy)
})

stacked <- bind_rows(all_cycles)

Slide 16 — Raw names in, analysis names out (3 min)

analysis <- stacked %>%
  rename(Sex = RIAGENDR, Age = RIDAGEYR,
         RaceEthnicity = RIDRETH3, BMI = BMXBMI) %>%
  filter(Age >= 20) %>%
  mutate(BMICat = cut(BMI, c(0, 18.5, 25, 30, Inf), right = FALSE,
                      labels = c("Underweight", "Normal weight", "Overweight", "Obese")))

Slide 17 — Look at what is missing before you model it (3 min)

colSums(is.na(analysis))
naniar::gg_miss_var(analysis, show_pct = TRUE)

tab1_vars <- c("Age", "RaceEthnicity", "BMI", "BMICat")
CreateTableOne(vars = tab1_vars, data = analysis, strata = "Sex",
               addOverall = TRUE, test = FALSE)

Slide 18 — BREAK (10 min)


Q2, continued — the population this paper defines · 14 minutes across the slides below

Slide 19 — Population: who is being studied? (3 min)

Slide 20 — How MASLD was actually ascertained (4 min)

Slide 21 — The funnel, with a type on every row (4 min)

Step N Kind of step
NHANES 2007–2018 records 59,842 —
Age ≥ 18 36,580 eligibility — drops 23,262
In fasting subsample 14,962 design — drops 21,618
FLI computable 14,170 missingness
Steatosis (FLI ≥ 60) 6,052 target population — drops 8,118
MASLD (≥1 criterion) 6,050 target population
Mortality-linked 6,048 outcome ascertainment

Analysis set: locked mortality-linked cohort, N = 6,048.

Slide 22 — What the funnel reveals (3 min)


Q3 — What is the exposure, and the comparison? · 16 minutes across the slides below

Slide 23 — The exposure is constructed, not measured (3 min)

Slide 24 — Exposure component 1: BMI (4 min)

Slide 25 — Exposure component 2: waist-to-height ratio (2 min)

Slide 26 — The exposure is the combination (4 min)

WHtR < 0.60 WHtR ≥ 0.60
Obesity by BMI Group I — reference Group II
No obesity by BMI Group III Group IV

Slide 27 — Eligibility and exposure share their inputs (3 min)

Inputs
Eligibility (FLI ≥ 60) triglycerides, GGT, BMI, waist
Exposure (phenotype) BMI, waist ÷ height

Q4 — What is the outcome, time zero, and follow-up? · 11 minutes across the slides below

Slide 28 — Outcome and the clock (6 min)

Slide 29 — Time zero is a question the checklist never asks (5 min)


Q5 — What other variables enter, and in what role? · 15 minutes across the slides below

Slide 30 — In the model is not the same as confounding (4 min)

Slide 31 — What a crude-to-adjusted change establishes (5 min)

Slide 32 — Five NHANES traps, each of which has bitten this project (3 min)

Slide 33 — The blood pressure trap, in full (3 min)


Q6 — What design and analysis features must be respected? · 10 minutes across the slides below

Slide 34 — NHANES is not a simple random sample (3 min)

Slide 35 — Designed subsampling is not missingness (4 min)

Slide 36 — Survey design: paper versus reproduction (3 min)


Closing · 6 minutes across the slides below

Slide 37 — PECOT, and the question rebuilt (2 min)

Element This study
P — Population Adults with MASLD by FLI ≥ 60 + ≥1 cardiometabolic criterion, in the fasting subsample
E — Exposure Four-category BMI × WHtR phenotype
C — Comparison Groups II, III, IV versus Group I
O — Outcome All-cause mortality to 31 Dec 2019
T — Time Months from exam to death or censoring

Slide 38 — M0: ask the six of your own papers (2 min)

Slide 39 — Bridge to L1 and M0 (2 min)


If you are running behind

Drop in this order. Each is a slide whose content is carried elsewhere in the course, so cutting it costs continuity rather than a concept:

  1. Slide 7 (different evidence of success, 4 min) — Slide 8 states its one-line version.
  2. Slide 25 (WHtR, 2 min) — the ratio is defined again on Slide 26’s table header.
  3. Slide 6 (different analyses, 4 min) — painful, but Slide 5 carries the distinction.
  4. Slide 33 (the blood pressure trap, 3 min) — Slide 32’s blood-pressure bullet survives alone. (Named, not numbered: the bullet’s position moved once already.)
  5. Slide 22 (what the funnel reveals, 3 min) — Week 3 revisits the cohort arithmetic.

Do not cut Slides 14–17. The lab preview is the reason this deck was rebuilt, and dropping it puts students into L1 cold.


Deliberately deferred

Three things the old Week 2 taught are not here, and are deferred on purpose rather than squeezed under a question:

The reading-Methods traps checklist is no longer listed as deferred: the NHANES traps now have their own slides under Q5, and the six questions are the reading checklist.

If a later revision wants any of the three back, they belong where they are now owned, not retrofitted into a six-question spine.


Relationship to the companion deck

lectures/bmj_open_revealjs/ — Decomposing the Study Aim — is the standalone deck this rebuild draws its NHANES anatomy, PECOT and goal-ladder material from. It remains published as a companion for students who want the aim-decomposition argument on its own, without the six-question scaffolding or the lab preview. Where the two disagree, this file wins.

Two errors were corrected during this rebuild. Neither is in the companion today, but they reached Week 2 by different routes, and the difference matters — an inherited error attributed to the wrong source cannot be traced:

One claim was wrong in the companion and has been fixed there in the same change: its funnel slide called the fasting subsample “the largest single exclusion”, which is false against its own table. It now carries the course-canonical after eligibility scoping, and its fused ALQ130 / 777-999 trap bullet has been split the same way as Slide 32’s.