| sysdir | Details State program directory | ||
| pwd | current working directory | ||
| cd | change current directory | Lesson 1 | File System |
| mkdir | create a new file in working folder | Lesson 1 | File System |
| dir [*.xxx] | list files in working folder | Lesson 1 | File System |
| erase yyy.xxx | deletes "yyy.xxx" | Lesson 1 | File System |
| copy old.xxx new.xxx | Copies file | Lesson 1 | File System |
| type yyy.xxx | displays contents of yyy.xxx | Lesson 1 | File System |
| use yyy.xxx[, clear] | opens dataset | Lesson 1 | File System |
| save yyy.xxx[, replace] | saves file | Lesson 1 | File System |
| describe | provides details of dataset | Lesson 1 | Data |
| list | lists data | Lesson 1 | Data |
| summarize [var] | basic summary statistics | Lesson 1 | Data |
| sort var | sorts by var | Lesson 1 | Data |
| drop var | discards var | Lesson 1 | Data |
| generate var = exp | generates new variable according to exp | Lesson 1 | Data |
| note: "text" [TS] | add note to dataset [timestamp] | Lesson 1 | Data |
| notes | show notes | Lesson 1 | Data |
| note drop _dta in range | erase notes | Lesson 1 | Data |
| log using yyy[,append|replace] | start [append/replace] a log | Lesson 1 | Data |
| compress | redefines variables to minimize memory taken | Lesson 2.1.1 | |
| set mem xM | changes memory allocated to stata where x is a number | Lesson 2.1.1 | |
| describe [varlist] | gives type, format, labels | Lesson 2.1.1 | |
| codebook [varlist] | type, # unique, # missing, warnings | Lesson 2.1.1 | |
| label define varlabel x "description" | defines the entries of
varlabel (for example, if varlabel were gender: label define gender 0 "female" 1 "male" | Lesson 2.1.2 | |
| label values var [varlabel] | associates the descriptions with the
variable or erases varlabels if varlabel excluded. | Lesson 2.1.2 | |
| [, nolabel] | option to ignore special labels (used with tabulate, list) | Lesson 2.1.2 | |
| ??set type %#.#x | formats variables | Lesson 2.1.3 | |
| format varlist %#.#x | formats variables | Lesson 2.1.3 | |
| label data [datalabel] | labels entire dataset [or clears label] | Lesson 2.1.4 | |
| browse | alternative to list | Lesson 2.3 | |
| count [if exp] [in range] | counts observations | Lesson 2.3 | |
| inspect | Lesson 2.3 | ||
| table | Lesson 2.3 | ||
| tabulate | Lesson 2.3 | ||
| by varlist: cmd | performs the command separately for each group within varlist | Lesson 2.3 | |
| generate [type] newvar = exp | creates a new variable according to expression where type is the data type | Lesson 2.4 | Data Manipulation |
| replace oldvar = exp [if
exp] [in range] | just like generate but replaces old data | Lesson 2.4 | Data Manipulation |
| egen | Lesson 2.4 | Data Manipulation | |
| word(s, n) | Retrieves a word from a string. s = string to parse, n = which word to retrieve. word("Happy Birthday",2) = "Birthday" | Lesson 2.4 | Data Manipulation |
| group(var) | for a string variable assigns each unique entry an index | Lesson 2.5 | |
| egen var | like generate, but with special powers | Lesson 2.5 | |
| encode oldvar, gen(newvar) | Lesson 2.5 | ||
| sum(var) | cumululative sum of variable data | Lesson 2.5 | |
| _n | number of observation (ie, 3rd observation in a group) | Lesson 2.5 | |
| _N | total number of observations in a group | Lesson 2.5 |
| infile varlist using filename | inputs variables in varlist from filename | Lesson 3.1 | |
| infile using filename | inputs variables according to dictionary named filename | Lesson 3.1 | |
| outsheet [varlist] using filename if exp in range | saves variables into format (tab-delimited by default) | Lesson 3.1 | |
| insheet using filename | Lesson 3.1 | ||
| duplicates [op] varlist | will find (and more) duplicates in a variable | Lesson 4.2.1 | |
| reshape | converts table between wide and long forms | Lesson 4.4 |
| ® reshape long inc, i(SSN) j(income) reshape wide income, i(SSN) j(inc) ¬ |
|