Search arXivSearch

arXiv · 2502.13117

Performance Evaluation of Large Language Models in Statistical Programming

Abstract

The programming capabilities of large language models (LLMs) have revolutionized automatic code generation and opened new avenues for automatic statistical analysis. However, the validity and quality of these generated codes need to be systematically evaluated before they can be widely adopted. Despite their growing prominence, a comprehensive evaluation of statistical code generated by LLMs remains scarce in the literature. In this paper, we assess the performance of LLMs, including two versions of ChatGPT and one version of Llama, in the domain of SAS programming for statistical analysis. Our study utilizes a set of statistical analysis tasks encompassing diverse statistical topics and datasets. Each task includes a problem description, dataset information, and human-verified SAS code. We conduct a comprehensive assessment of the quality of SAS code generated by LLMs through human expert evaluation based on correctness, effectiveness, readability, executability, and the accuracy of output results. The analysis of rating scores reveals that while LLMs demonstrate usefulness in generating syntactically correct code, they struggle with tasks requiring deep domain understanding and may produce redundant or incorrect results. This study offers valuable insights into the capabilities and limitations of LLMs in statistical programming, providing guidance for future advancements in AI-assisted coding systems for statistical analysis.

Explore related subjects

Keep this discovery

Explore connections, maps & timelines

BibTeXRIS

Xinyi Song, Kexin Xie, Lina Lee, Ruizhe Chen, Jared M. Clark, Hao He, Haoran He, Jie Min, Xinlei Zhang, Simin Zheng, Zhiyang Zhang, Xinwei Deng, Yili Hong. 2025-02-18. Performance Evaluation of Large Language Models in Statistical Programming. https://arxiv.org/abs/2502.13117

Cite the original work for its findings. Save a collection to share your selection of sources.

KEEP EXPLORING

Related papers

Geospatial Foundation Models Capture Health-Relevant Dimensions of Place Beyond Conventional Social Risk Indices

Area-based social risk indices summarize residents' socioeconomic conditions but incompletely capture physical features of place that may affect health. We evaluated whether numerical representations of physical place produced by four geospatial foundation model families from 2022 satellite data explained residual variance in tract-level associations between the Area Deprivation Index, Social Deprivation Index, and Social Vulnerability Index with health outcomes. We used LightGBM to predict variables from the American Community Survey and 40 chronic disease and health-behavior outcomes from CDC PLACES across 82,646 census tracts in the contiguous United States, evaluating performance across 10 held-out states. Among survey variables, models were moderately predictive of some variables including housing type (R-squared up to 0.54) but weak for disability, unemployment, and income disparity. For health outcomes, models explained up to 54% of variance left unexplained by social risk indices, with the largest gains for annual checkups, arthritis, and high blood pressure. Mean total variance explained by geospatial foundation models across the 40 health-related outcomes increased from 0.31 in the smallest tract-size decile to 0.39 in the largest. Geospatial foundation models capture health-relevant features of place not represented by conventional social risk indices and may usefully augment them in epidemiological analyses.

stat.AP

Transporting summary measures of relative effects from randomised trials to the treated patient population: an application to breast cancer endocrine therapy

Randomised trials often report relative treatment effects, such as risk ratios and hazard ratios, for trial populations. Clinical decision-making, however, often benefits from estimates of absolute treatment effects in the population eligible for treatment. Trial participants may not represent this target population well, and restrictions on access to individual participant trial data can further complicate absolute effect estimation. Routine care data are often representative of the target population but may be subject to uncontrolled confounding. We consider estimation of the average treatment effect on the treated (ATT), an absolute measure, by combining a representative sample of treated routine care patients with summary measures (i.e., estimated risk or hazard ratios) from either a randomised trial or a meta-analysis of trials. Under marginal or conditional transportability assumptions, the ATT is shown to be identifiable. The implications of collapsibility of the effect measure on transportability are discussed, and plug-in estimators of the ATT are presented. Simulation studies are used to assess finite sample performance of the estimators in a range of settings. The proposed methods are applied to estimate the ATT of endocrine therapy on 15-year breast cancer mortality using results from a meta-analysis of randomised trials and England's National Disease Registration Service.

stat.AP

Overcoming Model Misspecification in Bayesian Inference of Molecular Signalling Networks

Bayesian inference of molecular signalling networks usually relies on tractability of the marginal likelihood, enabling the set of possible networks to be efficiently explored. As such, linear models with independent errors and conjugate priors are routinely used. However, the dynamics of molecular signalling are nonlinear, and relevant confounders are often unobserved; failure to account for these complexities will almost certainly lead to over-confident inferences in the standard Bayesian framework. To confront this reality, we develop a post-Bayesian approach to inference of molecular signalling networks, guided by the principle that uncertainty should not vanish when the statistical model is misspecified, even in the infinite-data limit. Technically, we extend the predictively-oriented (PrO) posterior of McLatchie et al. (2025) to the setting of latent variable models, empirically investigating the properties of PrO posteriors in the challenging network inference context.

stat.AP