Scientific article
OA Policy
English

ChatGPT's performance in sample size estimation : a preliminary study on the capabilities of artificial intelligence

ContributorsSeboe, Paulorcid; Wang, Ting
Published inFamily practice, vol. 42, no. 5, cmaf069
Publication date2025-08-14
First online date2025-08-26
Abstract

Background: Artificial intelligence tools, including large language models such as ChatGPT, are increasingly integrated into clinical and primary care research. However, their ability to assist with specialized statistical tasks, such as sample size estimation, remains largely unexplored.

Methods: We evaluated the accuracy and reproducibility of ChatGPT-4.0 and ChatGPT-4o in estimating sample sizes across 24 standard statistical scenarios. Examples were selected from a statistical textbook and an educational website, covering basic methods such as estimating means, proportions, and correlations. Each example was tested twice per model. Models were accessed through the ChatGPT web interface, with a new independent chat session initiated for each round. Accuracy was assessed using mean and median absolute percentage error compared with validated reference values. Reproducibility was assessed using symmetric mean and median absolute percentage error between rounds. Comparisons were performed using Wilcoxon signed-rank tests.

Results: For ChatGPT-4.0 and ChatGPT-4o, absolute percentage errors ranged from 0% to 15.2% (except one case: 26.3%) and 0% to 14.3%, respectively, with most examples showing errors below 5%. ChatGPT-4o showed better accuracy than ChatGPT-4.0 (mean absolute percentage error: 3.1% vs. 4.1% in round#1, P-value = .01; 2.8% vs. 5.1% in round#2, P-value =.02) and lower symmetric mean absolute percentage error (0.8% vs. 2.5%), though not significant (P-value = .18).

Conclusions: ChatGPT-4.0 and ChatGPT-4o provided reasonably accurate sample size estimates across standard scenarios, with good reproducibility. However, inconsistencies were observed, underscoring the need for cautious interpretation and expert validation. Further research should assess performance in more complex contexts and across a broader range of AI models.

Keywords
  • ChatGPT
  • Accuracy
  • Artificial intelligence
  • Performance
  • Reproducibility
  • Sample size
Citation (ISO format)
SEBOE, Paul, WANG, Ting. ChatGPT’s performance in sample size estimation : a preliminary study on the capabilities of artificial intelligence. In: Family practice, 2025, vol. 42, n° 5, p. cmaf069. doi: 10.1093/fampra/cmaf069
Main files (1)
Article (Published version)
Identifiers
Journal ISSN0263-2136
19views
349downloads

Technical informations

Creation09/09/2025 10:25:56
First validation23/09/2025 06:47:57
Update23/09/2025 06:47:57
Status update23/09/2025 06:47:57
Last indexation23/09/2025 06:47:58
All rights reserved by Archive ouverte UNIGE and the University of GenevaunigeBlack