The library offers a range of helpful services. All of our appointments are free of charge and confidential.
The Stata interface provides a spreadsheet-like data editor window for creating and editing data files. It automatically opens when you start a session. Within the Stata interface window, there are five windows: Command, Results, History, Properties, and Variables. The Command window (bottom middle) is where commands are typed, which are then shown in the Results window (centre screen) above. Commands are then added to a list in the History window (left side) to keep track of your work. The window labelled Variables (top right) lists on the variables recognized from your dataset. Finally, the Properties window (bottom right) displays the particular properties of the dataset and variables, such as the name of the variable, the data type, et cetera.

While Stata can be command-driven by typing code in the Command window, it can also be used in a point-and-click manner using the tabs and buttons at the top left of the screen. There are several useful buttons to be aware of, including: Log, New Do-file Editor, and Data Editor.
The “Log” icon (the blue book) begins a Log-file to track and save the output from the Results window. This ensures replicability of the statistics being done during a Stata session.

The “New Do-file Editor” icon (the paper and pencil) opens the Do-file window, allowing you to type and save the commands in a more replicable format. This combines both the “Commands” tab and the “Log” file. Note that the output of the commands written in the Do-file will still be displayed on the original Stata Results window.

The “Data Editor” icons (the spreadsheets) display the data, and have two versions: the Data Editor (Edit) icon (spreadsheet with a pencil) opens an editable spreadsheet of your data, while the Data Editor (Browse) icon (spreadsheet with a magnifying glass) opens a non-editable spreadsheet of your data. The Variables tab (right side) provides a description of what is in the selected column. Columns often represent individual variables, and can include numbers or characters (text). Rows often represent individual cases / observations / samples.

You can enter data directly into the data editor window in the Data Editor (edit) window. You can enter data in any order.
In addition to files saved in Stata format, you can open a spreadsheet (Excel), Database (Access, dBASE), tab‐delimited file, and other types of ASCII text files without converting the files to an intermediate format.
To compute variables in Stata, use the “generate” or “gen” command (PDF) followed by a new variable name, and some arithmetic expression. This computes values based on numeric transformations of other variables. For example, the “gen” command can be used to:

This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.