Tag Archives: Stata

Keyboard shortcuts for Stata/IC 13

Here is a consolidated list of keyboard shortcut commands for Stata, as well as some directions on how to form custom macro strings. I have formed this list from various Stata help files as well as my own trial and error:

Tab: completes a variable’s name in the command line sequence, as far as ambiguity allows (if there are similarly named variables)
Esc: clears the command sequence

Move cursor to various panes:
Ctrl+Tab: reverse cycles through the various panes
Ctrl+Shift+Tab: forward cycles through the various panes
Ctrl + 1: command pane
Ctrl + 2: output pane
Ctrl + 3: review log
Ctrl + 4: variable pane (also: pressing space bar whilst a variable is selected in the variable pane inserts this variable into the command line sequence)
Ctrl + 5: properties pane
Ctrl + 7: viewer window
Ctrl + 8: data window

Function keys:

F1: enters the command ‘help advice’
F2: enters the command ‘describe’
F3: opens up a ‘find’ tab in the output pane to search for specific text
F7: inserts the command ‘save’ into the command sequence
F8: inserts the command ‘use’ into the command sequence

Alt+F4: quits the program (I think this maybe a general windows command)

Customise function keys
Entering a command sequence of global F[number]commands assigns a function key to a command sequence such as “list;” (leave out the square brackets), with the semi-colon indicating entry of a command. This is a special form of global macro – see below.

Custom macros
Entering a command sequence of global [macro][commands] saves a sequence of words which you can later recall by prefix-ing the macro with $, that is $[macro]. You can get quite fancy with this it seems, so if interested read more in the pdf file “Programming Stata”: http://www.stata.com/manuals13/u18.pdf


Coming from a background of using design software where shortcut usage is common, I find it surprising a command heavy program such as Stata doesn’t make keyboard shortcut information more readily accessible. Ideally, shortcut commands would be displayed when hovering a cursor over a menu command or displayed next to the command. Entry of these commands via shortcuts would still be recorded in the command log, so from a workflow perspective I can’t understand why this hasn’t been implemented in a mature program which many people use.