Stata

Overview

Stata is a general-purpose statistical software package. Versions 11, 12, 13, 13.1, 14.1, 16, 17, 18 are installed on the iCSF.

Restrictions on Use

Only those users who are part of a licensed group may access this software(further details below). Access to the software is restricted by Unix groups.

All users must abide by the Latest Stata license agreement (applies for all versions).
Should this link expire, please let us know: its-ri-team@manchester.ac.uk

Important points to note are:

  • Only staff and students of The University of Manchester are permitted to use the software.
  • Usage only for academic work is permitted. Usage for commercial work including commercially funded grants is not permitted

Set up procedure

Load one of the following modulefiles below according to which group you are in:

  • Institute of Population Health. To request access please contact license holder Evan Kontopantelis (install does not grant access to iCSF, must be part of a contributing group)
    #### Most IPH users who have been given stata access will use v17 ####
    module load apps/binapps/stata/17-iph           # (version 17.0 available from 2022-Apr)
    
    #### Not everybody in IPH has access to v18 ####
    # Original April version of v18
    module load apps/binapps/stata/18-iph-230418    # (version 18.0 available from 2023-April)
    # New June update of v18
    module load apps/binapps/stata/18-iph           # (version 18.0 available from 2023-June)
    

    Please note: due to license restrictions Stata 16 is no longer available.
    However, Stata is fully backward compatible.
    All you have to do is run a later version and add version 16 at the top of your script.
    See https://www.stata.com/manuals/pversion.pdf

  • Humanities and AMBS
    # Latest version
    module load apps/binapps/stata/14-170504 
    
  • Prof. Jane Worthington’s group
    # Latest version
    module load apps/binapps/stata/13-jw01
    
    module load apps/binapps/stata/13-jw01-150512  
    

Running the application

Several verisons of stata are available. Having loaded the appropriate modulefile simply run one of the following:

  • The stata GUI version:
    xstata &              # IC version (standard, medium data)
    xstata-sm &           # SM verison (small data)
    xstata-se &           # SE version (single core, big data)
    xstata-mp &           # MP version (multicore, big data)
    

    The & returns your iCSF prompt to you so that you can use the stata GUI and the iCSF command line at the same time. For example, you may wish to copy some files or look around your home directory to check where your files are.

  • The stata command-line version:
    stata               # IC version (standard, medium data)
    stata-sm            # SM verison (small data)
    stata-se            # SE version (single core, big data)
    stata-mp            # MP version (multicore, big data)
    

Full information on the differences between these versions (e.g., number of variables they can process, size of data) is available at http://www.stata.com/manuals13/u5.pdf.

Number of Cores and stata-mp

The multicore versions of stata (stata-mp and xstata-mp) will try to use all cores on the iCSF compute node where you are running, by default. iCSF nodes often have several users running applications on them. Hence the MP version may be trying to use cores in use by other users. If this happens you may not get the performance you are expecting.

To set the number of cores used by stata, run the following command in stata:

set processors 4           // 4 cores for example

To obtain help about this command, run:

help set_processors        // notice the _ in the help version of the command

Memory Considerations

We highly recommend you read the short section in the Stata manual on Managing Memory (pdf). This contains a few commands that can help if you are running out of memory or if Stata is reporting that no more variables can be added.

For example, use the following command to compress your data.

compress

To see how much memory Stata is using (run it after loading your dataset), run the following command:

# Show memory usage stats
memory

# Show memory settings
query memory

# Restrict stata's memory usage
set max_memory 50g

As we are running on Linux, another section of the manual recommends (pdf) that you use the set max_memory command, for example set max_memory 50g, to set the point at which Stata will begin to use disk as extra memory space, rather than trying to allocate more and more RAM on the compute node. The problem with trying to allocate more and more RAM is that if the memory has been used up (by you and other users on the iCSF node you are running on) then Stata may well simply crash if it fails to get any more memory. The max memory command will try to avoid this point being reached.

Exiting Stata

To exit the stata command shell type:

exit

Installing Modules with ssc

The University proxy is no longer available. You should REMOVE any proxy config from your stata config – see below.

If you can then no longer download Stata modules, please tell us the address of the remote host where your download is coming from.

Additional stata packages/modules can be installed using the ssc command in stata. If you’ve previously configured stata to use the University proxy, you’ll need to REMOVE that config, as follows:

  1. Start the graphical version of stata using:
    xstata
  2. Select the menus: Edit->Preferences->General Preferences
  3. Select Internet in the list on the left hand side
  4. UNTICK Connect through a proxy server and make the following settings:
  5. HTTP Server: proxy.man.ac.ukTHIS SHOULD NO LONGER BE USED
  6. Port: 3128 THIS SHOULD NO LONGER BE USED

You should then be able to run the ssc install command in the stata GUI. For example to install the parmest package:

. ssc install parmest

Stata should report it is downloading the file and installing. If Stata fails to download, please send us all output from the ssc command – we will need to add the remote hostname from where Stata is trying to download your module to an allow-list.

Further information

Updates

2018-Feb-06 Stata 14 for iph no longer available (for ref only the modulefile names were apps/binapps/stata/14-iph and apps/binapps/stata/14-iph-160128)

2020-Apr Stata 15 for iph no longer available (for ref only the modulefile names were apps/binapps/stata/15-iph )

Last modified on July 4, 2024 at 12:14 pm by George Leaver