Keiji AI LogoKeiji AI

Biostatistics & Trial Design guide

AI for SDTM and ADaM generation: tools, validated code and Pinnacle 21

Which AI tools generate SDTM and ADaM datasets, whether AI can write validated SAS or R code from a SAP, and how Pinnacle 21 and QC still apply.

Several AI tools now draft SDTM and ADaM datasets: Saama's SDTM and ADaM Navigator, Narrativa's BioStat Developer, Clymb Clinical's Data Mapper, GenInvo's CodeMagic and Keiji AI's TrialMind. AI can draft SAS or R code from a statistical analysis plan, but the code is not validated until your programmers QC it, often by independent double programming. Pinnacle 21 still checks conformance, and formal submission analyses still run in your validated environment.

Which AI tools generate SDTM and ADaM datasets

These products describe AI generation of CDISC datasets or the code behind them. Each statement links to the vendor page it comes from.

ProductSDTMADaMCode
TrialMind (Keiji AI)Domains built from your specificationsADSL derived from SDTM, with Pinnacle 21 rulesSAS and R, visible and exportable
Saama SDTM Navigator and ADaM NavigatorSpecs and programs from raw dataSpecs from the SAP, aligned to ADaM IG v1.1SAS or R for ADaM
Narrativa BioStat DeveloperDomains such as DM, AE, VS in XPTADSL, ADAE, ADLB and other BDS and OCCDS datasetsNot stated
Clymb Clinical Data MapperAI-proposed mappings from EDCDerived from approved SDTMSAS and R
GenInvo CodeMagicCode from specificationsSpecs and codeSAS, R and others

Pinnacle 21 from Certara is not on this list. It validates datasets, creates Define.xml and manages specifications, and its pages describe no AI programming. Most teams use it alongside any of these tools.

What you feed in

Every tool needs the same core material a programmer would use. Expect to supply:

  • Raw data. TrialMind takes raw CDISC ODM data. Clymb Clinical lists EDC extracts from systems such as Medidata Rave and Veeva CDMS, plus lab feeds.
  • Specifications. SDTM and ADaM mapping specs, or the metadata to draft them. Narrativa also uses the annotated CRF.
  • The statistical analysis plan. ADaM derivations and TLFs follow the SAP. Saama's ADaM Navigator parses the SAP for endpoints and derivations.
  • Your standards. Macro libraries, templates, controlled terminology and naming conventions.

Better specifications give better drafts. If your specs are incomplete, the AI will guess, and a reviewer has to catch it.

What comes out: datasets, define.xml, TLFs and code

Output scope differs more than the marketing suggests. Check each item:

  • SDTM and ADaM datasets, in XPT for submission. CDISC notes SDTM and ADaM are required standards for data submitted to FDA and PMDA.
  • Specifications and define.xml. Narrativa drafts Define.xml v2.1; Clymb generates define.xml and aCRF from metadata; Pinnacle 21 creates Define.xml 2.0 without code.
  • TLFs. TrialMind produces tables, listings and figures with SAS and R code. Clymb generates SAS and R programs with QC scripts from ARS-aligned shells.
  • Code you can read. TrialMind shows the generated R code next to each SDTM domain and lets you export it. Insist on code, not only datasets, so your team can inspect and rerun it.

Pinnacle 21 conformance checks

Generated datasets still have to pass the same conformance rules. FDA publishes validator rules it uses to check that study data are standards compliant, and validation happens at submission receipt and at the start of review.

Pinnacle 21 Enterprise validates SDTM, ADaM, SEND and Define.xml against FDA and PMDA rules. Several AI tools build those checks into the drafting loop:

Running the rules early catches issues before the formal run. It does not replace the formal run. Keep your Pinnacle 21 report as the conformance record for the submission.

How your own macros and standards are used

Most sponsors have years of validated macros and templates. An AI tool that ignores them produces code nobody wants to maintain.

In a pilot, give the tool your macro library and one finished study. Compare its draft with the production programs your team wrote.

Can AI write validated SAS or R code from a SAP?

AI can write the first draft. "Validated" describes what your process does to that draft, not where it came from.

FDA's Statistical Software Clarifying Statement says FDA does not require any specific statistical software. It asks that the software be fully documented in the submission, with version and build. It quotes ICH E9: software "should be reliable, and documentation of appropriate software testing procedures should be available."

For study programs, sponsors define QC in the SAP or their SOPs. A common method is independent double programming: a second programmer writes the same output from the specification and the results are compared. One published SAP requires full independent double programming for analysis datasets and key tables, but not listings. A PharmaSUG 2025 paper notes FDA requires sponsors to validate SDTM, ADaM and TLGs but does not prescribe how.

So treat AI-generated code like code from a new programmer:

  1. Review it against the SAP and specifications.
  2. QC it by your usual method, such as double programming or code review.
  3. Run it in your validated environment and keep the logs.

An AI tool can also be the second programmer, but then a person must still own and sign off the comparison.

When the protocol changes

Protocol amendments are where programming time is lost. Every change has to be traced through specs, derivations, datasets and tables.

TrialMind links each deliverable to the derivation and source behind it. When the protocol changes, it lists the affected code, specs, datasets and tables before rework starts, within a study and across a program. The chain runs from source dataset to derivation, to table, listing or figure, to CSR section, to eCTD submission.

Ask any vendor to show this on a real amendment. Saama says all changes to code and artifacts are logged automatically; Clymb lists version control and audit trails.

Boundaries and GxP qualification

Keep the line between drafting and the submission of record clear.

  • Formal submission analyses run in the sponsor's validated statistics environment. TrialMind's audit trail makes its steps reproducible, but it does not replace that environment.
  • GxP status. Keiji AI states that TrialMind's Data Science Assistant v1.0.0 is qualified as a GxP computerized system, using the GAMP 5 risk-based approach, with 21 CFR Part 11 and EU Annex 11 controls. See the compliance page.
  • Data location. TrialMind deploys inside the customer's environment. The AI components work on metadata, and raw patient records are not moved.
  • Other vendors. Clymb describes a validated statistical computing environment; Narrativa describes a validation-ready architecture for GxP workflows. Ask each vendor for its qualification documents.

Evidence: the DSWizard study

Keiji AI's team published DSWizard, "Making large language models reliable data science programming copilots for biomedical research", in Nature Biomedical Engineering (2026).

The paper reports a multi-step analysis workflow of roughly three months by hand completed in about a day. A human set the target and reviewed the results. It is evidence that agents can draft analysis code at speed. It is not evidence that unreviewed code is fit for submission.

More papers are on the publications page.

Frequently asked questions

Which AI tools can generate SDTM and ADaM datasets automatically?
Saama's SDTM and ADaM Navigator, Narrativa's BioStat Developer, Clymb Clinical's Data Mapper, GenInvo's CodeMagic and Keiji AI's TrialMind. All keep a programmer reviewing the output.
Can AI write validated SAS or R code from a statistical analysis plan?
AI can draft the code. It becomes validated only after your team reviews it, QCs it by your usual method, such as double programming, and runs it in your validated environment.
Do I still need Pinnacle 21 if I use an AI tool?
Yes. Some AI tools apply Pinnacle 21 rules while drafting, which catches issues early, but the formal Pinnacle 21 run remains the conformance record.
Does FDA require SAS?
No. FDA's Statistical Software Clarifying Statement says it does not require any specific software, but the software used must be documented with version and build.
Is TrialMind GxP validated?
Keiji AI states that the Data Science Assistant v1.0.0 is qualified as a GxP computerized system under GAMP 5, with 21 CFR Part 11 and EU Annex 11 controls. Formal submission analyses still run in the sponsor's validated environment.

See TrialMind on your own question

A 30-minute walkthrough on a study like yours, with sources and code you can check.