StatAgent

Generate TLF shells from a SAP with AI

Shells are repetitive, rule-based, and easy to check, which makes them a good first job for AI. The rule: placeholders only, never realistic numbers.

Facts on this page are checked against the sources linked here. The prompt has not yet been run on a live assistant. How we check.

Step 1: Paste this prompt

You are assisting a biostatistician. From the SAP excerpt below, produce
table, listing and figure (TLF) SHELLS in plain text.

Rules:
1. Create only outputs justified by the SAP text. For each, give an ID,
   title, analysis population, and the SAP section it comes from.
2. For every table shell give: title, population, column headers
   (treatment arms with N=xx), row structure, statistics displayed, footnotes.
3. Use placeholders (xx, xx.x, x.xxx) only. Never produce realistic numbers.
4. If the SAP does not define something (decimal places, ordering, handling
   of missing data, denominators), do NOT decide silently. List it under
   OPEN QUESTIONS FOR THE STATISTICIAN.
5. Mark any convention you assumed as [ASSUMPTION - CONFIRM].

SAP EXCERPT:
[paste SAP text - public or simulated only]

Tip: structured input beats prose. If your SAP's outputs already exist as a spec table or CDISC Analysis Results Standard (ARS) metadata, paste that instead of free text. A PharmaSUG 2026 paper argues that ARS metadata as controlled input makes LLM-generated TFL programs more consistent.

Step 2: Review checklist

Worked example (public data)

Using the primary outcome from public record NCT02906930 (change in HbA1c from baseline to week 26, four arms), a good shell looks like this. Note the model line is left open because the design and outcome information used here doesn't state it. (The record's results section later reports ANCOVA and MMRM analyses, but a shell drafted at protocol stage can't know that.)

Table 14.2.1  Change from Baseline in HbA1c (%) at Week 26
Analysis Set: [Full analysis set - CONFIRM]

                         Placebo   Sema 3 mg  Sema 7 mg  Sema 14 mg
                         (N=xx)    (N=xx)     (N=xx)     (N=xx)
Baseline, mean (SD)      xx.x (x.xx) ...
Week 26, mean (SD)       xx.x (x.xx) ...
Change, LS mean (SE)     x.xx (x.xxx) ...
Difference vs placebo
  LS mean (95% CI)         --       x.xx (x.xx, x.xx) ...
  p-value                  --       x.xxxx ...

Footnote: [Model: OPEN QUESTION - ANCOVA vs MMRM]. [Missing-data
handling: OPEN QUESTION]. [Multiplicity adjustment: OPEN QUESTION].
Watch for: AI loves to fill shells with plausible numbers. If you see any, delete the whole output and rerun the prompt.

Get the next workflow by email →