- RUN ENTIRE STATA 12 DO FILE AT ONCE HOW TO
- RUN ENTIRE STATA 12 DO FILE AT ONCE CODE
- RUN ENTIRE STATA 12 DO FILE AT ONCE WINDOWS
In Linux or MacOS, " ~" is short for your home directory. This means "go up one level, from c:\users\bbadger\dissertation\dofiles to c:\users\bbadger\dissertation, then go down into the data folder to find the rawdata.dta file."Ī single period, ". " means "go up one level." If the working directory were c:\users\bbadger\dissertation\dofiles then the path to the data file would be: Of course this wouldn't work if the working directory were c:\users\bbadger\ instead. If the working directory is c:\users\bbadger\dissertation, the relative path to the same file is: users/bbadger/dissertation/data/rawdata.dtaĪ relative path starts with just the name of a folder, which is assumed to be a subfolder of the working directory. For example:Ĭ:\users\bbadger\dissertation\data\rawdata.dtaĪn absolute path in Linux or MacOS starts with a forward slash, representing the root directory, and puts a forward slash between each folder:
RUN ENTIRE STATA 12 DO FILE AT ONCE WINDOWS
In Windows an absolute path typically starts with a drive letter followed by a colon, and then puts a backslash between each folder. An absolute path starts at the root and lists all the folders and subfolders needed to get from there to the location of the file or folder. In Windows, if you start Stata by double-clicking on a Stata file, the working directory will be set to the location of that file, making this easiest way to get to work in Stata.Ī path specifies the location of a file or folder.
Where path should be replaced by the path to the folder you want to make the new working directory. You can change the working directory with the cd (change directory) command: If you save a file without specifying a location, Stata will put it in the working directory. If you try to load a file without specifying its location, Stata will look for it in the working directory. Think of it as your current location in the file system hierarchy. Stata keeps track of a working directory, which is shown in the lower left corner of the Stata window. In Linux or on a Mac, it's just called the root directory. In Windows the root of the tree is usually a drive letter, like C: or U. But research projects with their many interdependent files require that you pay attention to where the files are located and how they're organized.Ī file system consists of folders (also known as directories) that can contain files and/or other folders, all organized in a hierarchy or "tree." A folder that is contained in another folder is also called a subfolder. You may never have given file systems much thought-most applications these days try to keep you from having to. Most data sets you'll work with will be files that are stored in a file system.
RUN ENTIRE STATA 12 DO FILE AT ONCE HOW TO
In this section we'll discuss how to get data sets into Stata. Other users who have found the question cross-posted are encouraged to share the links as a reply as well.This is part two of Data Wrangling in Stata. If you've asked a question, let people know where else you asked the question and what your solution(s) were! When you post a question on another platform, include those links in your questions or as a reply (if it's Discord, just mention it).See the sticked "READ ME: How to best ask for help in /r/Stata" post on how to comment here if all else fails. Make sure to include the word "Stata" in your search query. Perform a web search for your question prior to posting here. Stata's online community has been active for many years and many questions and solutions are documented on StataList, which are highly indexed on contemporary search engines (e.g., Google). Stata has extensive and complete documentation you can read before posting here (and you can type help followed by the command name in console to see it, e.g. This is not a place to find Stata tutoring. Do not request that the /r/Stata community do your homework for you. Assume good faith questions and comments. Be nice when posting or commenting to a post.
RUN ENTIRE STATA 12 DO FILE AT ONCE CODE