Difference between revisions of "Applications/Stata"
From HPC
m |
(→Application Details) |
||
(31 intermediate revisions by 2 users not shown) | |||
Line 2: | Line 2: | ||
== Application Details == | == Application Details == | ||
− | * Description : Stata is a commercial statistical package, which provides a complete solution for data analysis, data management, and graphics. | + | * Description : Stata is a commercial statistical package, which provides a complete solution for data analysis, data management, and graphics. |
− | * Versions : 14.1.0 | + | * Versions : Stata/SE/14.1.0, Stata/SE/15.0, Stata/SE/17.0 |
− | * Module names : stata/14.1.0 | + | * Module names : stata/SE/14.1.0, stata/SE/15.0, stata/SE/17.0 |
− | * License: University of Hull, | + | * License: University of Hull, Viper usage is restricted to two concurrent seats. When using Stata/SE on Viper you '''must''' request the appropriate license either from the command line (''interactive session'') or as part of your batch script (''batch mode''), [[#Interactive|see below]]: |
+ | == License == | ||
+ | There are two licenses for Stata/SE that have been made available on Viper. In order to ensure correct license usage, it is important to request a license as detailed in the usage examples below. If no licenses are available, a job will be held pending until a license becomes available, with squeue showing a pend reason of ''(Licenses)'': | ||
+ | <pre style="background-color: #000000; color: white; border: 2px solid black; font-family: monospace, sans-serif;"> | ||
+ | JOBID PARTITION NAME USER ST TIME NODES NODELIST(REASON) | ||
+ | 2521112 compute Statajob4 username PD 0:00 1 (Licenses) | ||
+ | 2531111 compute Statajob3 username PD 0:00 1 (Licenses) | ||
+ | 2531110 compute Statajob2 username R 2:48 1 c171 | ||
+ | 2531109 compute Statajob1 username R 4:48 1 c171 | ||
+ | </pre> | ||
− | + | You can check on current license usage by running the following command: | |
− | + | <pre style="background-color: #000000; color: white; border: 2px solid black; font-family: monospace, sans-serif;"> | |
+ | [username@login01 ~]$ scontrol show lic | ||
+ | LicenseName=statase | ||
+ | Total=2 Used=1 Free=1 Remote=no | ||
+ | </pre> | ||
== Usage Examples == | == Usage Examples == | ||
+ | === Executables === | ||
+ | {| class="wikitable" style="background-color:#f5f5dc;" | ||
+ | ! Executable | ||
+ | ! Description | ||
+ | |- | ||
+ | | stata-se | ||
+ | | Non-graphical Stata/SE designed for large databases, which can be used interactively through the terminal, or be used to run tasks automatically with the ''batch'' flag -b and a Stata do file. | ||
+ | |- | ||
+ | | stata | ||
+ | | Non-graphical Stata/IC which is the standard version of Stata. '''Note:''' For better performance and support for larger databases, stata-se should be used. | ||
+ | |- | ||
+ | | xstata-se | ||
+ | | Graphical version of Stata/SE, which can be used interactively in a similar working environment to Windows and Mac versions. | ||
+ | |- | ||
+ | | xstata | ||
+ | | Graphical version of Stata/IC which is the standard version of Stata. '''Note:''' For better performance and support for larger databases, xstata-se should be used. | ||
+ | |} | ||
+ | |||
+ | === Interactive === | ||
+ | When running Stata/SE interactively, it is important to request the appropriate license by starting an interactive session in the following way: | ||
+ | <pre style="background-color: #000000; color: white; border: 2px solid black; font-family: monospace, sans-serif;"> | ||
+ | [username@login01 ~]$ interactive -L statase:1 | ||
+ | </pre> | ||
+ | |||
+ | Interactive with full graphical interface: | ||
+ | <pre style="background-color: #000000; color: white; border: 2px solid black; font-family: monospace, sans-serif;"> | ||
+ | [username@login01 ~]$ interactive -L statase:1 | ||
+ | salloc: Granted job allocation 289661 | ||
+ | Job ID 289661 connecting to c174, please wait... | ||
+ | Last login: Thu Jan 26 12:59:11 2017 from 10.254.5.246 | ||
+ | [username@c174 ~]$ module add stata/SE/14.1.0 | ||
+ | [username@c174 ~]$ xstata-se | ||
+ | </pre> | ||
+ | [[File:Xstata-se.PNG]] | ||
+ | |||
+ | Interactive with command line only: | ||
+ | <pre style="background-color: #000000; color: white; border: 2px solid black; font-family: monospace, sans-serif;"> | ||
+ | [username@login01 ~]$ interactive -L statase:1 | ||
+ | salloc: Granted job allocation 289663 | ||
+ | Job ID 289663 connecting to c170, please wait... | ||
+ | Last login: Thu Jan 26 12:59:11 2017 from 10.254.5.246 | ||
+ | [username@c170 ~]$ stata-se | ||
+ | |||
+ | ___ ____ ____ ____ ____ (R) | ||
+ | /__ / ____/ / ____/ | ||
+ | ___/ / /___/ / /___/ 14.1 Copyright 1985-2015 StataCorp LP | ||
+ | Statistics/Data Analysis StataCorp | ||
+ | 4905 Lakeway Drive | ||
+ | Special Edition College Station, Texas 77845 USA | ||
+ | 800-STATA-PC http://www.stata.com | ||
+ | 979-696-4600 stata@stata.com | ||
+ | 979-696-4601 (fax) | ||
+ | |||
+ | 50-user Stata network license expires 14 Nov 2017: | ||
+ | Serial number: ############# | ||
+ | Licensed to: HULL IT | ||
+ | University of Hull | ||
+ | |||
+ | Notes: | ||
+ | 1. Unicode is supported; see help unicode_advice. | ||
+ | 2. Maximum number of variables is set to 5000; see help set_maxvar. | ||
+ | |||
+ | . | ||
+ | </pre> | ||
+ | |||
+ | === Batch Submission === | ||
+ | <pre style="background-color: #C8C8C8; color: black; font-family: monospace, sans-serif;"> | ||
+ | #!/bin/bash | ||
+ | #SBATCH -J Stata # Job name, you can change it to whatever you want | ||
+ | #SBATCH -N 1 # Number of nodes (for Stata/SE should be always one) | ||
+ | #SBATCH -o %N.%j.out # Standard output will be written here | ||
+ | #SBATCH -e %N.%j.err # Standard error will be written here | ||
+ | #SBATCH -p compute # Slurm partition, where you want the job to be queued | ||
+ | #SBATCH -L statase:1 # Use 1 Stata/SE license (this MUST be included in State/SE job scripts | ||
+ | module purge | ||
+ | module add stata/SE/14.1.0 | ||
+ | |||
+ | stata-se -b do testid.do | ||
+ | </pre> | ||
+ | |||
+ | <pre style="background-color: #000000; color: white; border: 2px solid black; font-family: monospace, sans-serif;"> | ||
+ | [username@login01 ~]$ sbatch STATAtest.job | ||
+ | Submitted batch job 289529 | ||
+ | </pre> | ||
=== Test Program === | === Test Program === | ||
− | |||
Below is a test example Stata batch file for submission to VIPER called <strong>testit.do</strong> | Below is a test example Stata batch file for submission to VIPER called <strong>testit.do</strong> | ||
− | <pre style="background-color: # | + | <pre style="background-color: #f5f5dc; color: black; font-family: monospace, sans-serif;"> |
− | |||
clear* | clear* | ||
set rmsg on | set rmsg on | ||
Line 36: | Line 131: | ||
*with bootstrap: | *with bootstrap: | ||
qui bs, reps(1000): logit dv i* | qui bs, reps(1000): logit dv i* | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
</pre> | </pre> | ||
Line 78: | Line 137: | ||
* [http://www.stata.com/ http://www.stata.com/] | * [http://www.stata.com/ http://www.stata.com/] | ||
− | + | {{Licensepagenav}} | |
− |
Latest revision as of 19:56, 1 June 2023
Contents
Application Details
- Description : Stata is a commercial statistical package, which provides a complete solution for data analysis, data management, and graphics.
- Versions : Stata/SE/14.1.0, Stata/SE/15.0, Stata/SE/17.0
- Module names : stata/SE/14.1.0, stata/SE/15.0, stata/SE/17.0
- License: University of Hull, Viper usage is restricted to two concurrent seats. When using Stata/SE on Viper you must request the appropriate license either from the command line (interactive session) or as part of your batch script (batch mode), see below:
License
There are two licenses for Stata/SE that have been made available on Viper. In order to ensure correct license usage, it is important to request a license as detailed in the usage examples below. If no licenses are available, a job will be held pending until a license becomes available, with squeue showing a pend reason of (Licenses):
JOBID PARTITION NAME USER ST TIME NODES NODELIST(REASON) 2521112 compute Statajob4 username PD 0:00 1 (Licenses) 2531111 compute Statajob3 username PD 0:00 1 (Licenses) 2531110 compute Statajob2 username R 2:48 1 c171 2531109 compute Statajob1 username R 4:48 1 c171
You can check on current license usage by running the following command:
[username@login01 ~]$ scontrol show lic LicenseName=statase Total=2 Used=1 Free=1 Remote=no
Usage Examples
Executables
Executable | Description |
---|---|
stata-se | Non-graphical Stata/SE designed for large databases, which can be used interactively through the terminal, or be used to run tasks automatically with the batch flag -b and a Stata do file. |
stata | Non-graphical Stata/IC which is the standard version of Stata. Note: For better performance and support for larger databases, stata-se should be used. |
xstata-se | Graphical version of Stata/SE, which can be used interactively in a similar working environment to Windows and Mac versions. |
xstata | Graphical version of Stata/IC which is the standard version of Stata. Note: For better performance and support for larger databases, xstata-se should be used. |
Interactive
When running Stata/SE interactively, it is important to request the appropriate license by starting an interactive session in the following way:
[username@login01 ~]$ interactive -L statase:1
Interactive with full graphical interface:
[username@login01 ~]$ interactive -L statase:1 salloc: Granted job allocation 289661 Job ID 289661 connecting to c174, please wait... Last login: Thu Jan 26 12:59:11 2017 from 10.254.5.246 [username@c174 ~]$ module add stata/SE/14.1.0 [username@c174 ~]$ xstata-se
Interactive with command line only:
[username@login01 ~]$ interactive -L statase:1 salloc: Granted job allocation 289663 Job ID 289663 connecting to c170, please wait... Last login: Thu Jan 26 12:59:11 2017 from 10.254.5.246 [username@c170 ~]$ stata-se ___ ____ ____ ____ ____ (R) /__ / ____/ / ____/ ___/ / /___/ / /___/ 14.1 Copyright 1985-2015 StataCorp LP Statistics/Data Analysis StataCorp 4905 Lakeway Drive Special Edition College Station, Texas 77845 USA 800-STATA-PC http://www.stata.com 979-696-4600 [mailto:stata@stata.com stata@stata.com] 979-696-4601 (fax) 50-user Stata network license expires 14 Nov 2017: Serial number: ############# Licensed to: HULL IT University of Hull Notes: 1. Unicode is supported; see help unicode_advice. 2. Maximum number of variables is set to 5000; see help set_maxvar. .
Batch Submission
#!/bin/bash #SBATCH -J Stata # Job name, you can change it to whatever you want #SBATCH -N 1 # Number of nodes (for Stata/SE should be always one) #SBATCH -o %N.%j.out # Standard output will be written here #SBATCH -e %N.%j.err # Standard error will be written here #SBATCH -p compute # Slurm partition, where you want the job to be queued #SBATCH -L statase:1 # Use 1 Stata/SE license (this MUST be included in State/SE job scripts module purge module add stata/SE/14.1.0 stata-se -b do testid.do
[username@login01 ~]$ sbatch STATAtest.job Submitted batch job 289529
Test Program
Below is a test example Stata batch file for submission to VIPER called testit.do
clear* set rmsg on set obs 1000000 forval n = 1/10 { g i`n' = runiform() } g dv = rbinomial(1,.3) memory qui logit dv i* qui xtmixed dv i* *with bootstrap: qui bs, reps(1000): logit dv i*