← Back to research

Publication · Nursing Research · 2026

Vibe coding for statistical analysis using large language models

Tolentino, D. A., Kohout, E., Boy, P., & Siddiq, H. (2026). Nursing Research. Advance online publication.

Artificial intelligenceLarge language modelsStatistical methods
Read the full article
The big idea

AI “vibe coding” can help run a statistical analysis, but it can also produce convincing wrong answers, so human oversight and verification stay essential.

Who
A clean graduate-admissions data set used as a proof-of-concept case
How
Human-in-the-loop vibe coding in Cursor, generating R code for logistic regression from plain-language prompts
What we learned
Core results matched a published reference, but a confidence-interval error was missed on first review

In plain language

“Vibe coding” means asking an AI model, in everyday language, to write and run code for you instead of writing that code by hand. We tested whether this approach can carry out a real statistical analysis. Using a small, clean data set, the AI produced code that checked and cleaned the data, ran a logistic regression, and made charts. The main results matched a trusted published example, but one output, a confidence interval for a predicted probability, was wrong, and we did not catch it on our first pass.

About this study

We treated vibe coding as a proof of concept and worked through a deliberate, human-in-the-loop workflow: framing the research question, defining the variables, organizing project folders, documenting each decision, using retrieval-augmented generation, and applying prompt-engineering techniques. Working in Cursor (v1.5.11), we modeled admission status as a function of Graduate Record Exam scores, grade point average, and undergraduate rank. The AI generated the analysis in R, and we compared the output against a published reference posted on a public website.

The results were mixed. Regression coefficients, p values, and model-fit statistics matched the reference output, yet an error appeared in the predicted-probability confidence interval that slipped past our initial review. The lesson is that vibe coding can lower the barrier to analysis, but it should be used with caution: structured verification and safeguards, transparent reporting, and appropriate statistical and methodological oversight.

Key themes

1

Human in the loop

The researcher stays responsible for framing, checking, and verifying every step, not the model.

2

A structured workflow

Clear research questions, defined variables, organized files, documented decisions, and careful prompting.

3

Valid and invalid outputs

Core results matched a published reference, but an error slipped through on first review.

4

Expertise still matters

Statistical training and methodological oversight remain essential when using these tools.