Monday, November 19, 2007

Step 1: Installation and a Working Directory

Let's set some preferences
So you've secured your copy of Stata for Mac OS X. Installation is pretty simple and there isn't a lot to it. You insert the CD and follow the standard procedure with Mac OS X installation packages.

One slight difference from other applications is that rather than installing in ~/Applications, Stata installs in ~Applications/Stata/. Not a lot to say about this. I have occasionally had a problem where I update the executable (more on this in the next installation) and it disappears from the dock temporarily. But otherwise everything works fine.

What you should do next is create a reasonable working directory. I believe Stata starts you out in either /Documents or /Applications/Stata, neither of which is ideal. Here's mine at startup:

Stata at startup


In this installment, we'll:

  1. Create a specific "Stata work" folder, with subfolders for projects

  2. Change the working directory

  3. Change the defaults so the working directory is always "Stata work"


Here's how:

  • If you're a mac user, you probably know how to create a directory. Go to "Documents" in the finder and select "New folder." Like this:

    Finder screenshot


  • There are three ways to change the working directory:

    1. Stata draws heavily from pre-windows command line (DOS and UNIX) structure; if you're comfortable with that, simply use the "cd" command from DOS (meaning "Change Directory") and type in the path. For example:


      cd "/Users/adamjacobs/Documents/Stata work/"







    2. However, most people will be more comfortable, and less error-prone, with the menu. Go to File ➡ Change Working Directory.

      Stata File menu

      * Note: the menubar is dark because I'm using a utility called MenuShade that dims the menubar while you're working. I recommend this for users who want to save their monitors and focus better while writing.

    3. If you prefer keyboard shortcuts, and I often do, the command is


      ⌘⇧J


      I'm not sure why it's J, something like C would make more sense.



    As for changing the defaults to always recognize this working directory, I'll cover that in the next step: Setting up a profile.do file.
  • 1 comment:

    Chinh Nguyen said...

    The reason the keyboard shortcut for Change Working Directory... is command-shift-J is simply because unlike Windows and Unix, the Macintosh has only one menubar so there's a very limited number of keyboard shorcuts available.

    In most applications, similar menu items use similar keyboard shortcuts but with extra keyboard modifiers such as shift and option. For example, command-C is Copy and command-shift-C is Copy Table in Stata. The keyboard shorcut for Filename... is command-J and Change Working Directory... is (sort of) similar so it's keyboard shortcut it command-shift-J. Command-F couldn't be used as a keyboard shortcut for Filename... because it's reserved for Find so a substitute had to be found.