Stata Commands Flashcards
cd
set current directory (or “folder”) - this is where Stata looks for or saves data
use
brings data into memory
list
for looking at raw data - list displays the values of variables
tabulate (tab)
produces different tables, depending on options
summarize (sum)
calculates and returns a variety of univariate statistics (detail is important option with this cmd)
tabstat
easy way to calculate statistics (esp measures of variability and central tendency) using Stata. Use statistics option.
capture
allows cmds that follow to run despite presence of errors
sort
Sort arranges the observations of a data set in ascending order based on the values of variables specified in the
varlist
generate (gen)
used to create a new variable that will eventually be recoded
replace
used along with gen in the recoding process, replaces the contents of an existing variable
recode
changes the values of variables according to user-specified rules
hist
creates a histogram
bysort:
stratifies the output of various cmds into subgroups and sorts on the stratifying variable (e.g. bysort sex: sum tvhours)
graph box
used to create a box plot
graph export
saves graph just created