Efficient computation of statistical measures using C programming
DOI:
https://doi.org/10.64497/jssci.169Abstract
Accurate computation of statistical measures such as mean, median, mode, variance, and standard deviation is fundamental to data analysis and decision making. Many traditional approaches rely on manual calculations or high-level languages like R and Python, which may not be applicable or feasible in resource-constrained environments or for educational reasons. In this paper, we present a C language implementation capable of calculating central tendency and dispersion measures on a dataset. The program is implemented to take user input dynamically, using loops and functions present results for maximum computational efficiency. A dataset is analyzed using Python to compare the statistical results with those obtained from the C programs. We compared the execution times of Excel and C for large datasets. The results, measured in seconds, show that C is significantly faster than Excel for big data.
Downloads
References
[1] Kernighan, B. W., & Ritchie, D. M. (1988). The C programming language (2nd ed.). Prentice Hall.
[2] Prasad, D. (2016). Statistical computing with C programming. International Journal of Computer Applications, 144(3), 12–17.
[3] Triola, M. F. (2018). Elementary statistics (13th ed.). Pearson.
[4] Venables, W. N., & Ripley, B. D. (2002). Modern applied statistics with S (4th ed.). Springer. DOI: https://doi.org/10.1007/978-0-387-21706-2
[5] Weiss, N. A. (2017). Introductory statistics (10th ed.). Pearson.
[6] Wickham, H., & Grolemund, G. (2017). R for data science. O’Reilly Media.
[7] Gropp, W., Lusk, E., & Skjellum, A. (1999). Using MPI: Portable parallel programming with the message-passing interface. MIT Press. DOI: https://doi.org/10.7551/mitpress/7056.001.0001
[8] Liu, C., & Wang, Y. (2015). Teaching computational statistics with C and Python: A comparative study. Journal of Statistics Education, 23(2), 45–58.
[9] Smith, J. P. (2014). Computational methods in statistics: C programming approach. International Journal of Computational Statistics, 11(1), 1–15.
[10] Jones, T., & Brown, R. (2012). Implementing statistical algorithms in C. Journal of Computational Methods, 5(3), 55–68.
[11] Gupta, A., & Sharma, K. (2016). Applications of C programming in data analysis. International Journal of Computer Science, 12(4), 101–110.
[12] Patel, R. (2018). Optimized algorithms for statistical computation in C. Computational Science Journal, 9(2), 77–85.
[13] Chen, L., & Zhao, H. (2013). Efficient variance and standard deviation calculations using C. Journal of Statistical Software, 52(1), 1–15.
[14] Kumar, S., & Mehta, V. (2017). C programming for data analytics education. International Journal of Emerging Technologies in Learning, 12(8), 65–74.
[15] Thompson, D., & Green, P. (2010). Low-level programming techniques for computational statistics. Journal of Applied Computing, 7(2), 33–42.
[16] Li, X., & Sun, Y. (2019). Embedded system applications of statistical computation using C. IEEE Transactions on Education, 62(3), 180–187.
[17] Harrison, M. (2011). Practical statistical programming in C. Wiley Publishing.
[18] Wang, J., & Lee, T. (2015). Comparative study of statistical programming languages: C vs Python. Journal of Computational Science Education, 6(1), 20–30.
[19] Ahmed, F., & Khan, S. (2016). Teaching statistics through programming in C. Journal of Computer Science Education, 24(4), 45–54.
[20] O’Neill, M., & Cooper, R. (2018). Performance evaluation of statistical computations in C and MATLAB. International Journal of Computational Science, 10(2), 99–110.
[21] Allam, I. (2025). Computing Nested ANOVA in Latin Squares Design Using C Programming. DOI: https://rgdoi. net/10.13140/RG, 2(36140.58243).
[22] Allam, I. (2025). IMPLEMENTATION OF FACTORIAL ANOVA IN COMPLETELY RANDOMIZED BLOCK DESIGNS USING CProgramming.
[23] Lavanya, A., Gaurav, L., Sindhuja, S., Seam, H., Joydeep, M., Uppalapati, V., ... & SD, V. S. (2023). Assessing the performance of Python data visualization libraries: a review. Int. J. Comput. Eng. Res. Trends, 10(1), 28-39. DOI: https://doi.org/10.22362/ijcert/2023/v10/i01/v10i0104
[24] Navarro, A. L. G., Koneva, N., Sánchez-Macián, A., & Hernández, J. A. (2024). A Comprehensive Guide to Combining R and Python code for Data Science, Machine Learning and Reinforcement Learning. arXiv preprint arXiv:2407.14695.
[25] Sial, A. H., Rashdi, S. Y. S., & Khan, A. H. (2021). Comparative analysis of data visualization libraries Matplotlib and Seaborn in Python. International Journal, 10(1), 277-281. DOI: https://doi.org/10.30534/ijatcse/2021/391012021
[26] Kabacoff, R. (2022). R in action: data analysis and graphics with R and Tidyverse. Simon and Schuster.
[27] Cordeiro, G. M., & Lemonte, A. J. (2011). The β-Birnbaum–Saunders distribution: An improved distribution for fatigue life modeling. Computational statistics & data analysis, 55(3), 1445-1461. DOI: https://doi.org/10.1016/j.csda.2010.10.007
[28] Al-Aqtash, R., Lee, C., & Famoye, F. (2014). Gumbel-Weibull distribution: Properties and applications. Journal of Modern applied statistical methods, 13(2), 11. DOI: https://doi.org/10.22237/jmasm/1414815000
Downloads
Published
How to Cite
Issue
Section
License
Copyright (c) 2026 Muhammad Osama

This work is licensed under a Creative Commons Attribution 4.0 International License.
- Abstract 65
- PDF 94

