Artificial Intelligence in Statistics Education: Leveraging LLMs for Analysis and Learning

Read full text
Authors: Enrico di di Bella, Sara Preti
Cited by: 1
References: 52

Abstract

Large Language Models (LLMs), such as GPT (GPT-5.5) by OpenAI and Gemini (Gemini 3.2 Pro) by Google DeepMind, have shown impressive capabilities in text generation and code assistance. This study evaluates their performance in generating R code—that is, computer scripts written in the R programming language for statistical analysis—using both classic educational datasets, including “The Lady Tasting Tea”, “Titanic”, “Iris”, and more recent datasets likely not included in the models’ training data. We assess the accuracy, readability, and educational relevance of the generated code, providing both quantitative and qualitative evaluations that highlight strengths and limitations of LLMs. Our findings suggest that while LLMs generate correct and interpretable R code in many cases, critical human oversight remains essential when integrating AI into educational contexts to ensure rigor and avoid potential misuse.

Fields of Study & Subjects

Data Analysis with R Computational and Text Analysis Methods Statistics Education and Methodologies

Publication details

Journal / source
Trends in Higher Education
Publisher
MDPI AG
Volume
5
Issue
2
Pages
39–39
Publication date
7 May 2026
Language
EN