Installing add-ons in Stata

When you are working from, you are not allowed to install packages. Here is a way to work around this.

1. Create a folder e.g. in your Documents-folder on M: called stata

2. Create two folders inside this folder called personal and plus

3. Create a new do-file named, with the following content (paths should lead to the folders you created above):

sysdir set PERSONAL "M:/Documents/stata/personal"
sysdir set PLUS "M:/Documents/stata/plus"
cd "M:/Documents/stata"

4. Place in your Documents-folder (typically in M:\pc\Dokumenter\) and it should run automatically when you launch STATA. You can verify this in the results-window, where upon each launch STATA should report: "running M:\pc\Dokumenter\ ..."

Any addons you install using the net install-command will now be placed in the plus-folder. You should place programs you have written on your own in the personal-folder. When you call a command that Stata does not immediately recognize, it will now look in these folders and run programs (ado-files) from there if they exist.

If does not run automatically, you need to start every session by doing so yourself. (On your own computer, you could place in the same folder as your Stata-program (exe-file) which would ensure autorun.)

Note that you can include in whatever commands you want to run at the beginning of each session. This is rarely useful, however, since you will typically rather make an ado-file for these purposes.

By Tarjei Havnes
Published Jan. 21, 2013 10:29 PM - Last modified Jan. 21, 2015 1:09 PM