Top Banner
i Stata R Release 13 Installation Guide Contents Simple installation ........................................ 1 Installing Stata for Windows ................................ 3 Installing Stata for Mac .................................... 9 Installing Stata for Unix .................................... 13 Platforms and flavors ...................................... 23 Documentation ........................................... 24 ® Copyright c 1985–2013 by StataCorp LP All rights reserved Version 13
28
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
  • iStata R Release 13 Installation Guide

    Contents

    Simple installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

    Installing Stata for Windows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

    Installing Stata for Mac . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

    Installing Stata for Unix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13

    Platforms and flavors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23

    Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24

    Copyright c 19852013 by StataCorp LPAll rights reservedVersion 13

  • 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 installStata/MP, Stata/SE, Stata/IC, or Small Stata.

    Stata for Windows installation

    1. Insert the installation media.

    2. If you have Auto-insert Notification enabled, the installer will start au-tomatically. Otherwise, you will want to navigate to your installationmedia and double-click on Setup.exe to start the installer.

    3. Go to page 3 for detailed instructions about the rest of the installation.

    Stata for Mac installation

    1. Insert the installation media.

    2. Open the installation media on the Desktop, and double-click on theInstaller application.

    3. Go to page 9 for detailed instructions about the rest of the installation.

    Stata for Unix installation

    1. Become superuser, and then insert and mount the installation media.

    2. Create the installation directory (we recommend /usr/local/stata13),and change to that directory.

    3. Type /media/Stata/install (assuming that /media/Stata is the path tothe installation media), and follow the prompts. Nothing will be writtento disk until you say it is okay to do so.

    4. Go to page 13 for detailed instructions about the rest of the installation.

    1

  • Installing Stata for Windows

    Upgrade or update?

    If you are using an earlier Stata release and you are upgrading to Stata 13, orif you have never installed Stata before on this computer, you need to readthis Installation Guide. If you have already installed Stata 13 and you wouldlike to install the latest updates to Stata 13, please refer to [GSW] 19 Updatingand extending StataInternet functionality.

    Upgrading to Stata/MP, Stata/SE, or Stata/IC

    If you have already installed a flavor of Stata 13 and have purchased anupgrade to Stata/MP, Stata/SE, or Stata/IC, run the installer again. CheckModify, click on Next, and choose the flavor(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 because yourexecutable will most likely be out of sync with your ado-files.

    Before you install

    Before you begin the installation procedure:

    1. Make sure you have the Stata installation media.

    2. Make sure you have a License and Activation Key.

    3. Determine from the License and Activation Key whether you should installStata/MP, Stata/SE, Stata/IC, or Small Stata.

    4. Decide where you want to install the Stata software. We recommendC:\Program Files (x86)\Stata13 on 64-bit Windows andC:\Program Files\Stata13 on 32-bit Windows.

    5. If you already have an old version of Stata on your system, decidewhether you want to keep it or uninstall it. We do not recommendhaving more than one version of Stata installed at a time, because it cancause confusing file-association behavior.

    3

  • 4 [ IG ] Installing Stata for Windows

    InstallationHave your Stata License and Activation Key with you.

    1. Insert the installation media.

    2. If you have Auto-insert Notification enabled, the installer will start au-tomatically. Otherwise, you will want to navigate to your installationmedia and double-click on Setup.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 Stata 13 Installation Wizard will start. Proceed as you would withany other software installation.

    5. Read and accept the software license agreement to proceed with theinstallation.

    6. The installer will display options for personalizing your installation andmaking Stata accessible to all users who share your computer. The defaultchoices are probably what you want. If not, make any necessary changes,and click on Next.

    7. At the Select Executable step, you can choose which type and flavor ofStata to install.

    a. Choose the flavor of Stata that matches your License and ActivationKey.

    b. If you have a 64-bit computer with 64-bit Microsoft Windowsinstalled, you must install a 64-bit version. For network instal-lations which require both 64-bit and 32-bit versions for clients,after completing the installation of the 64-bit version, run theinstaller again, as described in step 11 below, and install the32-bit version.

    c. If you have a 32-bit computer, you may only install a 32-bitversion of Stata.

    8. The installer will ask you where you want to install Stata.

    a. We recommend that you choose the default directory.

    b. If you want to install Stata on a network drive, you will need anetwork license. You can install Stata from the server, or if youhave the appropriate privileges, you can install Stata directly tothe network drive.

    c. When you have chosen an installation directory, click on Next.

  • [ IG ] Installing Stata for Windows 5

    9. The installer will then ask you where you want to set the default workingdirectory.

    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 Users Documents Folder.

    c. When you have chosen a default working directory, click onNext 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 flavors ofStata that are below the flavor of your license, you can run the installera second time. It will bring up the Application Maintenance dialog. CheckModify, and click on the Next button. You can then choose the flavor(s)of Stata that you would like to add.

    If you would like to install Stata by using the command line, please consulthttp://www.stata.com/support/faqs/win/autoinstall.html. Do this even if youhave installed previous versions of Stata via the command line, because thearguments have changed.

    Initialize the licenseYou now need to start Stata so that you can initialize the license. Go to theStata 13 program group in the Start menu, and click on the version of Statayou installed.

    The first time that you start Stata, it will prompt you for the information onyour 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 for Windows

    If you get the message The serial number, code, and authorization areinconsistent, try the initialization again. Be careful when typing your codeand authorization. Anything that looks like o is the letter oh, anything like0 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 often. These updates may include newfeatures and bug fixes that can be automatically downloaded and installed byStata from the Internet. There may be updates to Stata more recent than theversion of Stata on your installation media.

    The first time Stata is launched, a dialog will open asking you if you wouldlike 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 fromStata, visit http://www.stata.com/support/faqs/web/ for help.

    By default, automatic update checking is enabled. This ensures that yourStata is up to date, it is convenient, and it causes no problems even if you arenot connected to the Internet. If you disable automatic update checking, it isa good idea to periodically check for updates to Stata. See [GSW] 19 Updatingand extending StataInternet functionality for more information about updating.

  • [ IG ] Installing Stata for Windows 7

    Register your copy

    Make sure that your copy of Stata is registered. As a registered Stata user,you are entitled to free technical assistance should you have any questions,and we will keep you informed of any new products or advancements thathave been announced. To register your copy of Stata, fill out the onlineregistration form at http://www.stata.com/register/, or return the registrationcard that came with your Stata software.

    Creating network shortcuts

    If you installed Stata on a network drive, you will need to create shortcutson 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 editfield, 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. Ifthe workstation will be used by more than one user, consider changingthe Start in field to the environment variable %HOMEDRIVE%%HOMEPATH%.Doing so will set the default working directory to each users homedirectory.

    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.

    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 Openingand saving Stata datasets.

    If you experience any problems when trying to start Stata, see [GSW] A Trou-bleshooting Stata. (We are assuming that you have successfully installed Stataand have initialized the license. Please see page 24 for how to access thePDF documentation from outside Stata.)

  • 8 [ IG ] Installing Stata for Windows

    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: . exit

    no; data in memory would be lost

    r(4); If you would like to save your changes, you could save the dataset as yousave 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 http://www.stata.com/support/installation-qualification/.There you will find instructions for downloading and using the Stata InstallationQualification Tool (IQT). The tool will verify your installation not only afteryou initially install Stata, but also after every update you apply.

  • Installing Stata for Mac

    Upgrade or update?

    If you are using an earlier Stata release and you are upgrading to Stata 13, orif you have never installed Stata before on this computer, you need to readthis Installation Guide. If you have already installed Stata 13 and you wouldlike to install the latest updates to Stata 13, please refer to [GSM] 19 Updatingand extending StataInternet functionality.

    Upgrading to Stata/MP, Stata/SE, or Stata/IC

    If you have already installed a flavor of Stata 13 and have purchased anupgrade to Stata/MP, Stata/SE, or Stata/IC, run the installer again and selectAdd Stata/MP, Add Stata/SE, or Add Stata/IC 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 because yourexecutable will most likely be out of sync with your ado-files.

    Warning against multiple Stata applications

    We recommend against having more than one Stata application installed onthe same computer, because it can confuse the Finder. Why? Because whenyou 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, youmay be confused.

    Before you install

    Before you begin the installation procedure:

    1. Make sure you have the Stata installation media.

    2. Make sure you have a License and Activation Key.

    3. Determine from the License and Activation Key whether you should installStata/MP, Stata/SE, Stata/IC, or Small Stata.

    9

  • 10 [ IG ] Installing Stata for Mac

    4. You should not have any of your personal files in the Stata folder. Butif you do and wish to keep them, move them out of the Stata folderfirst.

    5. If you are upgrading, drag the current Stata folder to the Trash, andempty the Trash. Note: You must empty the Trash before proceeding.

    6. You are now ready to install.

    Installation

    1. Insert the installation media.

    2. Open the installation media from the Desktop, and double-click on theInstaller application to start the installation.

    3. After you have carefully read the Read Me file and have agreed to thesoftware license agreement, click on Continue.

    4. If you wish to change the folder that Stata will install to, changethe Destination. We recommend installing Stata in /Applications/Stata.Click on Continue.

    5. Choose the flavor of Stata that matches your license.

    6. Click on the Install button.

    7. Click on Quit after you see the message Installation was successful.

    Initialize the licenseYou 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 onyour 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 for Mac 11

    If you get the message The serial number, code, and authorization areinconsistent, try the initialization again. Be careful when typing your codeand authorization. Anything that looks like o is the letter oh, anything like0 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 often. These updates may include newfeatures and bug fixes that can be automatically downloaded and installed byStata from the Internet. There may be updates to Stata more recent than theversion of Stata on your installation media.

    The first time Stata is launched, a dialog will open asking you if you wouldlike 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 fromStata, visit http://www.stata.com/support/faqs/web/ for help.

    By default, automatic update checking is enabled. This ensures that yourStata is up to date, it is convenient, and it causes no problems even if you arenot connected to the Internet. If you disable automatic update checking, it isa good idea to periodically check for updates to Stata. See [GSM] 19 Updatingand extending StataInternet functionality for more information about updating.

  • 12 [ IG ] Installing Stata for Mac

    Register your copy

    Make sure that your copy of Stata is registered. As a registered Stata user,you are entitled to free technical assistance should you have any questions,and we will keep you informed of any new products or advancements thathave been announced. To register your copy of Stata, fill out the onlineregistration form at http://www.stata.com/register/, or return the registrationcard that came with your Stata software.

    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 Openingand saving Stata datasets.

    If you experience any problems when trying to start Stata, see [GSM] A Trou-bleshooting Stata. (We are assuming that you have successfully installed Stataand have initialized the license. Please see page 24 for how to access thePDF documentation from outside Stata.)

    Quitting Stata

    To quit Stata, select Quit from the Stata menu or press CommandQ. If youhave 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: . exit

    no; data in memory would be lost

    r(4); If you would like to save your changes, you could save the dataset as yousave any other file by using File > Save or CommandS. 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 for Unix

    Installation overviewThe outline of the installation process is as follows:

    1. Ensure that you have the Stata installation media and the License andActivation Key.

    2. As superuser, create the directory in which you want to install Stata.

    3. Change to that directory and run the installation script that is on theStata 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 ActivationKey. You will need both to install Stata. The codes in the License and ActivationKey are necessary for initializing the Stata software.

    Obtain superuser access

    You must be logged in as superuser (root) to install Stata. For varieties ofUnix that disable the root account by default, issue either the command sudosu - or the command su - to run as superuser during the installation. The #prompt below indicates that you are running as superuser.

    Create a directory for Stata

    We recommend that you install Stata in /usr/local/stata13.

    If you would like the path to the executables as seen by users to remain stableas you upgrade Stata in the future, you can create a symbolic link (type manln for more information) from /usr/local/stata13 to /usr/local/stata:

    # ln -s /usr/local/stata13 /usr/local/stata

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

    13

  • 14 [ IG ] Installing Stata for Unix

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

    Upgrading

    If you are upgrading from Stata 12, you can leave Stata 12 installed whereit is, allowing you to have both Stata 12 and Stata 13. Install Stata 13 in/usr/local/stata13 and leave Stata 12 alone.

    Have your users modify their shell start-up scripts to use the proper PATH forStata 13. Otherwise, when they run Stata, they will be running Stata 12.

    If you want to uninstall Stata 12, type

    # rm -r /usr/local/stata12

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

    Install Stata

    Set your current directory to /usr/local/stata13 and run the installationscript,

    # cd /usr/local/stata13

    # /media/Stata/install

    replacing /media/Stata with the path to the installation media if your devicepath differs (other common paths are /dev/cdrom and /mount/stata). If youhave trouble running the installer, it could be because your version of Unixwill not, by default, allow you to run applications from a installation media.Please see page 18 for more help.

    Follow the prompts. Nothing will be written until you say it is OK to do so.

    Initialize the license

    Initialize the license by typing

    # cd /usr/local/stata13

    # ./stinit

  • [ IG ] Installing Stata for Unix 15

    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 acceptthe 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 arenot case sensitive. You will also be asked to specify your name and addressif 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 thefuture, the license information will be displayed along with the name andaddress you enter. This information will also be written in system files thatStata 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 Stata reports whenit begins execution.

    If, for some reason, you need to reinitialize the license for an installedcopy of Stata, you will have to contact Stata Technical Support for specialinstructions.

    Set the message of the day (optional)

    Every time Stata is invoked, the contents of /usr/local/stata13/stata.msgare displayed. This feature provides a convenient way to communicate withStata users if you are administering a large site. As superuser, you may editthe file or erase it if you wish.

    Verify that Stata is working

    Now that you have completed the installation process, you should verify thateverything has been installed properly. You must log out as superuser and login again as a regular Stata user. The prompts below change to $ to indicateyour regular user status.

    To use Stata as a user, your path must include the Stata installation directory,and to run the GUI version, you must be running X Windows. For our quicktest, 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):

    $ stata

  • 16 [ IG ] Installing Stata for Unix

    For Stata(GUI):

    $ xstata

    Stata should launch. Use stata-se or xstata-se if you have Stata/SE, stata-mp or xstata-mp if you have Stata/MP, and stata-sm or xstata-sm if youhave Small Stata. If Stata does not start properly, see page 18.

    Assuming that nothing is wrong, type

    . exit

    $ exit

    The first exit took us out of Stata. The second exit took us out of the shthat we temporarily invoked.

    Modify shell start-up script

    Once you have verified that Stata is working, modify your shell start-upscript to include Stata in your path. We will assume that you have created asymbolic link from /usr/local/stata to your Stata installation directory. Ifyou did not create the recommended symbolic link, substitute your installationdirectory for /usr/local/stata in the paths below.

    If you use csh or tcsh, there is a line in your .cshrc file (in your homedirectory) that looks like

    set 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 homedirectory) 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 Stata installation directory and youhave included the path to the Stata installation directory, be sure that thesymbolic 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.Stata should now work from any directory on your computer.

  • [ IG ] Installing Stata for Unix 17

    Update Stata if necessary

    StataCorp releases updates to Stata often. These updates may include newfeatures and bug fixes that can be automatically downloaded and installed byStata from the Internet. There may be updates to Stata more recent than theversion of Stata on your installation media. You should check for updates toStata 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 to Stata. See [GSU] 19 Up-dating and extending StataInternet functionality for more information aboutupdating. If you have trouble connecting to the Internet from Stata, visithttp://www.stata.com/support/faqs/web/ for help.

    Starting Stata

    With Stata for Unix, you can choose between two user interfaces. The firstoption is the graphical user interface, or GUI, which we will refer to asStata(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.

    Upon installation, both interfaces are installed, but only the GUI version candisplay graphs. If you use X Windows, you will be able to invoke eitherinterface, GUI or console, at each session. See [GSU] 2 The Stata user interfacefor more information about the Stata user interface.

    To start Stata from a Unix prompt, type

    xstata or xstata-se or xstata-mp or xstata-sm to start Stata(GUI), or stata or stata-se or stata-mp or stata-sm 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 18.

    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.

  • 18 [ IG ] Installing Stata for Unix

    Exiting Stata

    To exit Stata(GUI), select Exit from the File menu or press Ctrl+Q. If youhave 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 onlyway to exit the console version of Stata, you will see the following in theResults window if you have made changes to your data: . exit

    no; data in memory would be lost

    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 eitherStata, 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 of Stata, it could be because youhave a recent copy of Unix that will not allow you to run applications froma DVD or USB drive. Type df -l to see what local devices are mounted; oneshould look like the Stata installation media. For example, you could seesomething like

    $ df -l

    Filesystem 1K-blocks Used Available Use% Mounted on

    /dev/hda6 23054660 5528268 16336380 26% /

    /dev/hdc 274158 274158 0 100% /media/Stata

    /dev/hdc is the device name, and /media/Stata is the mount point.

    If you see something indicating that the Stata installation media is successfullymounted, you need to see if you are being prevented from running applicationsdirectly from the installation media. Type mount to get information about anymounted file systems. Somewhere on the list, you should see informationabout your installation media. Continuing with the above example, you shouldsee 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)

  • [ IG ] Installing Stata for Unix 19

    If you see the term noexec appear, you are not allowed to run applications froma DVD or USB drive. Your best course of action is to copy everything fromthe Stata 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/stata13

    $ cd /usr/local/stata13

    $ sudo /tmp/statainstall/Stata/install

    After you have Stata running and initialized, you can delete the temporarydirectory /tmp/statainstall.

    If you are still having problems installing or if you have any other troubles,see the Unix FAQs on our website at http://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,xstata-mp, or xstata-sm at the Unix prompt and it has failed, attempt toinvoke Stata(console) by typing stata, stata-se, stata-mp, or stata-sm atthe Unix prompt. If Stata(console) fails, continue here. If Stata(console) startswithout problems, see the next section of this chapter.

    You tried to start Stata and it refused; Stata or your operating system presenteda message explaining that something is wrong. Here are the possibilities:

    Cannot find Stata directoryStata first checks in /usr/local/stata13 and then checks in /usr/local/statato find the license file. If Stata does not find the license in either of theselocations, it looks in every directory in the Unix PATH. If you receive thismessage, most likely the directory where Stata is installed is not in yourPATH. You need to add this directory to your PATH.

    Cannot find license fileThis 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 Statais 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.

  • 20 [ IG ] Installing Stata for Unix

    Error opening or reading the fileSomething is distinctly wrong and for purely technical reasons. Stata foundthe file that it was looking for, but either the operating system refused to letStata open it or there was an I/O error.

    The stata.lic file could have incorrect permissions. Verify that stata.lic isin /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 permis-sions, become superuser by logging in as root (using su or sudo) and typechmod a+r /usr/local/stata13/stata.lic.

    Other messagesThe other messages indicate that Stata thinks you are attempting to dosomething that you are not licensed to do. Most commonly, you are attemptingto run Stata over a network when you do not have a network license, but thereare 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 beupgraded, or, if Stata is wrong, we can provide codes to make Stata stopthinking that you are violating the license; see [U] 3.9 Technical support.

    Stata(console) starts but Stata(GUI) does not

    Trouble with librariesStata, like many other programs designed for Unix machines, needs certainsystem libraries to run. Most of the standard library routines that Stataneeds are included in the Stata binary. However, Stata does rely on a fewexternal libraries. For example, Stata assumes that your system will havethe standard C library available. Stata(GUI) assumes that you have the XWindows libraries as well. These libraries are often located in different placeson different implementations of Unix. For example, under Linux, the standardC libraries can be found in /lib, whereas the X Windows libraries are in/usr/lib; under Solaris, both the standard libraries and the X libraries arein /usr/lib. The operating system needs to know where to find the librariesthat Stata needs to run. The Unix environment variable LD LIBRARY PATHtells the operating system where to find libraries. If you get an error messagethat says something like

    ld.so.1: xstata: fatal: some library.so.#: cant open file

    the likely reason is that the operating system cannot find the necessarylibraries. Stata does not rely on any unique libraries; you can rest assuredthat the libraries you need are on your system. You should look for thelibrary in question on your system and make sure the environment variableLD LIBRARY PATH includes the path to the directory where the library inquestion is located. Your system administrator may be able to help with thistask.

  • [ IG ] Installing Stata for Unix 21

    Setting the DISPLAY environment variableSometimes 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. Youneed 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 permissionsAnother related error message can occur with Stata(GUI). When Stata is beingrun in a networked environment, the computer on which Stata(GUI) is actuallyexecuting 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 serverXlib: 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 onthe 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 machine

    This will give the client permission to draw on the server.

    Getting more helpIf you continue to experience problems invoking Stata(GUI), please seethe Unix FAQs on our website at http://www.stata.com/support/faqs/unix/, orcontact Stata Technical Support.

  • Platforms and flavors

    Available platforms

    Stata for Mac is available for 64-bit Intel-based Macs running Mac OS Xversion 10.6.8 or newer.

    Stata for Windows is available for 64-bit x86-64 and 32-bit x86 versions ofWindows 8 and 7, Vista, XP, and server versions of Windows.

    Stata for Unix is available for 64-bit Linux for x86-64, 32-bit Linux for x86,64-bit Solaris for SPARC, and 64-bit Solaris for x86-64.

    Support for other platforms may have been added; contact us for the latestinformation.

    Available flavors

    Stata/MP Professional version of Stata.Parallel-processing capable.Fastest on multiple-core/multiple-processor machines.Maximum of 32,767 variables; observations limited only bycomputer memory.

    Stata/SE Professional version of Stata.Fastest on a single-processor machine.Maximum of 32,767 variables; observations limited only bycomputer memory.

    Stata/IC Professional version of Stata.Very fast.Maximum of 2,047 variables; observations limited only by com-puter memory.

    Small Stata Stata for small computers.Slower than Stata/MP, Stata/SE, and Stata/IC.Maximum of 99 variables and 1,200 observations.

    23

  • Documentation

    All the documentation for Stata is included in PDF format. You can openit from within Stata by clicking on Help > PDF Documentation. It is alsolinked into Statas system help. If you want to get to the PDF documentsdirectly, they can be found in the docs subdirectory of the Stata instal-lation directory. There is also a copy of the manuals at the top levelof the installation installation media. For information about how to opti-mally set up Adobe Reader for viewing the PDF manuals, please visithttp://www.stata.com/support/faqs/res/documentation.html.

    When reading the manuals, you will find references to other Stata manuals.For example,

    [U] 26 Overview of Stata estimation commands[R] regress

    The first example is a reference to chapter 26, Overview of Stata estima-tion commands, in the Users Guide; and the second is a reference to theregress entry in the Base Reference Manual. All of these are clickable in thePDF documentation.

    24

  • [ IG ] Documentation 25

    All the manuals in the Stata Documentation have a shorthand notation:

    [GSM] Getting Started with Stata for Mac[GSU] Getting Started with Stata for Unix[GSW] Getting Started with Stata for Windows[U] Stata Users Guide[R] Stata Base Reference Manual[D] Stata Data Management Reference Manual[G] Stata Graphics Reference Manual[XT] Stata Longitudinal-Data/Panel-Data Reference Manual[ME] Stata Multilevel Mixed-Effects Reference Manual[MI] Stata Multiple-Imputation Reference Manual[MV] Stata Multivariate Statistics Reference Manual[PSS] Stata Power and Sample-Size Reference Manual[P] Stata Programming Reference Manual[SEM] Stata Structural Equation Modeling Reference Manual[SVY] Stata Survey Data Reference Manual[ST] Stata Survival Analysis and Epidemiological Tables Reference Manual[TS] Stata Time-Series Reference Manual[TE] Stata Treatment-Effects Reference Manual:

    Potential Outcomes/Counterfactual Outcomes

    [ I ] Stata Glossary and Index[M] Mata Reference Manual

  • Contents[IG] Installation GuideSimple installationBefore you installStata for Windows installationStata for Mac installationStata for Unix installation

    Installing Stata for WindowsUpgrade or update?Upgrading to Stata/MP, Stata/SE, or Stata/ICBefore you installInstallationInitialize the licenseUpdate Stata if necessaryRegister your copyCreating network shortcutsOther ways to start StataExiting StataVerifying installation

    Installing Stata for MacUpgrade or update?Upgrading to Stata/MP, Stata/SE, or Stata/ICWarning against multiple Stata applicationsBefore you installInstallationInitialize the licenseUpdate Stata if necessaryRegister your copyOther ways to start StataExiting Stata

    Installing Stata for UnixInstallation overviewFind your installation media and licenseObtain superuser accessCreate a directory for StataUpgradingInstall StataInitialize the licenseSet the message of the day (optional)Verify that Stata is workingModify shell start-up scriptUpdate Stata if necessaryStarting StataExiting StataTroubleshooting Unix installationTroubleshooting Unix start-upStata(console) starts but Stata(GUI) does not

    Platforms and flavorsAvailable platformsAvailable flavors

    Documentation

    [GS] Getting Started[GSM] MacContents1 Introducing Stata---sample sessionIntroducing StataSample sessionSimple data managementDescriptive statisticsA simple hypothesis testDescriptive statistics---correlation matricesGraphing dataModel fitting: Linear regressionCommands versus menusKeeping track of your workConclusion

    2 The Stata user interfaceThe windowsThe toolbarThe Command windowThe Results windowThe Review windowThe Variables windowThe Properties windowMenus and dialogsThe working directory

    3 Using the ViewerThe Viewer's purposeViewer buttonsViewer's functionViewing local text files, including SMCL filesViewing remote files over the InternetNavigating within the ViewerPrintingTabs in the ViewerRight-clicking on the Viewer windowSearching for help in the ViewerCommands in the ViewerUsing the Viewer from the Command window

    4 Getting helpSystem helpSearching helpHelp and search commandsThe Stata reference manuals and User's GuideThe Stata Journal and the Stata Technical BulletinStata videos

    5 Opening and saving Stata datasetsHow to load your dataset from disk and save it to disk

    6 Using the Data EditorThe Data EditorButtons on the Data EditorData entryNotes on data entryRenaming and formatting variablesCopying and pasting dataNotes on copying and pastingChanging dataWorking with snapshotsDates and the Data EditorData Editor adviceFiltering and hidingBrowse mode

    7 Using the Variables ManagerThe Variables ManagerThe Variable paneRight-clicking on the Variable paneThe Variable Properties paneManaging notes

    8 Importing dataCopying and pastingCommands for importing dataThe import delimited commandImporting files from other software

    9 Labeling dataMaking data readableThe dataset structure: The describe commandLabeling datasets and variablesLabeling values of variables

    10 Listing data and basic command syntaxCommand syntaxlist with a variable listlist with iflist with if, common mistakeslist with inControlling the list outputMoreBreak

    11 Creating new variablesgenerate and replacegeneratereplacegenerate with string variables

    12 Deleting variables and observationsclear, drop, and keepclear and drop _alldropkeep

    13 Using the Do-file Editor---automating StataThe Do-file EditorThe Do-file Editor toolbarUsing the Do-file EditorThe File menuThe Edit menuThe View > Do-file Editor menuSaving interactive commands from Stata as a do-fileProjects

    14 Graphing dataWorking with graphsA simple graph exampleGraph windowSaving and printing graphsRight-clicking on the Graph windowThe Graph button

    15 Editing graphsThe Graph Editor

    16 Saving and printing results by using logsUsing logs in StataLogging outputWorking with logsPrinting logsRerunning commands as do-files

    17 Setting font and window preferencesChanging and saving fonts and sizes and positions of your windowsGraph windowAll other windowsChanging color schemesManaging multiple sets of preferencesClosing and opening windows

    18 Learning more about StataWhere to go from hereSuggested reading from the User's Guide and reference manualsInternet resources

    19 Updating and extending Stata---Internet functionalityInternet functionality in StataUsing files from the InternetOfficial Stata updatesAutomatic update checkingFinding user-written programs by keywordDownloading user-written programs

    A Troubleshooting StataA.1 If Stata does not startA.2 Troubleshooting tips

    B Advanced Stata usageB.1 Executing commands every time Stata is startedB.2 Other ways to launch StataB.3 Stata batch modeB.4 Memory size considerations

    C More on Stata for MacC.1 Using Stata datasets and graphs created on other platformsC.2 Exporting a Stata graph to another documentC.3 Stata and the Notification ManagerC.4 Stata(console) for Mac OS X

    Subject indexABCDEFGHIJKLMNOPRSTUVWXY

    [GSU] UnixContents1 Introducing Stata---sample sessionIntroducing StataSample sessionSimple data managementDescriptive statisticsA simple hypothesis testDescriptive statistics---correlation matricesGraphing dataModel fitting: Linear regressionCommands versus menusKeeping track of your workConclusion

    2 The Stata user interfaceThe windowsThe toolbarThe Command windowThe Results windowThe Review windowThe Variables windowThe Properties windowMenus and dialogsThe working directory

    3 Using the ViewerThe Viewer in Stata(GUI)The Viewer's purposeViewer buttonsViewer's functionViewing local text files, including SMCL filesViewing remote files over the InternetNavigating within the ViewerPrintingTabs in the ViewerRight-clicking on the Viewer windowSearching for help in the ViewerCommands in the ViewerUsing the Viewer from the Command window

    4 Getting helpSystem helpSearching helpHelp and search commandsThe Stata reference manuals and User's GuideThe Stata Journal and the Stata Technical BulletinStata videos

    5 Opening and saving Stata datasetsHow to load your dataset from disk and save it to disk

    6 Using the Data EditorThe Data Editor in Stata(GUI)Buttons on the Data EditorData entryNotes on data entryRenaming and formatting variablesCopying and pasting dataNotes on copying and pastingChanging dataWorking with snapshotsDates and the Data EditorData Editor adviceFiltering and hidingBrowse mode

    7 Using the Variables ManagerThe Variables Manager in Stata(GUI)The Variable paneRight-clicking on the Variable paneThe Variable Properties paneManaging notes

    8 Importing dataCopying and pasting in Stata(GUI)Commands for importing dataThe import delimited commandImporting files from other software

    9 Labeling dataMaking data readableThe dataset structure: The describe commandLabeling datasets and variablesLabeling values of variables

    10 Listing data and basic command syntaxCommand syntaxlist with a variable listlist with iflist with if, common mistakeslist with inControlling the list outputMoreBreak

    11 Creating new variablesgenerate and replacegeneratereplacegenerate with string variables

    12 Deleting variables and observationsclear, drop, and keepclear and drop _alldropkeep

    13 Using the Do-file Editor---automating StataThe Do-file Editor in Stata(GUI)The Do-file Editor toolbarUsing the Do-file EditorThe File menuThe Edit menuThe Tools menuSaving interactive commands from Stata as a do-fileProjects

    14 Graphing dataWorking with graphsA simple graph exampleGraph windowSaving and printing graphsRight-clicking on the Graph windowThe Graph button

    15 Editing graphsThe Graph Editor

    16 Saving and printing results by using logsUsing logs in StataLogging outputWorking with logsPrinting logsRerunning commands as do-files

    17 Setting font and window preferencesChanging and saving fonts and sizes and positions of your windowsGraph windowAll other windowsChanging color schemesManaging multiple sets of preferencesClosing and opening windows

    18 Learning more about StataWhere to go from hereSuggested reading from the User's Guide and reference manualsInternet resources

    19 Updating and extending Stata---Internet functionalityInternet functionality in StataUsing files from the InternetOfficial Stata updatesFinding user-written programs by keywordDownloading user-written programs

    A Troubleshooting StataA.1 If Stata(GUI) and Stata(console) do not startA.2 If Stata(console) starts but Stata(GUI) does notA.3 Troubleshooting tips

    B Advanced Stata usageB.1 Executing commands every time Stata is startedB.2 Advanced starting of Stata for UnixB.3 Stata batch modeB.4 Using X Windows remotelyB.5 Summary of environment variablesB.6 Memory size considerations

    C Stata manual pages for UnixconrenSyntaxDescriptionFinding a color schemeCan your terminal underline?If you had successIf you did not have successAlso see

    stataSyntaxDescriptionRemarks and examples

    Subject indexABCDEFGHIKLMNOPRSTUVWXY

    [GSW] WindowsContents1 Introducing Stata---sample sessionIntroducing StataSample sessionSimple data managementDescriptive statisticsA simple hypothesis testDescriptive statistics---correlation matricesGraphing dataModel fitting: Linear regressionCommands versus menusKeeping track of your workConclusion

    2 The Stata user interfaceThe windowsThe toolbarThe Command windowThe Results windowThe Review windowThe Variables windowThe Properties windowMenus and dialogsThe working directoryFine control of Stata's windowsWindow typesDocking windowsAuto Hide and pinningNondocking windows

    3 Using the ViewerThe Viewer's purposeViewer buttonsViewer's functionViewing local text files, including SMCL filesViewing remote files over the InternetNavigating within the ViewerPrintingTabs in the ViewerRight-clicking on the Viewer windowSearching for help in the ViewerCommands in the ViewerUsing the Viewer from the Command window

    4 Getting helpSystem helpSearching helpHelp and search commandsThe Stata reference manuals and User's GuideThe Stata Journal and the Stata Technical BulletinStata videos

    5 Opening and saving Stata datasetsHow to load your dataset from disk and save it to disk

    6 Using the Data EditorThe Data EditorButtons on the Data EditorData entryNotes on data entryRenaming and formatting variablesCopying and pasting dataNotes on copying and pastingChanging dataWorking with snapshotsDates and the Data EditorData Editor adviceFiltering and hidingBrowse mode

    7 Using the Variables ManagerThe Variables ManagerThe Variable paneRight-clicking on the Variable paneThe Variable Properties paneManaging notes

    8 Importing dataCopying and pastingCommands for importing dataThe import delimited commandImporting files from other software

    9 Labeling dataMaking data readableThe dataset structure: The describe commandLabeling datasets and variablesLabeling values of variables

    10 Listing data and basic command syntaxCommand syntaxlist with a variable listlist with iflist with if, common mistakeslist with inControlling the list outputMoreBreak

    11 Creating new variablesgenerate and replacegeneratereplacegenerate with string variables

    12 Deleting variables and observationsclear, drop, and keepclear and drop _alldropkeep

    13 Using the Do-file Editor---automating StataThe Do-file EditorThe Do-file Editor toolbarUsing the Do-file EditorThe File menuThe Edit menuThe Tools menuSaving interactive commands from Stata as a do-fileProjects

    14 Graphing dataWorking with graphsA simple graph exampleGraph windowSaving and printing graphsRight-clicking on the Graph windowThe Graph button

    15 Editing graphsThe Graph Editor

    16 Saving and printing results by using logsUsing logs in StataLogging outputWorking with logsPrinting logsRerunning commands as do-files

    17 Setting font and window preferencesChanging and saving fonts and sizes and positions of your windowsGraph windowAll other windowsChanging color schemesManaging multiple sets of preferencesClosing and opening windows

    18 Learning more about StataWhere to go from hereSuggested reading from the User's Guide and reference manualsInternet resources

    19 Updating and extending Stata---Internet functionalityInternet functionality in StataUsing files from the InternetOfficial Stata updatesAutomatic update checkingFinding user-written programs by keywordDownloading user-written programs

    A Troubleshooting StataA.1 If Stata does not startA.2 Troubleshooting tips

    B Advanced Stata usageB.1 The Windows Properties SheetB.2 Making shortcutsB.3 Executing commands every time Stata is startedB.4 Other ways to launch StataB.5 Stata batch modeB.6 Running simultaneous Stata sessionsB.7 Memory size considerations

    C More on Stata for WindowsC.1 Using Stata datasets and graphs created on other platformsC.2 Exporting a Stata graph to another documentC.3 Installing Stata for Windows on a network driveC.4 Changing a Stata for Windows license

    Subject indexABCDEFGHIKLMNOPRSTUVWXY

    [U] User's GuideContentsStata basics1 Read this---it will help1.1 Getting Started with Stata1.2 The User's Guide and the Reference manuals1.3 What's new1.4 References

    2 A brief description of Stata2.1 Video example

    3 Resources for learning and using Stata3.1 Overview3.2 Stata on the Internet (www.stata.com and other resources)3.3 Stata Press3.4 The Stata listserver3.5 The Stata Journal3.6 Updating and adding features from the web3.7 Conferences and training3.8 Books and other support materials3.9 Technical support

    4 Stata's help and search facilities4.1 Introduction4.2 Getting started4.3 help: Stata's help system4.4 Accessing PDF manuals from help entries4.5 Searching4.6 More on search4.7 More on help4.8 search: All the details4.9 net search: Searching net resources

    5 Flavors of Stata5.1 Platforms5.2 Stata/MP, Stata/SE, Stata/IC, and Small Stata5.3 Size limits of Stata/MP, SE, IC, and Small Stata5.4 Speed comparison of Stata/MP, SE, IC, and Small Stata5.5 Feature comparison of Stata/MP, SE, and IC

    6 Managing memory6.1 Memory-size considerations6.2 Compressing data6.3 Setting maxvar6.4 Setting matsize6.5 The memory command

    7 --more-- conditions7.1 Description7.2 set more off7.3 The more programming command

    8 Error messages and return codes8.1 Making mistakes8.2 The return message for obtaining command timings

    9 The Break key9.1 Making Stata stop what it is doing9.2 Side effects of clicking on Break9.3 Programming considerations

    10 Keyboard use10.1 Description10.2 F-keys10.3 Editing keys in Stata10.4 Editing keys in Stata for Unix(console)10.5 Editing previous lines in Stata10.6 Tab expansion of variable names

    Elements of Stata11 Language syntax11.1 Overview11.2 Abbreviation rules11.3 Naming conventions11.4 varlists11.5 by varlist: construct11.6 Filenaming conventions11.7 References

    12 Data12.1 Data and datasets12.2 Numbers12.3 Dates and times12.4 Strings12.5 Formats: Controlling how data are displayed12.6 Dataset, variable, and value labels12.7 Notes attached to data12.8 Characteristics12.9 Data Editor and Variables Manager12.10 References

    13 Functions and expressions13.1 Overview13.2 Operators13.3 Functions13.4 System variables (_variables)13.5 Accessing coefficients and standard errors13.6 Accessing results from Stata commands13.7 Explicit subscripting13.8 Indicator values for levels of factor variables13.9 Time-series operators13.10 Label values13.11 Precision and problems therein13.12 References

    14 Matrix expressions14.1 Overview14.2 Row and column names14.3 Vectors and scalars14.4 Inputting matrices by hand14.5 Accessing matrices created by Stata commands14.6 Creating matrices by accumulating data14.7 Matrix operators14.8 Matrix functions14.9 Subscripting14.10 Using matrices in scalar expressions14.11 Reference

    15 Saving and printing output---log files15.1 Overview15.2 Placing comments in logs15.3 Logging only what you type15.4 The log-button alternative15.5 Printing logs15.6 Creating multiple log files for simultaneous use

    16 Do-files16.1 Description16.2 Calling other do-files16.3 Creating and running do-files16.4 Programming with do-files16.5 References

    17 Ado-files17.1 Description17.2 What is an ado-file?17.3 How can I tell if a command is built in or an ado-file?17.4 How can I look at an ado-file?17.5 Where does Stata look for ado-files?17.6 How do I install an addition?17.7 How do I add my own ado-files?17.8 How do I install official updates?17.9 How do I install updates to user-written additions?17.10 Reference

    18 Programming Stata18.1 Description18.2 Relationship between a program and a do-file18.3 Macros18.4 Program arguments18.5 Scalars and matrices18.6 Temporarily destroying the data in memory18.7 Temporary objects18.8 Accessing results calculated by other programs18.9 Accessing results calculated by estimation commands18.10 Storing results18.11 Ado-files18.12 Tools for interacting with programs outside Stata and with other languages18.13 A compendium of useful commands for programmers18.14 References

    19 Immediate commands19.1 Overview19.2 The display command19.3 The power command

    20 Estimation and postestimation commands20.1 All estimation commands work the same way20.2 Standard syntax20.3 Replaying prior results20.4 Cataloging estimation results20.5 Saving estimation results20.6 Specifying the estimation subsample20.7 Specifying the width of confidence intervals20.8 Formatting the coefficient table20.9 Obtaining the variance--covariance matrix20.10 Obtaining predicted values20.11 Accessing estimated coefficients20.12 Performing hypothesis tests on the coefficients20.13 Obtaining linear combinations of coefficients20.14 Obtaining nonlinear combinations of coefficients20.15 Obtaining marginal means, adjusted predictions, and predictive margins20.16 Obtaining conditional and average marginal effects20.17 Obtaining pairwise comparisons20.18 Obtaining contrasts, tests of interactions, and main effects20.19 Graphing margins, marginal effects, and contrasts20.20 Dynamic forecasts and simulations20.21 Obtaining robust variance estimates20.22 Obtaining scores20.23 Weighted estimation20.24 A list of postestimation commands20.25 References

    Advice21 Entering and importing data21.1 Overview21.2 Determining which method to use21.3 If you run out of memory21.4 Transfer programs21.5 ODBC sources21.6 Reference

    22 Combining datasets22.1 References

    23 Working with strings23.1 Description23.2 Categorical string variables23.3 Mistaken string variables23.4 Complex strings23.5 Reference

    24 Working with dates and times24.1 Overview24.2 Inputting dates and times24.3 Displaying dates and times24.4 Typing dates and times (datetime literals)24.5 Extracting components of dates and times24.6 Converting between date and time values24.7 Business dates and calendars24.8 References

    25 Working with categorical data and factor variables25.1 Continuous, categorical, and indicator variables25.2 Estimation with factor variables

    26 Overview of Stata estimation commands26.1 Introduction26.2 Means, proportions, and related statistics26.3 Linear regression with simple error structures26.4 Structural equation modeling (SEM)26.5 ANOVA, ANCOVA, MANOVA, and MANCOVA26.6 Generalized linear models26.7 Binary-outcome qualitative dependent-variable models26.8 ROC analysis26.9 Conditional logistic regression26.10 Multiple-outcome qualitative dependent-variable models26.11 Count dependent-variable models26.12 Exact estimators26.13 Linear regression with heteroskedastic errors26.14 Stochastic frontier models26.15 Regression with systems of equations26.16 Models with endogenous sample selection26.17 Models with time-series data26.18 Panel-data models26.19 Multilevel mixed-effects models26.20 Survival-time (failure-time) models26.21 Treatment-effect models26.22 Generalized method of moments (GMM)26.23 Estimation with correlated errors26.24 Survey data26.25 Multiple imputation26.26 Multivariate and cluster analysis26.27 Pharmacokinetic data26.28 Specification search tools26.29 Power and sample-size analysis26.30 Obtaining new estimation commands26.31 References

    27 Commands everyone should know27.1 41 commands27.2 The by construct

    28 Using the Internet to keep up to date28.1 Overview28.2 Sharing datasets (and other files)28.3 Official updates28.4 Downloading and managing additions by users28.5 Making your own download site

    Subject and author indexSymbolsABCDEFGHIJKLMNOPQRSTUVWY

    [D] Data ManagementContentsintroDescriptionRemarks and examplesWhat's new

    Also see

    data managementDescriptionReferenceAlso see

    appendSyntaxMenuDescriptionOptionsRemarks and examplesAlso see

    assertSyntaxDescriptionOptionsRemarks and examplesAlso see

    bcalSyntaxMenuDescriptionOption for bcal checkOptions for bcal createRemarks and examplesStored resultsAlso see

    bySyntaxDescriptionOptionsRemarks and examplesReferencesAlso see

    cdSyntaxDescriptionRemarks and examplesStata for WindowsStata for MacStata for Unix

    Also see

    cfSyntaxMenuDescriptionOptionsRemarks and examplesStored resultsMethods and formulasAcknowledgmentReferenceAlso see

    changeeolSyntaxDescriptionOptionsRemarks and examplesAlso see

    checksumSyntaxDescriptionOptionsRemarks and examplesStored resultsAlso see

    clearSyntaxDescriptionRemarks and examplesAlso see

    clonevarSyntaxMenuDescriptionRemarks and examplesAcknowledgmentsAlso see

    codebookSyntaxMenuDescriptionOptionsRemarks and examplesStored resultsReferencesAlso see

    collapseSyntaxMenuDescriptionOptionsRemarks and examplesIntroductory examplesVariablewise or casewise deletionWeightsA final example

    AcknowledgmentAlso see

    compareSyntaxMenuDescriptionRemarks and examplesAlso see

    compressSyntaxMenuDescriptionOptionRemarks and examplesAlso see

    contractSyntaxMenuDescriptionOptionsRemarks and examplesAcknowledgmentsReferenceAlso see

    copySyntaxDescriptionOptionsRemarks and examplesAlso see

    corr2dataSyntaxMenuDescriptionOptionsRemarks and examplesMethods and formulasReferenceAlso see

    countSyntaxMenuDescriptionRemarks and examplesStored resultsReferencesAlso see

    crossSyntaxMenuDescriptionRemarks and examplesReferencesAlso see

    data typesDescriptionRemarks and examplesPrecision of numeric storage types

    Also see

    datasignatureSyntaxMenuDescriptionOptionsRemarks and examplesUsing datasignature interactivelyUsing datasignature in do-filesInterpreting data signaturesThe logic of data signatures

    Stored resultsMethods and formulasReferenceAlso see

    datetimeSyntaxTypes of dates and their human readable forms (HRFs)Stata internal form (SIF)HRF-to-SIF conversion functionsDisplaying SIFs in HRFBuilding SIFs from componentsSIF-to-SIF conversionExtracting time-of-day components from SIFsExtracting date components from SIFsConveniently typing SIF valuesObtaining and working with durationsUsing dates and times from other software

    DescriptionRemarks and examplesReferencesAlso see

    datetime business calendarsSyntaxDescriptionRemarks and examplesStep 1: Read the data, date as stringStep 2: Convert date variable to %td dateStep 3: Convert %td date to %tb dateKey feature: Each business calendar has its own encodingKey feature: Omitted dates really are omittedKey feature: Extracting components from %tb datesKey feature: Merging on dates

    Also see

    datetime business calendars creationSyntaxDescriptionRemarks and examplesIntroductionConceptsThe preliminary commandsThe omit commands: from/to and ifThe omit commands: andThe omit commands: omit dateThe omit commands: omit dayofweekThe omit commands: omit dowinmonthCreating stbcal-files with bcal createWhere to place stbcal-filesHow to debug stbcal-filesIdeas for calendars that may not occur to you

    Also see

    datetime display formatsSyntaxDescriptionRemarks and examplesSpecifying display formatsTimes are truncated, not rounded, when displayed

    Also see

    datetime translationSyntaxDescriptionRemarks and examplesIntroductionSpecifying the maskHow the HRF-to-SIF functions interpret the maskWorking with two-digit yearsWorking with incomplete dates and timesTranslating run-together dates, such as 20060125Valid timesThe clock() and Clock() functionsWhy there are two SIF datetime encodingsAdvice on using datetime/c and datetime/CDetermining when leap seconds occurredThe date() functionThe other translation functions

    Also see

    describeSyntaxMenuDescriptionOptions to describe data in memoryOptions to describe data in fileRemarks and examplesdescribedescribe, replace

    Stored resultsReferencesAlso see

    destringSyntaxMenuDescriptionOptions for destringOptions for tostringRemarks and examplesdestringtostringSaved characteristics

    AcknowledgmentReferencesAlso see

    dirSyntaxDescriptionOptionRemarks and examplesAlso see

    drawnormSyntaxMenuDescriptionOptionsRemarks and examplesMethods and formulasReferencesAlso see

    dropSyntaxMenuDescriptionRemarks and examplesReferenceAlso see

    dsSyntaxMenuDescriptionOptionsRemarks and examplesStored resultsAcknowledgmentsReferencesAlso see

    duplicatesSyntaxMenuDescriptionOptionsOptions for duplicates examples and duplicates listOption for duplicates tagOption for duplicates drop

    Remarks and examplesAcknowledgmentsReferencesAlso see

    editSyntaxMenuDescriptionOptionRemarks and examplesModesThe current observation and current variableAssigning value labels to variablesChanging values of existing cellsAdding new variablesAdding new observationsCopying and pastingLogging changesAdvice

    ReferencesAlso see

    egenSyntaxMenuDescriptionRemarks and examplesSummary statisticsGenerating patternsMarking differences among variablesRanksStandardized variablesRow functionsCategorical and integer variablesString variablesU.S. marginal income tax rate

    Methods and formulasAcknowledgmentsReferencesAlso see

    encodeSyntaxMenuDescriptionOptions for encodeOptions for decodeRemarks and examplesencodedecode

    ReferenceAlso see

    eraseSyntaxDescriptionRemarks and examplesAlso see

    expandSyntaxMenuDescriptionOptionRemarks and examplesReferenceAlso see

    expandclSyntaxMenuDescriptionOptionsRemarks and examplesAlso see

    exportDescriptionRemarks and examplesSummary of the different methodsexport excelexport delimitedodbcoutfileexport sasxportxmlsave

    Also see

    filefilterSyntaxDescriptionOptionsRemarks and examplesStored resultsReferenceAlso see

    fillinSyntaxMenuDescriptionRemarks and examplesReferencesAlso see

    formatSyntaxMenuDescriptionOptionRemarks and examplesSetting formatsSetting European formatsDetails of formatsOther effects of formatsDisplaying current formats

    ReferencesAlso see

    functionsDescriptionMathematical functionsabs()acos()acosh()asin()asinh()atan()atan2()atanh()ceil()cloglog()comb()cos()cosh()digamma()exp()floor()int()invcloglog()invlogit()ln()lnfactorial()lngamma()log()log10()logit()max()min()mod()reldif()round()sign()sin()sinhh()sqrt()sum()tan()tanh()trigamma()trunc()

    Probability distributions and density functionsBeta and noncentral beta distributionsibeta()betaden()ibetatail()invibeta()invibetatail()nibeta()invnibeta()Binomial distributionbinomial()binomialp()binomialtail()invbinomial()invbinomialtail()Chi-squared and noncentral chi-squared distributionschi2()chi2den()chi2tail()invchi2()invchi2tail()nchi2()invnchi2()npnchi2()Dunnett's multiple range distributiondunnettprob()invdunnettprob()F and noncentral F distributionsF()Fden()Ftail()invF()invFtail()nF()nFtail()invnFtail()npnF()Gamma distributiongammap()gammaden()gammaptail()invgammap()invgammaptail()dgammapda()dgammapdada()dgammapdadx()dgammapdx()dgammapdxdx()Hypergeometric distributionhypergeometric()hypergeometricp()Negative binomial distributionnbinomial()nbinomialp()nbinomialtail()invnbinomial()invnbinomiailtail()Normal (Gaussian), log of the normal, and binormal distributionsbinormal()normal()normalden()invnormal()lnnormal()Poisson distributionpoisson()poissonp()poissontail()invpoisson()invpoissontail()Student's t and noncentral Student's t distributionst()tden()ttail()invt()invttail()nt()ntden()nttail()invnttail()npnt()Tukey's Studentized range distributiontukeyprob()invtukeyprob()

    Random-number functionsruniform()rbeta()rbinomial()rchi2()rgamma()rhypergeometric()rnbinomial()rnormal()rpoisson()rt()

    String functionsabbrev()char()indexnot()itrim()length()lower()ltrim()plural()proper()real()regexm()regexr()regexs()reverse()rtrim()soundex()soundex_nara()strcat()strdup()string()strlen()strlower()strltrim()strmatch()strofreal()strpos()strproper()strreverse()strrtrim()strtoname()strtrim()strupper()subinstr()subinword()substr()trim()upper()word()wordcount()

    Programming functionsautocode()byteorder()c()_caller()chop()clip()cond()e()e(sample)epsdouble()epsfloat()fileexists()fileread()filereaderror()filewrite()float()fmtwidth()has_eprop()inlist()inrange()irecode()matrix()maxbyte()maxdouble()maxfloat()maxint()maxlong()mi()minbyte()mindouble()minfloat()minint()minlong()missing()r()recode()replay()return()s()scalar()smallestdouble()

    Date and time functionsbofd()Cdhms()clock()Cmdyhms()Cofc()cofC()Cofd()cofd()daily()date()day()dhms()dofb()dofC()dofc()dofh()dofm()dofq()dofw()dofy()dow()doy()halfyear()halfyearly()hh()hhC()hms()hofd()hours()mdy()mdyhms()minutes()mm()mmC()mofd()month()monthly()msofhours()msofminutes()msofseconds()qofd()quarter()quarterly()seconds()ss()ssC()tC()tc()td()th()tm()tq()tw()week()weekly()wofd()year()yearly()yh()ym()yofd()yq()yw()

    Selecting time spanstin()

    Matrix functions returning a matrixcholesky()corr()diag()get()hadamard()I()inv()invsym()J()matuniform()nullmat()sweep()vec()vecdiag()

    Matrix functions returning a scalarcolsof()det()diag0cnt()el()issymmetric()matmissing()mreldif()rownumb()rowsof()trace()

    AcknowledgmentsReferencesAlso see

    generateSyntaxMenuDescriptionOptionsRemarks and examplesgenerate and replaceset type

    Methods and formulasReferencesAlso see

    gsortSyntaxMenuDescriptionOptionsRemarks and examplesAlso see

    hexdumpSyntaxDescriptionOptionsRemarks and examplesStored resultsAlso see

    icd9SyntaxMenuDescriptionOptionsOptions for icd9 checkOptions for icd9 cleanOptions for icd9 generateOption for icd9 search

    Remarks and examplesDescriptions

    Stored resultsReference

    importDescriptionRemarks and examplesSummary of the different methodsimport excelimport delimitedodbcinfile (free format){---}infile without a dictionaryinfix (fixed format)infile (fixed format){---}infile with a dictionaryimport sasxportimport haver (Windows only)xmluse

    ExamplesVideo example

    ReferenceAlso see

    import delimitedSyntaxMenuDescriptionOptions for import delimitedOptions for export delimitedRemarks and examplesimport delimitedexport delimited

    Also see

    import excelSyntaxMenuDescriptionOptions for import excelOptions for export excelRemarks and examplesVideo example

    Stored resultsReferenceAlso see

    import haverSyntaxMenuDescriptionOptions for import haverOptions for import haver, describeOption for set haverdirRemarks and examplesInstallationSetting the path to Haver databasesDownload example Haver databasesDetermining the contents of a Haver databaseLoading a Haver databaseLoading a Haver database from a describe fileTemporal aggregationDaily dataWeekly data

    Stored resultsAcknowledgmentAlso see

    import sasxportSyntaxMenuDescriptionOptions for import sasxportOption for import sasxport, describeOptions for export sasxportRemarks and examplesSaving XPORT files for transferring to SASDetermining the contents of XPORT files received from SASUsing XPORT files received from SAS

    Stored resultsTechnical appendixA1. Overview of SAS XPORT Transport formatA2. Implications for writing XPORT datasets from StataA3. Implications for reading XPORT datasets into Stata

    Also see

    infile (fixed format)SyntaxMenuDescriptionOptionsDictionary directives

    Remarks and examplesIntroductionReading free-format filesReading fixed-format filesNumeric formatsString formatsSpecifying column and line numbersExamples of reading fixed-format filesReading fixed-block filesReading EBCDIC files

    ReferencesAlso see

    infile (free format)SyntaxMenuDescriptionOptionsRemarks and examplesReading free-format dataReading comma-separated dataSpecifying variable typesReading string variablesSkipping variablesSkipping observationsReading time-series data

    Also see

    infix (fixed format)SyntaxMenuDescriptionOptionsSpecifications

    Remarks and examplesTwo ways to use infixReading string variablesReading data with multiple lines per observationReading subsets of observations

    Also see

    inputSyntaxDescriptionOptionsRemarks and examplesReferenceAlso see

    inspectSyntaxMenuDescriptionRemarks and examplesStored resultsAlso see

    ipolateSyntaxMenuDescriptionOptionsRemarks and examplesMethods and formulasReferenceAlso see

    isidSyntaxMenuDescriptionOptionsRemarks and examplesAlso see

    joinbySyntaxMenuDescriptionOptionsRemarks and examplesAcknowledgmentReferenceAlso see

    labelSyntaxMenuDescriptionOptionsRemarks and examplesStored resultsReferencesAlso see

    label languageSyntaxMenuDescriptionOptionRemarks and examplesCreating labels in the first languageCreating labels in the second and subsequent languagesCreating labels from a clean slateCreating labels from a previously existing languageSwitching languagesChanging the name of a languageDeleting a languageAppendix: Selected ISO 639-1 two-letter codes

    Stored resultsMethods and formulasReferencesAlso see

    labelbookSyntaxMenuDescriptionOptionsOptions for labelbookOptions for numlabelOptions for uselabel

    Remarks and exampleslabelbookDiagnosing problemsnumlabeluselabel

    Stored resultsAcknowledgmentsReferencesAlso see

    listSyntaxMenuDescriptionOptionsRemarks and examplesReferencesAlso see

    lookforSyntaxDescriptionRemarks and examplesStored resultsReferencesAlso see

    memorySyntaxDescriptionOptionsRemarks and examplesExamplesSerious bug in Linux OSNotes for system administrators

    Stored resultsReferenceAlso see

    mergeSyntaxMenuDescriptionOptionsRemarks and examplesOverviewBasic description1:1 mergesm:1 merges1:m mergesm:m mergesSequential mergesTreatment of overlapping variablesSort orderTroubleshooting m:m mergesExamples

    ReferencesAlso see

    missing valuesDescriptionRemarks and examplesReferenceAlso see

    mkdirSyntaxDescriptionOptionRemarks and examplesAlso see

    mvencodeSyntaxMenuDescriptionOptionsRemarks and examplesAcknowledgmentAlso see

    notesSyntaxMenuDescriptionRemarks and examplesHow notes are numberedAttaching and listing notesSelectively listing notesSearching and replacing notesDeleting notesWarnings

    ReferencesAlso see

    obsSyntaxDescriptionRemarks and examplesAlso see

    odbcSyntaxMenuDescriptionOptionsRemarks and examplesSetting up the data sourcesListing ODBC data source namesListing available table names from a specified data source's system catalogDescribing a specified tableLoading data from ODBC sources

    Also see

    orderSyntaxMenuDescriptionOptionsRemarks and examplesReferencesAlso see

    outfileSyntaxMenuDescriptionOptionsRemarks and examplesAlso see

    pctileSyntaxMenuDescriptionOptionsRemarks and examplespctilextile_pctile

    Stored resultsMethods and formulasAcknowledgmentAlso see

    putmataSyntaxDescriptionOptions for putmataOptions for getmataRemarks and examplesUse of putmataUse of putmata and getmataUsing putmata and getmata on subsets of observationsUsing viewsConstructing do-files

    Stored resultsReferenceAlso see

    rangeSyntaxMenuDescriptionRemarks and examplesAlso see

    recastSyntaxDescriptionOptionRemarks and examplesAlso see

    recodeSyntaxMenuDescriptionOptionsRemarks and examplesSimple examplesSetting up value labels with recodeReferring to the minimum and maximum in rulesRecoding missing valuesRecoding subsets of the dataOtherwise rulesTest for overlapping rules

    AcknowledgmentAlso see

    renameSyntaxMenuDescriptionRemarks and examplesReferencesAlso see

    rename groupSyntaxMenuDescriptionOptions for renaming variablesOptions for changing the case of groups of variable namesRemarks and examplesAdviceExplanation* matches 0 or more characters; use ?* to match 1 or more* is greedy# is greedier

    Stored resultsAlso see

    reshapeSyntaxMenuDescriptionOptionsRemarks and examplesDescription of basic syntaxWide and long data formsAvoiding and correcting mistakesreshape long and reshape wide without argumentsMissing variablesAdvanced issues with basic syntax: i()Advanced issues with basic syntax: j()Advanced issues with basic syntax: xijAdvanced issues with basic syntax: String identifiers for j()Advanced issues with basic syntax: Second-level nestingDescription of advanced syntax

    Stored resultsAcknowledgmentReferencesAlso see

    rmdirSyntaxDescriptionRemarks and examplesAlso see

    sampleSyntaxMenuDescriptionOptionsRemarks and examplesReferencesAlso see

    saveSyntaxMenuDescriptionOptions for saveOptions for saveoldRemarks and examplesAlso see

    separateSyntaxMenuDescriptionOptionsRemarks and examplesStored resultsAcknowledgmentReferenceAlso see

    shellSyntaxDescriptionRemarks and examplesStata for WindowsStata for MacStata for Unix(GUI)Stata for Unix(console)

    Also see

    snapshotSyntaxMenuDescriptionOptionRemarks and examplesStored resultsAlso see

    sortSyntaxMenuDescriptionOptionRemarks and examplesReferencesAlso see

    splitSyntaxMenuDescriptionOptionsRemarks and examplesStored resultsAcknowledgmentsAlso see

    stackSyntaxMenuDescriptionOptionsRemarks and examplesReferenceAlso see

    statsbySyntaxMenuDescriptionOptionsRemarks and examplesCollecting coefficients and standard errorsCollecting stored resultsAll subsets

    AcknowledgmentReferencesAlso see

    sysuseSyntaxMenuDescriptionOptionsRemarks and examplesTypical useA note concerning shipped datasetsUsing user-installed datasetsHow sysuse works

    Stored resultsAlso see

    typeSyntaxDescriptionOptionsRemarks and examplesAlso see

    useSyntaxMenuDescriptionOptionsRemarks and examplesAlso see

    varmanageSyntaxMenuDescriptionRemarks and examplesAlso see

    webuseSyntaxMenuDescriptionOptionRemarks and examplesTypical useA note concerning example datasetsRedirecting the source

    Also see

    xmlsaveSyntaxMenuDescriptionOptions for xmlsaveOptions for xmluseRemarks and examplesAlso see

    xposeSyntaxMenuDescriptionOptionsRemarks and examplesMethods and formulasReferencesAlso see

    zipfileSyntaxDescriptionOption for zipfileOption for unzipfileRemarks and examples

    Subject and author indexSymbolsABCDEFGHIJKLMNOPQRSTUVWXYZ

    [G] GraphicsContentsIntroductionintroDescriptionRemarks and examplesWhat's new

    Also see

    graph introRemarks and examplesSuggested reading orderA quick tourUsing the menus

    ReferencesAlso see

    graph editorRemarks and examplesQuick startIntroductionStarting and stopping the Graph EditorThe toolsThe Object BrowserRight-click menus, or Contextual menusThe Standard ToolbarThe main Graph Editor menuGrid editingGraph RecorderTips, tricks, and quick edits

    Also see

    CommandsgraphSyntaxDescriptionRemarks and examplesAlso see

    graph barSyntaxMenuDescriptionOptionsgroup_optionsyvar_optionslookofbar_optionslegending_optionsaxis_optionstitle_and_other_optionsSuboptions for use with over() and yvaroptions()

    Remarks and examplesIntroductionExamples of syntaxTreatment of barsTreatment of dataMultiple bars (overlapping the bars)Controlling the text of the legendMultiple over()s (repeating the bars)Nested over()sCharts with many categoriesHow bars are orderedReordering the barsPutting the bars in a prespecified orderPutting the bars in height orderPutting the bars in a derived orderReordering the bars, exampleUse with by()Video exampleHistory

    ReferencesAlso see

    graph boxSyntaxMenuDescriptionOptionsgroup_optionsyvar_optionsboxlook_optionslegending_optionsaxis_optionstitle_and_other_optionsSuboptions for use with over() and yvaroptions()

    Remarks and examplesIntroductionExamples of syntaxTreatment of multiple yvars versus treatment of over() groupsHow boxes are orderedReordering the boxesPutting the boxes in a prespecified orderPutting the boxes in median orderUse with by()Video exampleHistory

    Methods and formulasReferencesAlso see

    graph combineSyntaxDescriptionOptionsRemarks and examplesTypical useTypical use with memory graphsCombining twoway graphsAdvanced useControlling the aspect ratio of subgraphs

    Also see

    graph copySyntaxMenuDescriptionOptionRemarks and examplesAlso see

    graph describeSyntaxMenuDescriptionRemarks and examplesStored resultsAlso see

    graph dirSyntaxDescriptionOptionsRemarks and examplesStored resultsAlso see

    graph displaySyntaxMenuDescriptionOptionsRemarks and examplesChanging the size and aspect ratioChanging the margins and aspect ratioChanging the scheme

    Also see

    graph dotSyntaxMenuDescriptionOptionsgroup_optionsyvar_optionslinelook_optionslegending_optionsaxis_optionstitle_and_other_optionsSuboptions for use with over() and yvaroptions()

    Remarks and examplesRelationship between dot plots and horizontal bar chartsExamplesAppendix: Examples of syntax

    ReferencesAlso see

    graph dropSyntaxMenuDescriptionRemarks and examplesTypical useRelationship between graph drop _all and discardErasing graphs on disk

    Also see

    graph exportSyntaxDescriptionOptionsRemarks and examplesExporting the graph displayed in a Graph windowExporting a graph stored on diskExporting a graph stored in memory

    Also see

    graph manipulationSyntaxDescriptionRemarks and examplesOverview of graphs in memory and graphs on diskSummary of graph manipulation commands

    Also see

    graph matrixSyntaxMenuDescriptionOptionsRemarks and examplesTypical useMarker symbols and the number of observationsControlling the axes labelingAdding grid linesAdding titlesUse with by()History

    ReferencesAlso see

    graph otherSyntaxDescriptionRemarks and examplesAlso see

    graph pieSyntaxMenuDescriptionOptionsRemarks and examplesTypical useData are summedData may be long rather than wideHow slices are orderedOrdering slices by sizeReordering the slicesUse with by()Video exampleHistory

    ReferencesAlso see

    graph playSyntaxDescriptionRemarks and examplesAlso see

    graph printSyntaxDescriptionOptionsRemarks and examplesPrinting the graph displayed in a Graph windowPrinting a graph stored on diskPrinting a graph stored in memoryAppendix: Setting up Stata for Unix to print graphs

    Also see

    graph querySyntaxMenuDescriptionRemarks and examplesAlso see

    graph renameSyntaxMenuDescriptionOptionRemarks and examplesAlso see

    graph saveSyntaxDescriptionOptionsRemarks and examplesAlso see

    graph setSyntaxDescriptionRemarks and examplesOverviewSetting defaults

    Also see

    graph twowaySyntaxMenuDescriptionRemarks and examplesDefinitionSyntaxMultiple if and in restrictionstwoway and plot options

    graph twoway areaSyntaxMenuDescriptionOptionsRemarks and examplesTypical useAdvanced useCautions

    Also see

    graph twoway barSyntaxMenuDescriptionOptionsRemarks and examplesTypical useAdvanced use: OverlayingAdvanced use: Population pyramidCautions

    Also see

    graph twoway connectedSyntaxMenuDescriptionOptionsRemarks and examplesAlso see

    graph twoway contourSyntaxMenuDescriptionOptionsRemarks and examplesControlling the number of contours and their valuesControlling the colors of the contour areasChoose the interpolation methodVideo example

    ReferenceAlso see

    graph twoway contourlineSyntaxMenuDescriptionOptionsRemarks and examplesControlling the number of contour lines and their valuesControlling the colors of the contour linesChoose the interpolation method

    Also see

    graph twoway dotSyntaxMenuDescriptionOptionsRemarks and examplesReferenceAlso see

    graph twoway droplineSyntaxMenuDescriptionOptionsRemarks and examplesTypical useAdvanced useCautions

    Also see

    graph twoway fpfitSyntaxMenuDescriptionOptionsRemarks and examplesTypical useCautionsUse with by()

    Also see

    graph twoway fpfitciSyntaxMenuDescriptionOptionsRemarks and examplesTypical useAdvanced useCautionsUse with by()

    Also see

    graph twoway functionSyntaxMenuDescriptionOptionsRemarks and examplesTypical useAdvanced use 1Advanced use 2

    ReferenceAlso see

    graph twoway histogramSyntaxMenuDescriptionOptions for use in the discrete caseOptions for use in the continuous caseOptions for use in both casesRemarks and examplesRelationship between graph twoway histogram and histogramTypical useUse with by()History

    ReferencesAlso see

    graph twoway kdensitySyntaxMenuDescriptionOptionsRemarks and examplesTypical useUse with by()

    ReferencesAlso see

    graph twoway lfitSyntaxMenuDescriptionOptionsRemarks and examplesTypical useCautionsUse with by()

    Also see

    graph twoway lfitciSyntaxMenuDescriptionOptionsRemarks and examplesTypical useAdvanced useCautionsUse with by()

    Also see

    graph twoway lineSyntaxMenuDescriptionOptionsRemarks and examplesOneway equivalency of line and scatterTypical useAdvanced useCautions

    Also see

    graph twoway lowessSyntaxMenuDescriptionOptionsRemarks and examplesTypical useUse with by()

    ReferencesAlso see

    graph twoway lpolySyntaxMenuDescriptionOptionsRemarks and examplesTypical useUse with by()

    ReferencesAlso see

    graph twoway lpolyciSyntaxMenuDescriptionOptionsRemarks and examplesTypical useUse with by()

    Also see

    graph twoway mbandSyntaxMenuDescriptionOptionsRemarks and examplesTypical useUse with by()

    Also see

    graph twoway msplineSyntaxMenuDescriptionOptionsRemarks and examplesTypical useCautionsUse with by()

    Also see

    graph twoway pcarrowSyntaxMenuDescriptionOptionsRemarks and examplesBasic useAdvanced use

    ReferencesAlso see

    graph twoway pcarrowiSyntaxMenuDescriptionOptionsRemarks and examplesAlso see

    graph twoway pccapsymSyntaxMenuDescriptionOptionsRemarks and examplesBasic use 1Basic use 2

    Also see

    graph twoway pciSyntaxMenuDescriptionOptionsRemarks and examplesAlso see

    graph twoway pcscatterSyntaxMenuDescriptionOptionsRemarks and examplesAlso see

    graph twoway pcspikeSyntaxMenuDescriptionOptionsRemarks and examplesBasic useAdvanced useAdvanced use 2

    ReferenceAlso see

    graph twoway qfitSyntaxMenuDescriptionOptionsRemarks and examplesTypical useCautionsUse with by()

    Also see

    graph twoway qfitciSyntaxMenuDescriptionOptionsRemarks and examplesTypical useAdvanced useCautionsUse with by()

    Also see

    graph twoway rareaSyntaxMenuDescriptionOptionsRemarks and examplesTypical useAdvanced useCautions

    Also see

    graph twoway rbarSyntaxMenuDescriptionOptionsRemarks and examplesTypical useAdvanced use

    ReferenceAlso see

    graph twoway rcapSyntaxMenuDescriptionOptionsRemarks and examplesTypical useAdvanced useAdvanced use 2

    Also see

    graph twoway rcapsymSyntaxMenuDescriptionOptionsRemarks and examplesAlso see

    graph twoway rconnectedSyntaxMenuDescriptionOptionsRemarks and examplesAlso see

    graph twoway rlineSyntaxMenuDescriptionOptionsRemarks and examplesAlso see

    graph twoway rscatterSyntaxMenuDescriptionOptionsRemarks and examplesAlso see

    graph twoway rspikeSyntaxMenuDescriptionOptionsRemarks and examplesTypical useAdvanced useAdvanced use 2

    Also see

    graph twoway scatterSyntaxMenuDescriptionOptionsRemarks and examplesTypical useScatter syntaxThe overall look for the graphThe size and aspect ratio of the graphTitlesAxis titlesAxis labels and tickingGrid linesAdded linesAxis rangeLog scalesMultiple axesMarkersWeighted markersJittered markersConnected linesGraphs by groupsSaving graphsVideo exampleAppendix: Styles and composite styles

    ReferencesAlso see

    graph twoway scatteriSyntaxMenuDescriptionOptionsRemarks and examplesAlso see

    graph twoway spikeSyntaxMenuDescriptionOptionsRemarks and examplesTypical useAdvanced useCautions

    Also see

    graph twoway tslineSyntaxMenuDescriptionAlso see

    graph useSyntaxDescriptionOptionsRemarks and examplesAlso see

    paletteSyntaxDescriptionOptionsRemarks and examplesAlso see

    set graphicsSyntaxDescriptionRemarks and examplesAlso see

    set printcolorSyntaxDescriptionOptionRemarks and examplesWhat set printcolor affectsThe problem set printcolor solvesset printcolor automaticse