ADaM All lessons Scene 1 / 11

ADaM · Interactive Lesson

ADaM BDS: Building ADLB & ADVS

11 scenes· ~20 min· pairs with the article

Step through the scenes, pass the checkpoint quizzes, and try the hands-on exercises. Progress saves locally in this browser — no account, no tracking.

Scene index · 11 scenes
  1. ConceptThe Afternoon QC Listing
  2. ConceptThe BDS Skeleton and Its Grain
  3. ConceptBaseline Before Everything
  4. CheckpointCheckpoint: Grain and Baseline
  5. ConceptADVS Step by Step: One Parameter Goes Home
  6. ConceptADLB: Reference Ranges, Shift, and LOCF
  7. ConceptBuild Order Choices and Five QC Listings
  8. ConceptWhere This Runs: SCE, Double Programming, Agents
  9. Hands-onHands-On: Flag the Real Rows
  10. CheckpointFinal Check: From Rows to Analysis-Ready ADLB/ADVS
  11. ConceptKey Takeaways: Before It Leaves Your Desk
Concept1 / 11

The Afternoon QC Listing

The Afternoon QC Listing

• Table: Mean CHG in a vital sign nobody expected to move.

• Listing: 11 subjects — BASE from the first record, a screening value.

• Flag error: ABLFL wrong row → CHG tables inherit it.

BY THE END OF THIS LESSON

• Read the BDS grain — AVAL / PARAM / BASE / CHG.

• Window visits; set ABLFL / ANL01FL.

• Run the five QC listing checks on ADVS / ADLB.

Agenda: BDS skeleton → baseline rule → ADVS step-by-step → ADLB extras → QC checkpoints → practice · 043-18101

Open with a familiar working situation — a change-from-baseline table whose mean result nobody expected, traced back to one wrong baseline flag.

Speaker notes

Picture an afternoon quality control, QC, listing: a change-from-baseline, CHG, table shows a mean shift in a vital sign nobody expected to move. The cause is a flag, not arithmetic. For eleven subjects, the baseline value, BASE, came from the first record — a screening value — while the Statistical Analysis Plan, SAP, says the last value on or prior to first dose. ABLFL, the baseline flag, picked the wrong record, and every CHG table inherited it. By the end you can read the Basic Data Structure, BDS, grain, build AVAL, PARAM, BASE and CHG, window visits, and set ABLFL and ANL01FL. Then ADVS and ADLB — vital signs and laboratory — both Analysis Data Model, ADaM, datasets. Agenda: BDS skeleton, the baseline rule, ADVS step by step, ADLB extras, QC checkpoints, then practice on the demo study records.

Concept2 / 11

The BDS Skeleton and Its Grain

The BDS Skeleton and Its Grain

BDS grain — one record per subject + parameter + analysis timepoint; do not duplicate the USUBJID–PARAMCD–AVISITN key
Skeleton variableRole in ADaMValue (sample row)
USUBJIDSubject identifier (key)043-18101-74001-001
PARAMCDShort code for programming and matchingBSA
PARAMHuman-readable label used in outputsBody Surface Area (m^2)
AVISITAnalysis visit labelCYCLE 1 DAY 1
AVISITNNumeric timepoint (key)2.0
ADYAnalysis study day1
AVALAnalysis result value2.08
ABLFLBaseline row flagY
BASEBaseline value2.08
ANL01FLEligible for standard analysisY
ASEQSequence within dataset2
DTYPEDerivation type; blank/absent means collected, no derivation—
Column logic — PARAMCD is the machine code; PARAM is the output label; within a dataset one code maps to one label. DTYPE = LOCF/AVERAGE flags derived assumptions. ADSL: 1 row/subject. OCCDS: 1 row/occurrence. ADVS/ADLB/ADRS carry TRTP/TRTA/SAFFL from ADSL.

Establish the core mental model: Basic Data Structure carries one record per subject, parameter, and analysis timepoint, and every skeleton variable has a distinct role.

Speaker notes

Basic Data Structure, BDS, is a grain contract: one record per subject, parameter, and analysis timepoint. Duplicate that Unique Subject Identifier, Parameter Code, Analysis Visit Number key—USUBJID, PARAMCD, AVISITN—and downstream summaries double-count. The demo subject's Body Surface Area, BSA, row shows PARAMCD as the code and PARAM as the output label. Analysis Value, AVAL, is 2.08; Analysis Day, ADY, is 1; AVISITN is 2.0; Baseline Flag, ABLFL, is Y; Baseline Value, BASE, is 2.08; Analysis Flag 01, ANL01FL, is Y. Derivation Type, DTYPE, is absent because this is a collected row, not a derived assumption. Remember Subject-Level Analysis Dataset, ADSL, stays one row per subject, Occurrence Data Structure, OCCDS, is one row per occurrence, while BDS datasets merge treatment variables onto every row.

Concept3 / 11

Baseline Before Everything

Baseline Before Everything

ABLFL · BASE · CHG

SAP DECISION — not a programmer default

baseline = last non-missing value ≤ first dose date (TRT01SDT)

anchor to dates — visit labels drift

CASE CHECK — BSA · study 043-18101

Which pre-dose row earns ABLFL = “Y”?

VISITDATEADYABLFLBASE
SCREENING2019-05-06-2.
CYCLE 1 DAY 12019-05-081Y2.08

CANONICAL IDIOM · 05-baseline

sort pre-dose rows by USUBJID

PARAMCD descending ADY;

keep first row where AVAL is

non-missing:

if first.PARAMCD and AVAL ne .

then ABLFL = 'Y';

ABLFL belongs on CYCLE 1 DAY 1; BASE=2.08 travels to every BSA row

Teach the baseline rule as an SAP-owned decision and show why it keys on dates relative to TRT01SDT, takes the last qualifying value, and is encoded by ABLFL.

Speaker notes

Baseline is a Statistical Analysis Plan decision: last non-missing value on or prior to first dose. It keys on date relative to Treatment Start Date, or TRT01SDT, not a visit label like SCREENING. Sort by Unique Subject Identifier, or USUBJID, Parameter Code, or PARAMCD, descending Analysis Day, or ADY, then keep the first non-missing Analysis Value, or AVAL: if first.PARAMCD and AVAL is non-missing, then Baseline Flag, or ABLFL, equals Y. That row earns ABLFL equals Y; baseline value, or BASE, copies to every subject-parameter record, and Change from Baseline, or CHG, follows as AVAL minus BASE. In the demo Body Surface Area, or BSA, data, the qualifying row is CYCLE 1 DAY 1, ADY 1, 2019-05-08, not SCREENING with ADY negative 2 and date 2019-05-06, so ABLFL equals Y and BASE equals 2.08 travel to every BSA row.

Checkpoint4 / 11

Checkpoint: Grain and Baseline

1 Which set of variables must uniquely identify a row in an Analysis Data Model (ADaM) Basic Data Structure (BDS) dataset? The BDS record grain is one Unique Subject Identifier (USUBJID), one Parameter Code (PARAMCD), and one analysis-timepoint key such as Analysis Visit Number (AVISITN) or Analysis Day (ADY).

2 Suppose a subject has several pre-dose records for one PARAMCD in an ADaM BDS dataset. Which record should receive the Baseline Record Flag (ABLFL) under the date-anchored baseline rule? Use the Date of First Dose of Study Drug (TRT01SDT) as the dose anchor, and apply the tie-breaker specified by the Statistical Analysis Plan (SAP) if needed.

3 Which statements correctly distinguish the Baseline Record Flag (ABLFL) from the Analysis Record Flag 01 (ANL01FL)? Select all that apply. (select all that apply, then Check)

Speaker notes

This checkpoint confirms the Analysis Data Model (ADaM) Basic Data Structure (BDS) grain and the baseline rule before we build datasets. The BDS grain question asks which variables uniquely identify a row, and the correct answer is C: one Unique Subject Identifier (USUBJID), one Parameter Code (PARAMCD), and the analysis-timepoint key, such as Analysis Visit Number (AVISITN) or Analysis Day (ADY). USUBJID alone or USUBJID plus PARAMCD alone cannot make a row unique because a subject can have many records per parameter across visits. The baseline question asks which pre-dose record gets the Baseline Record Flag (ABLFL) using the Date of First Dose of Study Drug (TRT01SDT), and the correct answer is B: the record closest to, but not after, TRT01SDT, with the Statistical Analysis Plan (SAP) tie-breaker if records are tied. That matches the date-anchored rule: baseline is the last non-missing assessment before first dose, chosen by assessment date and time, not source order or value. The ABLFL versus Analysis Record Flag 01 (ANL01FL) question has two correct answers, A and B. ABLFL marks one baseline record per subject-parameter, while ANL01FL marks the one or many records selected for a particular analysis.

Concept5 / 11

ADVS Step by Step: One Parameter Goes Home

ADVS Step by Step: One Parameter Goes Home

ADVS = Analysis Dataset Vital Signs · USUBJID 043-18101-74001-001 · PARAMCD = BSA (Body Surface Area, m²)

VisitVSDYVSSTRESNAVALABLFLANL01FLCHG
SCREENING-22.082.08---
CYCLE 1 DAY 112.082.08YY-
CYCLE 1 DAY 882.062.06-Y-0.02
UNSCHEDULED 4.01102.052.05---
UNSCHEDULED 4.03132.052.05---

• Build order: PARAMCD (unit) → ADT/ADY anchored to TRT01SDT → SAP windowing → ABLFL / ANL01FL.

• ANL01FL = rows analysis uses; UNSCHEDULED 4.01 / 4.03 stay in ADVS but are not flagged.

• CHG = AVAL - BASE → CYCLE 1 DAY 8: 2.06 - 2.08 = -0.02; BASE stays 2.08.

Walk one real vital-sign parameter from raw VS rows to the built ADVS rows, showing parameters, ADY anchoring, windowing, ABLFL, ANL01FL, and CHG.

Speaker notes

Here we trace Body Surface Area (BSA) for the demo subject from Vital Signs (VS) to Analysis Dataset Vital Signs (ADVS). Raw VS holds one row per measurement; this subject has five BSA records. Vital Signs Standard Result in Standard Units 2.08 maps to Analysis Value (AVAL) 2.08 at screening, and 2.06 maps to 2.06 at cycle 1 day 8, where Change from Baseline (CHG) is 2.06 minus 2.08, or -0.02. Baseline (BASE) stays 2.08 on every row. The build order is Parameter Code (PARAMCD) with unit, then Analysis Date (ADT) and Analysis Day (ADY) anchored to Treatment Start Date (TRT01SDT), then windowing, then Baseline Flag (ABLFL) and Analysis Flag 01 (ANL01FL). ANL01FL marks rows the analysis uses; unscheduled 4.01 and 4.03 stay in ADVS but unflagged, so a change analysis restricted to that flag will not count them.

Concept6 / 11

ADLB: Reference Ranges, Shift, and LOCF

ADLB: Reference Ranges, Shift, and LOCF

Same build path as ADVS; lab layer adds ref-range logic.

Shift logic classifies each value against the subject's own range.

Raw LB → ADLB trace · ALB · USUBJID 043-18101-74001-001
SourceVisitKey valuesRange / class
LB (raw)SCREENINGLBSTRESN = 38.0LBNRIND = NORMAL; LO/HI = 35.0/52.0
ADLBSCREENINGAVAL = 38.0; BASE = 38.0Within 35.0–52.0
ADLBUNSCHEDULED 4.01 (ADY = 10)AVAL = 31.0; BASE = 38.0; CHG = -7.0Below 35.0

Shift: baseline × worst post-baseline class

Low / normal / high vs subject range

38.0 within; 31.0 below; 4.01 worst-class window = SAP

LOCF/AVERAGE: derived rows only when SAP asks

LOCF is an assumption — DTYPE='LOCF' / LOCFFL='Y'

proc freq data=adlb_locf_w; tables locffl / missing; run;

Show that ADLB uses the same BDS skeleton plus lab-specific logic: retained reference ranges, shift-from-normal classification, and DTYPE-marked derived rows such as LOCF.

Speaker notes

ADLB, the Analysis Data Model Laboratory dataset, uses the same Basic Data Structure, or BDS, build as ADVS, the Analysis Data Model Vital Signs dataset, but adds reference-range logic. For demo subject, the raw lab SCREENING row shows 38.0 with limits 35.0 and 52.0, class NORMAL; the ADLB SCREENING row has analysis value 38.0 and baseline 38.0. The ADLB UNSCHEDULED 4.01 row, analysis relative day 10, has value 31.0, baseline 38.0, change negative 7.0. Shift logic compares baseline class to worst post-baseline class against subject's own range: 38.0 is within 35.0 to 52.0, 31.0 is below 35.0, but whether 4.01 enters worst-class is the Statistical Analysis Plan's rule. LOCF, last observation carried forward, rows appear only when the SAP requests them; mark them with DTYPE, derived type, LOCF or LOCFFL, LOCF flag, Y, and audit them so no assumption hides.

Concept7 / 11

Build Order Choices and Five QC Listings

Build Order Choices and Five QC Listings

DimensionParameters-firstRows-first
Build orderDerive one PARAMCD at a time; stack resultsBuild full LONG set; flag/derive by PARAMCD
Best fitsFew PARAMCDs; per-parameter logic differsMany PARAMCDs; one shared logic applies
Main riskRecord-order surprises when stackingParameter-specific rules can be buried

Five QC Listing Checks — Run as Standard Pipeline Steps

1. Duplicates on USUBJID–PARAMCD–AVISITN

2. ABLFL='Y' with ADT > TRT01SDT

3. More than one ABLFL='Y' per subject-parameter

4. Baseline record absent from final analysis set (anti-join)

5. Recompute CHG = AVAL − BASE; compare with CHG

Compare parameters-first versus rows-first builds, then teach the five listing checks that catch BDS defects such as the opening baseline error.

Speaker notes

Every Basic Data Structure (BDS) build chooses an order: parameters-first derives one parameter code at a time and stacks, fitting few parameters with different logic but risking record-order surprises; rows-first builds the full long set and flags by parameter code, fitting many parameters with shared logic but burying parameter-specific rules. Run five quality control (QC) listing checks as pipeline steps: duplicates on unique subject identifier, parameter code, and analysis visit number; baseline flag equals Y with analysis date after treatment start date; more than one baseline flag equals Y per subject-parameter; baseline absent from final set via anti-join; and recompute change from baseline as analysis value minus baseline value. Structural conformance checking will not catch a wrong baseline, and a baseline off the wrong record makes every change-from-baseline table inherit the error, so baseline flags are checked, not merely computed.

Concept8 / 11

Where This Runs: SCE, Double Programming, Agents

Where This Runs

L2 stable layers: SCE pipeline + double-programmed QC  |  L3 volatile layer: agent-assisted drafts

SCE pipeline

Level 2 · build layer

•  Build: ADVS + ADLB after ADSL

•  Input: SDTM locked, script + logs

•  Spec: params, windows, ABLFL

•  Docs: define.xml from metadata

Double programming

Level 2 · QC verification

•  Independent code, side-by-side

•  Listings: five QC comparisons

•  CORE: CDISC structural check

•  Wrong-record baseline? QC listings

Agents

Level 3 · volatile layer

•  Draft: BDS shell, ABLFL, CFB

•  Verified 2026-08-30; re-verify

•  Watch: plausible rule ≠ SAP

•  Ask rule + source; diff vs SAP

Place the BDS build into the modern workflow layers: the SCE pipeline, QC double programming plus structural checks, and the time-sensitive agentic way of working.

Speaker notes

In Statistical Computing Environment, or SCE, Vital Signs Analysis Dataset, or ADVS, and Laboratory Analysis Dataset, or ADLB, build after Subject-Level Analysis Dataset, or ADSL, from locked Study Data Tabulation Model data. The spec owns parameters, windows, and Baseline Flag rules; define.xml comes from same metadata, preventing drift. Quality Control, or QC, is independent double programming, side-by-side listings, plus Clinical Data Interchange Standards Consortium Open Rules Engine, or CORE, structural checks. Structural checks catch a missing parameter or bad variable length, but not a wrong-record baseline—the five QC listings catch that. Agents draft analysis dataset shells, Baseline Flags, and change-from-baseline code, yet invent plausible rules instead of the Statistical Analysis Plan, or SAP, sentence. Ask the agent to state its baseline rule and source, diff that against the SAP, hand-check three subject-parameter listings.

Hands-on9 / 11

Hands-On: Flag the Real Rows

Hands-on interactive — if it does not load, open the paired article and try the exercise there.

Speaker notes

This scene is hands-on, so you will work it on the website at jaimeyan.com/learn rather than watch me click through it. It drills three things: picking the record that earns ABLFL, the Baseline Flag, for the demo subject, reconstructing BASE, the Baseline Value, and CHG, Change from Baseline, and then sorting which rows qualify for ANL01FL, the Analysis Flag 01. Run it right after the video, and let the instant feedback show you why a baseline pulled from the wrong record corrupts every downstream change-from-baseline value.

Checkpoint10 / 11

Final Check: From Rows to Analysis-Ready ADLB/ADVS

1 In the ADaM analysis datasets ADVS (vital signs) and ADLB (laboratory), after a row has been assigned to a windowed analysis visit, which pair of variables correctly carries the assignment and identifies the record used in the inferential analysis? Use the variable names Analysis Visit (AVISIT), Analysis Visit Numeric (AVISITN), Baseline Record Flag (ABLFL), and Analysis Record Flag 01 (ANL01FL).

2 In the ADVS QC extract, the row labeled UNSCHEDULED 4.01 is present in advs.csv but is not selected by ANL01FL. Which statements correctly distinguish Baseline Record Flag (ABLFL) from Analysis Record Flag 01 (ANL01FL) and describe how such unselected rows should be handled? (select all that apply, then Check)

3 During the ADVS/ADLB BDS build, when is a last-observation-carried-forward (LOCF) value allowed for a scheduled analysis visit that has no measurement, and what flag/value pair must be used so that the carried observation is not mistaken for an actual measurement? Use the relevant variable Derivation Type (DTYPE). (reflect, then reveal)

Reveal analysis
Under the study SAP, LOCF is used when a scheduled post-baseline analysis visit has no observed measurement and the last available value within the analysis window can be carried forward. The carried value is written to AVAL and the record is marked DTYPE='LOCF'. This makes it clear that the row is derived rather than observed, so it should not be reported as an actual assessment.

4 You are verifying CHG for an ADVS record in the QC listing. The record has Analysis Value (AVAL)=2.06 and Baseline Value (BASE)=2.08 from advs.csv. Which option correctly states the recomputed CHG and identifies the QC check that would catch an invalid baseline record whose assessment date occurs after Date of First Study Treatment (TRT01SDT)?

Speaker notes

This final checkpoint verifies integrated understanding of Analysis Data Model (ADaM) Basic Data Structure (BDS) variable roles, baseline and analysis flags, derived-record rules, and Quality Control (QC) arithmetic. For the first question, in the Vital Signs Analysis Dataset (ADVS) and Laboratory Analysis Dataset (ADLB), after windowing the analysis visit is carried by Analysis Visit (AVISIT) and Analysis Visit Numeric (AVISITN), while Analysis Record Flag 01 (ANL01FL) marks the record used in the analysis, so the correct answer is A. Baseline Record Flag (ABLFL) only identifies the baseline record, and Derivation Type (DTYPE) only marks derivations such as Last Observation Carried Forward (LOCF), not visit selection. For the second question, Baseline Record Flag (ABLFL) identifies the record supplying the baseline value, while Analysis Record Flag 01 (ANL01FL) identifies the records included in the analysis, and a row such as UNSCHEDULED 4.01 without ANL01FL equal to Y remains in ADVS or ADLB for traceability but is not selected, so the correct answers are A and B. For the third question, under the study Statistical Analysis Plan (SAP), a Last Observation Carried Forward (LOCF) value is allowed when a scheduled post-baseline analysis visit has no observed measurement and the last available value within the analysis window can be carried forward; the carried value is written to Analysis Value (AVAL) and the record must be marked Derivation Type (DTYPE) equal to LOCF so it is not mistaken for an actual measurement. For the fourth question, with Analysis Value (AVAL) equal to 2.06 and Baseline Value (BASE) equal to 2.08, Change from Baseline (CHG) recomputes as 2.06 minus 2.08 equals minus 0.02, and the QC listing that shows Analysis Day (ADY) or assessment date, Baseline Record Flag (ABLFL), and Date of First Study Treatment (TRT01SDT) would catch an ABLFL equal to Y row whose assessment date is after TRT01SDT, so the correct answer is B.

Concept11 / 11

Key Takeaways: Before It Leaves Your Desk

Key Takeaways: Before It Leaves Your Desk

Legend: BDS = basic data structure  ·  USUBJID = subject  ·  PARAMCD = parameter code  ·  AVISITN = analysis visit no.  ·  ABLFL = baseline flag  ·  DTYPE = derivation type  ·  TRT01SDT = first treatment date  ·  evidence: study 043-18101, ADVS/ADLB

BDS grain — duplicate-check USUBJID/PARAMCD/AVISITN first

ABLFL — last qualifying value before TRT01SDT per SAP

LOCF/AVERAGE — derived rows always carry DTYPE

Shift — compare baseline/post on own reference range

QC views miss bad ABLFL; duplicate checks/listings catch

Next — ADSL skill; then OCCDS/ADAE and ADTTE

Summarize the durable rules of BDS builds and point back to the article and the ADSL skill that feeds every BDS merge.

Speaker notes

Before this leaves your desk, lock the grain: one record per subject, parameter, and analysis timepoint — the basic data structure, or BDS, grain. Duplicate-check the subject identifier USUBJID, parameter code PARAMCD, and analysis visit number AVISITN first. Baseline flag ABLFL keys on first treatment date TRT01SDT per the Statistical Analysis Plan, or SAP, and takes the last qualifying non-missing value, never a visit label. LOCF — last observation carried forward — and AVERAGE rows are derived records with derivation type DTYPE, only when the SAP calls for them. Shift tables compare each subject's baseline and post-baseline values against their own reference range; structural checks miss a wrong baseline, but duplicate checks and listings catch it. Next, the subject-level analysis dataset, ADSL, covers the spine every BDS build merges in; then occurrence data structure OCCDS and time-to-event ADTTE.

✓

Lesson complete

Nice work — every scene seen. Keep the momentum going.

← → Space to navigate · progress is saved locally in your browser

AI Tutor

Ask the tutor