![set more off stata set more off stata](https://wlm.userweb.mwn.de/Stata/grafik/Stata-Do-File_2.png)
![set more off stata set more off stata](https://static.docsity.com/documents_first_pages/2009/08/20/e63e03dffbcafd1313432a0e2f9ddf52.png)
‘data1.dta’ can simply be loaded by: use “data1.dta”, clear We don’t have to specify this entire path when we import or merge data sets anymore. This command changes our working directory to the folder ‘Project1’. To change the working directory, we first specify the cdcommand before importing any dataset: cd “E:\\Stata\Project1\” Changing the working directory of the Stata file we are working on.There are two ways to use relative paths: To get around this issue, we use relative paths that allow such command to run on any computer. The above commands will not run on their computer.
![set more off stata set more off stata](https://d20ohkaloyme4g.cloudfront.net/img/document_thumbnails/6e58a5da5ce142f768b2cfbf320f94e4/thumb_1200_1553.png)
For example, your co-author may not have the datasets saved in a folder called ‘Project1’ like you. If you share this do file with another co-author, or you decide to run it yourself on a different computer system, chances are these datasets will not be saved in the exact path you specified initially.
#Set more off stata code
The above code specifies the entire directory where datasets ‘data1.dta’ and ‘data2.dta’ are stored. For example: use “E:\\Stata\Project1\data1.dta”, clear merge 1:1 symbol using “E:\\Stata\Project1\example\data2.dta” Absolute paths are those paths that give the exact location of a file. To understand relative paths, let’s first understand absolute paths. Also add a date and author name if it is to be used by multiple people. Specify a project title, its description and all the datasets used in the file. Add a HeaderĪlways add a header to your do file to indicate what the do file’s purpose is. A versioncommand written at the start of the do file will make the execution of any code smooth regardless of which new Stata version you are running it on. This is especially a good idea in hindsight because you may want to execute an older do file months (or years) later with a new version of Stata but you may not remember which version of Stata you wrote that command in. Your commands will then be executed as they would have been in the older version of Stata. If you want to use a command from an older version, the version command will let you use it in a newer version. Some commands (or their syntax) are specific to older versions of Stata and are not supported by newer versions. If you wish for this to be version 13 of Stata, simply type: version 13 This lets Stata know which version it should base its interpretation of your command on.
#Set more off stata download
Download Do File The do file should always start with the version command