Difference between revisions of "Applications/Stata"

From HPC
Jump to: navigation , search
(Application Details)
(Usage Examples)
Line 8: Line 8:
  
 
== Usage Examples ==
 
== Usage Examples ==
 +
 +
=== 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: #f5f5dc; color: black; font-family: monospace, sans-serif;">
 
<pre style="background-color: #f5f5dc; color: black; font-family: monospace, sans-serif;">
 
 
clear*
 
clear*
 
set rmsg on
 
set rmsg on
Line 31: Line 49:
 
*with bootstrap:
 
*with bootstrap:
 
qui bs, reps(1000): logit dv i*
 
qui bs, reps(1000): logit dv i*
 
</pre>
 
 
 
=== Batch Submission ===
 
 
 
<pre style="background-color: #C8C8C8; color: black; border: 2px solid #C8C8C8; font-family: monospace, sans-serif;">
 
 
#!/bin/bash
 
 
#SBATCH -J StataMP-20
 
#SBATCH -N 1
 
#SBATCH --ntasks-per-node=20
 
 
#SBATCH -o test.out
 
#SBATCH -e test.err
 
#SBATCH -p compute
 
#SBATCH --exclusive
 
#SBATCH --time=2-00:00:00
 
 
echo $SLURM_NTASKS
 
echo $SLURM_JOB_NODELIST
 
echo $SLURM_HOSTS
 
 
module purge
 
module add stata/14.1.0
 
 
stata-mp -s do testit.do
 
 
</pre>
 
 
 
<pre style="background-color: black; color: white; border: 2px solid black; font-family: monospace, sans-serif;">
 
[username@login01 ~]$ sbatch stata-mp.job
 
Submitted batch job 389522
 
 
</pre>
 
</pre>
  

Revision as of 17:36, 16 March 2017

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
  • Module names : stata/SE/14.1.0
  • License: University of Hull, restricted to two concurrent seats

Usage Examples

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*

Further Information