the right tools for the job
Kieran
A discussion about Mac applications at Scatterplot (which is threatening to spill over into a Windows vs OS X war) reminded me of something. Although not by any means a quant jock, a good deal of my work involves analyzing quantitative data. Almost since I learned how to do that kind of thing at all, I have used software tools designed to make the process easier and less error-prone.
The most basic of these is a proper programmer’s text editor with support for whatever statistical software I’m using. One of the simplest things that an editor of this kind can do is highlight the syntax of your code in a way that makes it more readable. Typically they will also passively signal to you when you’ve done something wrong (like forget a closing brace or semicolon or quotation mark), automagically indent your code in an intelligent way, and perhaps also allow you to “fold up” chunks of code (such as long functions) if you don’t want to see them. Beyond that, many editors integrate well with your statistics software, allowing you to send bits of code or whole files to the stats package for execution, and subsequently see the results, without leaving the editor or putting your hand on the mouse to tediously cut and paste stuff over. It’s all about reducing errors and improving flow. Here’s a screenshot of an R file in TextMate, for instance.
Until recently I took it for granted that the many people much more knowledgeable than me about statistics were all well aware of this kind of thing. But then a quant-jock colleague dropped by one day and asked me what the hell all the colored text was on my screen. Astonishingly, he had always edited his (extensive, voluminous, complex, vertiginous) Stata code in Notepad. Notepad! He was unaware of the very concept of a professional text editor. So, I helped him install WinEdt on his PC and set up a few simple bits and pieces to mark up his code and send it seamlessly to Stata.
He came back a few days later with the air of someone who has just had a religious experience. And he said unto me, “You have changed my life, man.” Subsequently, the Good News spread to some other friends who had previously been living in the Uttermost Monochromatic Darkness and the effects upon them were similarly revelatory. Further conversions followed.
As you might expect, there’s path-dependence here. It seems that a number of (very good!) sociology programs that teach their students excellent quantitative skills nevertheless leave this component out of the mix altogether, presumably because the teachers themselves never got into using these tools. This led to my friend thinking maybe he would email his eminent former teacher and tell him that it was — quel horreur — some Princeton culture guy who had turned him on to the path of righteousness.
Meanwhile, it dawned on me shortly afterward that I had just given away my sole comparative advantage to a bunch of people who really have no need whatsoever to be made more productive than they already are. But the cat’s out of the bag now.

Fabio [hearts] vi (and emacs).
Call me a neanderthal, but vi friggin’ rulz.
fabiorojas
December 13, 2007 at 6:37 pm
My life is now changed too. Thanks for the tip Kieran.
brayden
December 13, 2007 at 6:39 pm
I’ve known about program editors for a long time because my spouse is a programmer, but I have only gotten far enough to use TextPad, which at least has a color-coded syntax file for Stata. I have learned to write some pretty good code in Stata, with substantial coaching from a couple of former students.
olderwoman
December 13, 2007 at 7:50 pm
jEdit. jEdit changed my life forever. I wrote pretty complex stata code to handle cross country demographic analyses from a database of the demographic and health surveys and…well. You can split the screen! And have multiple dofiles open! And having a way to check brackets saved many a macro mess. Seriously, jEdit people. It was a religious experience. Although, full disclosure, I am a huge. quant. geek.
geographer
December 13, 2007 at 9:36 pm
For Windows users, I find Notepad++ extremely useful.
One of the advantages of Notepad++ for Stata users (though it is not the only editor that allows this functionality) is the ability to run Stata directly from within Notepad by simply selecting text and running it in Stata (like Stata’s dofile editor except it has syntax highlighting and the ability to undo/redo). It took a while to set up, but if you follow the instructions here and , it works great.
mike3550
December 13, 2007 at 11:42 pm
That’s a pretty tall screenshot. Must be a nice great big screen you’ve got there.
Fabio, I think you misspelled “TextMate” when you wrote “vi” and “emacs.”
alan
December 14, 2007 at 12:42 am
On my webpage I have Stata color highlighting for UltraEdit. I’ve thought about migrating to Notepad++
jeremy
December 14, 2007 at 5:54 am
I had my conversion experience in my fourth year of grad school. That’s when I truly understood all of the economics talk about “increases in productivity due to more efficient use of the factors of production.”
I went with the Stata + Textpad combo. Like Mike, I used Friedrich Huebler’s instructions to seamlessly integrate (through the Autoit macro scripting program) Textpad and Stata, so that I can push a button from within Textpad (or execute a keyboard shortcut) and run a Stata command or a chunk of a do file. J. Scott Long has the syntax highlighting file for Stata 8 commands in Textpad so that you can add some color to your life.
Omar
December 14, 2007 at 5:58 pm
Thanks for this very useful tip! I have used such editors elsewhere but never thought of using them for Stata.
Sai
December 19, 2007 at 3:44 am
[...] on from our discussion of editing tools the other day, and in response to a couple of requests, I have updated and somewhat expanded my [...]
workflow update « orgtheory.net
December 21, 2007 at 9:13 pm
[...] on from our discussion of editing tools the other day, and in response to a couple of requests, I have updated and somewhat expanded my [...]
Kieran Healy’s Weblog » Blog Archive » Workflow Update
December 21, 2007 at 9:14 pm