This lesson is in the early stages of development (Alpha version)

Economics Lesson with Stata: Setup

Install Stata

This lesson uses the statistical package Stata. It has been tested on Stata 15.1 MultiProcessor, but it should work on most recent versions. If you do not have a Stata license, please let your instructor know so that they can request a short-term training license for free.

Windows

Step-by-step installation on Windows:

Linux

Step-by-step installation on Linux:

Mac

Step-by-step installation on Mac:

Add Stata to the path so that stata can be called from the command line

Windows

Add executable folders to Windows 10 system environment variables path:

  1. Open the Start Search, type in “env”, and choose “Edit the system environment variables”.
  2. On the Advanced tab click on the “Environment Variables…” button.
  3. Under the “System Variables” section, find the row with “Path” in the first column, and click edit. The “Edit environment variable” UI will appear.
  4. Here, you can click “New” and type in the new path you want to add. C:\Program Files (x86)\Stata15\
  5. Click OK till you exit from the system properties.

After you did these steps Windows will search for executable(.exe) files in this folder.

Your path could be different if you installed Stata to an other folder. Your Stata version could be different if you have an other edition of Stata. For example you might have a single edition Stata which exe file’s name is: StataSE-64.exe

Install and adjust Git Bash for Windows.

  1. Install Git for Windows (The Bash Shell) by the help of the Carpentries workshop template:

http://carpentries.github.io/workshop-template/

You can also find a video tutorial on this page.

  1. Run the Git Bash program.
  2. Into Bash command line write nano .bashrc.
  3. Inside the empty file write alias stata='StataMP-64.exe'.
  4. Press Ctrl+O then press enter to write out the file. Press Ctrl+X to exit from .bashrc.
  5. You can check with pwd where are you know and where is your .bashrc file located.
  6. When you rerun the Git Bash program and type stata the program will start automatically.

With these steps we created a file where you can adjust your bash settings and also replaced the alias of Stata’s executable.

Mac

If Stata is installed in /Applications/Stata/ the path to the Stata executable is /Applications/Stata/StataSE.app/Contents/MacOS/ for Stata Special Edition and /Applications/Stata/StataMP.app/Contents/MacOS/ for Stata MultiProcessing.

To add StataSE to the path you should open the terminal and type

sudo vi /etc/paths

and add /Applications/Stata/StataSE.app/Contents/MacOS/ to it.

Finally, close the terminal and reopen it. Once everything is set up, type stata in your terminal to launch Stata.

Linux

Download the workshop data

  1. Download the data package from Zenodo.
  2. Create a new directory you are going to use at the workshop. We recommend you to choose stata-economics for working folder name.
  3. Unzip the .zip file into this directory. You should see the files, LICENSE.md and README.md, as well as directories data and doc.