Coding Basics
Emilian R. Vankov, Rob M. Sylvester, Christfried H. Focke · 2024
This chapter provides a primer to version control and programming when carrying out statistical analysis in epilepsy. Keeping in mind that each of these topics is a lifetime of learning in and of itself, introductions are made to version control, an aspect of coding practice employed in industry and increasingly in academia to increase reproducibility and collaboration, and programming in two common software languages employed in applied statistical research, R and Python. We focus primarily on illustrating basic coding principles in R being the preferred software of most statisticians, and provide a brief introduction to object-oriented programming in Python, a language that is also extremely popular, particularly among data scientists, machine learning engineers, and software engineers. Concepts are illustrated using a simulated dataset of interictal epileptiform dischages and electrographic seizure counts from chronic ambulatory electrocorticography acquired from the responsive neurostimulation system (RNS®).