Practice on a made-up study
In this chapter
- Make a made-up study of an indication from the indication library of Sapling.
- Check its sample size by hand from the assumptions in the plan.
- Read the designed cases of the dummy data: what each one tests.
- Run the whole chain on it, and see why dummy data are never final.
- Time
- 30 minutes, of which about 2 minutes of R
- At the end you have
- a second study of your own (T2DTEST): a protocol, dummy SDTM data, a first SAP, and its ADaM data, tables and dashboard made in R; all MADE, none FINAL.
21.1 The idea: a realistic study before any data
Section titled “21.1 The idea: a realistic study before any data”The pilot is one study. To practise the path again, to test a plan before the first patient, or to show the method to a colleague, you need a second study, and it must be realistic: a protocol, data with the problems of real data, and numbers of the right size.
sapling new --indication makes one. The numbers come from the indication library of Sapling: for each of ten
therapeutic areas, the medians of the posted results of published trials on ClinicalTrials.gov, each number with the
count of trials behind it and their NCT ids. The study and the medicine are made up, and every product says so.
| What | Where it comes from |
|---|---|
| the population, the arms, the time point, the visits | the library’s profile of the indication |
| the baseline, the placebo change, the difference between the arms, the SD of the change, the dropout | the medians over the trials of the library |
| the sample size | 90% power, two-sided 0.05, from those medians |
| the dummy SDTM data | sapling dummy with the profile: designed cases, plus an effect on the primary endpoint |
| the medicine’s name | invented; never a stem of real medicines (-gliptin, -mab, …) |
21.2 Make the study
Section titled “21.2 Make the study”$ sapling new t2dtest --indication t2d --seed 1 --no-openmade up Type 2 diabetes mellitus: Teralozarel (an invented name) against placebo, Placebo; Teralozarel 100 mg, 70 patients, 24 weeks "MADE-UP: A Randomized, Double-Blind, Placebo-Controlled, Parallel-Group Study of Teralozarel in Adults with Type 2 Diabetes Mellitus (not a real study)"create protocol/usdm.jsoncreate sdtm/sdtm.json and sdtm/*.xpt (DUMMY data of DM 74, EX 84, DS 74, SV 455, AE 47, VS 1815, LB 2262; seed 1)create protocol/protocol.json (the page index of the protocol)create sap.qmd (648 lines: sapc init and the omakase defaults; 11 tables: T14_1_1, T14_1_2, T14_2_1, T14_3_1, T14_4_1, T14_5_1, T14_5_2, T14_5_3, T14_6_1, T14_6_2, T14_7_1)create README.md, AGENTS.md (the rules of an AI agent), .gitignore, custom/, out/, .sapling/, _extensions/sapling/ (the Quarto extension of Sapling: sapling sap pdf, Quarto preview)create .Rprofile and .sapling/ (the R engine ~/.vscode-remote/extensions/datastep-labs.sapling-sap-0.16.2/sapling/engine, in place)create sdtm/DUMMY.md (DUMMY data of a made-up study: the cases with their subjects), sdtm/dummy-profile.json (the numbers of the indication library)effect LB.HBA1C, change to WEEK 24: Teralozarel 100 mg - Placebo = -0.76, p = 0.0058 (the dummy data, Welch, observed cases; the input: -0.76 %)check 0 error(s), 1 warning(s): SAPLING CHECK PASS0.3 s. Next: cd t2dtest && sapling build (open decisions: sapling decide)Type 2 diabetes, 24 weeks, placebo against Teralozarel 100 mg, 70 patients. The primary endpoint is the change in HbA1c. The generator’s own test on the dummy data, a Welch t-test of the observed change, gives -0.76 percentage points, p = 0.0058. It describes the dummy data, not a medicine.
# DUMMY data of T2DTEST: not the data of a study
**MADE UP: the study T2DTEST and the medicine Teralozarel are not real** (`sapling new --indication t2d`, seed 1). The name of the medicine is invented.
The numbers the data are made from are the medians of the posted results of the trials of the indication library (standards/indications/t2d.json, 40 trials of type 2 diabetes mellitus): the baseline of HbA1c (the median over 21 trials), the change in the placebo arm, the difference between the arms, the SD of the change, the dropout and its reasons, the age, the share of women, the race, the adverse events of the placebo arm and their ratio in the active arms. They describe what published trials looked like, not this medicine....21.3 The sample size, by hand
Section titled “21.3 The sample size, by hand”Open sap.qmd: the plan states the sample size with its assumptions, cited.
## Sample size []{.cite source="protocol:4.4" words="A total of 70 patients"}
The protocol plans 70 patients in total (35 per arm). The assumptions are the medians of the posted results of theplacebo-controlled trials of the indication library of Sapling (standards/indications/t2d.json; the difference from39 trials, the SD of the change from 40 trials, the dropout from 40 trials: NCT01620489, NCT01704261, NCT01733758,NCT01755156, NCT01769378, NCT01792518 and 33 more), to discuss with the statistician: sapling design simulate.
::: {.samplesize #SS1 n="70" power="0.90" alpha="0.05" sided="2" effect="0.76" sd="0.95" dropout="0.055" test="ancova"}:::[]{.cite source="protocol:4.4" words="A total of 70 patients"}...Check it with the usual normal-approximation formula for two groups, with a two-sided α of 0.05 (z = 1.960) and 90% power (z = 1.282):
- per arm before dropout: 2 × (1.960 + 1.282)² × (0.95 / 0.76)² = 2 × 10.51 × 1.5625 ≈ 32.8, so 33;
- with 5.5% dropout: 33 / (1 − 0.055) ≈ 34.9, so 35 per arm, 70 in total: the number of the plan.
21.4 The designed cases
Section titled “21.4 The designed cases”Dummy data from sapling dummy are not random noise. The first patients of each arm are designed cases, one problem
each: a patient who drops out after week 4, a missed visit, two records in one visit window, a tie, a late visit, no
baseline, partial dates of adverse events, a patient randomized and never dosed, an exposure without an end date, two
records before the first dose, a death. sdtm/DUMMY.md lists them with their patient ids. Each one tests a rule of the
plan: LOCF, the visit windows, the baseline, the populations, the imputation of partial dates.
21.5 The whole chain on dummy data
Section titled “21.5 The whole chain on dummy data”$ sapling dashboard --check --no-browser... 10 dashboard: 11 pages, 1726 numbers equal to the ARD: DASHBOARD PASSdashboard DASHBOARD PASS (36.7 s)... - 18 item(s) of the scorecard open (agent score 89/100) [agent] sapling next -> one block -> sapling round - 16 open decision(s) [statistician] sapling decide <n> "<answer>" --by NAME - 50 of 50 block(s) not agreed [statistician] sapling judge; sapling agree <block> --by NAME - the plan is not approved [statistician]... - made from dummy data (sdtm/DUMMY.md): a test of the plan, never a result of the study [programmer]...SAPLING FINAL: 0 of 4 FINAL (SAP NOT FINAL, ADaM MADE, TLFs MADE, Dashboard MADE)Every program runs CLEAN, the dashboard passes its gate (1,726 numbers on 11 pages), and still nothing is final. The SAP is not approved and has 16 open decisions. The other three products are MADE: made from dummy data: a test of the plan, never a result of the study.
| Statistic | Placebo (N=35) | Teralozarel 100 mg (N=35) | p-value |
|---|---|---|---|
| Baseline | |||
| n | 28 | 27 | |
| Mean (SD) | 8.1 (0.98) | 8.1 (0.85) | |
| Median | 8.0 | 8.4 | |
| Min, Max | 6, 11 | 6, 10 | |
| Week 24 | |||
| n | 29 | 28 | |
| Mean (SD) | 7.9 (1.07) | 7.2 (1.05) | |
| Median | 7.9 | 7.1 | |
| Min, Max | 6, 10 | 5, 10 | |
| Change from baseline to Week 24 | |||
| n | 28 | 27 | 0.011 |
| Mean (SD) | -0.2 (1.02) | -0.9 (0.94) | |
| Median | -0.1 | -0.9 | |
| Min, Max | -3, 1 | -3, 1 | |
Program: t14_3_1.R · Output: T14_3_1 · Results: output/ard/t14_3_1.csvSource: out/tlf/listings/t14_3_1.lst of T2DTESTDUMMY DATA of a made-up study: no number here describes a patient or a medicine.
Your turn 21.1 A study of depression
Make a second made-up study: major depressive disorder, seed 2. What does the note about the sample size say, and what does it mean for the plan?
Show the answer
$ sapling new mddtest --indication mdd --seed 2 --no-openmade up Major depressive disorder: Lolatobelzen (an invented name) against placebo, Placebo; Lolatobelzen 50 mg; Lolatobelzen 100 mg, 606 patients, 8 weeks "MADE-UP: A Randomized, Double-Blind, Placebo-Controlled, Parallel-Group Study of Lolatobelzen in Adults with Major Depressive Disorder (not a real study)"create protocol/usdm.jsoncreate sdtm/sdtm.json and sdtm/*.xpt (DUMMY data of DM 610, EX 756, DS 610, SV 3999, AE 441, VS 15828, QS 3963; seed 2)create protocol/protocol.json (the page index of the protocol)create sap.qmd (610 lines: sapc init and the omakase defaults; 9 tables: T14_1_1, T14_1_2, T14_2_1, T14_3_1, T14_4_1, T14_5_1, T14_5_2, T14_5_3, T14_7_1)create README.md, AGENTS.md (the rules of an AI agent), .gitignore, custom/, out/, .sapling/, _extensions/sapling/ (the Quarto extension of Sapling: sapling sap pdf, Quarto preview)create .Rprofile and .sapling/ (the R engine ~/.vscode-remote/extensions/datastep-labs.sapling-sap-0.16.2/sapling/engine, in place)create sdtm/DUMMY.md (DUMMY data of a made-up study: the cases with their subjects), sdtm/dummy-profile.json (the numbers of the indication library)note the sample size: 90% power for the library's median difference (-1.7 points) needs 780 patients per arm; the study plans 202 per arm (the library's median), with 38% powereffect QS.MADRSTOT, change to WEEK 8: Lolatobelzen 50 mg - Placebo = -1.86, p = 0.0699 (the dummy data, Welch, observed cases; the input: -0.85 points)effect QS.MADRSTOT, change to WEEK 8: Lolatobelzen 100 mg - Placebo = -1.99, p = 0.0418 (the dummy data, Welch, observed cases; the input: -1.7 points)check 0 error(s), 1 warning(s): SAPLING CHECK PASS0.3 s. Next: cd mddtest && sapling build (open decisions: sapling decide)The library’s median difference on the MADRS is small (-1.7 points). For 90% power it would need 780 patients per arm. The study plans the library’s median size, 202 per arm, and says that this gives 38% power. With 38% power, a medicine with exactly that effect would fail more often than it wins. This is a question for you before any protocol: is the effect worth 780 patients per arm, or is another endpoint or design needed?
What you learned
sapling new <study> --indication <id> --seed Smakes a realistic made-up study from the posted results of published trials.- The sample size block states its assumptions; you can check the number by hand.
- Designed cases in the dummy data test the rules of the plan.
- Products made from dummy data are MADE, never FINAL.
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.