Tuesday, June 16, 2009

Researchers Should Learn How To Program

Throughout most of my first year in medical school, and by most I mean the entire time, my background in engineering was useless. Sure, I could figure out how to plot the inverse of a graph without breaking a sweat, but surprisingly, that isn't an important skill to have as a doctor...doesn't really help with picking up the ladies either, seriously, Dr. Madden is a liar!

Anyways, this summer I'm doing research and I've finally been able to take advantage of my background in electrical engineering. I've found my experience in programming to be priceless. In our lab we collect our data in excel spreadsheets and then analyze them. Excel, and most other Microsoft Office products, have a scripting language called VBA. VBA is an easy language to learn, particularly if you have programmed or scripted in another language before. Using VBA, I am able to automate data analysis. For example, instead of having to calculate the mean of a column, I can write a script that will do it for me. Not that impressive when you look at a simple example like that, but you can imagine that if you have ten thousand columns per spreadsheet and you have 500 spreadsheets, then it would be nice to be able to write a ten line script just once to be able to calculate all the column means you need.

Anyways, being able to automate the analyses of the excel data has been incredibly valuable. I spent maybe a day writing scripts, but I will save at least two weeks in the end because the scripts will take me about two minutes to analyze the data collected from each patient.

Automating analyses can be a huge time saver. The time you invest in learning how to script will payoff in the end, especially if you find that you can reuse parts of your scripts in multiple studies (which is often the case).

No comments: