Evidence map›Paper›PMID 41572109›Full record

ArticleHealth economics review2026

Can AI write your code? A case study of chatgpt's statistical coding capabilities for quantitative research.

Debra Winberg, Ethan Tsai, Tiange Tang, Dennis Xuan, Nicolas Marchi, Lizheng Shi

Abstract read
In one paragraph

Article in Health economics review, 2026. The graph could read no effect estimate from its abstract, so it casts no vote on the map. Not yet cited in PubMed.

0numbers the graph read from it
0cells of the map it votes in
0citing papers in PubMed
–field-weighted citation impact
1 · What the graph read from it

What it found

Each row is one number read from the abstract, on the scale the paper reported it, with its interval. Left of the dashed line favours the treatment, right favours the comparator. Under each row is the sentence it came from. New to these charts? A ten-minute tutorial.

The abstract states no effect estimate the extractor could read, or names no intervention and outcome on the map, so this paper lights no cell and moves no belief. It is still indexed, cited and linked below.

2 · The registry

The trial behind it

Trials whose registry record cites this paper, or whose number appears in the abstract. A trial that started after this paper was published is citing it as background, not reporting it.

Neither the registry nor the abstract names a trial number. If this is a trial report, that itself is worth knowing.

3 · Its place in the literature

Who cites it

0 citing papers in PubMed.

No citing paper in PubMed yet.

4 · The record

Corrections and comments

PubMed lists nothing against this paper. Absence here is not a guarantee, only a check that was made.

5 · Who and what money

Authors and funding

6 authors.

Debra WinbergDepartment Health Management and Policy, School of Health, Georgetown University, 3700 Reservoir Rd NW, Washington, DC, 20007, USA. Dw1051@georgetown.edu.
Ethan TsaiDepartment Health Management and Policy, School of Health, Georgetown University, 3700 Reservoir Rd NW, Washington, DC, 20007, USA.
Tiange TangDepartment of Health Policy and Management, Celia Scott Weatherhead School of Public Health and Tropical Medicine Tulane University, New Orleans, LA, USA.
Dennis XuanDepartment of Health Policy and Management, Celia Scott Weatherhead School of Public Health and Tropical Medicine Tulane University, New Orleans, LA, USA.
Nicolas MarchiUniversity Hospitals Plymouth NHS Trust, Plymouth, UK.
Lizheng ShiDepartment of Health Policy and Management, Celia Scott Weatherhead School of Public Health and Tropical Medicine Tulane University, New Orleans, LA, USA.

Funding

No grant is acknowledged in the PubMed record.

6 · The paper itself

Abstract

backgroundRecent advancements in Artificial Intelligence (AI), particularly in large language models (LLMs) like OpenAI’s ChatGPT, have extended its applications well beyond simple dialogue generation. ChatGPT has shown potential in supporting data-driven decision-making. ChatGPT has gained traction in academia for its ability to generate code for data analysis, providing robust support for programming languages. This study aims to evaluate ChatGPT’s ability to generate code for causal inference and data analysis.

methodsThis study evaluates ChatGPT4.0 Pro’s performance in coding Difference-in-Differences (Diff-in-Diff ), Inverse Probability Treatment Weighting (IPTW), and Regression Discontinuity (RD) using problem sets and reference code from “Causal Inference: The Mixtape”. The evaluation was conducted in Python, Stata, and R. Researchers provided structured prompts and feedback, and a fourth researcher replicated all tasks to assess consistency. Primary outcomes included accuracy, efficiency, error output, editing needs, and inter-user consistency.

resultsChatGPT generated accurate code and results in R and Python for most tasks. However, it struggled with IPTW and performed less reliably in Stata. Errors were often related to data management or figure generation. Although ChatGPT could replicate correct results, the structure and syntax of its code varied across users and sessions.

conclusionsChatGPT shows strong potential as a supportive tool for econometric coding tasks in health economics, especially in Python and R. However, its output still requires human interpretation and validation. As generative AI continues to evolve, these tools hold promise for streamlining research tasks but remain supplementary to skilled human researchers in quantitative research.

Indexed as

ChatGPTCodingGenerative AIQuantitativeStatistics

Identifiers

PMID41572109
PMCPMC12911307

What Socratic holds

Textmetadata
LicenceCC BY-NC-ND
Read underepoch 390

Registered trials

None linked

Read under generation 80e0d062 · epoch 390. Bibliography from PubMed, PubMed Central and OpenAlex; grants from NIH RePORTER; trial links from ClinicalTrials.gov; estimates, votes and beliefs from the Socratic graph.