Coding Chronicles: My experience learning how to code

I have been at the Office for National Statistics (ONS) for four years now, working in the Methodology and Quality Directorate (MQD). My early years at ONS were primarily spent conducting qualitative research. So, when I moved to the Methodological Research Hub in MQD and got the opportunity to work on quantitative projects that used the R programming language to conduct analyses, I was understandably very nervous!
My experience of quantitative methods was limited to assignments from my undergraduate degree in Psychology, all of which used SPSS or Excel – so I had no experience of writing code for analysis using programming languages like R. Also, I now found myself comfortable in the qualitative research space, as someone who enjoys talking to people, so conducting qualitative interviews was easy and enjoyable for me.
Learning R Programming
Being able to conduct quantitative research in ONS was a skill I wanted to learn. I started with a self-taught introductory R course, where I learned the basics of coding in R. I was pleasantly surprised with the simplicity of R, as my previous perceptions of coding were that it was quite complex! It wasn’t all plain sailing, and I encountered a few challenges along the way. But six months after starting to learn how to code, with the support from my colleagues along the way, I found myself quite confident in performing quantitative methods using R.
Applying New Skills to Projects
With this growing confidence, I’ve been able to use these skills for some exciting projects. One project was applying latent class modelling (LCM) techniques to estimate classification error in administrative datasets containing categorical data. Specifically, LCM tells us the extent to which units (for example, people) in a dataset are assigned to the correct variable class when taking in all the available information (multiple admin datasets). For example, if looking at housing, outputs tell us how many people were classified as ‘renting’ in the dataset and were also classified as ‘renting’ by the model. We are now continuing with LCM techniques, focusing on Multiple Imputation Latent Classification (MILC) modelling to look at characteristics data.
Overcoming Challenges
My experience with coding in these projects reminds me of what I was told when I passed my driving exam: “You really learn how to drive after you’ve passed your test”. After completing the introductory R course, I had the tools and knowledge to comfortably code to an extent, but when it came to applying this knowledge to real-world data, I encountered various new issues, which were not included in the course. I was able to negotiate these issues, which has solidified my knowledge base, but it is easy to get overwhelmed sometimes. It’s easy to get disheartened too, as it is very rare that your code works first time, often for reasons that you initially don’t understand. My learning involved a lot of frantic calls and troubleshooting sessions with my colleagues, to see if they had experienced any of these errors before and how to solve them. I was, and still am very lucky to have the support system I do in the team I work in. They have been patient with me as I learned this new skill, but also have been active in supporting my development, by giving me the opportunity to implement what I have learned in projects.
The Importance of Support and Persistence
Overall, having a great support system to help with my learning helped make this experience a positive one. It was also important to accept that failure is normal when it comes to coding and is all part of the process. Finally, it helps to seek out opportunities where you can implement what you’ve learnt in an actual project, it’s where you actually learn!
Looking Ahead
While I do miss working on qualitative research, I am surprised by how much I have enjoyed working on these quantitative projects and using R and am now keen to learn more programming languages in the future, such as Python.
Get in Touch
If you are interested in any methods mentioned in this blog, please get in touch at methods.research@ons.gov.uk.