
From Protocol to Dashboard

- Sapling SAPthe extension, on the VS Code Marketplace
- The Sapling manualevery command, every block of the plan
- The lab in your browserVS Code, R and the data: nothing to install
- DataStep Studio for Rruns every R program of the book
The four products you make
Section titled “The four products you make”The book ends with this line of a real run: four products, each one FINAL. Click a card for the chapter that makes it.
The approved SAPFINALsap.qmd, its PDF and its structured form. Every block cites the protocol; you agreed to each one.
The ADaM dataFINALSeven analysis data sets made in R from the SDTM data, checked against the ADaM Implementation Guide.
The tablesFINALTwelve tables in R, and every number in the analysis results data (ARD): 18,392 numbers.
The dashboardFINALThe study for management, with filters. Its gate checks every number on screen against the ARD.
SAPLING FINAL: 4 of 4 FINAL (SAP FINAL, ADaM FINAL, TLFs FINAL, Dashboard FINAL)- 254 randomized patients, 3 arms
- 22 open decisions, all yours
- 84 blocks you read and agree to
- 18,392 numbers in the ARD
- 12 dashboard pages, each number checked
The whole path
Section titled “The whole path”Ten steps. The steps with the amber edge are yours: an agent cannot do them, and Sapling refuses when it tries.
sapling new pilot --protocol usdm.json --sdtm data/sdtma first draft of the SAP from the protocol: every block cites its sentencesapling roundthe scorecard: the agent score, and your readinesssapling agentthe agent works the loop: one block, checked in its place, measured againsapling revise·sapling agreeyou read each block in the dossier: ask for a change, or agreesapling decideyou answer what the protocol leaves opensapling build·sapling runthe specifications, the programs, the ADaM data and the tables, in Rsapling blind --seed 7the programs proven on the real data with a dummy treatmentsapling unblindthe real treatment back: a person’s actsapling approveyour approval, only when every block is agreedsapling final --makethe four products made again from the approved SAP, and judged
The whole path in one hour runs these steps with their real output and links each one to its chapter.
Who it is for
Section titled “Who it is for”The statistician
The main reader. Each chapter explains the statistics first: estimands and intercurrent events (ICH E9(R1)), LOCF and its assumption, co-primary endpoints, the tipping-point analysis, why a dummy treatment before the unblinding. Then you make each decision yourself.
The statistical programmer
The ADaM specification, the admiral programs, the table programs, the ARD with every number, the readable R programs and the trace of a failure to its SAP block. Every program runs in R through DataStep Studio for R.
The manager
What an AI agent may do in a regulated analysis, and what it may not. Read chapter 1, the whole path, and Part IV: the dashboard and the gate that checks it.
How the book is built
Section titled “How the book is built”| Part | What you do | Chapters |
|---|---|---|
| Start here | See the products, set up the lab, run the whole path once | 1–3 |
| I · The SAP with an AI agent | A first draft, the scorecard, the agent’s loop, your additions, your judgment, your decisions | 4–10 |
| II · ADaM in R | The specifications, the ADaM data in R, the check against the ADaM IG | 11–13 |
| III · Tables in R | The shells, the tables and the ARD, readable R programs, a failure traced | 14–17 |
| IV · Unblinding and the dashboard | A dummy treatment, the unblinding, the dashboard, the four final products | 18–20 |
| V · Practice | A made-up study of type 2 diabetes from public trial results | 21 |
Each chapter starts with what you will be able to do and how long it takes. It explains the idea, shows the commands in short terminal blocks, shows the products, and ends with an exercise and its answer.
Nothing on these pages is typed by hand. Every terminal block is the transcript of a real run on the CDISC pilot study, and every picture is taken from the products of that run. Run the same commands in the lab, and you get the same output.
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.