COMM 205 Study Guide - Final Guide: Stata
Document Summary
Structure: command varname(s) [if varname == value] [, options] // don"t actually include. Tabulate and summarize together tab [categorical variable], sum([numerical variable]) Generate(gen): gen [type] newvar = (expression | value) [if] . Gsort(gsort): gsort [+|-] varname [ [+|-] varname ] Egen(egen): egen newvar = func(arguments) [if] [, options] Egen with if: egen newvar = func(arguments) if [conditionals] Bysort and egen: bysort keyvar: egen newvar = func(existingvar) Tostring(tostring): tostring varlist, generate(newvarlist) || tostring varlist, replace. Destring(destring): destring varlist, generate(newvarlist) || destring varlist, replace. Ex sum cash if (loc== usa | loc== can ) & year==2012, detail. Missing numbers stored as a period . is greater than the greatest value for that var.