AI and Clinical Trial Data:
Protocol, SAP and Bias Checks First
AI and clinical trial data can work well together when AI supports controlled programming, documentation or quality checks. But a randomized trial's statistical analysis is defined by its protocol, statistical analysis plan (SAP), estimands and data-handling requirements, not by a model's preferred test. Independent validation is especially important where clinical results support regulatory or treatment decisions (FDA, 2021; EMA, 2025).

Here, AI assistance is a tool applied to clinical trial data, not the intervention under study. That differs from a clinical trial evaluating an AI-based intervention, a distinction that matters for both reporting standards and regulatory expectations.
What should be fixed before AI drafts a single line of code?
| Planning element | Why it matters |
|---|---|
| Trial design and randomization | Defines treatment groups, units and comparison structure |
| Primary endpoint and timing | Determines the primary analysis target |
| Estimand | States the treatment effect being estimated and treatment of intercurrent events |
| Analysis populations | Defines who enters intention-to-treat, full-analysis or per-protocol sets |
| Missing-data handling | Establishes main assumptions and sensitivity analyses |
| Multiplicity | Controls interpretation across multiple endpoints or comparisons |
| Analysis plan and amendments | Separates prespecified tests from exploratory changes |
The ICH E9(R1) estimands framework helps connect the clinical question with the target treatment effect, including how events such as treatment discontinuation or rescue medication are handled (FDA, 2021). An AI-generated script may fit a standard model while answering the wrong clinical question if these details are absent.
What tasks can AI support?
Useful controlled tasks include writing template code from a fictional data structure, documenting variable transformations, generating shell tables, reviewing syntax for reproducibility and identifying candidate consistency checks. The analyst must still inspect the code, run it in an authorized environment and validate the clinical/statistical decisions.
High-stakes analysis needs independently reproducible datasets, programming specifications, quality control and review records. Sponsor requirements, the protocol and the applicable regulatory framework determine the appropriate validation process. Not every small academic trial needs the same infrastructure as a pivotal regulatory submission, but both require defensible methods. Independent Statistical Review covers analyses prepared with AI assistance.
Why is a generic “compare the groups” prompt insufficient?
Illustrative example: Suppose the primary outcome is measured repeatedly and some participants discontinue treatment. A prompt that returns an independent t-test on completers may yield mathematically correct group means. It does not establish that a completers-only contrast corresponds to the prespecified estimand, deals with missingness appropriately or respects the repeated measurement structure.
The clinical question must be stated first. Different strategies for handling intercurrent events can legitimately target different estimands. A sensitivity analysis should assess robustness for the same estimand, rather than silently changing the question (FDA, 2021).
AI and clinical trial data: what do current regulators expect?
The ICH E6(R3) principles and Annex 1 emphasize proportionate quality management, appropriate systems and data integrity; on the EMA’s implementation timeline these came into effect in July 2025. The separate Annex 2 becomes effective in January 2027 in that jurisdiction (EMA, 2026). These principles should not be misrepresented as a rule that every use of ChatGPT in research is prohibited.
The FDA’s January 2025 document on AI used to support regulatory decision-making for drugs and biological products is a draft guidance concerning AI-produced information used in regulatory contexts. It should not be cited as a final binding rule for all academic trial analyses (FDA, 2025).
A verification matrix before a trial result is released
| Quality check | What to confirm |
|---|---|
| Protocol/SAP reconciliation | Every final model matches a documented endpoint and objective |
| Blind review or controlled changes | Changes are dated, justified and distinguished from prespecified analyses |
| Dataset lineage | Derivations, reconciliation and analysis populations are traceable |
| Statistical programming QC | Independent checking of critical code and outputs as appropriate |
| Missingness and intercurrent events | Handled consistently with the estimand and sensitivity plan |
| Reporting | Effect estimates, confidence intervals and deviations documented accurately |
Does this include real-world clinical data?
Observational healthcare databases require additional attention to confounding by indication, selection, time-related biases and causal identification (Hernán & Robins, 2020). Those issues do not automatically describe a properly randomized comparison. When a report combines trial and real-world data, it should state which framework applies to each result.
Frequently asked questions
Can a clinical trial statistician use AI to write programming code?
Potentially, when authorized by sponsor and institutional policies and when privacy, security, version control and validation requirements are met.
Should patient-level trial data be uploaded to a consumer AI chatbot?
Do not upload until the study’s data steward and applicable agreements authorize that exact system and processing arrangement. Generic code can be drafted without exposing subject-level records.
Is AI use itself an analysis protocol deviation?
Not automatically. The material question is whether methods, tools, processing and disclosure comply with the approved protocol, relevant governance and required amendments.
Independent Statistical ReviewNeed the analysis checked against the protocol and SAP? A statistician reviews endpoints, estimands and analysis populations against what the trial prespecified.
Independent Statistical Review
Independent Statistical Review is carried out by in-house PhD-level statisticians at OnlineSPSS, and it checks method, assumptions, reproducibility and reporting. Overall responsibility for the study remains with the research team. Research data and project details are handled confidentially, and an NDA is available where required.
References
- European Medicines Agency. (2025). ICH E6(R3) guideline for good clinical practice: Principles and Annex 1. https://www.ema.europa.eu/en/scientific-guidelines/ich-e6-good-clinical-practice
- European Medicines Agency. (2026). ICH E6(R3) guideline on good clinical practice: Annex 2. https://www.ema.europa.eu/en/scientific-guidelines/ich-e6-good-clinical-practice
- Hernán, M. A., & Robins, J. M. (2020). Causal inference: What if. Chapman & Hall/CRC. https://miguelhernan.org/whatifbook
- U.S. Food and Drug Administration. (2021). E9(R1) statistical principles for clinical trials: Addendum: Estimands and sensitivity analysis in clinical trials. https://www.fda.gov/regulatory-information/search-fda-guidance-documents/e9r1-statistical-principles-clinical-trials-addendum-estimands-and-sensitivity-analysis-clinical
- U.S. Food and Drug Administration. (2025). Considerations for the use of artificial intelligence to support regulatory decision-making for drug and biological products [Draft guidance]. https://www.fda.gov/regulatory-information/search-fda-guidance-documents/considerations-use-artificial-intelligence-support-regulatory-decision-making-drug-and-biological
Last reviewed November 2026 by the OnlineSPSS Statistical Team. Worked examples use hypothetical values and are not client data.
NEXT STEP
Need this done for
your study?
Share your research in about a minute and receive a complimentary assessment the same day: scope, timeline and one fixed fee.
No Commitment Required
Strictly Confidential
Fixed Project Fee
In-House PhD-Level Statisticians
Same-Day Response
Serving Researchers Since 2014