How to set up your computer for Stata
Part of Data & Code. Full guide: Stata setup.
Get Stata
- You will need a Stata license to use it. Your institution may have access, check for that.
- You may ask for a student license, too.
Code language versions
- You will need a Stata version of 13.0 or above. Most code will work with older versions, but we have not checked. We used v.15.1, but all code should work for versions above 13.0.
- We saved data in the Stata 13 version.
Setting up in Stata
- Create a folder structure as described in setting up folders, basically having one directory for the codes (.do files) and one for data.
- The first time you use these codes, you shall use run
ch00-tech-prep/ch00_install_librariesfrom the case study working directory - this will install user written programs we use in the textbook.
How to run case studies in Stata
- Each do file will ask you to set up your working directory before first running. You set it, and save the code, so you’ll only have to do it once.
- Data directories will have be set up as well. There are two options.
- Option 1: run directory-setting do file (RECOMMENDED)
Open our
set-data-directory-example.dochange the the path to where you store your data files in theda_data_repodirectory and save asset-data-directory.do. From now, this will be automatically used in all the .do files. - You can set the data file every time by simply adding the path to the
da_data_repoto the .do files. This is useful if you only use a few files.
- Option 1: run directory-setting do file (RECOMMENDED)
Open our