Suggestions for Using Stata (Windows Version)
at Notre Dame

Richard Williams, Department of Sociology

Special thanks to Paul Bern, who showed me how Princeton handles similar issues; and to Nicholas Cox and Alan Riley for several other helpful suggestions.  Please email me if you have any problems with these instructions or suggestions for making them clearer. This page assumes basic knowledge of Stata, the Windows operating system, and of how networking works at Notre Dame.

Using Stata in the Campus Clusters

A nice feature of Stata is that you can download and install several useful user-written programs that enhance Stata's capabilities.  You can even write your own programs.  Unfortunately, if you install programs on a shared campus cluster machine, you will likely find that (a) the programs are only installed on that machine, and (b) 24 hours later, they won't be there, either.  This is because most users do not have permission to permanently write to the C: drive of the cluster machine they are using, and by default Stata stores downloaded  files in C:\ado\plus.

To get around this, you need to tell Stata to use locations you can write to.

Google Drive

Notre Dame switched to Google Drive a few years ago. So, I created a file called gprofile.do and store it in the My Drives folder. It assumes that Google Drive uses G:. If that isn't the case you need to modify the program. I just execute gprofile.do to start Stata and hopefully all is well.

* Use this when you want to use Google Drive

noisily display ""
noisily display "Date & Time: $S_DATE $S_TIME"
noisily display ""

* These commands personalize your Stata directories.
* You need to create these directories first.
* You need to modify this program if G: is not
* the right drive letter for you.
local drive "G:\My Drive"

sysdir set OLDPLACE "`drive'\ado"
sysdir set PERSONAL "`drive'\ado\personal"
sysdir set PLUS "`drive'\ado\plus"

* Anything after this is optional.
* You can add other startup commands below.
* The capture commands will prevent errors in case
* you have already been working with Stata
capture log close _all
capture cmdlog close
capture log using "`drive'\statalogs\mylog.txt", replace text
capture cmdlog using "`drive'\statalogs\mycmd.txt", replace
capture adopath + "`drive'\statafiles"
noisily adopath

 

Network/ USB drive

This was the old way to do it at Notre Dame. It may still work at other locations. Also you could use a USB flash drive that you carried around with you. Again, you have to make sure you have the right drive letters, which can be a nuisance if the drive letters are not always the same.

(1)  To do that, copy the following file

mystata.do

and place it in the root directory of N:, i.e. N:\ (Or, if you prefer, you can use H: or any other network drive you have read/write access to.)  NOTE: Don't just click on the file name, or Stata may try to execute it.  Instead, do right-click and copy.

(2) Also, create the directories N:\ado, N:\ado\personal, N:\ado\plus, and N:\statalogs

(3) Then, every time you start Stata, make your first command

run N:\mystata

Everything you download will then go to N:\ado\plus .  (Click here if you want an explanation of how mystata.do works.)

Alternatives.  For those of you fortunate enough to have options besides working in the clusters, click here for Suggestions on Using Stata With Your Own Campus Machine.  Instructors, if you'd rather not have students download programs or else have special programs you want your class to have access to, here are Instructions for Setting Up a Shared Course Site.

Downloading and Installing Programs

There are literally hundreds of user-written routines that you can download and install on your machine.  However, you should be careful: the authors may or may not have done careful testing of their programs, and I have found routines that have errors in them. To find a particular routine, from within Stata type

findit progname

where progname is the name of of the program you are looking for.  Also, you don't even need to know the name of the program; you could do something like

findit multicollinearity

and Stata would give you a list of various help files, FAQs and programs that feature the keyword or keywords you have specified.  Most programs include a .hlp file that you can view before deciding to download. Once you have found what you want, there is an easy to use install command that will download the program onto your machine.

Suggested Downloads

Click here to get a list of some of the programs that I personally like and often use in my classes or research.  My handouts often assume/require that these routines be installed.  I will no doubt add to this list from time to time.