Princeton University Library Data and Statistical 
Services

Search DSS





Finding Data Analyzing Data Citing data

About Us


DSS lab consultation schedule
(Monday-Friday)
Sep 1-Nov 3By appt. here
Nov 6-Dec 15Walk-in, 2-5 pm*
Dec 18-Feb 2By appt. here
Feb 5-May 4Walk-in, 1-5 pm*
May 7-May 15Walk-in, 2-5 pm*
May 16-Aug 31By appt. here
For quick questions email data@princeton.edu.
*No appts. necessary during walk-in hrs.
Note: the DSS lab is open as long as Firestone is open, no appointments necessary to use the lab computers for your own analysis.

Follow DssData on Twitter
See DSS on Facebook

Home Online Help Statistical Packages Stata Running Stata on UNIX at Princeton

Stata on UNIX

Stata (X-Windows GUI version) is available on the Nobel server (click here for more info)

STEP 1: Prior registration to the Nobel server is requiered (free) click here

NOTE: For off-campus access you need to connect to the Princeton network using a secure remote access connection

As FYI, Stata is also installed on the Windows machines and Macs in OIT's public clusters.


Mac users:

Step 1 --- OS X 10.5-10.7 not need to install X11, all other versions need to install the X11 app (XQuartz) available through this link. Once installed, run it and proceed to the next step. If you require technical assistance, you can visit the Tech Clinic at 112 Frist Campus Center (M-F, 9-5 pm). For more information contact OIT

Step 2 --- Login into the UNIX Nobel server using the X-terminal from your Mac (Finder->Go->Utilities, double-click on Terminal) and type:

       ssh -X your_netid@nobel.princeton.edu

You will be asked to enter your password (when typing your password you may not see any characters, this is normal, just hit the enter key).

Then type:  xstata &

The Stata GUI should pop-up (it may take a few seconds, see example below)


Windows PC/laptop users

To run Stata from an X-Windows interface, you need the following:

  • An X-Windows server program, OIT recommends to use XMing. Once installed, run it, then proceed to the next step. If you require technical assistance, you can visit the Tech Clinic at 112 Frist Campus Center (M-F, 9-5 pm). For more information contact OIT
  • A connection to the Nobel server using either SSH or PuTTY.
  • Configure SSH or PuTTY to allow X-Windows tunneling, see instructions below.

If using Exceed (as the X-windows program) -> Hummingbird Exceed is available on some computers on campus. To start Exceed, simply click on the "Exceed" icon in the "Hummingbird Connectivity" folder on the start menu. Minimize or ignore the taskbar that pops up.

Once you have an X-Windows server program running, you need to use an SSH program to connect to the machine you will be running Stata from. The program SSH Secure Shell Client or PuTTY should be installed in your Windows machine. You will need to configure it (SSH or PuTTY) to allow X-Windows tunneling.

If using SSH - Open SSH Secure Shell, go to File -> Profiles -> Edit Profiles. Click on the 'Tunneling' tab, check 'Tunnel X11 connections' and press 'OK'. (Different versions of SSH Secure Shell may have slightly different layouts of options). Mac users may not need to do this.

Connect to Nobel server using Quick Connect.


To run Stata from your SSH window type at the prompt:

    xstata &

You should see a Stata window pop-up (it may take few seconds, see example below)



If using PuTTY - Try logon to nobel.princeton.edu directly. Follow steps below in the "Category:" window:

If you click 'open' it will bring up the terminal to login. You will be asked to enter your netid and password (when entering your netid/ password you may not see any characters, this is normal, just hit the enter key).
Then type:     xstata &

The Stata GUI should pop-up (it may take a few seconds, see below for illustration purposes)



Text-Only Unix Stata

To run Stata in text mode on Unix, connect to the Nobel server using an SSH program such as SSH Secure Shell, which is available on all the OIT clusters. After logging in, type "stata" at the prompt.

Once you're in Stata, you type your commands at the prompt at the bottom of the screen, and the output from your commands appears above it, the same as it would appear in the "results" window in Windows Stata. The commands are the same. The only difference is that you don't have a variables window, a review window, or any of the menus.

A few shortcut key combinations are different on Unix. To repeat a previous command, type control-r (hold the control key down and press r) instead of using the pageup key. To interrupt a command, press control-c rather than control-k.

UNIX Background

Sometimes you may want to run a Stata job as a background Unix process. This is usefull if you have a very large dataset or are running complex stata procedures that will take a long time to finish. Running stata as a background process lets you start your commands running, go away and ignore it for a while, and then come back and retrieve your output. If Stata is running in the background, it won't be interrupted if someone closes your SSH window on you, or even turns off the computer you're connected from.

To do this, you need to have all your stata commands entered in a do file, which is just a text file containing a list of commands. After creating your do file, run it by entering the following command at the unix prompt:

   stata -b do mydofile.do &

This runs all the commands in mydofile.do and saves the output in mydofile.log.

Buying Stata?

There are affordable semester or academic year long licenses available, for more info contact OIT at software@princeton.edu.

If you are interested on purchasing a full Stata perpetual license click here for a campus GradPlan. Budget permitting, we recommend to get, at least, Stata/SE.


This page last updated on: