inspect displays information about the values of variables and is useful for checking data accuracy.Ħ. When you are done click the "close box" for the "Data Editor" window.ĥ. Double click on the column head and you can change the name of the variables. You can also get to the "Data Editor" from the pull-down "Window" menu or by clicking on the "Data Editor" icon on the tool bar.Įnter values and press return. edit command opens up a spreadsheet like window in which you can enter and change data. describe displays a summary of a Stata dataset, describing the variables and other information.Ĥ. We need to do this before we can create or read a new dataset.ģ. clear command clears out the dataset that is currently in memory. codebook displays information about variables' names, labels and values.Ģ. Load data/raw/cepii/dist_ Stata Commands Stata Computer Module Useful Stata Commands by Janet Cadizġ. This command also gives you the minimum and maximum values. inspect distw shows that distw is missing in 2,215 cases.summarize distw shows that the distance varies between 0.91.39 kilometers.This command also shows that the variable is double, not integer. describe distw gives you the variable label “weighted distance (pop-wt, km)”.In how many cases is this variable missing?.
![stata commands stata commands](https://www.ssc.wisc.edu/sscc/pubs/intro_stata/stata_gui.png)
![stata commands stata commands](https://www.stata.com/why-use-stata/i/markdown_example4_browser_dofile_combo.png)
This is the first thing to do after loading a new Stata dataset.Ĭontains data from /stata-economics/data/raw/cepii/dist_cepii.dta This would look for dist_cepii.dta in the directory /home/user, one level up from the current working directory, /home/user/stata-economics.
![stata commands stata commands](https://www.stata.com/support/finding-resources/i/net_sj_software.png)
STATA COMMANDS MAC
This will work on Windows, but not on Linux and Mac machines. This is an absolute path because it starts with /, but it is not the correct absolute path for /home/user/stata-economics/data/raw/cepii/dist_cepii.dta.
![stata commands stata commands](https://www.stata.com/support/finding-resources/i/ahelpnet_mnu.png)
STATA COMMANDS CODE
Note, however, that your code may not run on someone else’s computer where the absolute path is different. It is good practice to put the filename inside double quotes to guard against problems caused by spaces and other special characters in filenames. You can always use the absolute path of a datafile you want to load. use "/home/user/stata-economics/data/raw/cepii/dist_cepii.dta".If your current working directory is /home/user/stata-economics, which of the following can you use to load the data in /home/user/stata-economics/data/raw/cepii/dist_cepii.dta? Use "/Users/koren/Dropbox/teaching/courses/2019/carpentries/stata-economics/data/raw/cepii/dist_cepii.dta"