Tips for Stata, Latex and other useful resources for applied economists
- #Statatip: always define your Stata version in your do-file with e.g. “version 17” – this can be crucial for replicating results later
- #StataTip: use –set varabbrev off– to only allow full variable names in your Stata code (and no abbreviations)
- #StataTip: use –which name_ado_file– to show from which folder Stata calls the .ado-file
- #StataTip: use inlist(VAR,a,b,c,…,y)==1 to condition on numerical a, b, c, etc. Works also for string variables!
- #Statatip: use inrange(VAR,MIN,MAX)==1 to condition on MIN<=VAR<=MAX
- #StataTip: use missing(VAR)==1 to condition on variable VAR being missing
- #StataTip: variable lists selected by “*” select all variables. To select all but a few (e.g. “year”) write –ds year, not– and get all variables but the one specified (results stored in local `r(varlist)’)