AbstractThis research explores the dynamics of total electricity generation (TEG) in South Africa through an analysis of data from the International Energy Agency database from 1990 to 2020. A comprehensive examination of various energy sources, including coal, oil, biofuels, nuclear, hydro, solar photovoltaic (PV), solar thermal, and wind, is conducted to ascertain their respective contributions to TEG. Employing the R software environment, the study employs a methodical analytical framework encompassing meticulous data preparation, statistical analysis, and model formulation. The data preparation phase involves intricate processes such as structuring, cleansing, and visualization aimed at eliminating stochastic variables and outliers. Missing data are addressed through the application of the Piecewise Cubic Hermite Interpolating Polynomial method. Subsequent statistical analyses are informed by tests for normality and homogeneity of variance, revealing deviations from normality and disparate variances across energy source groups. Consequently, non‐parametric methodologies such as the Kruskal–Wallis test are adopted. Findings underscore the significant role of nuclear energy in TEG despite facing challenges. Model development entails the construction of multiple linear regression models with varying predictor sizes, with Model m06 emerging as the optimal choice, incorporating key predictors such as coal, nuclear, and solar PV. Rigorous diagnostic assessments confirm the robustness of Model m06 and its suitability for TEG prediction. Comparative analysis against actual data validates its superior performance, characterized by minimal errors and high predictive accuracy. The efficacy of Model m06 in capturing TEG dynamics underscores its utility for informing energy planning initiatives. Recommendations derived from the study advocate for prioritizing renewable energy integration, infrastructure investment, research endeavors, monitoring mechanisms, and public awareness campaigns to advance sustainable energy development goals in South Africa.