Research Computing >> Software >> Stata
Linux: Stata/MP 4 version 12 is currently available in Kellogg's Linux server, Skew5 for up to six (6) concurrent users. Type
MS Windows: Stata/IC version 13 is installed in the "special software" workstations at the Jacobs Center (ten workstations) and Chicago campus (six workstations) computer laboratories. For more information about the Kellogg computer labs, point your web browser to the KIS page on kiosks and computer labs.
Personal copies: Stata 13 can be purchased for individual Kellogg user's machines through Stata's GradPlan . Other members of the Northwestern community please click on the Stata GradPlan link in the Weinberg IT web page. Through the GradPlan, Intercooled Stata costs $189, while Stata/SE costs $425. The GradPlan also includes licensing the the multi-processor version, Stata/MP, for 2 and 4 cores, to take advantage of dual core and/or dual CPU workstations.
Students enrolled in the school's MBA programs, are eligible for a copy of Stata/IC through the school license. Support information for MBA students, including office hours and scheduled training sessions, can be found here .
Stata/IC is a general purpose statistical package with good graphics capabilities and a graphic editor. Stata covers a wide range of statistical techniques and is programmable, allowing the user to add new commands. Among the highlights of Stata are that it is relatively easy to learn for beginners. It includes a variety of routines to analyze complex survey data ("svy" commands), panel data ("xt" commands), and survival analysis.
Stata/SE is a version of Stata that can handle up to 32,766 (versus 2,047 for Stata/IC) variables in a dataset, strings of to 244 characters (versus 80 characters), matrices of up to 11,000 by 11,000 elements (versus 800 by 800). Thus, this upgrade is suitable for users who have run into these restrictions.
In general, Stata keeps a large portion of the data in memory; hence, available RAM is a typical constraint for Stata users (versus SAS, for example, which uses very little RAM memory and more hard disk space).
In addition to Stata's FAQ section, the Stata listserv is very active and a good source of reference. Users may also contact Stata directly, by sending e-mail to firstname.lastname@example.org and including the serial number for the copy of Stata being used. The serial number appears on the screen when a Stata session starts.
Important information when generating Stata graphics in X Windows: When you create a graph with Stata do NOT close the window that Stata creates for this graph with the control box in the upper-left corner of the window. If you do, your X session may lock up. Instead, return to your working Stata window and continue working. You can issue the command "window define graphics" if you wish to set up a window for any type of graph you use.
Creating a log file: Stata does not create a log file unless specified. To do so, in the first line of code include the following command:
where "filename" is the log file name and path. For example, to save the commands and results to a log file called "reg-tests.do", the necessary command is:
At the end of the program include the following command:
This command will save the results to the specified file.
Logs in version 7 and higher (SMCL): The default format for log files in versions 7 and up is "Stata Mark-up and Control Language" (SMCL). SMCL log files can be translated to ASCII with the "translate" command:
If you are using the GUI interface, you may select "Log" | "Translate" from the File menu.
To create an ASCII log instead of an SMCL log, use the "text" option in the "log" command:
Dealing with long commands - changing the command delimiter: By default, Stata uses a carriage return to delimit one command from the next. If you need more than one line for a command, you may change the command delimiter to a semi-colon (";") with the following command:
After this statement, each Stata command has to end with a semi-colon, but it can take more than one line. To reset the command delimiter to a carriage return:
Note that the "
Changing the memory allocated to the data area: For large datasets, the default memory allocation of 1024KB (1MB) may not be enough. In UNIX, Stata can be started with a larger memory allocation with the "-k" command line option (see example above). In bothe the UNIX and MS Windows versions, memory allocation can also be modified within an exisiting Stata session with the "
where X is the desired memory allocation in kilobytes (default). You may also specify the memory in MB. The following three examples set the data memory to 4MB:
Moving Stata data files (.dta) between MS Windows and UNIX: Stata data files can be read by the UNIX and MS Windows versions of Stata regardless of where the file was created, as long as the files are transferred (FTP) in binary mode.
Moving Stata data files (.dta) between version 7 and version 6: Stata 6 cannot read Stata 7 data files. However, Stata 7 allows you to save files in Stata 6 format. Use the "old" option in the "save" command:
If you have variables with names longer than 8 characters (supported in version 7, but not in version 6), Stata will refuse to save the file.
Saving estimation results to a spreadsheet: The
Stata will clear the dataset in memory (unless it has been changed) with a new dataset with the following variables (columns): b_x1, b_x2, b_cons, se_x1, se_x2, se_cons, rsq, adjrsq, fstat. Each line gives the results of the regression for a value of "catvar". The "
Note that if the dataset was modified and not saved before issuing the
For more information, refer to the Stata "User's Guide" (for version 7, sections 16.6, 21.8 and 21.9), as well as to the section on "Saved Results" included in the reference chapter for any estimation command. A quick list of saved results can be obtained after an estimation by typing "
Creating publishable tables: "Outreg", an ado file written by John L. Gallup, reduces the work needed to create publishable tables from regular Stata output. To download and install it, type "
For tables of summary statistics, there are various of user contributed programs. For example,
Adding personal ADO files in skew3: Unlike personal workstations, users are not allowed to write to the Stata directory in skew3 or any other Unix server. If you need to use ado files written by you or some other researcher, you may accomplish this by placing these ado files in your "personal ado directory". In skew3, this directory is a subdirectory of the user's home directory: ~/ado/personal. The location may vary in different systems. Use the "
Adding personal or "Plus" (from the Stata Technical Bulletins or Stata Journal) ado files in public lab computer: Users of Kellogg's lab computers cannot install plus or personal ADO files in the directory where Stata is installed. Instead, users can install the needed ADO files to their Windows home directory (drive H). To do this:
Searching and adding user-written additions (ADO files): Within Stata, use the
The available commands will be listed in reverse chronological order.
Variable labels are not displayed in the variables window: In Stata 7 variable names are shown with a default of 32 characters in the variables window. This often results in variable labels that cannot be seen unless the variables window is made wider. To reduce the space reserved for the variable names in the variables window, use the "
where "#" is a number between 8 and 32.
Executing commands every time Stata is started: To execute commands immediately after Stata starts, create a file called "profile.do" in one of the directories searched by Stata (see the "Getting Started" manual, section A.7). For example, in Windows, "profile.do" could be created in "c:\ado\personal", while in Unix the equivalent directory would be "~/ado/personal". To see a list of Stata's system directories, use the
Performance issues with graphics in Stata 8: Kellogg users of Windows 98 have reported performance problems with graphics and dialog boxes in Windows 98. For example, a simple scatter plot using the new "
Starting with Stata 11, there is an electronic version of Stata manuals in .pdf format, linked below. In addition, there is an electronic version of the help files, which you may search. The result of your search will open in a new window.
Other books about Stata (available at Kellogg)
|© 2001-2010 Kellogg School of Management, Northwestern University|