What Is Stata and How Does It Work?
Commands, Do-Files, Logs and Editions
What is Stata? It is a statistical package driven by commands: menus and dialogs only compose the command, and the do-file and the log are the record of an analysis. The BE, SE and MP editions run the same commands and differ in capacity and speed.
HOW THE PACKAGE WORKS
What Is Stata, and What Does a Session Leave Behind?
A session is a run of commands on one dataset held in memory, and the files saved from it decide whether anyone can repeat the analysis later.
Stata is a commercial statistical package from StataCorp for data management, analysis and graphics, operated chiefly by typing commands, which its menus and dialogs compose on the user’s behalf. In a research workflow, the short answer to what is Stata is a dataset in memory, a stream of commands acting on it and the files that preserve what was done. It is widely used in economics, epidemiology, public health and political science, often for panel data, survey data and regression-based work. For OnlineSPSS, a specialist statistical consultancy for academic, clinical and professional research, Stata is among the programs in which in-house PhD-level statisticians run an agreed analysis; the research question and the conclusions drawn from it are the researcher’s own.
In This Guide
Commands Are the Real Interface
Every analysis is a command such as summarize or regress, followed by variable names and options, and Stata command syntax keeps that order across nearly all commands. A dialog composes the same command and echoes it in the Results window, so the menus are a way of typing, not a different program.
Tip: After using a dialog, copy the echoed command from the Results or Review window into a do-file. A command seen once is learned more readily than a dialog clicked many times.
Do-Files and Logs Keep the Record
A do-file is a plain-text list of commands that Stata runs in order, and a log file captures the commands and their output as formatted or plain text. Together they let the same analysis be rerun and its printed results compared with a report.
Check: Open the log before the first command and name it after the do-file. A log started midway lacks everything that came before it, including the steps that built the variables.
Datasets Live in Memory
A .dta file stores variables with their labels and value labels, and Stata loads it into memory to work on it, normally one dataset at a time (frames, introduced in Stata 16, can hold several). Edits change the copy in memory until a save overwrites the file.
Watch: Saving over the original .dta closes the way back to the raw data. Save cleaned versions under new names and let the do-file rebuild them from the untouched original.
Editions and Community Commands
The Stata editions BE, SE and MP, so named since Stata 17, run the same commands and differ in how many variables and how large a model they hold and in speed on multiple processor cores. Community-contributed commands, often installed from the SSC archive, extend official Stata.
Tip: Note each community command in a do-file comment and test it once on a small example whose answer you already know. The same check suits any command new to you.
The Version Command and Reruns
Placing version at the top of a do-file asks Stata to interpret the commands as a chosen release did, so older do-files keep running as intended. With the log and the saved data it supports an analysis that others can reproduce.
Check: Report the Stata release and edition in the methods section, and the version of each community command. A rerun on another release can differ in small details of the output.
FREQUENTLY ASKED QUESTIONS
Dialogs, Syntax and Editions in Stata
Two doubts hold many researchers back from Stata: whether the dialogs are enough on their own, and whether a smaller edition gives different numbers.
Can I use Stata without learning command syntax?
For many routine analyses, yes, because the dialogs compose and run the command for you. The echoed command is what makes the work repeatable, so keep it. Data management, loops and repeated analyses soon take less effort to type than to click, and a do-file is the form in which a committee or reviewer can inspect them.
Does the edition I use change my estimates?
No: BE, SE and MP run the same estimation commands, and they differ in the size of dataset they accommodate and in their use of multiple processor cores. Estimates can still differ between releases when an algorithm or a default has changed, a separate matter from the edition, and one that the version command and the saved log let a reader trace.
How do you protect my research data and confidentiality?
Your data and project details are handled confidentially, and project information is not published. Researcher names and institutions are not used publicly without permission. An NDA is available where required and can be arranged before sensitive materials are shared. Read more about confidentiality and data security.
What happens when I request an assessment, and how long does it take?
You share your research question, design and relevant materials, such as the dataset or the output you have, and a statistically trained Research Coordinator reviews the request and responds the same day. The analysis, deliverables, timeline and one fixed project fee are then confirmed before any work begins, so the timeline follows from the agreed scope.
Still have a question? Find more answers in our full FAQ.
NEXT STEP
What Would a Reviewer Find
in Your Stata Folder?
When a supervisor or reviewer asks how a table was produced, the answer is the do-file and the log behind it. The assessment works with a complete set of files as readily as with a few pasted tables.
No Commitment Required
Strictly Confidential
Fixed Project Fee
In-House PhD-Level Statisticians
Same-Day Response
Serving Researchers Since 2014