Many versions of Stata are install on the ICER HPC. When you log-in, Stata is not available by default, but it may be load easily using this command (note you must type Stata with a capital 'S'
module load Stata
This loads Stata SE version 15. This is equivalent to using the command module load Stata/15.0.SE
Stata has a command line version and a GUI (windowed) version. To use the command line, type stata at the prompt. You will see this :
[billspat@dev-intel18 ~]$ module load Stata [billspat@dev-intel18 ~]$ stata ___ ____ ____ ____ ____ (R) /__ / ____/ / ____/ ___/ / /___/ / /___/ 15.0 Copyright 1985-2017 StataCorp LLC Statistics/Data Analysis StataCorp 4905 Lakeway Drive College Station, Texas 77845 USA 800-STATA-PC http://www.stata.com 979-696-4600 stata@stata.com 979-696-4601 (fax) 15-user Stata network perpetual license: Serial number: 401506213245 Licensed to: iCER / HPCC at Michigan State University East Lansing, MI Notes: 1. Unicode is supported; see help unicode_advice. .
In which you may type Stata commands. Type 'exit' to quit this version.
To run a Stata do file from the command line in 'batch', you use the syntax
stata -b do dofilename.do
Versions
Stata comes in several versions: IC, SE, and MP; see https://www.stata.com/products/which-stata-is-right-for-me/ for details for the differences. Stata/IC has limitations on the numbers of variables that affect most users but has no licensing restrictions (see below). While the default version of Stata available when you load the module is Stata/SE, you currently have to use the command 'stata-se' to start the 'SE' version
module load Stata/15.0.SE stata-se # to run the interactive version stata-se -b do dofilename.do # to run a do file
However, to use the "MP" Version, you must load it explicitly.
module load Stata/15.0.MP stata-mp
Note that even if you load Stata/MP or SE module, as above, if you just use the command 'stata' it will load the IC version. To see which version of Stata you are current in, use the "about" command at the dot prompt. to use these special versions to run a bach do file, use stata-se and stata-mp instead of plain stata
For Stata/SE There are 15 licenses available, so 15 users may use it, for MP there are 5 user licenses of 8-cores each. Please exit the program when you are finished with it.
GUI version
To use the GUI version, you must first be connected to HPCC with X11 forwarding ( MobaXterm for Windows, XQuartz for Mac - see ICER workshop set up instructions) or using a Remote Desktop Client (see Copy of Connecting with a Remote Desktop Client ) . Once an X11 or remote desktop client is connected, you can run xstata on a dev node:
[billspat@dev-intel18 ~]$ module load Stata [billspat@dev-intel18 ~]$ xstata
Variables Limits
Even if you load the MP or SE versions, Stata limits the number of variables to 5000 unless you tell it otherwise. For information use the help set_maxvar command at the dot prompt. You can set the maxvar for your session or in your do file with (for example to 6000)
. set maxvar 6000
There are other settings related to memory usage which are important as Stata attempts to be very conservative. For more information use the Stata "memory" command
Running Jobs
Note you must use the command line version inside a sb script when running jobs. To copy a working example of Stata job file into your home directory, you can use our getexample tool
module load powertools cd ~ getexample STATA_example cd STATA_example # look into the README file in this folder for details cat README