StatAgent

Draft a SAP skeleton with AI in 15 minutes

Works in Microsoft 365 Copilot, ChatGPT, or Claude. No coding, no real trial data. You stay the statistician; AI writes the first draft and tells you what it doesn't know.

Tested once in Microsoft 365 Copilot (GPT), October 2026. Facts checked against the sources linked on this page. How we check.

When to use it

You have a protocol synopsis (objectives, endpoints, design) and want a SAP outline to react to instead of a blank page.

Step 1: Paste this prompt

You are assisting a senior biostatistician. Draft a Statistical Analysis Plan
SKELETON from the protocol information below.

Rules:
1. Use ONLY information in the input. If the input does not state something
   (analysis method, multiplicity, missing-data handling, analysis sets),
   do NOT invent it. Put it in a section titled "OPEN QUESTIONS FOR THE
   STATISTICIAN" and propose 1-2 common options with trade-offs.
2. Mark every statement as [FROM PROTOCOL] or [ASSUMPTION - CONFIRM].
3. Structure: Objectives and Endpoints; Study Design; Analysis Sets;
   Primary Analysis; Secondary Analyses; Handling of Missing Data;
   Multiplicity; Safety Analyses; Subgroups/Sensitivity; Open Questions.
4. Do not fabricate sample size justification, effect sizes, or p-values.
5. Write for a statistical reviewer: concise, no marketing language.

INPUT:
[paste protocol synopsis here]

Step 2: Review with the 6-point checklist

Step 3: Resolve the open questions, then ask for a skeptical review

Make your own decisions on the open questions first, and paste them in. Asking for a review of the bare skeleton mostly returns the skeleton's own open questions, re-ranked (see the test result below).

Now act as a skeptical regulatory statistical reviewer. List the 10 most likely
questions or objections to this SAP draft, ranked by seriousness.

Worked example (public data)

Source: the public ClinicalTrials.gov record NCT02906930, a phase 3, randomized, double-blind trial of oral semaglutide (3, 7 and 14 mg) vs placebo in 703 adults with type 2 diabetes treated with diet and exercise alone. Primary outcome: change in HbA1c from baseline to week 26. Secondary outcomes include body weight, fasting plasma glucose, SMPG measures, and fasting insulin and proinsulin ratios.

For the exercise, paste in only what you would have at protocol stage: the design, arms, population, and the outcome names and time frames. Deliberately leave out the results section.

What a good AI draft does with that input

Now check the AI against what the sponsor actually did

After a trial reports, the Results section of the same ClinicalTrials.gov record describes the analyses. For the HbA1c endpoint it reports two: an "in-trial" analysis labelled a treatment policy estimand (multiple imputation under a pattern mixture model, then ANCOVA with treatment and region as fixed effects and baseline HbA1c as a covariate, pooled with Rubin's rules) and an "on-treatment" analysis labelled a hypothetical estimand (an MMRM assuming data missing at random). The record's outcome description frames the in-trial analysis as the evaluation of the primary endpoint and says the endpoint was "also analysed" on-treatment. It states the in-trial analyses were controlled for multiplicity and the on-treatment analyses were not, but the record text doesn't name the procedure (the SAP does, below). The full analysis set is all randomised participants.

The sponsor also posted its real documents on that record, so you can compare your AI draft to the actual thing: the protocol (PDF) and the statistical analysis plan (PDF). Here is what that SAP (version 1.0, dated 26 January 2018) decided, so you know what to score your AI against:

Notice how many of those are exactly the decisions a good AI draft should have flagged as open questions, and how many a vague prompt would never raise.

Now score your AI draft. Which open questions did it raise that the sponsor actually had to answer? Which sponsor decisions did it never mention? Those misses show you where to tighten your prompt.

A real test: Microsoft 365 Copilot (GPT)

This prompt and protocol-stage input were run in October 2026 in Microsoft 365 Copilot using a GPT model, and the output was scored against the sponsor's SAP:

The skeptical-reviewer follow-up, same test:

One run, one model, one trial: treat this as an example of the behaviour to look for, not a guarantee.

What the research says (and doesn't)

Takeaway: AI is good at structure and extraction, and weaker at statistical logic. That is why this workflow makes it list what it can't decide.

The failure mode this workflow catches: if the AI hands back a confident, complete methods section with no open questions, don't trust it.

Get the next workflow by email →