Stata console mode

September 24, 2009 at 4:45 am 3 comments

| Gabriel |

I just realized that Stata SE/MP includes the console version of Stata.

Since the Stata GUI adds only about 15 or 16 megs of RAM and a comparably light load to the CPU, it doesn’t really improve the performance that much for most things, but I still thought it was pretty cool in a dorky ASCII art kind of way. The only place where I notice a substantial performance jump is with one do-file that generates hundreds of graphs (and saves them to disk) — not only is console mode much faster but it’s less distracting as graphs aren’t constantly popping up.

To invoke console mode on a mac, go to the terminal and write:


To get the GUI you’d do the same thing but change the last bit to “stataMP” (note the case-sensitivity). Of course both versions can take a do-file as an argument and you can add the path as an alias to ~/.bashrc like this:

echo "alias stataconsole='exec /Applications/Stata/'" >> ~/.bashrc
echo "alias statagui='exec /Applications/Stata/'" >> ~/.bashrc

You could similarly change text editor push scripts to use console, but I think it’s a good idea to use the GUI while you’re still debugging because it’s easier to spot error messages (the GUI has syntax highlighting) and experiment with alternate usage (the GUI menus can be useful for learning syntax).

Entry filed under: Uncategorized. Tags: , .

Shell vs “Shell” so random


  • 1. Fred  |  September 24, 2009 at 9:06 am

    You can likely match the speed boost for your graphs do-file in the GUI by adding the nodraw option to your graph commands–as the name suggests, it suppresses the display of the resulting graph.

  • 2. Executing do-files from text editors « Code and Culture  |  September 28, 2011 at 5:20 am

    […] you could rewrite your text editor’s Stata support to use Stata console, but that’s probably overkill. Like this:LikeBe the first to like this […]

  • 3. Felix  |  March 28, 2013 at 5:33 am

    1) It’s a hell of a lot faster as you can run it in batch mode not drawing to the screen at all. Stata has the bad habit of always writing something on the screen, even when applying ‘quiet’. This slows down larger processes significantly as it can only go as fast as the screen draw.

    2) You don’t need to apply ‘quiet’ which makes the code a lot easier to read.

    3) You can implement it into e.g. Vim Editor via console plugins.

    4) I got stata installed on an external more powerful machine than my notebook. Larger scripts that require several thousand estimations are execute there via remote console. Large time saver. If combined with some neat shell scripts, you can actually receive mails when it is done. Better than a hot running laptop that would take 4 times longer.

    One turn off though: in batch mode I haven’t found a way to turn of the logging, to increase speed further. It currently writes like 15-20MB logs. Pretty useless.

    Having this option is a huge help. I wonder all the time why it isn’t implemented under Windows OS.
    However, nothing ‘dorky’ about it.

The Culture Geeks

%d bloggers like this: