Stata

Software Category
Version
15

Stata

Introduction

Stata is a software tool for performing statistical analysis of data. The Stata software is licensed and has been provided by the Department of Political Science.

Using Stata on RCC Resources

To use Stata, you must first load the module:

module load stata

The Stata binaries are:

  • stata - the batch version of STATA
  • stata-mp - the batch multi-processor version of STATA
  • xstata - the gui version of STATA (Spear only)
  • xstata-mp - the gui multi-processor version of STATA (Spear only)

You can run Stata in three different ways:

  1. Interactive on the HPC Compute Nodes
  2. Batch jobs on the HPC Compute Nodes
  3. Interactive on the Spear Cluster (GUI or CLI)

Interactive on the HPC Compute Nodes

To use interactive mode on the HPC Compute Nodes, you will login into one of the compute nodes directly and type the stata commands just as you would on your computer. This is a good way for troubleshooting. However, you must stay logged in while your jobs are running. For long running jobs, we recommend using batch mode (see below).

For interactive use of STATA, use the following command on an HPC login node:

module load stata
srun --pty -t30:00 -n1 stata

This command will connect you to a node where STATA is installed.

Batch mode on the HPC

In batch mode, you submit your job to the system and it will run independently, like other HPC jobs. This is the preferred way of submitting large Stata jobs.

The following is an example of a batch job submission script (job.sh) that will run a Stat job via SLURM with a do-file called sample.do.

#!/bin/bash

#SBATCH -p stata_q
#SBATCH -J MYSTATAJOB

module load stata
stata -b do sample.do

If you save this file as job.sh, you can submit it using this command on your login node:

sbatch job.sh

Interactive on the Spear Cluster

The Spear nodes provide a good way to use GUI version of STATA. However, only short jobs are allowed to run on the Spear cluster.

To use the GUI version, login to Spear and run:

$xstata

or

$xstata-mp

For more information about Stata, refer to the official documentation: http://www.stata.com/support/documentation.