03 · What You Need to Know
How Citation, Disclosure, and Computational Documentation Differ
What Is the Difference Between Citing AI and Disclosing AI Use?
Citation identifies a source or resource to which scholarly attribution is given. Disclosure communicates how a tool contributed to the research process.
These activities may overlap, but they answer different questions.
Citation
Identifies a source, software resource, or other material according to an applicable referencing convention.
Disclosure
Explains the nature and extent of AI assistance in preparing or conducting the research.
A researcher might cite R and a statistical package while separately disclosing that generative AI helped draft portions of the analysis script.
Conversely, adding ChatGPT to the reference list without explaining its analytical contribution may not satisfy a journal's disclosure requirements.
The appropriate practice depends on the publication's instructions and the actual role of the technology.
Why AI-Generated Code Is Different From Ordinary Software Use
Using an established statistical package involves selecting and executing computational procedures. Generative AI may additionally propose which commands, transformations, and analytical options should be used.
For example, a researcher might use R's documented lm function to fit a prespecified regression model. That is different from asking AI to choose the predictors, determine how missing values should be handled, and generate the complete analytical workflow.
The distinction concerns the contribution to analytical decision-making, not merely whether AI produced programming text.
A system that helps recall syntax may contribute less substantively than one that proposes the model specification or changes the analytical sample.
However, even routine assistance may fall within an institution's or publisher's disclosure policy.
What Do Major Publication-Ethics Organizations Say?
The International Committee of Medical Journal Editors (ICMJE) addresses the use of AI-assisted technologies in scientific publication. Its recommendations require authors to disclose AI assistance according to the relevant instructions and remain responsible for the accuracy and integrity of the work.
The recommendations distinguish assistance with writing from AI use in activities such as data collection, analysis, and figure generation, which may need to be described in the Methods section.
The Committee on Publication Ethics (COPE) has also emphasized that AI tools cannot fulfill authorship responsibilities and that human authors remain accountable for submitted content.
These positions provide important guidance, but they should not be interpreted as identical disclosure rules for every publisher.
Researchers must consult the current policies of their target journal, institution, and relevant funding or ethics bodies.
Does AI-Generated Statistical Code Always Need a Reference-List Citation?
No universal rule requires every use of AI-generated statistical code to appear as a bibliographic reference.
Some publishers provide citation formats for AI-generated content or require acknowledgment of particular uses. Others request a disclosure statement without treating AI output as a conventional scholarly source.
Researchers should not assume that citing a chatbot is sufficient to document the analysis.
In particular, an AI-generated script is not an authoritative methodological reference merely because the code was produced by a named system.
The statistical procedure should be supported by appropriate methodological literature and software documentation where relevant.
Should Researchers Cite the Statistical Software Separately?
Software citation serves a different purpose from AI disclosure.
It can identify the software and computational tools used to produce the analysis, acknowledge their developers, and help readers locate the relevant implementation.
For example, researchers may cite R or a specialized R package according to its recommended citation information.
The R function citation provides citation information for R itself and, where available, installed packages.
citation
citation("stats")
Researchers should verify the recommended citation and version details for the specific software used.
Smith, Katz, and Niemeyer (2016), in Software Citation Principles, explain why research software should be treated as a legitimate scholarly product with appropriate identification and attribution.
Citing the software does not disclose that AI helped generate the code used to operate it.
Where Should AI Assistance Be Disclosed?
The appropriate location depends on the journal's requirements and the nature of the AI contribution.
When AI materially contributes to statistical analysis or code development, the Methods section may be an appropriate place to describe that role.
Some journals instead require a dedicated declaration or statement concerning generative AI use.
Where applicable, a disclosure may identify the tool, its role in drafting analytical scripts, and the verification performed by the research team.
The statement should accurately describe what occurred rather than imply that the AI conducted analyses independently when researchers actually executed and validated the code.
How Much Detail Should the Disclosure Include?
A useful disclosure communicates enough information for readers to understand the material contribution without becoming a transcript of every interaction.
Depending on the applicable requirements, relevant information may include:
- The AI system used and its identifiable version, where available.
- The stages of statistical programming in which AI assistance occurred.
- Whether AI generated code, explained existing code, or suggested analytical decisions.
- Whether the code was reviewed, corrected, and independently verified.
- The human responsibility for the final statistical analysis.
Not every publisher requires all these details. Researchers should avoid presenting an illustrative disclosure framework as a universally mandated reporting standard.
Does Disclosure Establish That the Code Is Correct?
No. Disclosure is a transparency practice, not a statistical validation procedure.
A researcher can openly acknowledge AI assistance while reporting an inappropriate statistical model.
For example, a disclosed AI-generated script may still use an independent-samples test for paired observations or silently remove participants during data cleaning.
Such errors require computational and methodological verification.
Researchers should therefore treat verification of AI-generated statistical code as a separate responsibility.
Should Researchers Preserve AI Prompts and Outputs?
Retaining prompts and outputs that materially influenced the analysis can support auditability and help reconstruct analytical decisions.
For example, a prompt may reveal that AI suggested changing a covariance estimator or excluding observations with missing values.
However, retaining every conversational exchange is not universally required and may be unnecessary for routine assistance.
Documentation should be proportionate to the analytical contribution and consistent with institutional policies.
Researchers should also avoid retaining confidential participant information in AI conversation records when doing so would violate applicable data-governance requirements.
What If AI Suggests a Statistical Method Rather Than Merely Writing Code?
This represents a more substantive analytical contribution.
Suppose a researcher asks AI which statistical test to use, and the system recommends a mixed-effects model. The researcher then adopts that recommendation.
The choice of statistical method can affect the estimated quantities, assumptions, and conclusions.
Researchers should independently justify the method using the study design and appropriate methodological references.
Where required, the disclosure should accurately reflect AI's contribution to that decision.
AI-generated methodological suggestions should not be cited as authoritative evidence that a procedure is appropriate.
Can Publishing the Code Replace an AI Disclosure?
Not necessarily. Sharing analytical code can improve transparency and computational reproducibility, but readers may not know which portions were generated or modified using AI.
Similarly, a disclosure does not provide the executable script or information needed to reproduce the results.
Code availability, software citation, AI disclosure, and methodological reporting therefore serve complementary purposes.
The National Academies' report Reproducibility and Replicability in Science emphasizes the importance of computational transparency and the information required to reconstruct analyses.
Researchers should document the final verified implementation rather than relying exclusively on the AI conversation as the analysis record.
Can AI Be Credited as an Author for Writing Statistical Code?
Under ICMJE and COPE authorship principles, AI tools cannot fulfill the responsibilities required of scholarly authors.
Generating a substantial amount of code does not independently confer authorship status on an AI system.
Human researchers must remain accountable for the analytical decisions, reported findings, and integrity of the work.
The contribution of human programmers, statisticians, and collaborators should be evaluated under the applicable authorship and contributorship criteria.
AI disclosure should not obscure the contributions or responsibilities of human collaborators.
04 · A Practical Example
How to Report AI Assistance in a Statistical Analysis Without Overstating Its Role
Hypothetical Example
Using ChatGPT to Draft R Code for Educational Research
A researcher conducts a study involving 350 university students to examine associations between AI tutoring usage, study hours, and examination performance.
The researcher independently specifies the multiple regression model and asks ChatGPT to generate R code for data preparation, estimation, and diagnostics.
The researcher reviews the script, corrects a factor-coding error, checks missing-data exclusions, and reproduces the main estimates using a separately verified implementation.
The target journal requires disclosure of material generative AI assistance.
An Inadequate Disclosure
Incomplete Statement
"ChatGPT was used in this research."
This statement identifies a tool but does not explain its role.
Readers cannot determine whether AI helped edit the manuscript, generated statistical code, selected the analytical model, or interpreted the findings.
A More Informative Disclosure
Illustrative Disclosure
"ChatGPT (OpenAI) was used to assist in drafting portions of the R code for data preparation, multiple regression, and model diagnostics. The statistical model was specified by the researcher. All generated code was reviewed and revised where necessary, and the main analytical results were independently verified. The researcher retained responsibility for the statistical procedures, interpretations, and conclusions."
This statement distinguishes AI's programming contribution from the researcher's methodological decisions and verification.
The exact wording, location, and additional identifying details should follow the target journal's current requirements.
What Should the Methods Section Still Report?
Even with an AI disclosure, the manuscript should describe the statistical methods sufficiently for readers to understand and evaluate the analysis.
For example, the Methods section may identify the regression model, outcome, predictors, analytical sample, missing-data approach, estimation procedure, and relevant software information.
The AI disclosure does not replace these details.
A Practical Reporting Sequence
1. Identify the actual AI contribution.
Determine whether AI drafted syntax, suggested methods, transformed data, or assisted with interpretation.
2. Verify the analysis.
Confirm that the final code implements the intended statistical procedures and produces defensible results.
3. Check the publication policy.
Identify the required disclosure location, wording, and information.
4. Report the computational methods.
Document the statistical procedures, software, relevant dependencies, and analytical decisions.
5. Preserve appropriate records.
Retain the verified code and documentation of material AI contributions under applicable requirements.
The purpose of disclosure is to make the research process understandable, not to transfer responsibility for the analysis to the technology.