<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE article PUBLIC "-//NLM//DTD Journal Publishing DTD v2.0 20040830//EN" "journalpublishing.dtd"><article xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink" dtd-version="2.0" xml:lang="en" article-type="research-article"><front><journal-meta><journal-id journal-id-type="nlm-ta">J Med Internet Res</journal-id><journal-id journal-id-type="publisher-id">jmir</journal-id><journal-id journal-id-type="index">1</journal-id><journal-title>Journal of Medical Internet Research</journal-title><abbrev-journal-title>J Med Internet Res</abbrev-journal-title><issn pub-type="epub">1438-8871</issn><publisher><publisher-name>JMIR Publications</publisher-name><publisher-loc>Toronto, Canada</publisher-loc></publisher></journal-meta><article-meta><article-id pub-id-type="publisher-id">v28i1e99597</article-id><article-id pub-id-type="doi">10.2196/99597</article-id><article-categories><subj-group subj-group-type="heading"><subject>Original Paper</subject></subj-group></article-categories><title-group><article-title>Performance, Failures, and Oversight of a Large Language Model Agent for Clinical Data Analysis: Evaluation Study</article-title></title-group><contrib-group><contrib contrib-type="author"><name name-style="western"><surname>Wu</surname><given-names>Yilan</given-names></name><degrees>MD</degrees><xref ref-type="aff" rid="aff1">1</xref></contrib><contrib contrib-type="author"><name name-style="western"><surname>Fu</surname><given-names>Dun Jack</given-names></name><degrees>BM, BCh, PhD</degrees><xref ref-type="aff" rid="aff1">1</xref><xref ref-type="aff" rid="aff2">2</xref></contrib><contrib contrib-type="author"><name name-style="western"><surname>Zhou</surname><given-names>Yukun</given-names></name><degrees>PhD</degrees><xref ref-type="aff" rid="aff1">1</xref><xref ref-type="aff" rid="aff2">2</xref><xref ref-type="aff" rid="aff3">3</xref></contrib><contrib contrib-type="author"><name name-style="western"><surname>Wagner</surname><given-names>Siegfried K</given-names></name><degrees>BM, BCh, PhD</degrees><xref ref-type="aff" rid="aff1">1</xref><xref ref-type="aff" rid="aff2">2</xref></contrib><contrib contrib-type="author" corresp="yes"><name name-style="western"><surname>Keane</surname><given-names>Pearse A</given-names></name><degrees>MD</degrees><xref ref-type="aff" rid="aff1">1</xref><xref ref-type="aff" rid="aff2">2</xref></contrib></contrib-group><aff id="aff1"><institution>Institute of Ophthalmology, University College London</institution><addr-line>162 City Rd</addr-line><addr-line>London</addr-line><addr-line>England</addr-line><country>United Kingdom</country></aff><aff id="aff2"><institution>NIHR Biomedical Research Centre at Moorfields Eye Hospital NHS Foundation Trust</institution><addr-line>London</addr-line><country>United Kingdom</country></aff><aff id="aff3"><institution>Hawkes Institute, University College London</institution><addr-line>London</addr-line><country>United Kingdom</country></aff><contrib-group><contrib contrib-type="editor"><name name-style="western"><surname>Steenstra</surname><given-names>Ivan</given-names></name></contrib></contrib-group><contrib-group><contrib contrib-type="reviewer"><name name-style="western"><surname>Arora</surname><given-names>Mehak</given-names></name></contrib><contrib contrib-type="reviewer"><name name-style="western"><surname>Akbar</surname><given-names>Natasha</given-names></name></contrib></contrib-group><author-notes><corresp>Correspondence to Pearse A Keane, MD, Institute of Ophthalmology, University College London, 162 City Rd, London, England, EC1V2PD, United Kingdom, 1 7482213973; <email>p.keane@ucl.ac.uk</email></corresp></author-notes><pub-date pub-type="collection"><year>2026</year></pub-date><pub-date pub-type="epub"><day>8</day><month>9</month><year>2026</year></pub-date><volume>28</volume><elocation-id>e99597</elocation-id><history><date date-type="received"><day>27</day><month>04</month><year>2026</year></date><date date-type="rev-recd"><day>11</day><month>08</month><year>2026</year></date><date date-type="accepted"><day>13</day><month>08</month><year>2026</year></date></history><copyright-statement>&#x00A9; Yilan Wu, Dun Jack Fu, Yukun Zhou, Siegfried K Wagner, Pearse A Keane. Originally published in the Journal of Medical Internet Research (<ext-link ext-link-type="uri" xlink:href="https://www.jmir.org">https://www.jmir.org</ext-link>), 8.9.2026. </copyright-statement><copyright-year>2026</copyright-year><license license-type="open-access" xlink:href="https://creativecommons.org/licenses/by/4.0/"><p>This is an open-access article distributed under the terms of the Creative Commons Attribution License (<ext-link ext-link-type="uri" xlink:href="https://creativecommons.org/licenses/by/4.0/">https://creativecommons.org/licenses/by/4.0/</ext-link>), which permits unrestricted use, distribution, and reproduction in any medium, provided the original work, first published in the Journal of Medical Internet Research (ISSN 1438-8871), is properly cited. The complete bibliographic information, a link to the original publication on <ext-link ext-link-type="uri" xlink:href="https://www.jmir.org/">https://www.jmir.org/</ext-link>, as well as this copyright and license information must be included.</p></license><self-uri xlink:type="simple" xlink:href="https://www.jmir.org/2026/1/e99597"/><abstract><sec><title>Background</title><p>Large language model (LLM) agents capable of generating and executing statistical code from natural language may broaden access to clinical data analysis, yet which pipeline stages they perform reliably and which require expert oversight remain poorly defined.</p></sec><sec><title>Objective</title><p>This study aimed to evaluate the performance and systematic failure modes of an LLM agent across 5 stages of a clinical data analysis workflow.</p></sec><sec sec-type="methods"><title>Methods</title><p>The publicly available dataset and R script (R Foundation for Statistical Computing) were drawn from a previously published study of 12-year outcomes in 7802 patients with eyes with neovascular age-related macular degeneration at Moorfields Eye Hospital. Participants were evaluated using an LLM agent (Claude; Anthropic) across 3 interaction modes (Chat, Code, and Cowork). It was asked to perform 3 levels of data analysis practice: prompt A, to generate research questions from raw data only; prompt B, to develop a statistical analysis plan (SAP) from a high-level clinical objective, then execute it; and prompt C, to execute an analysis given an investigator-drafted SAP. Each was replicated 3 times (27 total runs). Qualitative evaluation of research question thematic coverage (prompt A), SAP completeness against a reference checklist (prompt B), and evaluation of execution outputs against validated reference values and of result text and narrative summaries against execution logs (prompts B and C) was conducted.</p></sec><sec sec-type="results"><title>Results</title><p>The agent generated 18 clinically grounded questions spanning 7 domains; Cowork mode uniquely reached 3 thematic areas requiring data-driven methods. All 9 SAPs correctly identified the statistical framework. Kaplan-Meier estimates were near-identical across 17 completed runs. Systematic execution errors emerged: SAP quality did not predict code correctness, and within-mode errors propagated identically across independent repetitions. Result text accurately reflected execution logs in nearly all runs, though unit propagation and an undisclosed postcrash rerun were identified. Of 17 narrative summaries, 8 were fully satisfactory; 2 runs produced clinically meaningful errors.</p></sec><sec sec-type="conclusions"><title>Conclusions</title><p>LLM agents perform reliably for question generation and SAP drafting but require expert verification of formula composition, cohort boundary logic, and concordance computation before results are reported. Using an ophthalmology dataset as a controlled testbed, this study develops and applies an evaluation framework whose lessons are likely applicable across clinical specialties.</p></sec></abstract><kwd-group><kwd>AI</kwd><kwd>data analysis</kwd><kwd>large language model</kwd><kwd>ophthalmology</kwd><kwd>survival analysis</kwd></kwd-group></article-meta></front><body><sec id="s1" sec-type="intro"><title>Introduction</title><p>Large language model (LLM)-powered tools capable of generating and executing statistical code have begun to enter clinical research workflows [<xref ref-type="bibr" rid="ref1">1</xref>-<xref ref-type="bibr" rid="ref4">4</xref>]. Clinical data analysis requires substantial statistical and epidemiological expertise that may not be uniformly available to clinician-researchers [<xref ref-type="bibr" rid="ref5">5</xref>-<xref ref-type="bibr" rid="ref7">7</xref>]. LLM-powered agents offer a compelling model: a researcher states a research question, and the agent drafts a statistical plan and runs the analysis [<xref ref-type="bibr" rid="ref8">8</xref>,<xref ref-type="bibr" rid="ref9">9</xref>].</p><p>Despite this promise, a systematic evaluation of where LLM agents succeed and where they fail in clinical research workflows is lacking. In the field of clinical data analysis, which requires expertise to enter, it is possible for an agent to produce plausible-looking outputs while harboring methodological errors that are invisible to a nonexpert reviewer [<xref ref-type="bibr" rid="ref10">10</xref>]. Existing benchmarks focus on code correctness for isolated tasks or on multiple-choice medical knowledge [<xref ref-type="bibr" rid="ref1">1</xref>,<xref ref-type="bibr" rid="ref11">11</xref>], without examining the full chain from question formulation through protocol design to statistical execution on real clinical data.</p><p>This pilot study evaluated an LLM agent across 5 stages of clinical data analysis, using a publicly released dataset and validated R (R Foundation for Statistical Computing) script from a previously published JAMA (Journal of the American Medical Association) Ophthalmology study [<xref ref-type="bibr" rid="ref12">12</xref>] as a controlled benchmark. Three interaction modes spanning a spectrum from conversational use (Chat) to fully autonomous local execution (Code and Cowork) were compared across 3 prompt levels to identify systematic error patterns and to inform practical deployment guidance. Although the benchmark is grounded in ophthalmology, the data analysis workflow evaluated in this study (clinical question generation, statistical analysis plan [SAP] drafting, analysis execution, and result summarization and manuscript writing) is common to observational research across medical specialties. Accordingly, we identify and summarize generalizable error patterns and an evaluation framework for assessing future LLM agent releases in clinical data analysis more broadly.</p><p>The primary objective of this study was to evaluate the reliability, failure modes, and required human oversight of LLM agents across 5 stages of the clinical data analysis pipeline: research question generation, SAP formulation, data preprocessing and cohort boundary logic, statistical execution, and narrative clinical reporting. We hypothesized that while LLM agents could generate clinically relevant research questions and technically compliant statistical plans, their autonomous code execution would introduce silent, plausible-looking logical errors (such as cohort boundary mismatches, mathematical tie violations, or statistical assumption check omissions) that require mandatory expert biostatistical review and cannot be detected from runtime success or final numerical summaries alone.</p></sec><sec id="s2" sec-type="methods"><title>Methods</title><sec id="s2-1"><title>Dataset and Reference Standard</title><p>This study used the publicly available dataset and reference R script from Fu et al [<xref ref-type="bibr" rid="ref12">12</xref>]. The original study examined 12-year longitudinal anti&#x2013;vascular endothelial growth factor treatment outcomes for neovascular age-related macular degeneration in 7802 eyes (118,255 clinic visits at Moorfields Eye Hospital, October 2008-February 2020) using Cox proportional hazards (PHs) models and Kaplan-Meier (KM) estimators and released both the dataset and script publicly alongside the publication. Three time-to-event outcomes were benchmarked: (O1) time to visual acuity (VA) at least 70 Early Treatment Diabetic Retinopathy Study (ETDRS) letters, (O2) duration of sustained VA at least 70 letters, and (O3) time to VA decline to 35 or fewer letters. Quantitative outputs (cohort sizes, KM medians, hazard ratios [HRs], and concordance statistics) served as the evaluation benchmark.</p></sec><sec id="s2-2"><title>Ethical Considerations</title><p>This study did not involve human participants, clinical trials, or the collection or analysis of primary patient data. All experiments were conducted using a publicly available, fully deidentified database [<xref ref-type="bibr" rid="ref12">12</xref>] and a reference R script released under a Creative Commons Zero license. Consequently, in accordance with the UK Health Research Authority (HRA) and National Health Service (NHS) research ethics guidelines [<xref ref-type="bibr" rid="ref13">13</xref>], as well as the institutional policies of Moorfields Eye Hospital and University College London, this study was exempt from institutional ethics review board assessment. This study was reported in accordance with the DECIDE-AI (Developmental and Exploratory Clinical Investigations of Decision Support Systems Driven by AI) reporting guidelines [<xref ref-type="bibr" rid="ref14">14</xref>].</p></sec><sec id="s2-3"><title>Prompt Framework</title><p>Three prompts were developed to ask the agent to conduct different steps of the data analysis pipeline using different predefined information.</p><p>Prompt A is designed for research question generation, where the agent received the dataset and data dictionary [<xref ref-type="bibr" rid="ref15">15</xref>] and was asked to propose 2 novel, clinically meaningful, and analytically feasible research questions. Prompt B is designed for SAP development and execution, where the agent received 3 outcome definitions as high-level clinical objectives, independently drafted a complete SAP, and then implemented and executed it. Prompt C is designed for guided execution, where the agent received an SAP and implemented it (<xref ref-type="fig" rid="figure1">Figure 1</xref>; Method S2 in <xref ref-type="supplementary-material" rid="app1">Multimedia Appendix 1</xref>).</p><fig position="float" id="figure1"><label>Figure 1.</label><caption><p>Study design overview. Different levels of prompts can be interpreted as different clinicians&#x2019; mental labor and input levels. Prompt A, from dataset to question, simulates the workflow when a junior researcher is given a dataset by their mentor but without a specific project, so they must first identify a scientific question. Prompt B, from aim to statistical analysis plan (SAP), represents when a junior researcher only receives high-level guidance and must develop a detailed protocol independently. Prompt C, with specific SAP input, simulates when the junior researcher already has a detailed protocol and can directly proceed with execution. LLM: large language model.</p></caption><graphic alt-version="no" mimetype="image" position="float" xlink:type="simple" xlink:href="jmir_v28i1e99597_fig01.png"/></fig><p>The outcome definitions for prompt B were extracted from the published abstract of the original publication [<xref ref-type="bibr" rid="ref12">12</xref>], and the prompt C SAP was drafted based on the Methods section, specifying model family, covariates, cohort definitions, and reporting requirements from the original publication [<xref ref-type="bibr" rid="ref12">12</xref>]. Only the prompts, dataset, and data dictionary [<xref ref-type="bibr" rid="ref14">14</xref>] were provided to the agent, and no reference to the original paper or code was provided.</p></sec><sec id="s2-4"><title>Agent Platform and Interaction Modes</title><p>All experiments used Claude (Anthropic) in 3 modes: Chat (conversational; no autonomous file-system or script execution; free tier), Code (writes files and executes R or Python code locally; paid subscription), and Cowork (highest autonomy; may independently choose programming language and analytical strategy; paid subscription). Each mode-prompt combination was replicated 3 times in fully independent sessions, yielding 27 total runs. The runs were coded as A/B/C (prompt)_Chat/Code/Cowork (mode)_1/2/3 (replicate number).</p><p>All experiments were done by Claude Sonnet (version 4.6). Claude for Mac was accessed from February 27, 2026, to July 04, 2026, to run the experiments. Zero-shot model memory probing was run to avoid model contamination.</p></sec><sec id="s2-5"><title>Evaluation Framework</title><sec id="s2-5-1"><title>Research Question Quality (Prompt A)</title><p>All 18 questions were evaluated qualitatively. Each question was assigned to a thematic group based on the primary clinical construct addressed by the question. Thematic groups were derived inductively from the question set by a clinician-researcher reviewer and cross-checked against the data dictionary [<xref ref-type="bibr" rid="ref15">15</xref>]. LLM agent&#x2013;generated questions were rated for novelty, clinical importance, and analytical feasibility on a 5-point Likert scale (1=&#x201C;lowest&#x201C; to 5=&#x201C;highest&#x201D;). Novelty and importance were evaluated against existing publications. Feasibility was evaluated against the available covariates in the released database. Two graders were involved in the assessment, one with 3 years of clinical and ophthalmology research experience, and the other with over 10 years of clinical and ophthalmology research experience.</p></sec><sec id="s2-5-2"><title>SAP Quality (Prompt B)</title><p>Each SAP was assessed against a reference checklist from the Methods section of the original publication, covering statistical model specification, covariate completeness, cohort definitions, and reporting requirements. The generated R scripts were validated by comparing each run against the reference standard: first, for correctness (computational execution), we verified whether the generated scripts executed successfully to completion without runtime crashes or programming bugs. This was validated as the final result, as the agent might internally debug and self-correct in the process to complete a targeted run. Then, for statistical validity (numerical accuracy), we manually audited and compared the resulting quantitative outputs against the validated reference values of the original reference publication. Lastly, for implementation (code logic and variable selection), for any run that exhibited a numerical deviation from the reference standard, we manually reviewed the lines of code in each script to verify whether the data preprocessing, cohort-filtering boundaries, and regression formulas correctly reflected the SAP. The manual validation was conducted by a researcher with 6 years of clinical data analysis experience, and confirmed by the author of the reference study, who performed the ground truth data analysis.</p></sec><sec id="s2-5-3"><title>Analysis Execution Quality (Prompts B and C)</title><p>Scripts were assessed for Cox formula composition, cohort boundary logic, and counting-process implementation; quantitative outputs were compared with reference values.</p></sec><sec id="s2-5-4"><title>Script Output-to-Result Text Fidelity (Prompts B and C):</title><p>The text summary was asked to directly report the key statistical analysis results, including, but not limited to, the sample size, baseline descriptions, methods, variables, and results for each analysis conducted (Method S1 in <xref ref-type="supplementary-material" rid="app1">Multimedia Appendix 1</xref>). Each run&#x2019;s result summary was compared line-by-line against its execution log for numerical accuracy and potential hallucinations.</p></sec><sec id="s2-5-5"><title>Manuscript Writing Quality (Prompts B and C)</title><p>Manuscripts were asked to use the computed output to get high-level conclusions in a manuscript-like narrative style, without specific length or style guidance (Methods S1 and S2 in <xref ref-type="supplementary-material" rid="app1">Multimedia Appendix 1</xref>). Each manuscript was evaluated by a clinician reviewer against the reference paper across three criteria: (1) interpretation, about the appropriate use of associative language and the correct direction and magnitude of findings; (2) clinical implications, about logical derivation from results, proportionate conclusions, and appropriate observational caveats; and (3) reporting alignment, about the correspondence with the key findings of the reference paper without omission or invention. Each criterion was rated as satisfactory, minor issue, or significant issue.</p></sec><sec id="s2-5-6"><title>Error Pattern Taxonomy</title><p>Failure modes across all pipeline stages were aggregated inductively from the qualitative evaluations above. Repeated errors were classified according to the mechanisms, in order to develop a practical taxonomy for guiding expert verification of LLM-generated analyses.</p></sec></sec></sec><sec id="s3" sec-type="results"><title>Results</title><sec id="s3-1"><title>Research Question Quality (Prompt A)</title><p>All 9 prompt A runs generated 2 questions each (18 total; 100% completion rate). Thematic analysis identified 7 distinct clinical domains across the 18 questions (Table S1 in <xref ref-type="supplementary-material" rid="app1">Multimedia Appendix 1</xref>). These themes were as follows: induction phase completeness and long-term VA (group-a, n=6, 33% questions); injection interval and variability (group-b, n=5, 28% questions); early VA response as a prognostic biomarker (group-c, n=3, 17% questions); treatment burden and maintenance phenotype (group-d, n=1, 6% question); latent VA trajectory phenotyping (group-e, n=1, 6% question); withheld injection visits and VA decline (group-f, n=1, 6% question); and ethnic disparities in VA outcomes (group-g, n=2, 11% questions).</p><p>Thematic coverage was unequal and mode-dependent. Group-a alone accounted for 6 of 18 (33%) questions, reflecting consistent agent anchoring on the most structurally prominent binary variable in the dataset (loaded or not loaded). Chat and Code modes generated questions exclusively in groups a to c. Cowork was the only mode to reach group-e (latent trajectory phenotyping), group-f (withheld injection adherence), and groups-g (ethnic disparity mediation)&#x2014;3 thematic domains not generated by Chat or Code in any of the 6 combined runs.</p><p>Mean scores were 3.0 (SD 0.69) for novelty, 4.2 (SD 0.43) for importance, and 3.5 (SD 0.92) for feasibility on a 5-point scale. Thematic groups with higher novelty (such as withheld injections or ethnic disparities) suffer from low feasibility (2.00) due to dataset variable limitations (missing access or mediation variables or noninjection visit coding). Conversely, routine questions like induction completeness are highly feasible (4.40) but have low novelty (2.80).</p></sec><sec id="s3-2"><title>SAP Quality (Prompt B)</title><p>All 9 SAPs correctly identified Cox PHs and KM estimation and specified the main covariate domains (Table S2 in <xref ref-type="supplementary-material" rid="app1">Multimedia Appendix 1</xref>). Chat mode produced the most specific technical language: B_Chat_1 explicitly specified that VA be scaled per 5 ETDRS letters and that injection count must be excluded from the Cox formula, which was the most methodologically precise SAP in the study. However, B_Chat_2 introduced ambiguity with the permissive phrase &#x201C;may be used&#x201D; for injection count. Code mode SAPs were nearly identical across all 3 repetitions but systematically underspecified VA scaling and injection count handling, indicating within-mode stereotyping. Cowork mode showed the widest variation: B_Cowork_2 produced the most detailed SAP overall, while B_Cowork_1 produced the least specific SAP.</p><p>Beyond the core of KM and Cox PH, the 9 SAPs proposed a broad set of ancillary methods (Table S3 in <xref ref-type="supplementary-material" rid="app1">Multimedia Appendix 1</xref>). Competing risks modeling (Fine-Gray subdistribution hazard) was the most consistently proposed extension, appearing in all 9 SAPs and most often for Outcome 3 (time to VA&#x2264;35), with treatment discontinuation as the competing event. Landmark analysis was proposed by all 9 SAPs to address immortal-time and selection bias in Outcome 2. Code-mode SAPs were the most conservative, consistently proposing Fine-Gray, landmark, and restricted mean survival time but rarely venturing further; Chat mode was the most expansive; Cowork occupied a middle ground with multistate and frailty models.</p></sec><sec id="s3-3"><title>Analysis Execution Quality (Prompts B and C)</title><p>KM median estimates were highly consistent across all conditions (O1: 2.03&#x2010;2.04 y; O2: 0.54 y; O3: 8.65&#x2010;8.66 y), suggesting that KM estimation may be a dependable pipeline component (<xref ref-type="table" rid="table1">Table 1</xref>).</p><table-wrap id="t1" position="float"><label>Table 1.</label><caption><p>Analysis execution quality by run.</p></caption><table id="table1" frame="hsides" rules="groups"><thead><tr><td align="left" valign="bottom">Run</td><td align="left" valign="bottom">Cohort O1</td><td align="left" valign="bottom">Injection count in Cox</td><td align="left" valign="bottom">HR<sup><xref ref-type="table-fn" rid="table1fn1">a</xref></sup> (O1)</td><td align="left" valign="bottom">Concordance (O1)</td><td align="left" valign="bottom">Key execution finding</td></tr></thead><tbody><tr><td align="left" valign="top">Reference</td><td align="left" valign="top">5978</td><td align="left" valign="top">&#x2717;<sup><xref ref-type="table-fn" rid="table1fn2">b</xref></sup> excluded</td><td align="left" valign="top">1.434</td><td align="left" valign="top">0.749</td><td align="left" valign="top"/></tr><tr><td align="left" valign="top">B_Chat_1</td><td align="left" valign="top">5794 (&#x2212;184)</td><td align="left" valign="top">&#x2717; crash</td><td align="left" valign="top">&#x2717; crash</td><td align="left" valign="top">0.700 (rerun)</td><td align="left" valign="top">VA<sup><xref ref-type="table-fn" rid="table1fn3">c</xref></sup> entered categorically; crashed; result summary reflects corrected rerun</td></tr><tr><td align="left" valign="top">B_Chat_2</td><td align="left" valign="top">5794 (&#x2212;184)</td><td align="left" valign="top">&#x2717; absent</td><td align="left" valign="top">&#x25B2;<sup><xref ref-type="table-fn" rid="table1fn4">d</xref></sup> 1.075</td><td align="left" valign="top">0.749 &#x2713;<sup><xref ref-type="table-fn" rid="table1fn5">e</xref></sup></td><td align="left" valign="top">Injection count absent (hedged SAP)<sup><xref ref-type="table-fn" rid="table1fn6">f</xref></sup>; VA per letter</td></tr><tr><td align="left" valign="top">B_Chat_3</td><td align="left" valign="top">5794 (&#x2212;184)</td><td align="left" valign="top">&#x25B2;<sup><xref ref-type="table-fn" rid="table1fn7">g</xref></sup></td><td align="left" valign="top">&#x25B2;<sup><xref ref-type="table-fn" rid="table1fn4">d</xref></sup> 1.075</td><td align="left" valign="top">0.749 &#x2713;</td><td align="left" valign="top">Partial TDC<sup><xref ref-type="table-fn" rid="table1fn8">h</xref></sup> matches partial SAP</td></tr><tr><td align="left" valign="top">B_Code_1</td><td align="left" valign="top">5794 (&#x2212;184)</td><td align="left" valign="top">&#x25B2;<sup><xref ref-type="table-fn" rid="table1fn7">g</xref></sup></td><td align="left" valign="top">&#x25B2;<sup><xref ref-type="table-fn" rid="table1fn4">d</xref></sup> 1.075</td><td align="left" valign="top">0.749 &#x2713;</td><td align="left" valign="top">VA per letter; within-mode stereotyping</td></tr><tr><td align="left" valign="top">B_Code_2</td><td align="left" valign="top">5794 (&#x2212;184)</td><td align="left" valign="top">&#x25B2;<sup><xref ref-type="table-fn" rid="table1fn7">g</xref></sup></td><td align="left" valign="top">&#x25B2;<sup><xref ref-type="table-fn" rid="table1fn4">d</xref></sup> 1.075</td><td align="left" valign="top">0.749 &#x2713;</td><td align="left" valign="top">Identical to B_Code_3</td></tr><tr><td align="left" valign="top">B_Code_3</td><td align="left" valign="top">5794 (&#x2212;184)</td><td align="left" valign="top">&#x25B2;<sup><xref ref-type="table-fn" rid="table1fn7">g</xref></sup></td><td align="left" valign="top">&#x25B2;<sup><xref ref-type="table-fn" rid="table1fn4">d</xref></sup> 1.075</td><td align="left" valign="top">0.749 &#x2713;</td><td align="left" valign="top">Identical to B_Code_2</td></tr><tr><td align="left" valign="top">B_Cowork_1</td><td align="left" valign="top">5978 &#x2713;</td><td align="left" valign="top">&#x2717; absent (Python)</td><td align="left" valign="top">&#x2713; 1.427</td><td align="left" valign="top">&#x2014;<sup><xref ref-type="table-fn" rid="table1fn9">i</xref></sup></td><td align="left" valign="top">Lowest SAP specificity; best cohort</td></tr><tr><td align="left" valign="top">B_Cowork_2</td><td align="left" valign="top">5978 &#x2713;</td><td align="left" valign="top">&#x25B2;<sup><xref ref-type="table-fn" rid="table1fn7">g</xref></sup></td><td align="left" valign="top">&#x2717; 1.329</td><td align="left" valign="top">0.668</td><td align="left" valign="top">Best SAP; injection count included despite SAP exclusion</td></tr><tr><td align="left" valign="top">B_Cowork_3</td><td align="left" valign="top">5794 (&#x2212;184)</td><td align="left" valign="top">&#x25B2;<sup><xref ref-type="table-fn" rid="table1fn7">g</xref></sup></td><td align="left" valign="top">&#x2713; 1.427</td><td align="left" valign="top">&#x2014;</td><td align="left" valign="top">Moderate SAP; consistent implementation</td></tr><tr><td align="left" valign="top">C_Chat_1</td><td align="left" valign="top">5978 &#x2713;</td><td align="left" valign="top">&#x25B2;<sup><xref ref-type="table-fn" rid="table1fn7">g</xref></sup></td><td align="left" valign="top">&#x2717; 1.260</td><td align="left" valign="top">&#x2014;</td><td align="left" valign="bottom">Custom CP; injection count in formula biases HR</td></tr><tr><td align="left" valign="top">C_Chat_2</td><td align="left" valign="top">5978 &#x2713;</td><td align="left" valign="top">&#x25B2;<sup><xref ref-type="table-fn" rid="table1fn7">g</xref></sup></td><td align="left" valign="top">&#x2717; 1.219</td><td align="left" valign="top">&#x2014;</td><td align="left" valign="bottom">tmerge; &#x2212;15% HR bias</td></tr><tr><td align="left" valign="top">C_Chat_3</td><td align="left" valign="top">5978 &#x2713;</td><td align="left" valign="top">&#x25B2;<sup><xref ref-type="table-fn" rid="table1fn7">g</xref></sup></td><td align="left" valign="top">&#x2713;&#x223C;1.430</td><td align="left" valign="top">&#x2014;</td><td align="left" valign="bottom">HR unaffected in this run</td></tr><tr><td align="left" valign="top">C_Code_1</td><td align="left" valign="top">5978 &#x2713;</td><td align="left" valign="top">&#x25B2;<sup><xref ref-type="table-fn" rid="table1fn7">g</xref></sup></td><td align="left" valign="top">&#x2717; 1.264</td><td align="left" valign="top">&#x2014;</td><td align="left" valign="bottom">Custom CP; injection count biases HR</td></tr><tr><td align="left" valign="top">C_Code_2</td><td align="left" valign="top">5978 &#x2713;</td><td align="left" valign="top">&#x25B2;<sup><xref ref-type="table-fn" rid="table1fn7">g</xref></sup></td><td align="left" valign="top">&#x2713; 1.436</td><td align="left" valign="top">0.753 &#x2713;</td><td align="left" valign="bottom">Most accurate run</td></tr><tr><td align="left" valign="top">C_Code_3</td><td align="left" valign="top">5978 &#x2713;</td><td align="left" valign="top">&#x25B2;<sup><xref ref-type="table-fn" rid="table1fn7">g</xref></sup></td><td align="left" valign="top">&#x2713;&#x223C;1.430</td><td align="left" valign="top">&#x2014;</td><td align="left" valign="bottom">Consistent with C_Code_2</td></tr><tr><td align="left" valign="top">C_Cowork_1</td><td align="left" valign="top">5978 &#x2713;</td><td align="left" valign="top">&#x25B2;<sup><xref ref-type="table-fn" rid="table1fn7">g</xref></sup></td><td align="left" valign="top">&#x2713; 1.433</td><td align="left" valign="top">&#x2014;</td><td align="left" valign="bottom">Row count matches reference; HR accurate</td></tr><tr><td align="left" valign="top">C_Cowork_2</td><td align="left" valign="top">5809 &#x2717;</td><td align="left" valign="top">&#x25B2;<sup><xref ref-type="table-fn" rid="table1fn7">g</xref></sup></td><td align="left" valign="top">&#x2717; 1.261</td><td align="left" valign="top">&#x2717; 0.867</td><td align="left" valign="bottom">Python interval over-splitting; concordance inflated</td></tr><tr><td align="left" valign="top">C_Cowork_3</td><td align="left" valign="top">&#x2014;</td><td align="left" valign="top">&#x2014;</td><td align="left" valign="top">&#x2014;</td><td align="left" valign="top">&#x2014;</td><td align="left" valign="top">Complete execution failure</td></tr></tbody></table><table-wrap-foot><fn id="table1fn1"><p><sup>a</sup>HR: hazard ratio.</p></fn><fn id="table1fn2"><p><sup>b</sup>Incorrect answer.</p></fn><fn id="table1fn3"><p><sup>c</sup>VA: visual acuity.</p></fn><fn id="table1fn4"><p><sup>d</sup>The agent reported the HR per individual Early Treatment Diabetic Retinopathy Study (ETDRS) letter rather than the standard 5-letter standard.</p></fn><fn id="table1fn5"><p><sup>e</sup>Correct answer.</p></fn><fn id="table1fn6"><p><sup>f</sup>SAP: statistical analysis plan.</p></fn><fn id="table1fn7"><p><sup>g</sup>The agents partially implemented the requirement by recognizing that &#x201C;injection count&#x201D; was a required variable but failing to operationalize it as a TDC.</p></fn><fn id="table1fn8"><p><sup>h</sup>TDC: time-dependent covariate.</p></fn><fn id="table1fn9"><p><sup>i</sup>Not applicable.</p></fn></table-wrap-foot></table-wrap><p>At prompt B, all 6 Chat and Code runs produced O1 cohorts of 5794 (&#x2212;184 vs the reference 5978), attributable to a strict-inequality boundary error that was identical across all repetitions. The 2 highest-quality SAPs (B_Chat_1, B_Cowork_2) produced the worst outputs: B_Chat_1&#x2019;s script entered VA categorically despite the SAP specifying continuous per&#x2013;5-letter modeling and crashed; B_Cowork_2&#x2019;s Python implementation included injection count in the Cox formula despite its SAP explicitly excluding it (HR 1.329 vs reference 1.434). While B_Cowork_1, with the least specific SAP, independently generated the most accurate cohort definitions in code. This trend suggests that SAP quality and implementation accuracy may represent distinct dimensions that did not covary in this small sample (Table S4 in <xref ref-type="supplementary-material" rid="app1">Multimedia Appendix 1</xref>).</p><p>At prompt C, all completed runs achieved the reference cohort size. However, a consistent new error emerged: every run that adopted the counting-process structure also included the injection count in the Cox formula despite the SAP&#x2019;s explicit exclusion. The SAP provided rationale for the exclusion, yet the agent reproduced only the observable structural pattern without operationalizing the stated omission. Code mode was the most reproducible; Cowork mode substituted Python for R in multiple runs, with one (C_Cowork_2) producing a concordance inflated from 0.749 to 0.867 due to interval oversplitting (83,088 rows vs the reference 35,949), which was undetectable from model output alone (Table S5 in <xref ref-type="supplementary-material" rid="app1">Multimedia Appendix 1</xref>).</p><p>Post hoc diagnostic testing of the reference Cox PHs models revealed that several key variables violated the PHs assumption, and that the original R code omitted patient-level clustering in the Cox model. However, in the original 27 unguided runs, the agents blindly replicated this unclustered reference model and completely omitted PHs and multicollinearity diagnostics (only C_Code_3 noted the PH assumption in its text plan, but failed to write any code to evaluate it). In our post hoc update phase (Table S6 in <xref ref-type="supplementary-material" rid="app1">Multimedia Appendix 1</xref>), when explicitly prompted to run diagnostics and resolve violations, the agents successfully executed variance inflation factor checks in 17 of 18 runs. In runs C_Code_2 and C_Code_3, the agents automatically resolved the PH violations without prompt requesting. These results illustrated that while agents lack spontaneous diagnostic metacognition, they can implement standard statistical verification and model refinement checks reliably when guided by a prescriptive protocol under human oversight.</p></sec><sec id="s3-4"><title>Script Output to Result Text Fidelity (Prompts B and C)</title><p>For most prompt B runs, numerical values in the result summaries accurately reflected the execution logs, without detectable hallucinations (Table S7 in <xref ref-type="supplementary-material" rid="app1">Multimedia Appendix 1</xref>). B_Chat_2 and all B_Code runs modeled VA per individual letter; the resulting HR of 1.075 per letter was accurately transcribed but clinically nonstandard (conventional scale: HR^5&#x2248;1.44), requiring clinician manual conversion.</p><p>For prompt C, the Chat and Code run summaries accurately reflected the logs. C_Chat_1 described an O2 cohort consistent with its log, and also faithfully transcribed a code error reflecting its incorrect cohort definition, without hallucination. C_Cowork_2 reported an inverted O2 HR direction that propagated to a confident but clinically incorrect narrative interpretation (&#x201C;higher baseline VA was paradoxically associated with shorter duration of sustained &#x2265;70&#x201D;), demonstrating how implementation errors can produce misleading result text that is undetectable without expert code review.</p></sec><sec id="s3-5"><title>Narrative Result Summary Quality (Prompts B and C)</title><p>Narrative summaries were of high quality in most runs (<xref ref-type="table" rid="table2">Table 2</xref>). Of 17 evaluated summaries, 8 were rated satisfactory across all 3 criteria (interpretation, clinical implications, and reporting alignment); 7 had minor issues in one dimension; and 2 had notable deficiencies across multiple criteria. Clinical implications was the most consistently handled dimension: all runs except C_Cowork_2 produced clinically sound messages covering early treatment benefit, induction adherence, and age-stratified counseling. Causal language was managed well in most runs; the best performers (B_Chat_2, B_Chat_3, C_Chat_3, and C_Code_2) explicitly disclaimed causal inference within the analysis section rather than deferring to the limitations section alone.</p><table-wrap id="t2" position="float"><label>Table 2.</label><caption><p>Narrative result summary quality by run (prompts B and C)<sup><xref ref-type="table-fn" rid="table2fn1">a</xref></sup>.</p></caption><table id="table2" frame="hsides" rules="groups"><thead><tr><td align="left" valign="bottom">Run</td><td align="left" valign="bottom">Interpretation</td><td align="left" valign="bottom">Clinical implications</td><td align="left" valign="bottom">Reporting alignment</td><td align="left" valign="bottom">Key finding</td></tr></thead><tbody><tr><td align="left" valign="top">B_Chat_1</td><td align="left" valign="top">&#x25B2;<sup><xref ref-type="table-fn" rid="table2fn2">b</xref></sup></td><td align="left" valign="top">&#x2713;<sup><xref ref-type="table-fn" rid="table2fn3">c</xref></sup></td><td align="left" valign="top">&#x2713;</td><td align="left" valign="top">Near-causal phrasing for drug effect (&#x201C;independent treatment-level effect&#x201D;); otherwise correctly associative</td></tr><tr><td align="left" valign="top">B_Chat_2</td><td align="left" valign="top">&#x2713;</td><td align="left" valign="top">&#x2713;</td><td align="left" valign="top">&#x2713;</td><td align="left" valign="top">Best in B-Chat group; explicit causal disclaimer; C-stat differences noted across outcomes</td></tr><tr><td align="left" valign="top">B_Chat_3</td><td align="left" valign="top">&#x2713;</td><td align="left" valign="top">&#x2713;</td><td align="left" valign="top">&#x2713;</td><td align="left" valign="top">Causal inference disclaimed for drug comparison; HR<sup><xref ref-type="table-fn" rid="table2fn4">d</xref></sup> per letter but mathematically consistent</td></tr><tr><td align="left" valign="top">B_Code_1</td><td align="left" valign="top">&#x25B2;</td><td align="left" valign="top">&#x2713;</td><td align="left" valign="top">&#x25B2;</td><td align="left" valign="top">Reports ethnicity effect not in reference paper; limited O2 discrimination discussion</td></tr><tr><td align="left" valign="top">B_Code_2</td><td align="left" valign="top">&#x2713;</td><td align="left" valign="top">&#x2713;</td><td align="left" valign="top">&#x2713;</td><td align="left" valign="top">Clean associative language; drug nonsignificance for O1 and O2 correctly stated</td></tr><tr><td align="left" valign="top">B_Code_3</td><td align="left" valign="top">&#x25B2;</td><td align="left" valign="top">&#x2713;</td><td align="left" valign="top">&#x25B2;</td><td align="left" valign="top">O2 injection-interval association not in reference paper; minor O3 magnitude discrepancy</td></tr><tr><td align="left" valign="top">B_Cowork_1</td><td align="left" valign="top">&#x2713;</td><td align="left" valign="top">&#x2713;</td><td align="left" valign="top">&#x2713;</td><td align="left" valign="top">Confounding by indication explicitly caveated; per&#x2013;5-letter HR aligned with paper</td></tr><tr><td align="left" valign="top">B_Cowork_2</td><td align="left" valign="top">&#x2713;</td><td align="left" valign="top">&#x2713;</td><td align="left" valign="top">&#x25B2;</td><td align="left" valign="top">Methodologically sophisticated; attenuation of drug effect with injection covariate not flagged as diverging from paper</td></tr><tr><td align="left" valign="top">B_Cowork_3</td><td align="left" valign="top">&#x25B2;</td><td align="left" valign="top">&#x2713;</td><td align="left" valign="top">&#x2717;<sup><xref ref-type="table-fn" rid="table2fn5">e</xref></sup></td><td align="left" valign="top">Drug effect on O1 reported as significant and clinically conclude as superiority, whereas original paper finds no drug effect on O1</td></tr><tr><td align="left" valign="top">C_Chat_1</td><td align="left" valign="top">&#x25B2;</td><td align="left" valign="top">&#x2713;</td><td align="left" valign="top">&#x25B2;</td><td align="left" valign="top">Drug effect magnitude differs from paper; partial caveat; time-varying injection inverse correctly interpreted</td></tr><tr><td align="left" valign="top">C_Chat_2</td><td align="left" valign="top">&#x2713;</td><td align="left" valign="top">&#x2713;</td><td align="left" valign="top">&#x25B2;</td><td align="left" valign="top">Age nonsignificant in O1, which diverges from paper (where HR 0.88/5 y)</td></tr><tr><td align="left" valign="top">C_Chat_3</td><td align="left" valign="top">&#x2713;</td><td align="left" valign="top">&#x2713;</td><td align="left" valign="top">&#x2713;</td><td align="left" valign="top">Best in C-Chat group; explicitly notes real-world era effects; paradoxical injection effect correctly explained</td></tr><tr><td align="left" valign="top">C_Code_1</td><td align="left" valign="top">&#x2713;</td><td align="left" valign="top">&#x2713;</td><td align="left" valign="top">&#x25B2;</td><td align="left" valign="top">Drug nonsignificant across all outcomes, which diverges from the original paper</td></tr><tr><td align="left" valign="top">C_Code_2</td><td align="left" valign="top">&#x2713;</td><td align="left" valign="top">&#x2713;</td><td align="left" valign="top">&#x2713;</td><td align="left" valign="top">Exceptionally written; drug effect caveat well-framed; all 3 outcomes fully covered</td></tr><tr><td align="left" valign="top">C_Code_3</td><td align="left" valign="top">&#x2713;</td><td align="left" valign="top">&#x2713;</td><td align="left" valign="top">&#x2713;</td><td align="left" valign="top">Drug effect O3 correctly highlighted; proportional hazard assumption noted; induction covariate addressed</td></tr><tr><td align="left" valign="top">C_Cowork_1</td><td align="left" valign="top">&#x2713;</td><td align="left" valign="top">&#x2713;</td><td align="left" valign="top">&#x2713;</td><td align="left" valign="top">Confounding by indication caveated; O3 drug magnitude aligned with paper</td></tr><tr><td align="left" valign="top">C_Cowork_2</td><td align="left" valign="top">&#x25B2;</td><td align="left" valign="top">&#x25B2;</td><td align="left" valign="top">&#x25B2;</td><td align="left" valign="top">O2 direction inverted (&#x201C;higher baseline VA<sup><xref ref-type="table-fn" rid="table2fn6">f</xref></sup> paradoxically shorter sustain&#x201D;); counterintuitive direction not resolved; multiple issues across criteria</td></tr><tr><td align="left" valign="top">C_Cowork_3</td><td align="left" valign="top">&#x2014;<sup><xref ref-type="table-fn" rid="table2fn7">g</xref></sup></td><td align="left" valign="top">&#x2014;</td><td align="left" valign="top">&#x2014;</td><td align="left" valign="top">No output (execution failure)</td></tr></tbody></table><table-wrap-foot><fn id="table2fn1"><p><sup>a</sup>Evaluation criteria: interpretation (associative language; correct direction and magnitude); clinical implications (logical, proportionate, and caveated); and reporting alignment (key paper findings covered; no invention).</p></fn><fn id="table2fn2"><p><sup>b</sup>Minor issue.</p></fn><fn id="table2fn3"><p><sup>c</sup>Satisfactory.</p></fn><fn id="table2fn4"><p><sup>d</sup>HR: hazard ratio.</p></fn><fn id="table2fn5"><p><sup>e</sup>Notable issue.</p></fn><fn id="table2fn6"><p><sup>f</sup>VA: visual acuity.</p></fn><fn id="table2fn7"><p><sup>g</sup>Not applicable.</p></fn></table-wrap-foot></table-wrap><p>Two runs had clinically meaningful errors. B_Cowork_3 incorrectly reported a significant drug effect on O1 (time to achieving VA&#x2265;70) and derived a clinical implication of aflibercept superiority for this outcome, contradicting the reference paper&#x2019;s finding. C_Cowork_2 produced a directionally inverted interpretation of the O2 finding, stating that higher baseline VA was associated with a shorter duration of sustaining at least 70 letters, which arose from the implementation bias identified at the execution stage and propagated into a confident but incorrect clinical conclusion.</p></sec></sec><sec id="s4" sec-type="discussion"><title>Discussion</title><p>This study evaluated an LLM agent across 3 clinical data analysis stages using a validated ophthalmology dataset and a fully specified reference analysis, in alignment with our primary objective of characterizing agent reliability, systematic failure modes, and required human oversight. The LLM agent was validated across different clinical data analysis stages, moving from a clinical question to an SAP, then to time-to-event code and narrative interpretation, which is common across observational research.</p><p>Relative to our stated aims, our main findings are as follows: for research question formulation, the agent successfully generated clinically relevant and important research questions, but their novelty was moderate, and 3 questions had low analytical feasibility due to data availability constraints (required clinical variables were absent from the raw CSV file).</p><p>The agent drafted complete, technically compliant SAPs, but we observed a critical dissociation where high-quality SAPs did not predict code correctness, and the agent introduced silent, plausible-looking execution errors (such as cohort boundary mismatches, time-zero tied survival time omissions, and incorrect censoring definitions) that produced no runtime error signals. Guided runs with detailed SAPs resolved cohort boundaries but introduced other repetitive error types, where the agent reproduced data structures from the SAP while ignoring explicit covariate exclusion directives. For transcription of numerical results from code logs to narrative summaries, the agent&#x2019;s performance was highly accurate, but we identified in one case that the agent propagated an inverted HR into a confident but clinically incorrect narrative conclusion.</p><p>These findings suggest that while LLM agents can accelerate the initial generation of research questions, study protocols, and analysis code, they are currently better suited to supporting analytical work under strict expert supervision than to autonomously conducting it. Indeed, the substantial &#x201C;verification time-tax&#x201D; required to audit the code line-by-line, coupled with the absence of a pre-established ground truth in real-world practice, means that autonomous deployment carries significant risks of introducing silent, plausible-looking statistical errors that a researcher cannot easily identify without prior expertise.</p><p>For research question formulation, while all modes generated clinically grounded questions, mode selection shaped the thematic range of the output but did not map cleanly onto clinical value. Chat generated one treatment-burden question; Code generated trajectory phenotyping and withheld-injection clustering questions; and Cowork was the only mode to generate questions on ethnic disparity mediation. This pattern is consistent with lower-autonomy modes defaulting toward the most structurally prominent variables, though causal attribution to mode alone cannot be established from a nonrandomized design in which modes also differ in tool access, interface, and computational environment [<xref ref-type="bibr" rid="ref16">16</xref>,<xref ref-type="bibr" rid="ref17">17</xref>]. Despite this, the most divergent questions generated by higher-autonomy modes (such as ethnic-disparity mediation and withheld-injection clustering) had low feasibility because they required access to variables weakly represented in the released CSV (eg, socioeconomic status, comorbidity measures, and explicit noninjection visit coding). In addition, while the generated questions were highly important (mean score 4.2/5, SD 0.43) and reasonably feasible (mean score 3.5/5, SD 0.92), their novelty was moderate (mean score 3.0/5, SD 0.92) as many repeated familiar themes from the published literature. Consequently, clinician-researchers using the agent for question generation should review novelty, clinical priority, and dataset support separately rather than treating a well-formed question as study-ready.</p><p>The dissociation between SAP quality and code correctness is consistent with the current LLM architecture, in which language generation and code generation are functionally distinct processes [<xref ref-type="bibr" rid="ref18">18</xref>,<xref ref-type="bibr" rid="ref19">19</xref>], yet other explanations are also possible, such as context window limitations. Providing a complete, rationale-annotated SAP at prompt C resolved cohort boundary errors, as the agent operationalized explicit eligibility criteria correctly. However, this is still not a solution for all errors. Although every run reproduced the counting-process data structure described in the SAP, they included the injection count variable that the SAP explicitly excluded from the model formula. The SAP stated the exclusion and explained why, while the agent reproduced the observable structural pattern without operationalizing the stated omission. Thus, the practical lesson is that the verification should focus on the model formula itself instead of the stated SAP.</p><p>Beyond structural coding mistakes, several failure modes highlighted a lack of robust commonsense medical reasoning and metacognition. For example, B_Code iterations modeled VA down to the single ETDRS letter rather than defaulting to the standard 5-letter. Additionally, agents iteratively struggled to handle injection counts as a time-varying covariate, reproducing counting-process frameworks without conceptually integrating why treatment frequency necessitates specific statistical handling. Agents also narrated directionally inverted HR for VA endpoints, constructing plausible-sounding clinical summaries that completely failed to recognize the inherent biological paradox of their own conclusions. Furthermore, the agents failed to demonstrate basic statistical diagnostics spontaneously. In the original 27 runs, only one (C_Code_3) noted the PHs assumption, and none evaluated it or checked for multicollinearity. The agents executed the prespecified Cox models and KM curves blindly, ignoring significant violations of model assumptions (such as the PHs violation of baseline VA and the moderate multicollinearity between drug regimen and treatment era). However, in our post hoc update phase, when explicitly prompted to execute these diagnostics, the agent successfully wrote and executed PHs testing in 17 of the 18 runs. This indicates that while agents lack spontaneous diagnostic metacognition, they can only implement standard statistical verification checks reliably when guided by a prescriptive protocol under human oversight. Together, these errors underscore that while an LLM can mimic the syntax of clinical data analysis, it lacks the critical metacognition required to independently sanity-check its inputs, model design, and interpretations against real-world clinical logic, which is echoed by other studies [<xref ref-type="bibr" rid="ref20">20</xref>,<xref ref-type="bibr" rid="ref21">21</xref>].</p><p>A methodological concern when benchmarking LLM agents on retrospective data is data contamination. To assess the contamination status of our benchmark, we conducted an empirical zero-shot probing study by querying the LLM in independent sessions without any attached files [<xref ref-type="bibr" rid="ref22">22</xref>]. These probes evaluated the model&#x2019;s direct recall of the raw dataset schema, the original R analysis script, and the published results. The results revealed that while the model could retrieve the paper&#x2019;s final text-based results (such as cohort sizes and specific HRs), it had no memory of the raw dataset schema (recalling incorrect variable names from a third-party R package) or the R script&#x2019;s code syntax (such as the specific tmerge or counting-process implementation). One of the key findings is that we observed direct conflicts between the model&#x2019;s zero-shot memory and its actual execution outputs: the model recalled the published cohort size of 5978 but dynamically output 5794 eyes due to strict-inequality code logic, and recalled the baseline VA HR of 1.43 but output a biased 1.329 HR due to formula composition errors. The agent&#x2019;s language summaries anchored exclusively on these local execution logs rather than correcting them using pretraining memory, confirming that the agent was dynamically generating and executing code. Furthermore, to verify file-level noncontamination, we probed the model for unpublished dataset statistics (the mean and missing count of the mean_inj_interval column), which the model was unable to retrieve. Together, these findings indicate that the benchmark effectively measures the agent&#x2019;s task execution capacity, even when the underlying study&#x2019;s high-level findings are present in the model&#x2019;s training data. We acknowledge that other contamination detection methods are available [<xref ref-type="bibr" rid="ref23">23</xref>,<xref ref-type="bibr" rid="ref24">24</xref>]; however, dense clinical and biostatistical text inherently resists word-level synonym swapping, as key clinical terms (drug names, ophthalmic measurement scales, defined statistical model names, and numerical outcome parameters) cannot be substituted without altering clinical meaning or creating nonsensical prose. More fundamentally, both methods measure the degree of text memorization, whereas the central validity question for our study is the knowledge-to-execution transfer: whether text-level recall translates into memorized code execution. Our memory-to-execution dissociation provides direct evidence that code execution was dynamic and situated rather than memorized. Even conservatively assuming that partial text-level contamination influenced the agent&#x2019;s SAP method selection (eg, choosing Cox regression and survival analysis), the model still produced systematic coding errors across all 18 execution runs, which supports our implementation-level error findings.</p><p>Recent literature has increasingly explored the utility of LLMs in statistical analysis, reviewing their general capabilities in exploratory data analysis and code generation [<xref ref-type="bibr" rid="ref25">25</xref>,<xref ref-type="bibr" rid="ref26">26</xref>], or demonstrating proof-of-concept autonomous research pipelines [<xref ref-type="bibr" rid="ref27">27</xref>,<xref ref-type="bibr" rid="ref28">28</xref>]. While these studies acknowledge that LLMs exhibit &#x201C;nonstandard errors&#x201D; arising from variable analytical choices and emphasize the necessity of human copiloting for complex tasks [<xref ref-type="bibr" rid="ref29">29</xref>], they frequently evaluate performance on isolated coding challenges [<xref ref-type="bibr" rid="ref26">26</xref>] or general nonclinical domains [<xref ref-type="bibr" rid="ref28">28</xref>,<xref ref-type="bibr" rid="ref30">30</xref>]. Our study is distinguished by evaluating an LLM agent across the complete, end-to-end clinical data analysis workflow using a validated, real-world clinical dataset. Consistent with previous reports, we found that while LLMs efficiently generate plausible code and text, they lack robust statistical domain-aware error-checking, require human verification [<xref ref-type="bibr" rid="ref29">29</xref>,<xref ref-type="bibr" rid="ref31">31</xref>], and can produce silent execution errors [<xref ref-type="bibr" rid="ref26">26</xref>]. However, our findings diverge by characterizing silent failure modes and a critical dissociation in which high-quality statistical analysis plans do not guarantee correct code implementation [<xref ref-type="bibr" rid="ref26">26</xref>]. Whereas prior work often provides generic warnings regarding LLM hallucinations [<xref ref-type="bibr" rid="ref27">27</xref>,<xref ref-type="bibr" rid="ref32">32</xref>], our study provides actionable, targeted guidance for clinical researchers. Our findings indicate that analysis plans or numerical outputs alone cannot be assumed to confirm analytical correctness [<xref ref-type="bibr" rid="ref26">26</xref>-<xref ref-type="bibr" rid="ref28">28</xref>] and propose a concrete oversight framework that mandates expert verification of specific components of the code before AI-assisted research can be safely interpreted for clinical practice [<xref ref-type="bibr" rid="ref29">29</xref>].</p><p>A further contribution of this study is methodological. Beyond evaluating one model on one dataset, we propose a reusable multistage evaluation framework for prospectively assessing future model releases. Rather than proposing our specific dataset-script replication task as a static benchmark, which would be highly vulnerable to benchmark leakage and memorization once published, this framework serves as a methodological blueprint. It translates our findings into a reusable infrastructure (the error taxonomy in <xref ref-type="table" rid="table3">Table 3</xref> and the minimum evaluation framework in <xref ref-type="table" rid="table4">Table 4</xref>) that researchers can apply to their own local, unpublished clinical datasets. With specialty-appropriate datasets and reference analyses, the same framework could be applied to other clinical domains to support local validation before deployment. In real-world analytic tasks where no published reference analysis is available, the error taxonomy and evaluation framework may also help structure oversight by identifying high-risk stages of the workflow, prioritizing targeted verification checks, and documenting where errors arise, although they do not replace expert validation.</p><table-wrap id="t3" position="float"><label>Table 3.</label><caption><p>Error pattern taxonomy: observed large language model (LLM) agent failure modes by evaluation stage.</p></caption><table id="table3" frame="hsides" rules="groups"><thead><tr><td align="left" valign="bottom">Error pattern</td><td align="left" valign="bottom">Example</td><td align="left" valign="bottom">Likely mechanism</td><td align="left" valign="bottom">Potential mitigation</td></tr></thead><tbody><tr><td align="left" valign="top" colspan="4">SAP<sup><xref ref-type="table-fn" rid="table3fn1">a</xref></sup> errors</td></tr><tr><td align="left" valign="top">Within-mode SAP stereotyping</td><td align="left" valign="top">All 3 B_Code SAPs: identical gaps in VA<sup><xref ref-type="table-fn" rid="table3fn2">b</xref></sup> scaling and injection count handling</td><td align="left" valign="top">Agent converges on a fixed SAP template within a mode</td><td align="left" valign="top">Cross-mode SAP comparison; use Chat mode when precision is required</td></tr><tr><td align="left" valign="top">Blurry description</td><td align="left" valign="top">B_Chat_2: &#x201C;injection count may be used as a covariate&#x201D;</td><td align="left" valign="top">Permissive language interpreted as nonobligatory</td><td align="left" valign="top">Use prescriptive directives; avoid &#x201C;may,&#x201D; &#x201C;consider,&#x201D; &#x201C;if appropriate&#x201D;</td></tr><tr><td align="left" valign="top" colspan="4">SAP-to-analysis execution errors</td></tr><tr><td align="left" valign="top">SAP-script dissociation</td><td align="left" valign="top">B_Chat_1: SAP specifies VA per 5 letters; script enters VA categorically and crashes</td><td align="left" valign="top">SAP and code generation are functionally distinct LLM processes</td><td align="left" valign="top">Expert comparison of model formula against SAP; treat as separate steps</td></tr><tr><td align="left" valign="top">Cohort boundary error</td><td align="left" valign="top">All B_Chat and B_Code runs: O1 n=5794 (&#x2212;184) due to strict vs nonstrict inequality</td><td align="left" valign="top">Default to strict inequality without explicit boundary specification</td><td align="left" valign="top">Specify eligibility criteria with explicit boundary condition</td></tr><tr><td align="left" valign="top">Language substitution artifact</td><td align="left" valign="top">C_Cowork_2: Python substituted for R; concordance 0.749 &#x2192; 0.867 due to interval over-splitting</td><td align="left" valign="top">Agent selected Python; library-specific differences introduced bias</td><td align="left" valign="top">Specify programming language; check counting-process row count in log</td></tr><tr><td align="left" valign="top">Lack of basic clinical judgment</td><td align="left" valign="top">B_Chat_2, B_Code_1&#x2010;3: treating VA as per 1 letter or categorical variable. All prompt C runs: counting-process structure adopted but injection count included in Cox formula despite SAP exclusion</td><td align="left" valign="top">LLMs reproduce observable positive patterns more reliably than deliberate omissions</td><td align="left" valign="top">Annotate SAP exclusions with rationale; verify model formula line-by-line</td></tr><tr><td align="left" valign="top">Lack of self-validation and refinement</td><td align="left" valign="top">B_Code runs: failed to spontaneously check model assumptions (proportional hazards violations) or run VIF<sup><xref ref-type="table-fn" rid="table3fn3">c</xref></sup> diagnostics, and seldomly refined the statistical model until prescriptively prompted</td><td align="left" valign="top">Agent prioritizes completion of prespecified script execution without statistical self-validation or metacognition</td><td align="left" valign="top">Mandate model diagnostics (Schoenfeld residuals, VIF) and model refinement rules directly in the SAP</td></tr><tr><td align="left" valign="top" colspan="4">Script-to-text errors</td></tr><tr><td align="left" valign="top">Postcrash rerun undisclosed</td><td align="left" valign="top">B_Chat_1: summary reflects corrected rerun, not the crashing script</td><td align="left" valign="top">Agent generates summary after resolving error; does not disclose substitution</td><td align="left" valign="top">Verify summary corresponds to the same analysis.log as the reported script</td></tr><tr><td align="left" valign="top">Biased result &#x2192; misleading narrative</td><td align="left" valign="top">C_Cowork_2: inverted O2 HR<sup><xref ref-type="table-fn" rid="table3fn4">d</xref></sup> &#x2192; clinically incorrect but confident interpretation</td><td align="left" valign="top">Biased result interpreted without reference to expected association direction</td><td align="left" valign="top">Expert review of HR direction and concordance before reporting</td></tr><tr><td align="left" valign="top" colspan="4">Script-to-narrative errors</td></tr><tr><td align="left" valign="top">Spurious clinical claim</td><td align="left" valign="top">B_Cowork_3: reports significant drug effect on O1 and concludes drug superiority</td><td align="left" valign="top">Agent hallucinated significance or overinterpreted finding, contradicting reference paper</td><td align="left" valign="top">Expert clinician review of narrative conclusions against raw statistical outputs</td></tr><tr><td align="left" valign="top">Paradoxical rationalization</td><td align="left" valign="top">C_Cowork_2: confidently explains inverted relationship between baseline VA and sustained duration</td><td align="left" valign="top">Agent constructs plausible narrative to fit biased execution output, failing to recognize the clinical paradox</td><td align="left" valign="top">Mandate a &#x201C;clinical sanity check&#x201D; to evaluate biological plausibility of results</td></tr></tbody></table><table-wrap-foot><fn id="table3fn1"><p><sup>a</sup>SAP: statistical analysis plan.</p></fn><fn id="table3fn2"><p><sup>b</sup>VA: visual acuity.</p></fn><fn id="table3fn3"><p><sup>c</sup>VIF: variance inflation factor.</p></fn><fn id="table3fn4"><p><sup>d</sup>HR: hazard ratio.</p></fn></table-wrap-foot></table-wrap><table-wrap id="t4" position="float"><label>Table 4.</label><caption><p>Minimum evaluation framework for large language model (LLM) agents in clinical data analysis.</p></caption><table id="table4" frame="hsides" rules="groups"><thead><tr><td align="left" valign="bottom">Framework element</td><td align="left" valign="bottom">What it is</td><td align="left" valign="bottom">How to use it for a new agent or model release</td><td align="left" valign="bottom">Example from this study</td></tr></thead><tbody><tr><td align="left" valign="top">1. Reference-anchored benchmark</td><td align="left" valign="top">Evaluate the agent against a real dataset with a validated reference analysis, not just subjective impressions.</td><td align="left" valign="top">Choose a specialty dataset with a known analysis pipeline and prespecified reference outputs.</td><td align="left" valign="top">The study used a public ophthalmology dataset plus a validated reference script and output as the ground truth comparator.</td></tr><tr><td align="left" valign="top">2. Stage-based pipeline evaluation</td><td align="left" valign="top">Separate the workflow into distinct stages rather than scoring only the final answer.</td><td align="left" valign="top">Keep the stages separate in future evaluations so strengths in one stage do not hide failures in another.</td><td align="left" valign="top">The study evaluated question generation, SAP<sup><xref ref-type="table-fn" rid="table4fn1">a</xref></sup> drafting, execution, result text, and narrative summary as different constructs. Strong SAPs did not guarantee correct analytic code implementation.</td></tr><tr><td align="left" valign="top">3. Graduated prompt levels</td><td align="left" valign="top">Test different degrees of task and aim specification.</td><td align="left" valign="top">Reuse the same 3 levels to test whether a model improves when guidance increases.</td><td align="left" valign="top">The framework used prompt A (data to questions), prompt B (aim to SAP plus execution), and prompt C (SAP to execution). Prompt C reduced cohort-boundary errors but did not eliminate formula errors.</td></tr><tr><td align="left" valign="top">4. Structural code review, not output review alone</td><td align="left" valign="top">Inspect formulas, eligibility rules, and data structure, not just headline estimates.</td><td align="left" valign="top">For future releases, require inspection of formula composition, cohort logic, and row structure before accepting outputs. Ask the agent to do diagnosis analysis or refinement of the modeling.</td><td align="left" valign="top">Injection count was wrongly included in Cox models despite SAP exclusion; Python interval over-splitting inflated concordance; model conducted prespecified SAP blindly though it has the capability to diagnosis the issues of the current modeling and conduct refinement.</td></tr><tr><td align="left" valign="top">5. SAP-to-code fidelity check</td><td align="left" valign="top">Treat planning quality and coding quality as distinct dimensions.</td><td align="left" valign="top">Always compare the code directly against the SAP instead of assuming faithful execution.</td><td align="left" valign="top">One of the best SAPs produced one of the worst implementations.</td></tr><tr><td align="left" valign="top">6. Clinician interpretation review</td><td align="left" valign="top">Evaluate whether the narrative is clinically logical, not just statistically grammatical.</td><td align="left" valign="top">Add expert review for effect direction, causal language, and biological plausibility.</td><td align="left" valign="top">Visual acuity was modeled down to the single ETDRS<sup><xref ref-type="table-fn" rid="table4fn2">b</xref></sup> letter rather than defaulting to the standard 5-letter. Inverted hazard-ratio direction was turned into a confident but clinically incorrect explanation.</td></tr><tr><td align="left" valign="top">7. Error taxonomy linked to audit steps</td><td align="left" valign="top">Convert recurring failures into a reusable checklist.</td><td align="left" valign="top">Reuse the taxonomy prospectively when testing new releases; track whether old failure classes disappear and new ones emerge.</td><td align="left" valign="top">The study&#x2019;s <xref ref-type="table" rid="table3">Table 3</xref> classifies failures by mechanism and mitigation.</td></tr></tbody></table><table-wrap-foot><fn id="table4fn1"><p><sup>a</sup>SAP: statistical analysis plan.</p></fn><fn id="table4fn2"><p><sup>b</sup>ETDRS: Early Treatment Diabetic Retinopathy Study.</p></fn></table-wrap-foot></table-wrap><p>Our study has limitations. First, this is a single-dataset, single-agent pilot study. Second, the dataset used in this study has been manually cleaned so the findings may only be representative of performance on precleaned datasets, with qualitative evaluation anchored by comparison with a validated reference. Further multiagent, multidataset benchmarking is required to generalize across platforms or analytical domains. Moreover, our zero-shot probing showed the model could retrieve the published text-level results of the reference study, which may be aided by its use of live web-search tools. While we cannot definitively establish whether the original paper itself was present in the pretraining corpus, we acknowledge that this may have influenced its selection of survival analysis methods and covariates during SAP generation. Although our memory-to-execution dissociation analysis provides direct evidence that code execution was dynamic rather than memorized, we cannot fully exclude the possibility that the agent&#x2019;s high-level analytical design was shaped by pretraining knowledge of the published methodology. Future studies should evaluate LLM agents on unpublished clinical datasets using our proposed evaluation framework (<xref ref-type="table" rid="table4">Table 4</xref>) and error taxonomy (<xref ref-type="table" rid="table3">Table 3</xref>) as a reusable blueprint to assess performance under conditions free of any potential text-level contamination.</p><p>In conclusion, LLM agents are best regarded as capable analytical assistants requiring a mandatory expert-verification layer rather than autonomous biostatisticians. While they can dramatically accelerate the initial draft stages of research, spanning writing protocols, generating questions, and drafting template code, their code execution remains prone to introducing silent, plausible-looking errors that can compromise clinical validity. Therefore, even when used as analytical support tools, their outputs require critical validation.</p><p>The broader implication is that safe adoption will depend not only on better models but also on rigorous, reusable evaluation frameworks. The utility of generative AI in clinical research is highly asymmetrical, benefiting experienced clinical data scientists who can quickly audit code but carrying high risks for novice researchers who cannot verify the underlying code or statistical logic. The &#x201C;verification time-tax&#x201D; required to check the implementation status of the SAP by the model significantly offsets any automation speedups, making autonomous AI deployment in peer-reviewed clinical research premature. Evaluating AI models based on execution success (ie, whether the code runs without throwing errors) is insufficient for safety-critical clinical informatics. Benchmarks must shift toward auditing logical correctness. This study yields a stage-based minimum evaluation framework for future LLM agents in clinical data analysis (<xref ref-type="table" rid="table4">Table 4</xref>). Although demonstrated in an ophthalmology dataset, the workflow and oversight logic are adaptable across clinical specialties.</p></sec></body><back><ack><p>Claude Sonnet 4.6 was used to correct the grammar of the draft. Gemini 3 was used to assist with the drawing of <xref ref-type="fig" rid="figure1">Figure 1</xref>, but the authors have edited and redrawn the figure.</p></ack><notes><sec><title>Funding</title><p>PAK is supported by a UK Research and Innovation Future Leaders Fellowship (MR/T019050/1), Moorfields Eye Charity with The Rubin Foundation Charitable Trust (GR001753), and an Alcon Research Institute Senior Investigator Award. YZ is supported by a Wellcome Award (318987/Z/24/Z). YW is supported by an Alcon Research Institute Senior Investigator Award. For the purpose of open access, the author has applied a Creative Commons Attribution (CC BY) license to any Author Accepted Manuscript version arising.</p></sec><sec><title>Data Availability</title><p>The original deidentified patient dataset and reference R script used in this study were previously made publicly available under an open-access license by Fu et al [<xref ref-type="bibr" rid="ref12">12</xref>,<xref ref-type="bibr" rid="ref14">14</xref>].</p></sec></notes><fn-group><fn fn-type="conflict"><p>PAK is a cofounder of Cascader Ltd and has acted as a consultant for Retina Consultants of America, Roche, Boehringer-Ingelheim, and Bitfount, and is an equity owner in Big Picture Medical. He has received speaker fees from Zeiss, Thea, Apellis, and Roche. He has received travel support from Bayer and Roche. He has attended advisory boards for Topcon, Bayer, Boehringer-Ingelheim, and Roche. The other authors declare no conflicts of interest.</p></fn></fn-group><glossary><title>Abbreviations</title><def-list><def-item><term id="abb1">DECIDE-AI</term><def><p>Developmental and Exploratory Clinical Investigations of Decision Support Systems Driven by AI</p></def></def-item><def-item><term id="abb2">ETDRS</term><def><p>Early Treatment Diabetic Retinopathy Study</p></def></def-item><def-item><term id="abb3">HR</term><def><p>hazard ratio</p></def></def-item><def-item><term id="abb4">HRA</term><def><p>Health Research Authority</p></def></def-item><def-item><term id="abb5">JAMA</term><def><p>Journal of the American Medical Association</p></def></def-item><def-item><term id="abb6">KM</term><def><p>Kaplan-Meier</p></def></def-item><def-item><term id="abb7">LLM</term><def><p>large language model</p></def></def-item><def-item><term id="abb8">NHS</term><def><p>National Health Service</p></def></def-item><def-item><term id="abb9">PH</term><def><p>proportional hazard</p></def></def-item><def-item><term id="abb10">SAP</term><def><p>statistical analysis plan</p></def></def-item><def-item><term id="abb11">VA</term><def><p>visual acuity</p></def></def-item></def-list></glossary><ref-list><title>References</title><ref id="ref1"><label>1</label><nlm-citation citation-type="journal"><person-group person-group-type="author"><name name-style="western"><surname>Singhal</surname><given-names>K</given-names> </name><name name-style="western"><surname>Azizi</surname><given-names>S</given-names> </name><name name-style="western"><surname>Tu</surname><given-names>T</given-names> </name><etal/></person-group><article-title>Large language models encode clinical knowledge</article-title><source>Nature</source><year>2023</year><month>08</month><volume>620</volume><issue>7972</issue><fpage>172</fpage><lpage>180</lpage><pub-id pub-id-type="doi">10.1038/s41586-023-06291-2</pub-id><pub-id pub-id-type="medline">37438534</pub-id></nlm-citation></ref><ref id="ref2"><label>2</label><nlm-citation citation-type="other"><person-group person-group-type="author"><name name-style="western"><surname>Nori</surname><given-names>H</given-names> </name><name name-style="western"><surname>King</surname><given-names>N</given-names> </name><name name-style="western"><surname>McKinney</surname><given-names>SM</given-names> </name><name name-style="western"><surname>Carignan</surname><given-names>D</given-names> </name><name name-style="western"><surname>Horvitz</surname><given-names>E</given-names> </name></person-group><article-title>Capabilities of GPT-4 on medical challenge problems</article-title><source>arXiv</source><comment>Preprint posted online on  Mar 20, 2023</comment><pub-id pub-id-type="doi">10.48550/arXiv.2303.13375</pub-id></nlm-citation></ref><ref id="ref3"><label>3</label><nlm-citation citation-type="journal"><person-group person-group-type="author"><name name-style="western"><surname>Thirunavukarasu</surname><given-names>AJ</given-names> </name><name name-style="western"><surname>Ting</surname><given-names>DSJ</given-names> </name><name name-style="western"><surname>Elangovan</surname><given-names>K</given-names> </name><name name-style="western"><surname>Gutierrez</surname><given-names>L</given-names> </name><name name-style="western"><surname>Tan</surname><given-names>TF</given-names> </name><name name-style="western"><surname>Ting</surname><given-names>DSW</given-names> </name></person-group><article-title>Large language models in medicine</article-title><source>Nat Med</source><year>2023</year><month>08</month><volume>29</volume><issue>8</issue><fpage>1930</fpage><lpage>1940</lpage><pub-id pub-id-type="doi">10.1038/s41591-023-02448-8</pub-id><pub-id pub-id-type="medline">37460753</pub-id></nlm-citation></ref><ref id="ref4"><label>4</label><nlm-citation citation-type="journal"><person-group person-group-type="author"><name name-style="western"><surname>Han</surname><given-names>T</given-names> </name><name name-style="western"><surname>Adams</surname><given-names>LC</given-names> </name><name name-style="western"><surname>Bressem</surname><given-names>KK</given-names> </name><name name-style="western"><surname>Busch</surname><given-names>F</given-names> </name><name name-style="western"><surname>Nebelung</surname><given-names>S</given-names> </name><name name-style="western"><surname>Truhn</surname><given-names>D</given-names> </name></person-group><article-title>Comparative analysis of multimodal large language model performance on clinical vignette questions</article-title><source>JAMA</source><year>2024</year><month>04</month><day>16</day><volume>331</volume><issue>15</issue><fpage>1320</fpage><lpage>1321</lpage><pub-id pub-id-type="doi">10.1001/jama.2023.27861</pub-id><pub-id pub-id-type="medline">38497956</pub-id></nlm-citation></ref><ref id="ref5"><label>5</label><nlm-citation citation-type="journal"><person-group person-group-type="author"><name name-style="western"><surname>Rahman</surname><given-names>P</given-names> </name><name name-style="western"><surname>Nandi</surname><given-names>A</given-names> </name><name name-style="western"><surname>Hebert</surname><given-names>C</given-names> </name></person-group><article-title>Amplifying domain expertise in clinical data pipelines</article-title><source>JMIR Med Inform</source><year>2020</year><month>11</month><day>5</day><volume>8</volume><issue>11</issue><fpage>e19612</fpage><pub-id pub-id-type="doi">10.2196/19612</pub-id><pub-id pub-id-type="medline">33151150</pub-id></nlm-citation></ref><ref id="ref6"><label>6</label><nlm-citation citation-type="journal"><person-group person-group-type="author"><name name-style="western"><surname>Localio</surname><given-names>AR</given-names> </name><name name-style="western"><surname>Stack</surname><given-names>CB</given-names> </name><name name-style="western"><surname>Meibohm</surname><given-names>AR</given-names> </name><etal/></person-group><article-title>Inappropriate statistical analysis and reporting in medical research: perverse incentives and institutional solutions</article-title><source>Ann Intern Med</source><year>2018</year><month>10</month><day>16</day><volume>169</volume><issue>8</issue><fpage>577</fpage><lpage>578</lpage><pub-id pub-id-type="doi">10.7326/M18-2516</pub-id><pub-id pub-id-type="medline">30304363</pub-id></nlm-citation></ref><ref id="ref7"><label>7</label><nlm-citation citation-type="journal"><person-group person-group-type="author"><name name-style="western"><surname>MacDougall</surname><given-names>M</given-names> </name><name name-style="western"><surname>Cameron</surname><given-names>HS</given-names> </name><name name-style="western"><surname>Maxwell</surname><given-names>SRJ</given-names> </name></person-group><article-title>Medical graduate views on statistical learning needs for clinical practice: a comprehensive survey</article-title><source>BMC Med Educ</source><year>2019</year><month>12</month><volume>20</volume><issue>1</issue><fpage>1</fpage><pub-id pub-id-type="doi">10.1186/s12909-019-1842-1</pub-id><pub-id pub-id-type="medline">31892326</pub-id></nlm-citation></ref><ref id="ref8"><label>8</label><nlm-citation citation-type="journal"><person-group person-group-type="author"><name name-style="western"><surname>Peasley</surname><given-names>D</given-names> </name><name name-style="western"><surname>Kuplicki</surname><given-names>R</given-names> </name><name name-style="western"><surname>Sen</surname><given-names>S</given-names> </name><name name-style="western"><surname>Paulus</surname><given-names>M</given-names> </name></person-group><article-title>Leveraging large language models and agent-based systems for scientific data analysis: validation study</article-title><source>JMIR Ment Health</source><year>2025</year><month>02</month><day>13</day><volume>12</volume><fpage>e68135</fpage><pub-id pub-id-type="doi">10.2196/68135</pub-id><pub-id pub-id-type="medline">39946556</pub-id></nlm-citation></ref><ref id="ref9"><label>9</label><nlm-citation citation-type="journal"><person-group person-group-type="author"><name name-style="western"><surname>Qu</surname><given-names>Y</given-names> </name><name name-style="western"><surname>Huang</surname><given-names>K</given-names> </name><name name-style="western"><surname>Yin</surname><given-names>M</given-names> </name><etal/></person-group><article-title>CRISPR-GPT for agentic automation of gene-editing experiments</article-title><source>Nat Biomed Eng</source><year>2026</year><month>02</month><volume>10</volume><issue>2</issue><fpage>245</fpage><lpage>258</lpage><pub-id pub-id-type="doi">10.1038/s41551-025-01463-z</pub-id><pub-id pub-id-type="medline">40738974</pub-id></nlm-citation></ref><ref id="ref10"><label>10</label><nlm-citation citation-type="journal"><person-group person-group-type="author"><name name-style="western"><surname>Tang</surname><given-names>L</given-names> </name><name name-style="western"><surname>Sun</surname><given-names>Z</given-names> </name><name name-style="western"><surname>Idnay</surname><given-names>B</given-names> </name><etal/></person-group><article-title>Evaluating large language models on medical evidence summarization</article-title><source>NPJ Digit Med</source><year>2023</year><month>08</month><day>24</day><volume>6</volume><issue>1</issue><fpage>158</fpage><pub-id pub-id-type="doi">10.1038/s41746-023-00896-7</pub-id><pub-id pub-id-type="medline">37620423</pub-id></nlm-citation></ref><ref id="ref11"><label>11</label><nlm-citation citation-type="confproc"><person-group person-group-type="author"><name name-style="western"><surname>Jimenez</surname><given-names>CE</given-names> </name><name name-style="western"><surname>Yang</surname><given-names>J</given-names> </name><name name-style="western"><surname>Wettig</surname><given-names>A</given-names> </name><etal/></person-group><article-title>SWE-bench: can language models resolve real-world github issues</article-title><access-date>2026-08-20</access-date><conf-name>International Conference on Learning Representations 2024 (ICLR 2024)</conf-name><conf-date>May 7-11, 2024</conf-date><comment><ext-link ext-link-type="uri" xlink:href="https://proceedings.iclr.cc/paper_files/paper/2024/hash/edac78c3e300629acfe6cbe9ca88fb84-Abstract-Conference.html">https://proceedings.iclr.cc/paper_files/paper/2024/hash/edac78c3e300629acfe6cbe9ca88fb84-Abstract-Conference.html</ext-link></comment></nlm-citation></ref><ref id="ref12"><label>12</label><nlm-citation citation-type="journal"><person-group person-group-type="author"><name name-style="western"><surname>Fu</surname><given-names>DJ</given-names> </name><name name-style="western"><surname>Keenan</surname><given-names>TD</given-names> </name><name name-style="western"><surname>Faes</surname><given-names>L</given-names> </name><etal/></person-group><article-title>Insights from survival analyses during 12 years of anti-vascular endothelial growth factor therapy for neovascular age-related macular degeneration</article-title><source>JAMA Ophthalmol</source><year>2021</year><month>01</month><day>1</day><volume>139</volume><issue>1</issue><fpage>57</fpage><lpage>67</lpage><pub-id pub-id-type="doi">10.1001/jamaophthalmol.2020.5044</pub-id><pub-id pub-id-type="medline">33211064</pub-id></nlm-citation></ref><ref id="ref13"><label>13</label><nlm-citation citation-type="report"><article-title>UK research ethics committee (REC) policy document</article-title><year>2026</year><access-date>2026-08-26</access-date><publisher-name>Health Research Authority</publisher-name><comment><ext-link ext-link-type="uri" xlink:href="https://s3.eu-west-2.amazonaws.com/www.hra.nhs.uk/media/documents/UK_REC_Policy_document_Final_v_1.0_28th_April_2026.pdf#page=3.11">https://s3.eu-west-2.amazonaws.com/www.hra.nhs.uk/media/documents/UK_REC_Policy_document_Final_v_1.0_28th_April_2026.pdf#page=3.11</ext-link></comment></nlm-citation></ref><ref id="ref14"><label>14</label><nlm-citation citation-type="journal"><person-group person-group-type="author"><collab>The DECIDE-AI Steering Group</collab></person-group><article-title>DECIDE-AI: new reporting guidelines to bridge the development-to-implementation gap in clinical artificial intelligence</article-title><source>Nat Med</source><year>2021</year><month>02</month><volume>27</volume><issue>2</issue><fpage>186</fpage><lpage>187</lpage><pub-id pub-id-type="doi">10.1038/s41591-021-01229-5</pub-id><pub-id pub-id-type="medline">33526932</pub-id></nlm-citation></ref><ref id="ref15"><label>15</label><nlm-citation citation-type="web"><person-group person-group-type="author"><name name-style="western"><surname>Fu</surname><given-names>DJ</given-names> </name><name name-style="western"><surname>Keane</surname><given-names>P</given-names> </name></person-group><article-title>Insights from survival analyses during 12 years of anti-VEGF therapy for neovascular age-related macular degeneration</article-title><source>Dryad</source><year>2020</year><access-date>2026-08-20</access-date><comment><ext-link ext-link-type="uri" xlink:href="https://datadryad.org/dataset/doi:10.5061/dryad.nvx0k6dqg">https://datadryad.org/dataset/doi:10.5061/dryad.nvx0k6dqg</ext-link></comment></nlm-citation></ref><ref id="ref16"><label>16</label><nlm-citation citation-type="confproc"><person-group person-group-type="author"><name name-style="western"><surname>Si</surname><given-names>C</given-names> </name><name name-style="western"><surname>Yang</surname><given-names>D</given-names> </name><name name-style="western"><surname>Hashimoto</surname><given-names>T</given-names> </name></person-group><article-title>Can LLMs generate novel research ideas? a large-scale human study with 100+ NLP researchers</article-title><access-date>2026-08-20</access-date><conf-name>International Conference on Learning Representations 2025 (ICLR 2025)</conf-name><conf-date>Apr 24-28, 2025</conf-date><comment><ext-link ext-link-type="uri" xlink:href="https://openreview.net/forum?id=M23dTGWCZy">https://openreview.net/forum?id=M23dTGWCZy</ext-link></comment></nlm-citation></ref><ref id="ref17"><label>17</label><nlm-citation citation-type="other"><person-group person-group-type="author"><name name-style="western"><surname>Ren</surname><given-names>S</given-names> </name><name name-style="western"><surname>Xie</surname><given-names>C</given-names> </name><name name-style="western"><surname>Jian</surname><given-names>P</given-names> </name><name name-style="western"><surname>Ren</surname><given-names>Z</given-names> </name><name name-style="western"><surname>Leng</surname><given-names>C</given-names> </name><name name-style="western"><surname>Zhang</surname><given-names>J</given-names> </name></person-group><article-title>Towards scientific intelligence: a survey of LLM-based scientific agents</article-title><source>arXiv</source><comment>Preprint posted online on  Mar 31, 2026</comment><pub-id pub-id-type="doi">10.48550/arXiv.2503.24047</pub-id></nlm-citation></ref><ref id="ref18"><label>18</label><nlm-citation citation-type="other"><person-group person-group-type="author"><name name-style="western"><surname>Yeti&#x015F;tiren</surname><given-names>B</given-names> </name><name name-style="western"><surname>&#x00D6;zsoy</surname><given-names>I</given-names> </name><name name-style="western"><surname>Ayerdem</surname><given-names>M</given-names> </name><name name-style="western"><surname>T&#x00FC;z&#x00FC;n</surname><given-names>E</given-names> </name></person-group><article-title>Evaluating the code quality of AI-assisted code generation tools: an empirical study on GitHub Copilot, Amazon CodeWhisperer, and ChatGPT</article-title><source>arXiv</source><comment>Preprint posted online on  Apr 21, 2023</comment><pub-id pub-id-type="doi">10.48550/arXiv.2304.10778</pub-id></nlm-citation></ref><ref id="ref19"><label>19</label><nlm-citation citation-type="confproc"><person-group person-group-type="author"><name name-style="western"><surname>Merler</surname><given-names>M</given-names> </name><name name-style="western"><surname>Pan</surname><given-names>R</given-names> </name><name name-style="western"><surname>Krishna</surname><given-names>R</given-names> </name><name name-style="western"><surname>Ho</surname><given-names>TK</given-names> </name><name name-style="western"><surname>Pavuluri</surname><given-names>R</given-names> </name><name name-style="western"><surname>Vukovic</surname><given-names>M</given-names> </name></person-group><article-title>Usage, effects and requirements for ai coding assistants in the enterprise: an empirical study</article-title><conf-name>LLM4Code &#x2019;26: The 3rd International Workshop on Large Language Models For Code</conf-name><conf-date>Apr 12-18, 2026</conf-date><pub-id pub-id-type="doi">10.1145/3786181.378872</pub-id></nlm-citation></ref><ref id="ref20"><label>20</label><nlm-citation citation-type="journal"><person-group person-group-type="author"><name name-style="western"><surname>Griot</surname><given-names>M</given-names> </name><name name-style="western"><surname>Hemptinne</surname><given-names>C</given-names> </name><name name-style="western"><surname>Vanderdonckt</surname><given-names>J</given-names> </name><name name-style="western"><surname>Yuksel</surname><given-names>D</given-names> </name></person-group><article-title>Large language models lack essential metacognition for reliable medical reasoning</article-title><source>Nat Commun</source><year>2025</year><month>01</month><day>14</day><volume>16</volume><issue>1</issue><fpage>642</fpage><pub-id pub-id-type="doi">10.1038/s41467-024-55628-6</pub-id><pub-id pub-id-type="medline">39809759</pub-id></nlm-citation></ref><ref id="ref21"><label>21</label><nlm-citation citation-type="journal"><person-group person-group-type="author"><name name-style="western"><surname>Kim</surname><given-names>J</given-names> </name><name name-style="western"><surname>Podlasek</surname><given-names>A</given-names> </name><name name-style="western"><surname>Shidara</surname><given-names>K</given-names> </name><name name-style="western"><surname>Liu</surname><given-names>F</given-names> </name><name name-style="western"><surname>Alaa</surname><given-names>A</given-names> </name><name name-style="western"><surname>Bernardo</surname><given-names>D</given-names> </name></person-group><article-title>Limitations of large language models in clinical problem-solving arising from inflexible reasoning</article-title><source>Sci Rep</source><year>2025</year><month>11</month><day>11</day><volume>15</volume><issue>1</issue><fpage>39426</fpage><pub-id pub-id-type="doi">10.1038/s41598-025-22940-0</pub-id><pub-id pub-id-type="medline">41219270</pub-id></nlm-citation></ref><ref id="ref22"><label>22</label><nlm-citation citation-type="confproc"><person-group person-group-type="author"><name name-style="western"><surname>Golchin</surname><given-names>S</given-names> </name><name name-style="western"><surname>Surdeanu</surname><given-names>M</given-names> </name></person-group><article-title>Time travel in LLMs: tracing data contamination in large language models</article-title><access-date>2026-08-07</access-date><conf-name>The 12th International Conference on Learning Representations (ICLR 2024)</conf-name><conf-date>May 7-11, 2024</conf-date><comment><ext-link ext-link-type="uri" xlink:href="https://openreview.net/forum?id=2Rwq6c3tvr">https://openreview.net/forum?id=2Rwq6c3tvr</ext-link></comment></nlm-citation></ref><ref id="ref23"><label>23</label><nlm-citation citation-type="book"><person-group person-group-type="author"><name name-style="western"><surname>Ye</surname><given-names>W</given-names> </name><name name-style="western"><surname>Hu</surname><given-names>J</given-names> </name><name name-style="western"><surname>Li</surname><given-names>L</given-names> </name><name name-style="western"><surname>Wang</surname><given-names>H</given-names> </name><name name-style="western"><surname>Chen</surname><given-names>G</given-names> </name><name name-style="western"><surname>Zhao</surname><given-names>J</given-names> </name></person-group><person-group person-group-type="editor"><name name-style="western"><surname>Ku</surname><given-names>LW</given-names> </name><name name-style="western"><surname>Martins</surname><given-names>A</given-names> </name><name name-style="western"><surname>Srikumar</surname><given-names>V</given-names> </name></person-group><article-title>Data contamination calibration for black-box llms</article-title><source>Findings of the Association for Computational Linguistics: ACL 2024</source><year>2024</year><publisher-name>Association for Computational Linguistics</publisher-name><fpage>10845</fpage><lpage>10861</lpage><pub-id pub-id-type="doi">10.18653/v1/2024.findings-acl.644</pub-id></nlm-citation></ref><ref id="ref24"><label>24</label><nlm-citation citation-type="journal"><person-group person-group-type="author"><name name-style="western"><surname>Golchin</surname><given-names>S</given-names> </name><name name-style="western"><surname>Surdeanu</surname><given-names>M</given-names> </name></person-group><article-title>Data contamination quiz: a tool to detect and estimate contamination in large language models</article-title><source>Trans Assoc Comput Linguist</source><year>2025</year><month>07</month><day>29</day><volume>13</volume><fpage>809</fpage><lpage>830</lpage><pub-id pub-id-type="doi">10.1162/TACL.a.20</pub-id></nlm-citation></ref><ref id="ref25"><label>25</label><nlm-citation citation-type="journal"><person-group person-group-type="author"><name name-style="western"><surname>Song</surname><given-names>X</given-names> </name><name name-style="western"><surname>Lee</surname><given-names>L</given-names> </name><name name-style="western"><surname>Xie</surname><given-names>K</given-names> </name><name name-style="western"><surname>Liu</surname><given-names>X</given-names> </name><name name-style="western"><surname>Deng</surname><given-names>X</given-names> </name><name name-style="western"><surname>Hong</surname><given-names>Y</given-names> </name></person-group><article-title>StatLLM: a dataset for evaluating the performance of large language models in statistical analysis</article-title><source>Sci Data</source><year>2026</year><month>02</month><day>6</day><volume>13</volume><issue>1</issue><fpage>369</fpage><pub-id pub-id-type="doi">10.1038/s41597-026-06731-4</pub-id><pub-id pub-id-type="medline">41651864</pub-id></nlm-citation></ref><ref id="ref26"><label>26</label><nlm-citation citation-type="journal"><person-group person-group-type="author"><name name-style="western"><surname>Wang</surname><given-names>Z</given-names> </name><name name-style="western"><surname>Danek</surname><given-names>B</given-names> </name><name name-style="western"><surname>Yang</surname><given-names>Z</given-names> </name><name name-style="western"><surname>Chen</surname><given-names>Z</given-names> </name><name name-style="western"><surname>Sun</surname><given-names>J</given-names> </name></person-group><article-title>Making large language models reliable data science programming copilots for biomedical research</article-title><source>Nat Biomed Eng</source><year>2026</year><month>08</month><volume>10</volume><issue>8</issue><fpage>1732</fpage><lpage>1746</lpage><pub-id pub-id-type="doi">10.1038/s41551-025-01587-2</pub-id><pub-id pub-id-type="medline">41571796</pub-id></nlm-citation></ref><ref id="ref27"><label>27</label><nlm-citation citation-type="journal"><person-group person-group-type="author"><name name-style="western"><surname>Ifargan</surname><given-names>T</given-names> </name><name name-style="western"><surname>Hafner</surname><given-names>L</given-names> </name><name name-style="western"><surname>Kern</surname><given-names>M</given-names> </name><name name-style="western"><surname>Alcalay</surname><given-names>O</given-names> </name><name name-style="western"><surname>Kishony</surname><given-names>R</given-names> </name></person-group><article-title>Autonomous LLM-driven research &#x2014; from data to human-verifiable research papers</article-title><source>NEJM AI</source><year>2025</year><month>01</month><volume>2</volume><issue>1</issue><pub-id pub-id-type="doi">10.1056/AIoa2400555</pub-id></nlm-citation></ref><ref id="ref28"><label>28</label><nlm-citation citation-type="journal"><person-group person-group-type="author"><name name-style="western"><surname>Lu</surname><given-names>C</given-names> </name><name name-style="western"><surname>Lu</surname><given-names>C</given-names> </name><name name-style="western"><surname>Lange</surname><given-names>RT</given-names> </name><etal/></person-group><article-title>Towards end-to-end automation of AI research</article-title><source>Nature</source><year>2026</year><month>03</month><volume>651</volume><issue>8107</issue><fpage>914</fpage><lpage>919</lpage><pub-id pub-id-type="doi">10.1038/s41586-026-10265-5</pub-id><pub-id pub-id-type="medline">41882133</pub-id></nlm-citation></ref><ref id="ref29"><label>29</label><nlm-citation citation-type="other"><person-group person-group-type="author"><name name-style="western"><surname>Gao</surname><given-names>R</given-names> </name><name name-style="western"><surname>Xiao</surname><given-names>SC</given-names> </name></person-group><article-title>Nonstandard errors in AI agents</article-title><source>SSRN</source><comment>Preprint posted online on  Mar 16, 2026</comment><pub-id pub-id-type="doi">10.2139/ssrn.6427518</pub-id></nlm-citation></ref><ref id="ref30"><label>30</label><nlm-citation citation-type="confproc"><person-group person-group-type="author"><name name-style="western"><surname>Zhu</surname><given-names>Y</given-names> </name><name name-style="western"><surname>Du</surname><given-names>S</given-names> </name><name name-style="western"><surname>Li</surname><given-names>B</given-names> </name><name name-style="western"><surname>Luo</surname><given-names>Y</given-names> </name><name name-style="western"><surname>Tang</surname><given-names>N</given-names> </name></person-group><article-title>Are large language models good statisticians?</article-title><conf-name>Advances in Neural Information Processing Systems 37</conf-name><conf-date>Dec 10-15, 2024</conf-date><pub-id pub-id-type="doi">10.52202/079017-2005</pub-id></nlm-citation></ref><ref id="ref31"><label>31</label><nlm-citation citation-type="journal"><person-group person-group-type="author"><name name-style="western"><surname>Jeon</surname><given-names>KH</given-names> </name><name name-style="western"><surname>Youn</surname><given-names>TJ</given-names> </name><name name-style="western"><surname>Chae</surname><given-names>IH</given-names> </name></person-group><article-title>ChatGPT and medical statistics: a narrative review on opportunities, pitfalls, and the principle of &#x201C;trust, but verify&#x201D;</article-title><source>J Cardiovasc Interv</source><year>2025</year><volume>4</volume><issue>4</issue><fpage>231</fpage><pub-id pub-id-type="doi">10.54912/jci.2025.0020</pub-id></nlm-citation></ref><ref id="ref32"><label>32</label><nlm-citation citation-type="journal"><person-group person-group-type="author"><name name-style="western"><surname>Kim</surname><given-names>SN</given-names> </name></person-group><article-title>Statistical analysis using ChatGPT in medical research</article-title><source>Obstet Gynecol Sci</source><year>2025</year><month>11</month><volume>68</volume><issue>6</issue><fpage>467</fpage><lpage>472</lpage><pub-id pub-id-type="doi">10.5468/ogs.25232</pub-id><pub-id pub-id-type="medline">40825566</pub-id></nlm-citation></ref></ref-list><app-group><supplementary-material id="app1"><label>Multimedia Appendix 1</label><p>Observed capabilities, limitations, and responsible use of a large language model agent for clinical data analysis.</p><media xlink:href="jmir_v28i1e99597_app1.docx" xlink:title="DOCX File, 4975 KB"/></supplementary-material></app-group></back></article>