i

Stata R Release 18 Installation Guide
Contents
Simple installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

1

Installing Stata or StataNow for Windows . . . . . . . . . . . . . . . . . . . . .

3Installing Stata or StataNow for Mac . . . . . . . . . . . . . . . . . . . . . . . . .

9Installing Stata or StataNow for Unix . . . . . . . . . . . . . . . . . . . . . . . .

14

Platforms and editions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

23

Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

24®

Copyright c 1985–2023 by StataCorp LLC
All rights reserved
Version 18

Simple installation

Before you install
Before you begin the installation procedure:
1. Make sure you have a License and Activation Key.
2. Determine from the License and Activation Key whether you should
install Stata/MP, Stata/SE, or Stata/BE. Your license may also show
StataNow/MP, StataNow/SE, or StataNow/BE.

Stata or StataNow for Windows installation
1. Download or insert the installation media.
2. If you have Auto-insert Notification enabled, the installer will start automatically. Otherwise, you will want to navigate to your installation media
and double-click on SetupStata18.exe or SetupStataNow18.exe to start
the installer.
3. Go to page 3 for detailed instructions about the rest of the installation.

Stata or StataNow for Mac installation
1. Download or insert the installation media.
2. Open the installation media on the Desktop, and double-click on the
Install Stata or Install StataNow file.
3. Go to page 9 for detailed instructions about the rest of the installation.

Stata or StataNow for Unix installation
1. Become superuser, and then download or insert and mount the installation
media.
2. Create the installation directory (we recommend /usr/local/stata18),
and change to that directory.
1

2[ IG ] Simple installation

3. Type /media/Stata/install (assuming that /media/Stata is the path tothe installation media), and follow the prompts. Nothing will be written
to disk until you say it is okay to do so.
4. Go to page 14 for detailed instructions about the rest of the installation.

Installing Stata or StataNow for Windows

Upgrade or update?
If you are using an earlier Stata release and you are upgrading to Stata 18, or
if you have never installed Stata before on this computer, you need to readthis Installation Guide. If you have already installed Stata 18 and you would
like to install the latest updates to Stata 18, please refer to [GSW] 19 Updatingand extending Stata—Internet functionality.

Upgrading to Stata/MP or Stata/SE
If you have already installed Stata/BE for version 18 and have purchased
an upgrade to Stata/MP or Stata/SE for version 18, run the installer again.
Check Modify, click on Next, and choose the edition(s) of Stata you wish to
install. Your existing copy will not be affected.
Make sure that you have your License and Activation Key before doing this.
After installation, you will immediately want to update Stata.

Before you install
Before you begin the installation procedure:
1. Make sure you have the installation media.
2. Make sure you have a License and Activation Key.
3. Determine from the License and Activation Key whether you should install
Stata/MP, Stata/SE, or Stata/BE.
4. Decide where you want to install the software. We recommend C:\Program
Files\Stata18.
5. If you already have an old version of the software on your system, decide
whether you want to keep it or uninstall it. We do not recommend having
more than one version installed at a time, because it can cause confusing
file-association behavior.

3

4[ IG ] Installing Stata or StataNow for Windows

Installation
Have your License and Activation Key with you.
1. Download or insert the installation media.
2. If you have Auto-insert Notification enabled, the installer will start automatically. Otherwise, you will want to navigate to your installation
media and double-click on SetupStata18.exe or SetupStataNow18.exe
to start the installer.
3. You might be asked to verify that you want to install the software; ifso, confirm that you wish to do so.
4. The Installation Wizard will start. Proceed as you would with any othersoftware installation.
5. Read and accept the software license agreement to proceed with the
installation.
6. The installer will display options for personalizing your installation andmaking Stata accessible to all users who share your computer. The default
choices are probably what you want. If not, make any necessary changes,
and click on Next.
7. At the Select Edition step, you can choose which edition of Stata to install.
Choose the edition of Stata that matches your License and Activation Key.
8. The installer will ask you where you want to install.
a. We recommend that you choose the default directory. It is
C:\Program Files\Stata18 for Stata 18. The default directoryfor StataNow 18 is C:\Program Files\Stata18 if Stata 18 is
not already installed there, and C:\Program Files\StataNow18
otherwise.
b. If you want to install on a network drive, you will need a
network license. You can install from the server, or if you havethe appropriate privileges, you can install directly to the network
drive.
c. When you have chosen an installation directory, click on Next.

[ IG ] Installing Stata or StataNow for Windows

5

9. The installer will then ask you where you want to set the default working
directory.
a. The default working directory is the default location for yourdatasets, graphs, and other Stata-related files.
b. We recommend that you choose Use each user’s documents folder.
c. When you have chosen a default working directory, click on
Next to begin the installation.
10. When the installation is complete, click on Finish to exit the installer.
11. If you would like to modify your installation or install other editions of
Stata that are below the edition of your license, you can run the installera second time. It will bring up the Application Maintenance dialog. Check
Modify, and click on the Next button. You can then choose the edition(s)of Stata that you would like to add.
If you would like to install by using the command line, please consult https://www.stata.com/support/faqs/windows/install-from-command-line/
Do this even if you have installed previous versions of Stata via the command
line, because the arguments have changed.

Initialize the license
You now need to start Stata so that you can initialize the license. Go to the
Stata 18 or StataNow 18 program group in the Start menu, and click on theedition of Stata you installed.
The first time that you start Stata, it will prompt you for the information on
your License and Activation Key. You must enter something for all fields inthe dialog before you can continue. The code and authorization are not casesensitive. If you make a mistake typing the codes, you will be prompted totry again.

6[ IG ] Installing Stata or StataNow for Windows

If you get the message “The serial number, code, and authorization areinconsistent”, try the initialization again. Be careful when typing your code
and authorization. Anything that looks like “o” is the letter oh, anything like“0” is a zero, anything like “1” is the number one, and anything like “L” isthe letter el.
Important: Do not lose your License and Activation Key. You may need itagain in the future.

Update Stata if necessary
StataCorp releases updates to Stata and StataNow often. These updates may
include new features and bug fixes that can be automatically downloaded andinstalled by Stata from the Internet. There may be updates more recent thanthe version on your installation media.
The first time Stata is launched, a dialog will open asking you if you would
like to check for updates now. Click on OK to do so. If an update is available,
follow the instructions. If you have trouble connecting to the Internet from
Stata, visit https://www.stata.com/support/faqs/web/ for help.
By default, automatic update checking is enabled. This ensures that yoursoftware is up to date, it is convenient, and it causes no problems even if you
are not connected to the Internet. If you disable automatic update checking, it
is a good idea to periodically check for updates. See [GSW] 19 Updating andextending Stata—Internet functionality for more information about updating.

[ IG ] Installing Stata or StataNow for Windows

7

Register your copy
Make sure that your copy of Stata is registered. As a registered user, youare entitled to free technical assistance should you have any questions, andwe will keep you informed of any new products or advancements that havebeen announced. To register your copy, fill out the online registration form
at https://www.stata.com/register/.

Read the Getting Started manual
After installing Stata, you should read the Getting Started with Stata for
Windows manual. See page 24 of this Installation Guide for a complete list of
documentation.

Creating network shortcuts
If you installed Stata on a network drive, you will need to create shortcuts
on the workstations that will be using Stata.
1. Mount the network drive that Stata is installed on from a workstation.
Right-click on the Desktop or on the Windows Start menu, and selectNew > Shortcut. Type the path for the Stata executable into the edit
field, or click on Browse... to locate it. Enter “Stata” for the name of theshortcut.
2. Once a shortcut for Stata has been created, right-click on it, and selectProperties. Set the default working directory for Stata by changing theStart in field to a local drive that users have write access to. This iswhere Stata will store datasets, graphs, and other Stata-related files. If
the workstation will be used by more than one user, consider changing
the Start in field to the environment variable %HOMEDRIVE%%HOMEPATH%.
Doing so will set the default working directory to each user’s home
directory.

Other ways to start Stata
You can start Stata in multiple ways:• From the Start menu.
• Double-click on its application icon (as with any other application).
• Double-click on a Stata do-file. See [GSW] 13 Using the Do-file Editor—
automating Stata and [U] 16 Do-files for more information.

8[ IG ] Installing Stata or StataNow for Windows• Double-click on a Stata data file. Stata data files are files created by Stataand have the extension .dta. When you double-click on a Stata data file,
Stata is started and the data file is loaded into Stata; see [GSW] 5 Opening
and saving Stata datasets.
If you experience any problems when trying to start Stata, see [GSW] A Troubleshooting Stata. (We are assuming that you have successfully installed Stataand have initialized the license. Please see page 24 for how to access the
PDF documentation from outside Stata.)

Exiting Stata
To exit Stata, select Exit from the File menu or press Alt+F4. If you havemade any changes to the data in your dataset, including creating a newdataset, you will be prompted to save the changes.
If you exit Stata by typing the equivalent exit command, you will see thefollowing in the Results window if you have made changes to your data:. exitno; dataset in memory has changed since last saved
r(4);





If you would like to save your changes, you could save the dataset as you
save any other file by using File > Save or Ctrl +S. You can also save thedataset by typing save filename. You could then type exit again, and Statawill exit. If you do not wish to save your changes, you can force Stata toexit without saving the dataset by typing exit, clear.

Verifying installation
If you need to create a report to verify that Stata has been installed properly,
point your browser to https://www.stata.com/support/installation-qualification/.
There you will find instructions for downloading and using the Stata Installation
Qualification Tool (IQT). The tool will verify your installation not only after
you initially install Stata, but also after every update you apply.

Installing Stata or StataNow for Mac

Upgrade or update?
If you are using an earlier Stata release and you are upgrading to Stata 18, or
if you have never installed Stata before on this computer, you need to readthis Installation Guide. If you have already installed Stata 18 and you would
like to install the latest updates to Stata 18, please refer to [GSM] 19 Updatingand extending Stata—Internet functionality.

Upgrading to Stata/MP or Stata/SE
If you have already installed Stata/BE for version 18 and have purchased an
upgrade to Stata/MP or Stata/SE for version 18, run the installer again andselect the edition you are upgrading to for the Installation Type.
Make sure that you have your License and Activation Key before doing this.
After installation, you will immediately want to update Stata.

Warning against multiple Stata applications
We recommend against having more than one Stata application installed on
the same computer, because it can confuse the Finder. Why? Because when
you double-click on a Stata file, the Mac may choose the wrong Stata to run.
You will not be able to predict which one will start. If you typically do notstart Stata by double-clicking on Stata files, you can have multiple versions,but be forewarned that the first time you start Stata by double-clicking, you
may be confused.

Before you install
Before you begin the installation procedure:
1. Make sure you have the installation media.
2. Make sure you have a License and Activation Key.
3. Determine from the License and Activation Key whether you should install
Stata/MP, Stata/SE, or Stata/BE.
9

10[ IG ] Installing Stata or StataNow for Mac

4. You should not have any of your personal files in the Stata folder. But
if you do and wish to keep them, move them out of the Stata folder
first.
5. If you are upgrading, exit Stata and drag the current Stata folder tothe Trash, and empty the Trash. Note: You must empty the Trash before
proceeding.

6. You are now ready to install.

Installation
1. Download or insert the installation media.
2. Open the installation media from the Finder, and double-click on the
Install Stata or Install StataNow file to start the installation.
3. After you have carefully read the Introduction, click on Continue.
4. After you have carefully read the License, click on Continue, and thenclick on Agree to accept the terms of the license agreement.
5. If you see Destination Select, we recommend that you accept the default
destination by clicking on Continue.
6. Choose the edition of Stata that matches your license, and then click on
Continue.
7. Click on the Install button.
8. Click on Close after you see the message Installation was successful.

Initialize the license
You now need to start Stata so that you can initialize the license.
The first time that you start Stata, it will prompt you for the information on
your License and Activation Key. You must enter something for all fields inthe dialog before you can continue. The code and authorization are not casesensitive. If you make a mistake typing the codes, you will be prompted totry again.

[ IG ] Installing Stata or StataNow for Mac

11

If you get the message “The serial number, code, and authorization areinconsistent”, try the initialization again. Be careful when typing your code
and authorization. Anything that looks like “o” is the letter oh, anything like“0” is a zero, anything like “1” is the number one, and anything like “L” isthe letter el.
Important: Do not lose your License and Activation Key. You may need itagain in the future.

Update Stata if necessary
StataCorp releases updates to Stata and StataNow often. These updates may
include new features and bug fixes that can be automatically downloaded andinstalled by Stata from the Internet. There may be updates more recent thanthe version on your installation media.
The first time Stata is launched, a dialog will open asking you if you would
like to check for updates now. Click on OK to do so. If an update is available,
follow the instructions. If you have trouble connecting to the Internet from
Stata, visit https://www.stata.com/support/faqs/web/ for help.
By default, automatic update checking is enabled. This ensures that yoursoftware is up to date, it is convenient, and it causes no problems even if you
are not connected to the Internet. If you disable automatic update checking, it
is a good idea to periodically check for updates. See [GSM] 19 Updating andextending Stata—Internet functionality for more information about updating.

12[ IG ] Installing Stata or StataNow for Mac

Register your copy
Make sure that your copy of Stata is registered. As a registered user, youare entitled to free technical assistance should you have any questions, andwe will keep you informed of any new products or advancements that havebeen announced. To register your copy, fill out the online registration form
at https://www.stata.com/register/.

Read the Getting Started manual
After installing Stata, you should read the Getting Started with Stata for
Mac manual. See page 24 of this Installation Guide for a complete list of
documentation.

Other ways to start Stata
You can start Stata in multiple ways:• Double-click on its application icon (as with any other application).
• Double-click on a Stata do-file. See [GSM] 13 Using the Do-file Editor—
automating Stata and [U] 16 Do-files for more information.

• Double-click on a Stata data file. Stata data files are files created by Stataand have the extension .dta. When you double-click on a Stata data file,
Stata is started and the data file is loaded into Stata; see [GSM] 5 Opening
and saving Stata datasets.
If you experience any problems when trying to start Stata, see [GSM] A Troubleshooting Stata. (We are assuming that you have successfully installed Stataand have initialized the license. Please see page 24 for how to access the
PDF documentation from outside Stata.)

Quitting Stata
To quit Stata, select Quit from the Stata menu or press Command –Q. If you
have made any changes to the data in your dataset, including creating a newdataset, you will be prompted to save the changes.
If you quit Stata by typing the equivalent exit command, you will see thefollowing in the Results window if you have made changes to your data:[ IG ] Installing Stata or StataNow for Mac



13



. exitno; dataset in memory has changed since last saved
r(4);





If you would like to save your changes, you could save the dataset as you
save any other file by using File > Save or Command –S. You can also save thedataset by typing save filename. You could then type exit again, and Statawill quit. If you do not wish to save your changes, you can force Stata toquit without saving the dataset by typing exit, clear.

Installing Stata or StataNow for Unix
Installation overview
The outline of the installation process is as follows:
1. Ensure that you have the installation media and the License and Activation
Key.
2. As superuser, create the directory in which you want to install Stata.
3. Change to that directory and run the installation script from the installation
media.
4. Follow the instructions during the installation process.
5. Once the installation is complete, enter your license codes.
The details for each of these steps are below, with some pointers fortroubleshooting.

Find your installation media and license
You should have received the installation media and a License and Activation
Key. You will need both. The codes in the License and Activation Key arenecessary for initializing the software.

Obtain superuser access
You must be logged in as superuser (root) during installation. For varietiesof Unix that disable the root account by default, issue either the commandsudo su - or the command su - to run as superuser during the installation.
The # prompt below indicates that you are running as superuser.

Create an installation directory
We recommend that you install Stata in /usr/local/stata18. We recommendthat you install StataNow in /usr/local/stata18 or /usr/local/statanow18.
If you have both Stata and StataNow, use the appropriate directory for each.
If you would like the path to the executables as seen by users to remain stable
as you upgrade Stata in the future, you can create a symbolic link (type manln for more information) from /usr/local/stata18 to /usr/local/stata:# ln -s /usr/local/stata18 /usr/local/stata

If you wish to install in a different directory, you are free to do so.
14

[ IG ] Installing Stata or StataNow for Unix

15

Users who want to access Stata must modify their .profile or .cshrc or.login shell start-up scripts to include the installation directory in their PATH.
Throughout this manual, we will assume that you have installed Stata in/usr/local/stata18 and used a symbolic link to /usr/local/stata.

UpgradingIf you are upgrading from Stata 17, you can leave Stata 17 installed where
it is, allowing you to have both Stata 17 and Stata 18. Install Stata 18 in/usr/local/stata18 and leave Stata 17 alone.
Have your users modify their shell start-up scripts to use the proper PATH for
Stata 18. Otherwise, when they run Stata, they will be running Stata 17.
If you want to uninstall Stata 17, type# rm -r /usr/local/stata17

to remove it. If Stata 17 is installed in a different directory, you will haveto change the above command accordingly.

Install Stata
Set your current directory to /usr/local/stata18 and run the installation
script,# cd /usr/local/stata18# /media/Stata/install

replacing /media/Stata with the path to the installation media if your device
path differs (other common paths are /dev/cdrom and /mount/stata). If you
have trouble running the installer, it could be because your version of Unix
will not, by default, allow you to run applications from the installation media.
Please see page 19 for more help.
Follow the prompts. Nothing will be written until you say it is okay to doso.

Initialize the license
Initialize the license by typing# cd /usr/local/stata18# ./stinit

16[ IG ] Installing Stata or StataNow for Unix

You will be asked if you accept the software license agreement, which canbe found in the file license.pdf on your installation media. Read and accept
the software license agreement to proceed with the installation.
You will be asked for your serial number, code, and authorization, which areprovided in your License and Activation Key. The code and authorization are
not case sensitive. You will also be asked to specify your name and address
if you have a single-user license, or the institution name and department oraddress if you have a multiple-user license. When you invoke Stata in the
future, the license information will be displayed along with the name andaddress you enter. This information will also be written in system files that
Stata creates so that, should you ever need to send a file to us, we will knowwhom it is from. Whenever you or any of your users calls our technicalsupport line, we will ask for this information, all of which is reported when
it begins execution.
If, for some reason, you need to reinitialize the license for your installed copy,
you will have to contact Stata Technical Support for special instructions.

Set the message of the day (optional)
Every time you start the software, the contents of/usr/local/stata18/stata.msg are displayed. This feature provides a convenient way to communicate with Stata users if you are administering a large
site. As superuser, you may edit the file or erase it if you wish.

Verify that the software is working
Now that you have completed the installation process, you should verify thateverything has been installed properly. You must log out as superuser andlog in again as a regular user. The prompts below change to $ to indicate
your regular user status.
To use Stata or StataNow as a user, your path must include the installation
directory, and to run the GUI version, you must be running X Windows. For
our quick test, we are going to be crude. The following will work whether
you use sh, csh, bash, or ksh:
% sh
$ PATH=$PATH:/usr/local/stata$ export PATH

For Stata(console) or StataNow(console):$ stata[ IG ] Installing Stata or StataNow for Unix

17

For Stata(GUI):$ xstata

The software should launch. Use stata-se or xstata-se if you have Stata/SE
or StataNow/SE and stata-mp or xstata-mp if you have Stata/MP or
StataNow/MP. If the software does not start properly, see page 19.
Assuming that nothing is wrong, type
. exit$ exit

The first exit took us out of the software. The second exit took us out of
the sh that we temporarily invoked.

Modify shell start-up script
Once you have verified that Stata is working, modify your shell start-up
script to include the installation directory in your path. We will assume thatyou have created a symbolic link from /usr/local/stata to your installation
directory. If you did not create the recommended symbolic link, substituteyour installation directory for /usr/local/stata in the paths below.
If you use csh or tcsh, there is a line in your .cshrc file (in your home
directory) that looks likeset path = (/bin /usr/bin /usr/local/bin ~/bin)Edit the file and add /usr/local/stata to the end of the list:
set path = (/bin /usr/bin /usr/local/bin ~/bin /usr/local/stata)If you use bash, sh, or ksh, there is a line in your .profile (in your home
directory) that looks like
PATH="/bin:/usr/bin:/usr/local/bin:$HOME/bin"Edit the file and add /usr/local/stata to the list:
PATH="/bin:/usr/bin:/usr/local/bin:$HOME/bin:/usr/local/stata"If you are using a symbolic link to your installation directory and you haveincluded the path to the installation directory, be sure that the symbolic link
appears before the true directory in the path.
Log out and log back in so that the changes you have made will take effect.
The software should now work from any directory on your computer.

18[ IG ] Installing Stata or StataNow for Unix

Update Stata if necessary
StataCorp releases updates to Stata and StataNow often. These updates may
include new features and bug fixes that can be automatically downloaded andinstalled by Stata from the Internet. There may be updates more recent thanthe version on your installation media. You should check for updates to Stata
before you use it for the first time. You can do this one of two ways:• Select Help > Check for updates.
• Enter update query from the command line.
It is also a good idea to periodically check for updates. See [GSU] 19 Updating and extending Stata—Internet functionality for more information about
updating. If you have trouble connecting to the Internet from Stata, visit
https://www.stata.com/support/faqs/web/ for help.

Register your copy
Make sure that your copy of Stata is registered. As a registered user, youare entitled to free technical assistance should you have any questions, andwe will keep you informed of any new products or advancements that havebeen announced. To register your copy, fill out the online registration form
at https://www.stata.com/register/.

Read the Getting Started manual
After installing Stata, you should read the Getting Started with Stata for
Unix manual. See page 24 of this Installation Guide for a complete list of
documentation.

Starting Stata
With Stata for Unix, you can choose between two user interfaces. The first
option is the graphical user interface, or GUI, which we will refer to as
Stata(GUI). The second option is the nongraphical user interface, which wewill refer to as Stata(console). If instructions apply to either interface, wewill simply refer to Stata. Starting StataNow is the same as starting Stata,so we wiill just refer to “Stata” below.
Upon installation, both interfaces are installed, but only the GUI version candisplay graphs. If you use X Windows, you will be able to invoke either
interface, GUI or console, at each session. See [GSU] 2 The Stata user interface
for more information about the Stata user interface.

[ IG ] Installing Stata or StataNow for Unix

19

To start Stata from a Unix prompt, type• xstata or xstata-se or xstata-mp to start Stata(GUI), or• stata or stata-se or stata-mp to start Stata(console).
If you see a message telling you that Stata could not find the license file orif you receive any other error when you try to start Stata, please see page 19.
Stata(GUI) requires X Windows to run.
Stata(console) has a nongraphical interface; it is run in a terminal window,
and output is displayed on the terminal.

Exiting Stata
To exit Stata(GUI), select Exit from the File menu or press Ctrl +Q. If you
have made any changes to the data in your dataset, including creating a newdataset, you will be prompted to save the changes.
If you exit Stata by typing the equivalent exit command, which is the only
way to exit the console version of Stata, you will see the following in the
Results window if you have made changes to your data:. exitno; dataset in memory has changed since last saved
r(4);





If you would like to save your changes in Stata(GUI), you could save thedataset as you save any other file by using File > Save or Ctrl +S. In either
Stata, you can also save the dataset by typing save filename. You could thentype exit again, and Stata will exit. If you do not wish to save your changes,
you can force Stata to exit without saving the dataset by typing exit, clear.

Troubleshooting Unix installation
If you had trouble with the installation, it could be because you have a recent
copy of Unix that will not allow you to run applications from a DVD or USB
drive. Type df -l to see what local devices are mounted; one should look
like the installation media. For example, you could see something like20

[ IG ] Installing Stata or StataNow for Unix

$ df -lFilesystem/dev/hda6/dev/hdc

1K-blocks
23054660
274158Used Available Use% Mounted on
5528268 16336380 26% /2741580 100% /media/Stata/dev/hdc is the device name, and /media/Stata is the mount point.

If you see something indicating that the installation media is successfully
mounted, you need to see if you are being prevented from running applications
directly from the installation media. Type mount to get information about any
mounted file systems. Somewhere on the list, you should see information
about your installation media. Continuing with the above example, you should
see your device name and mount point in the output:$ mount

omitted output/dev/hdc on /media/Stata type iso9660 (ro,noexec,nosuid,nodev,uid=220)

If you see the term noexec appear, you are not allowed to run applications
from a DVD or USB drive. Your best course of action is to copy everythingfrom the installation media to a temporary directory and run the installationfrom there. Substitute your mount point for /media/Stata below.
$ mkdir /tmp/statainstall$ cp -r /media/Stata /tmp/statainstall$ mkdir /usr/local/stata18$ cd /usr/local/stata18$ sudo /tmp/statainstall/Stata/install

After you have Stata running and initialized, you can delete the temporary
directory /tmp/statainstall.
If you are still having problems installing or if you have any other troubles,
see the Unix FAQs on our website at https://www.stata.com/support/faqs/unix/.
If this does not help, contact Stata Technical Support. Please gather all theinformation you can about your system, including your computer model andthe type and version of Unix that you are using.

Troubleshooting Unix start-up
If you have attempted to invoke Stata(GUI) by typing xstata, xstata-se, or
xstata-mp at the Unix prompt and it has failed, attempt to invoke Stata(console)by typing stata, stata-se, or stata-mp at the Unix prompt. If Stata(console)
fails, continue here. If Stata(console) starts without problems, see the next
section of this chapter.
You tried to start Stata and it refused; Stata or your operating system presented
a message explaining that something is wrong. Here are the possibilities:

[ IG ] Installing Stata or StataNow for Unix

21

Cannot find Stata directory
Stata first checks in /usr/local/stata18 and then checks in /usr/local/stata
to find the license file. StataNow first chacks in /usr/local/statanow18 andthen in the two above directories. If Stata does not find the license in eitherof these locations, it looks in every directory in the Unix PATH. If you receive
this message, most likely the directory where Stata is installed is not in your
PATH. You need to add this directory to your PATH.
Cannot find license file

This message means just what it says; nothing is too seriously wrong. Statasimply could not find what it is looking for. The two most common reasonsfor this are that you did not complete the installation process or that Stata
is not installed where it should be.
Did you insert the codes on your License and Activation Key to unlock Stata?
If not, go back and complete the initialization procedure.
Assuming that you did unlock Stata, Stata is merely mislocated, or thelocation has not been filled in.
Error opening or reading the fileSomething is distinctly wrong and for purely technical reasons. Stata found
the file that it was looking for, but either the operating system refused to let
Stata open it or there was an I/O error.
The stata.lic file could have incorrect permissions. Verify that stata.lic is
in /usr/local/stata (or at least in the directory linked to /usr/local/stata)and that everybody has been granted read permission. To change the permissions, become superuser by logging in as root (using su or sudo) and typechmod a+r /usr/local/stata18/stata.lic.
Other messages

The other messages indicate that Stata thinks you are attempting to dosomething that you are not licensed to do. Most commonly, you are attempting
to run Stata over a network when you do not have a network license, but there
are many other alternatives. There are two possibilities: either you really areattempting to do something that you are not licensed to do, or Stata is wrong.
In either case, you are going to have to contact us. Your license can be
upgraded, or, if Stata is wrong, we can provide codes to make Stata stop
thinking that you are violating the license; see [U] 3.8 Technical support.

Stata(console) starts but Stata(GUI) does not
Trouble with libraries

Stata, like many other programs designed for Unix machines, needs certain
system libraries to run. Most of the standard library routines that Stata needs
are included in the Stata binary. However, Stata does rely on a few external
libraries. For example, Stata assumes that your system will have the standard C

22[ IG ] Installing Stata or StataNow for Unix

library available. Stata(GUI) assumes that you have the X Windows libraries
as well. These libraries are often located in different places on different
implementations of Unix. For example, under Linux, the standard C libraries
can be found in /lib, whereas the X Windows libraries are in /usr/lib. The
operating system needs to know where to find the libraries that Stata needs
to run. The Unix environment variable LD LIBRARY PATH tells the operating
system where to find libraries. If you get an error message that says something
likeld.so.1: xstata: fatal: some library.so.#: can’t open filethe likely reason is that the operating system cannot find the necessary
libraries. Stata does not rely on any unique libraries; you can rest assured
that the libraries you need are on your system. You should look for the
library in question on your system and make sure the environment variable
LD LIBRARY PATH includes the path to the directory where the library inquestion is located. Your system administrator may be able to help with thistask.
Setting the DISPLAY environment variable

Sometimes when executing Stata in a networked environment, Stata(GUI) willproduce the error message
You need X Windows for this version of Stata.

This means that Stata has not found the DISPLAY environment variable. You
need to set the DISPLAY variable to be the screen on which you want Stata(GUI)to appear. For example, in csh, type setenv DISPLAY machine:0.0.
xhost permissions

Another related error message can occur with Stata(GUI). When Stata is being
run in a networked environment, the computer on which Stata(GUI) is actually
executing may not have permission to draw on the screen of the computeron which you have asked Stata to draw. Then you may see the following:
Xlib: connection to machine name:0.0 refused by server
Xlib: Client is not authorized to connect to Server
xhost: unable to open display

This means that the machine that is actually executing the Stata instructions(the x-client in X Windows parlance) does not have permission to draw on
the screen of the computer that you have asked it to (the x-server). On themachine on which you want to display Stata(GUI), type% xhost +client machineThis will give the client permission to draw on the server.
Getting more help

If you continue to experience problems invoking Stata(GUI), please see theUnix FAQs on our website at https://www.stata.com/support/faqs/unix/, orcontact Stata Technical Support.

Platforms and editions

Available platforms
Stata for Mac requires a minimum of macOS 11.0 (Big Sur) for Macs withApple Silicon and macOS 10.13 (High Sierra) for Macs with Intel processors.
Stata for Windows is available for 64-bit x86-64 versions of Windows 11
and 10 and server versions of Windows from 2012R2 and later.
Stata for Unix is available for 64-bit Linux for x86-64.
Support for other platforms may have been added; contact us for the latest
information.

Available editions
Stata/MP
Professional version of Stata.
andParallel-processing capable.
StataNow/MP Fastest on multiple-core/multiple-processor machines.

Maximum of 120,000 variables; maximum of
1,099,511,627,775 observations.
Stata/SE
andStataNow/SE

Professional version of Stata.
Fastest on a single-processor machine.
Maximum of 32,767 variables; maximum of 2,147,483,619
observations.

Stata/BEandStataNow/BE

Professional version of Stata.
Very fast.
Maximum of 2,048 variables; maximum of 2,147,483,619
observations.

23Documentation
All the documentation for Stata is included in PDF format. You can open it
from within Stata by clicking on Help > PDF documentation. It is also linked
into Stata’s system help. If you want to get to the PDF documents directly,
they can be found in the docs subdirectory of the Stata installation directory.
There is also a copy of the manuals at the top level of the installation
installation media. For information about PDF viewers that we recommend
for viewing Stata documentation, please visit https://www.stata.com/support/
faqs/resources/pdf-documentation-tips/.
When reading the manuals, you will find references to other Stata manuals.
For example,[U] 27 Overview of Stata estimation commands[R] regress

The first example is a reference to chapter 27, Overview of Stata estimation commands, in the User’s Guide; and the second is a reference to theregress entry in the Base Reference Manual. All of these are clickable in the
PDF documentation.
All the manuals in the Stata Documentation have a shorthand notation asshown in the table on the following page.

24

[ IG ] Documentation

25

[GSM]
Getting Started with Stata for Mac[GSU]
Getting Started with Stata for Unix
[GSW]
Getting Started with Stata for Windows[U]
Stata User’s Guide[R]
Stata Base Reference Manual[ADAPT] Stata Adaptive Designs: Group Sequential Trials Reference Manual[BAYES] Stata Bayesian Analysis Reference Manual[BMA]
Stata Bayesian Model Averaging Reference Manual[CAUSAL] Stata Causal Inference and Treatment-Effects Estimation Reference Manual[CM]
Stata Choice Models Reference Manual[D]
Stata Data Management Reference Manual[DSGE] Stata Dynamic Stochastic General Equilibrium Models Reference Manual[ERM]
Stata Extended Regression Models Reference Manual[FMM]
Stata Finite Mixture Models Reference Manual[FN]
Stata Functions Reference Manual[G]
Stata Graphics Reference Manual[IRT]
Stata Item Response Theory Reference Manual[LASSO] Stata Lasso Reference Manual[XT]
Stata Longitudinal-Data/Panel-Data Reference Manual[META] Stata Meta-Analysis Reference Manual[ME]
Stata Multilevel Mixed-Effects Reference Manual[MI]
Stata Multiple-Imputation Reference Manual[MV]
Stata Multivariate Statistics Reference Manual[PSS]
Stata Power, Precision, and Sample-Size Reference Manual[P]
Stata Programming Reference Manual[RPT]
Stata Reporting Reference Manual[SP]
Stata Spatial Autoregressive Models Reference Manual[SEM]
Stata Structural Equation Modeling Reference Manual[SVY]
Stata Survey Data Reference Manual[ST]
Stata Survival Analysis Reference Manual[TABLES] Stata Customizable Tables and Collected Results Reference Manual[TS]
Stata Time-Series Reference Manual[I]
Stata Index[M]

Mata Reference Manual