← All publications

Conference Paper

Automating SAS and R Code Interpretation and Debugging: A Practical Pipeline for Statistical Programmers

Jaime Yan, Tingting Tian

PhUSE US Connect 2025 · 2025 · ET01

DOI · 10.5281/zenodo.22182897 Download PDF

Abstract

Statistical programmers spend substantial effort writing and debugging SAS and R code. This paper describes an LLM-based pipeline that translates natural-language queries into executable SAS, R, or Python code, runs it in a Jupyter kernel, captures runtime errors from the kernel, and feeds them back to the LLM for iterative repair until the code succeeds or a retry limit is reached, exposed through a Gradio-based user interface. Evaluated on a factorial corpus of 2,700 runs across Python, R, and SAS with injected syntax, runtime, and logical/statistical errors, the system achieved success rates above 96% across languages, resolving about 95% of syntax and 90% of runtime errors versus about 88% and 87% for logical and statistical errors.

Keywords

SAS · R · code generation · debugging · LLM · Jupyter kernel · statistical programming

Cite

Jaime Yan, Tingting Tian. "Automating SAS and R Code Interpretation and Debugging: A Practical Pipeline for Statistical Programmers." PhUSE US Connect 2025, 2025. doi:10.5281/zenodo.22182897.