Read a command
In summarize math read write, summarize is the command and the three names select variables from the dataset. In summarize math, detail, the option after the comma asks for more statistics.
A condition such as if math >= 60 selects observations for that command. For example, summarize read if math >= 60 summarizes reading scores among observations that satisfy the condition. by race: summarize math instead produces a separate mathematics summary for each race code.
Use describe to find variable names in the loaded data. A name in an example must match a variable in your dataset before you can use it there.
Load data and run your first commands
Open the example and click Run. It includes a CSV of student scores, so the commands work together without any file uploads or sign-in.
clear
import delimited "data/student_scores.csv"
summarize math read write
by race: summarize math
summarize math, detail
Sample data included. Opens in a new tab; click Run.
The first two lines clear the active tab’s working dataset and load the sample. The next lines produce an overall summary, summaries by race code, and a detailed summary with percentiles. Choose Show data to inspect the rows behind the results.
Run one command at a time
After running the example, enter summarize read, detail in a command entry and press Enter. The reading-score summary uses the dataset already loaded in that tab. Press Shift+Enter when you need a line break within an entry.
The Run button executes all commands in the tab again, including any line that clears or reloads data. Use it when you want to repeat the complete analysis.
For your next task, see creating a variable, calculating row or group summaries, counting categories, or fitting a regression. Each manual lists its syntax and options.
Use your own data and keep the commands
Choose Upload Files in Files to add a dataset. Click a .dta or .csv file to load it automatically in a new analysis tab. Enter describe there to check its variables before adapting the sample commands.
Choose the disk icon labelled Save commands as .do file to save the analysis instructions. Then right-click that file in Files and choose Download to keep a copy. The public example does not sync your changes to GitHub.
If you already have a script, follow the do-file guide to upload it with its data, adjust paths, and run the complete analysis.