Stats, Coding and AI
My journey with statistics has been rough, not going to lie. My undergrad university did not prepare me. I took an entry level course that told me the difference between types of bias and I had a cheat sheet of equations. I don’t think I learned what an ANOVA or t-test was, or at least I couldn’t remember it by the time it become relevant. So, for my first publication and I needed to understand the statistics and what it was telling me about my data, I felt thrown into the deep end.
I quickly found out that statistics and RStudio went hand in hand for biological science. Therefore, I needed to learn both statistics and Rsudio, simultaneously. I think this a pretty universal experience for budding scientists.
I’ll start with RStudio. Learning R is learning another language, literally. Just as in many Asian cultures, the pitch and tone of how you pronounce a syllable completely changes the meaning, so too in coding. But instead of vocal sounds, it’s capitalisation, it’s parentheses vs brackets, front vs forward slash. There are grammatical rules and syntax. Understanding this takes time and practice. However, just like spoken languages, once you learn one, the next isn’t as difficult.
Starting out, I recommend ensuring you understand these rules. Don’t try and memorise the name of functions or packages. Understand how to name a variable, how to create a dataset, what’s the difference between numerical and categorical, how a factor relates to a level. Understanding the structure of the language will make it much easier when you come to your seventeenth error on the same script.
The second bit of advice is make sure you understand error messages. When I started out I went to git hub, stack overflow, reddit. I copy and pasted the error codes and understood each red line. And then along came Claude, ChatGPT, copilot, pick your poison. The ethics behind AI and its use is numerous, and probably needs its own blog post. But for the sack of conciseness, I am going to keep this post focused. For me, I use AI the most for coding. I have been able to write much more complex code and adapt to different programming languages because of AI. The caveat is that you need to understand the language your working in and have explicit asks. Double check every variable, matrix, dataset created if you use AI generated code, make sure it is doing what you want it to do.
For stats, I read, a lot. I also took a class about how to inspect data. The visualisations can tell you a lot about what tests are most appropriate. I read about the tests, trying to (and failing) to understand the math behind it. The most frustrating part I found was the lack of a concrete answer. With AI, I get more clarity on what tests would be most appropriate. If, AND ONLY IF, I have a good understanding of my data (distributions, data type, independence) then I can tease out with AI which tests would be most appropriate. It helps when transformations are needed. A warning sign is if it starts suggesting things I have never heard of. To me, this flags I might be test hunting. This is basically searching for a test that will give you the result you want (i.e a significant result). Keeping it simple is always the best approach, and most defensible one in science. However, the best resource I have is for stats is still a good ole fashioned dichotomist key : https://www.amazon.com.au/Choosing-Using-Statistics-Biologists-Guide/dp/1405198397
To me, I still don’t feel comfortable with stats and always feel out of my depth (but I have found a love for coding?). AI has helped me better understand the concepts behind statistics by explaining in a more approachable way. However, having enough foundational understanding prior to turning to AI ensures I a.) know what I need clarity on and b.) if it appropriate for my data



Comments