Skip to content

The ADaM data in R

In this chapter

  • Say what ADaM is and what its three classes of data sets hold.
  • Run every program with sapling run, and read its verdicts.
  • Know what CLEAN means, and where the data sets are.
Time
15 minutes, of which about 2 minutes of R
At the end you have
7 ADaM data sets in out/adam/data, 12 tables, and 18,392 numbers in the ARD; every program CLEAN.

12.1 The idea: analysis data that a reviewer can trace

Section titled “12.1 The idea: analysis data that a reviewer can trace”

SDTM holds the data as collected: one domain per kind of record (DM demographics, EX exposure, QS questionnaires, AE adverse events). ADaM holds the data as analysed: one record per thing the analysis counts, with the derived values (the baseline, the change, the analysis visit, the population flags), and a trace back to SDTM. A reviewer can take any number of a table back to its records.

The pilot has seven ADaM data sets of three classes:

Class One record per Data sets
ADSL subject ADSL: the treatment, the dates, the population flags
BDS (basic data structure) subject, parameter, analysis visit ADQSADAS (ADAS-Cog), ADQSCIBI (CIBIC+), ADVS (vital signs), ADLBC, ADLBH (laboratory)
OCCDS (occurrence data) event ADAE: the adverse events

The programs use admiral, the open-source R package of the pharmaverse for ADaM.

Terminal
$ sapling run
adsl: BATCH: CLEAN (3.0 s)
adae: BATCH: CLEAN (1.2 s)
adqsadas: BATCH: CLEAN (2.5 s)
adqscibi: BATCH: CLEAN (2.4 s)
advs: BATCH: CLEAN (3.2 s)
adlbc: BATCH: CLEAN (3.7 s)
adlbh: BATCH: CLEAN (3.0 s)
adam data PASS: 7 of 7 programs BATCH: CLEAN; out/adam/data (19.8 s)
adam check SKIP: no reference to compare with (sapling.yml reference.adam) (0.0 s)
...
tlf run PASS: 12 of 12 programs BATCH: CLEAN; out/tlf/listings, out/ard (18392 results of 53 analyses, ars_results.json) (91.2 s)
...
111 s
SAPLING RUN PASS
The whole output (26 lines)
Terminal
$ sapling run
adsl: BATCH: CLEAN (3.0 s)
adae: BATCH: CLEAN (1.2 s)
adqsadas: BATCH: CLEAN (2.5 s)
adqscibi: BATCH: CLEAN (2.4 s)
advs: BATCH: CLEAN (3.2 s)
adlbc: BATCH: CLEAN (3.7 s)
adlbh: BATCH: CLEAN (3.0 s)
adam data PASS: 7 of 7 programs BATCH: CLEAN; out/adam/data (19.8 s)
adam check SKIP: no reference to compare with (sapling.yml reference.adam) (0.0 s)
t14_1_1: BATCH: CLEAN (2.7 s)
t14_1_2: BATCH: CLEAN (2.6 s)
t14_2_1: BATCH: CLEAN (3.0 s)
t14_3_1: BATCH: CLEAN (2.8 s)
t14_3_2: BATCH: CLEAN (2.8 s)
t14_4_1: BATCH: CLEAN (2.7 s)
t14_5_1: BATCH: CLEAN (2.6 s)
t14_5_2: BATCH: CLEAN (5.6 s)
t14_5_3: BATCH: CLEAN (2.5 s)
t14_6_1: BATCH: CLEAN (41.2 s)
t14_6_2: BATCH: CLEAN (3.4 s)
t14_7_1: BATCH: CLEAN (13.2 s)
tlf run PASS: 12 of 12 programs BATCH: CLEAN; out/tlf/listings, out/ard (18392 results of 53 analyses, ars_results.json) (91.2 s)
tlf check SKIP: no reference to compare with (sapling.yml reference.tlf) (0.0 s)
111 s
SAPLING RUN PASS

sapling run runs every program in a new R session through DataStep Studio for R (dsr batch): first the ADaM programs in their order, then the table programs. A new session for each program means that no program can depend on an object that another program left behind.

Each program ends BATCH: CLEAN, or it says its first cause. CLEAN means no error and no warning in its log. A warning is not ignored: a program with a warning is not clean.

What to look at:

  • adam data PASS: 7 of 7 programs. The data sets are in out/adam/data.
  • tlf run PASS: 12 of 12 programs, and 18,392 results of 53 analyses in the ARD (chapter 15).
  • adam check SKIP: there is no reference data set to compare with. A study that has one (for example a double programming in SAS) names it in sapling.yml, and the check compares cell by cell.

The folder out/adam/data holds each data set twice: as R data (.rds) and as a SAS transport file (.xpt, version 5), the form that a submission to the FDA needs.

Your turn 12.1 Why ADSL first?

The ADaM programs run in a fixed order. Which program runs first, and why must it?

Show the answer

ADSL runs first:

Terminal
$ sapling build
...
adam programs PASS: out/adam/programs (7 programs: ADSL -> ADAE -> ADQSADAS -> ADQSCIBI -> ADVS -> ADLBC -> ADLBH) (0.0 s)
...

The other data sets take the treatment, the dates of the first and last dose, and the population flags from ADSL. The specification of ADQSADAS, for example, copies TRTPN (the dose as a number), TRTSDT (the date of the first dose) and EFFFL from ADSL.

What you learned

  • SDTM is the data as collected; ADaM is the data as analysed, with a trace back to SDTM.
  • sapling run runs each program in its own R session through DataStep Studio for R; CLEAN means no error and no warning.
  • The data sets are in out/adam/data, as .rds and as .xpt version 5.

Next: 13 · Check the ADaM data →

Found an error or have a question? Write to datastep.studio@gmail.com· The plan is written in Sapling; every R program runs in DataStep Studio for R.

Data: the CDISC pilot study (cdiscpilot01). The protocol as CDISC USDM from the CDISC 360i project (MIT licence); the SDTM data from the PhUSE scripts repository (MIT licence). Public example data: no real patient.

R is a project of the R Foundation. SAS is a registered trademark of SAS Institute Inc. CDISC, SDTM, ADaM and USDM are trademarks of the Clinical Data Interchange Standards Consortium. Claude is a trademark of Anthropic. This book is not affiliated with or endorsed by any of them.

© 2026 DataStep Labs. All rights reserved.