7/12/2023 0 Comments Stata codebook commandcsv file from local directory - use the command import delimitedĮ.g. (iii) To import datasets from local directory - use the command use (ii) To import datasets from STATA Online Example Datasets - use the command webuse sysuse auto.dta, clear -"auto" is one of the example datasets from STATA. (i) To import datasets from STATA Example Datasets - use the command sysuseĮ.g. Then, we are going to use the change directory command cd:Ĭd “/Users/user_name/path” for Mac OS Useful tip: When you are in the command window, you can type cd or pwd to know your current directory. The first step will be to select the directory where we are going to work (i.e., the folder with the dataset and where Stata is going to save the files resulting from our work). We can start by typingĬlear all set more off so we clear our workspace and tell Stata to allow our screen to scroll (otherwise Stata will wait until we hit the button "more" to proceed with computations). Then, we will open the Do‐file editor by clicking the icon at the top of the screen. The set of commands we want Stata to execute can be saved in what Stata calls “do‐files”. DO-FILE: Despite we can type codes directly in the Command window, it is a better idea to write all commands in the same file so be can save and reproduce them in the future. DATA EDITOR:Now let’s look at what a dataset stored in Stata actually looks like (the way Stata sees it and reads it). Useful tip: When you are in the command window, you can scroll through your previous commands using the Page Up and Page Down buttons on your keyboard. You can click on it and it will appear in your command window. Notice that display “Hello!” now appears there. It should appear in the command window, eliminating the need for you to write it out. The variable window can act as a shortcut for creating commands. VARIABLES: lists all the variables in the dataset. Note what appeared as the result of the command you just typed in. Click inside the command window and type display “Hello” RESULTS: Here Stata displays the commands followed by the output that Stata has produced. The Basics: How the stata will look like?Īs you will immediately notice when Stata starts up, there are five windows arranged as follows:ĬOMMAND: You can tell Stata what to do by typing in commands. Important capabilities we find data management, statistical analysis, simulations, graphics, and custom Stata is a general‐purpose statistical package which is broadly used in social sciences. STATA 101 Alosias A, Behavioral Development Lab
0 Comments
Leave a Reply. |