Getting help in Stata

1. System help

Stata’s help system provides a wealth of information to help you learn and use Stata. To find out which Stata command will perform the statistical or data management task you would like to do, you should generally follow these steps:

  1. Select Help > Search…, choose Search all, and enter the topic or keywords. This search will open a new Viewer window containing information about Stata commands, references to articles in the Stata Journal, links to Frequently Asked Questions (FAQs) on Stata’s website, links to videos on Stata’s YouTube channel, links to selected external websites, and links to community-contributed features.
  2. Read through the results. If you find a useful command, click on the link to the appropriate command name to open its help file.
  3. Read the help file for the command you chose.
  4. If you want more in-depth help, click on the link from the name of the command to the PDF documentation, read it, then come back to Stata.
  5. If the first help file you went to is not what you wanted, either click on the Also see menu and choose a link to related help files or click on the Back button to go back to the previous document and go from there to other help files.
  6. With the help file open, click on the Command window and enter the command, or click on the Dialog button and choose a link to open a dialog for the command.
  7. If, at any time, you want to begin again with a new search, enter the new search terms in the search box of the Viewer window.
  8. If you select Search documentation and FAQs, Stata searches its keyword database for official Stata commands, Stata Journal articles and software, FAQs, and videos. If you select Search net resources, Stata searches for community-contributed commands, whether they are from the Stata Journal or elsewhere.

Let’s illustrate the help system with an example. You will get the most benefit from the example if you work along at your computer.

Suppose that we have been given a dataset about antique cars and that we need to know what it contains. Though we still have a vague notion of having seen something like this while working through the example session in [GSW] 1 Introducing Stata—sample session, we do not remember the proper command.

Start by typing sysuse auto, clear in the Command window to bring the dataset into memory.

Follow the above approach:

  • Select Help > Search
  • Check that the Search all radio button is selected.
  • Type dataset contents into the search box and click on OK or press Enter. Before we press Enter, the window should look like

Stata will now search for “dataset contents” among the Stata commands, the reference manuals, the Stata Journal, the FAQs on Stata’s website, and community-contributed features. Here is the result:

Upon seeing the results of the search, we see two commands that look promising: codebook and describe. Because we are interested in the contents of the dataset, we decide to check out the codebook The [D] means that we could look up the codebook command in the Data Management Reference Manual. The codebook link in (help codebook) means that there is a system help file for the codebook command. This is what we are interested in right now.

  • Click on the codebook Links can take you to a variety of resources, such as help for Stata commands, dialogs, and even webpages. Here the link goes to the help file for the codebook command.

What is displayed is typical for help for a Stata command. Help files for Stata commands contain, from top to bottom, these features:

  • The quick access toolbar with three buttons:
    • The Dialog button shows links to any dialogs associated with the command.
    • The Also see button shows links to related PDF documentation and help files.
    • The Jump to button shows links to other sections within the current help file.
  • The second line of a help file shows a View complete PDF manual entry Clicking on the link will open the complete documentation for the command—in this case, codebook—in your PDF viewer.
  • The command’s syntax, that is, rules for constructing a command that Stata will correctly interpret. The square brackets here indicate that all the arguments to codebook are optional but that if we wanted to specify them, we could use a varlist, an if qualifier, or an in qualifier, along with some options. (Options vary greatly from command to command.) The options are listed directly under the command and are explained in some detail later in the help file. You will learn more about command syntax later.
    • A description of the command. Because “codebook” is the name for big binders containing a hard copy describing each of the elements of a dataset, the description for the codebook command is justifiably terse.
    • The options that can be used with this command. These are explained in much greater detail than in the listing of the possible options after the syntax. Here, for example, we can see that the mv option can look to see if there is a pattern in the missing values—something important for data cleaning and imputation.
    • Examples of command usage. The codebook examples are real examples that step through using the command on a dataset either shipped with Stata or loadable within Stata from the Internet.
    • The information the command stores in the returned results. These results are used primarily by programmers.

For now, either click on Jump to and choose Examples from the drop-down menu or scroll down to the examples. It is worth going through the examples as given in the help file. Here is a screenshot of the top of the examples:

2. Searching help

Search is designed to help you find information about statistics, graphics, data management, and programming features in Stata, either as part of the official release or as community-contributed features. When entering topics for the search, use appropriate terms from statistics, etc. For example, you could enter Mann-Whitney. Multiple topic words are allowed, for example, regression residuals.

When you are using Search, use proper English and proper statistical terminology. If you already know the name of the Stata command and want to go directly to its help file, select Help > Stata command… and type the command name. You can also type the command name in the Search field at the top of the Viewer and press Enter.

Help distinguishes between topics and Stata commands because some names of Stata commands are also general topic names. For example, logistic is a Stata command. If you choose Stata command… and type logistic, you will go right to the help file for the command. But if you choose Search… and type logistic, you will get search results listing the many Stata commands that relate to logistic regression.

Remember that you can search for help from within a Viewer window by typing a command in the command box of the Viewer or by clicking the magnifying glass button to the right of the search box, selecting the scope of your search, typing the search criteria in the search box, and pressing Enter.

3. Help and search commands

As you might expect, the help system is accessible from the Command window. This feature is especially convenient when you need help on a particular Stata command. Here is a short listing of the various commands you can use:

  • Typing help commandname is equivalent to selecting Help > Stata command… and typing The help file for the command appears in a new Viewer window.
  • Typing search topic in the Command window produces the same output as selecting Help > Search…, choosing Search all, and typing The output appears in a new Viewer window.
  • Typing search topic, local in the Command window produces the same output as selecting Help > Search…, choosing Search documentation and FAQs, and typing The output appears in the Results window instead of a Viewer.
  • Typing search topic, net in the Command window produces the same output as selecting Help > Search…, choosing Search net resources, and typing The output appears in the Results window instead of a Viewer.

See [U] 4 Stata’s help and search facilities and [U] 4.8 search: All the details in the User’s Guide for more information about these command-language versions of the help system. The search command, in particular, has a few capabilities (such as author searches) that we have not demonstrated here.

4. The Stata reference manuals and User’s Guide

All the Stata reference manuals come as PDF files and are included with the software. The manuals themselves have many cross-references in the form of clickable links, so you can easily read the documentation in a nonlinear way.

Many of the links in the help files point to the PDF manuals that came with Stata. It is worth clicking on these links to read the extensive information found in the manuals. The Stata help system, though extensive, contains only a fraction of the information found in the manuals.

Most Stata reference manuals are each arranged alphabetically. Each Getting Started with Stata has its own index. A combined index for all other manuals can be found in the Stata Index. This combined index is a good place to start when you are looking for information about a command.

Entries have names like collapse, egen, and summarize, which are generally themselves Stata commands.

Notations such as [R] ci, [R] regress, and [R] ttest in the Search results and help files are references to the Base Reference Manual. You may also see things like [P] PyStata integration, which is a reference to the Programming Reference Manual, and [U] 12 Data, which is a reference to the User’s Guide. For a complete list of manuals and their shorthand notations, see Cross-referencing the documentation, which immediately follows the table of contents in this manual.

For advice on how to use the reference manuals, see [GSW] 18 Learning more about Stata, or see [U] 1.2 The User’s Guide and the Reference manuals.

5. Stata videos

The Stata YouTube channel is an excellent resource for learning about Stata. The brief videos demonstrate many topics using Stata’s graphical user interface. They cover basic topics, such as data management, graphics, summary statistics, and hypothesis testing, and advanced topics, such as multilevel models and structural equation models.

There are also several playlists that provide a series of videos about a topic in sequence. For example, the “Power and sample size calculations” playlist includes videos about how to calculate power, sample size, and effect size for two independent proportions and for paired samples. The “Survival analysis” playlist takes you through the process of setting your data up for survival analysis, conducting basic descriptive analysis of survival data, graphing survival data, and calculating survivor functions and life tables. The “Time series” playlist takes you through the process of setting your data up for time-series analysis, creating time-series graphs, using time-series operators in estimation, and fitting ARMA and ARIMA models. There is even a “Back-to-school video” playlist for students who are using Stata for the first time or want a refresher after summer break.

See https://www.stata.com/links/video-tutorials/ for an up-to-date list of videos organized by topic. The playlists can be accessed directly at https://www.youtube.com/user/statacorp/.

6. The Stata Journal

When searching in Stata, you will often see links to the Stata Journal.

The Stata Journal is a printed and electronic journal, published quarterly, containing articles about statistics, data analysis, teaching methods, and effective use of Stata’s language. The Journal publishes peer-reviewed papers together with shorter notes and comments, regular columns, tips, book reviews, and other material of interest to researchers applying statistics in a variety of disciplines. The Journal is a publication for all Stata users, both novice and experienced, with different levels of expertise in statistics, research design, data management, graphics, reporting of results, and Stata, in particular. See https://www.stata-journal.com for more information.

Associated with each issue of the Stata Journal are the programs and datasets described therein. These programs and datasets are made available for download and installation over the Internet, not only to subscribers but also to all Stata users. See [R] net and [R] sj for more information.

Because the Stata Journal has had several articles about measures of inequality, if you select Help > Search…, choose Search documentation and FAQs, type inequality, and scroll down a bit, you will see some of these references:


SJ-18-3 refers to volume 18, number 3 of the Stata Journal. st0539 refers to the package name; st indicates that this package is in the “statistics” category of the Stata Journal. Listed next is the title of the software package and the authors. The community-contributed commands found within this package are listed next in parentheses, followed by the reference details of the article. Clicking on an SJ link, such as SJ 18(3):692—715, will open a browser and take you to the Stata Journal website, where you can view the abstract of the article and purchase the article. The search listing concludes with a brief description of the community-contributed package.

The Stata Journal website allows all articles older than three years to be downloaded for free. See Downloading community-contributed commands in [GSW] 19 Updating and extending Stata— Internet functionality for more details on how to install community-contributed software. Also see [R] ssc for information on a convenient interface to resources available from the Statistical Software Components (SSC) Archive.

We recommend that all users subscribe to the Stata Journal. See [U] 3.4 The Stata Journal for more information.

Links to other sites where you can freely download programs and datasets for Stata can be found on the Stata website; see https://www.stata.com/links/.

Source: STATA (2021), Getting Started with Stata for Windows, Stata Press Publication.

1 thoughts on “Getting help in Stata

  1. Charles Gillians says:

    hi!,I like your writing very much! percentage we be in contact more approximately your post on AOL? I need an expert in this space to unravel my problem. Maybe that’s you! Looking ahead to see you.

Leave a Reply

Your email address will not be published. Required fields are marked *