What is Stata?

Stata is a general purpose statistical packages, that provides data management, statistical analysis, graphics, simulations, regression, and custom programming.

Stata is licensed through StatCorp (www.stata.com) . ITS has subscribed a Stata/MP license so that staff and students can speed up the Stata computation with multicore parallelism on the HPC2021 cluster system. You can visit the Stata/MP Performance Report for a complete assessment of Stata/MP’s performance that including command-by-command statistics.

Permission of using Stata

In order to run Stata in the HPC systems, user must be assigned in the group of “stata“. Please send your request to group-its-hpc@hku.hk to arrange the access.

Using Stata in HPC system

To use Stata in the HPC cluster system, you must first load the module to setup required environment variables.

System STATA version Command
HPC2021 16.1 module load stata/16.1
17.0 module load stata/17.0

Stata Commands

CommandDescription
stataThe Command Line interface (CLI) version of Stata
stata-mpThe multiple core CLI version of Stata
xstataThe Graphical User Interface (GUI) version of Stata
xstata-mpThe multiple core GUI version of Stata

The Stata MP16 3-user network license restricted 3 concurrent usage each with maximum 16 cores. User must request the appropriate license either from the command line (Interactive session) or as part of the batch script (batch mode). If no license is available, a job will be held pending until a license becomes available.

  1. Running Stata jobs with SLURM (batch mode)

    Be reminded that do not run computationally intensive processes on the frontend nodes. You should submit the Stata simulations through the job scheduling system. Sample SLURM scripts for submitting Stata jobs are available at /share1/stata/sample/.

    #!/bin/bash	 	 
    #SBATCH --job-name=StataMP 	 	 
    #SBATCH --nodes=1	 	 
    #SBATCH --tasks-per-node=16      # for Stata MP16 (max. 16 cores) 	 	 
    #SBATCH --output=%x.out.%j       # Standard output 	 	 
    #SBATCH --error=%x.err.%j        # Standard error 	 	 
    #SBATCH --licenses=stata:1       # Use 1 Stata/MP license 	 	 
    
    module load stata	 	 
    stata-mp -b do stata_parallel.do	 	 
    
  2. Graphical User Interface
    $ ssh -X <username>@hpc2021-io1.hku.hk 	 	 
    $ module load stata/17.0 
    $ xstata my-stata.do	 	 
    

 

Additional Information

Stata website: https://www.stata.com/
Stata official documentation: https://www.stata.com/features/documentation/
STATA Tutorials in Youtube: