Suggestions
for starting with Stata 10
This document describes a few suggestions to get you started with Stata 10.
Installing Stata from CD-ROM
Please read Chapter 1 of your "Getting Started with Stata" manual for installation instructions.
Windows Vista users
Vista users need to read page 4 of the Getting started manual for help in initializing the Stata licence.
Windowing and font preferences
- Stata 10 Windows are dockable. For help on how to do this go here
for a movie.
- Size the Review and Variables panels, and the Results and Command panels,
to suit yourself. Then go to the top menu and Edit/Preferences/Manage Preferences/ Save
Preferences/.....
- You may find that the default font for the Results panel in Stata 10 is hard
to read and prefer to change it. Go the top of the Results panel, select the
icon to the left of the words " Results", select font, and
try "Lucida Console Regular 8"
Alternatively right click in the window and select font
- Save your preferences with Edit/Preferences/Manage Preferences/ Save
Preferences/......
Chapter 18 of "Getting Started with Stata" gives more details.
- Tip: if you are using Stata with a data projector to an audience or class
of students, you could temporarily change the Results screen font to a larger
size and the back ground to white to make it easier for your audience to view
the results.
Getting updates
Stata is constantly adding new features and fixing any bugs that it detects,
especially when a new version is released. It is very easy to update your copy.
- Type -query born-
to see the release date of your copy of the program. The original release
date was 26 Jun 2007 but there have been several updates to
correct minor problems that have emerged.
- Type -update all-
to get the latest release.
- You will then be prompted to type -update
swap- to swap the old Stata executable file for the later one.
- Type -help whatsnew- to see a list
of the changes.
Alternatively set the automatic updates feature. Using the pull down menu Edit/Preferences/General
Preferences/ and then the Internet tab, then check "Enable automatic update
checking" and then set parameters.
Help
Please read Chapter 6 of your "Getting Started with Stata" manual for details
of online help and other sources of help for Stata.Stata offers plenty of online
assistance.
- For help on the syntax of a specific procedure use the
help command. For example, type:
help correlate. You can also use the Stata pulldown menu to do this:
Help and then Search... Alternatively type the command
db search
- Search will search your Stata database for keywords. findit
will look at your database for keywords and also search the net resources.
The search responses may lead you to Frequently Asked Questions (FAQ) at the
Stata web site or the Stata Technical Bulletins (STB) or to other information.
The items printed in blue are hyperlinked to
other parts of Stata or to other information.
- You can get technical support from Stata by email. Contact tech-support@stata.com
and include your Stata licence number with your message.
Creating a Stata dataset from Excel
It is easy to create Stata datasets from Excel files. We assume you have the
variable names as labels in the top row of your Excel file in lowercase.
- In Excel highlight all or part of the file that you want to convert to a
Stata datafile, including the labels in the top row.
- In Stata select the Data Editor button from the menu or just type edit.
- Select /Edit/Paste or use ctrl-V to drop the Excel file into the Stata Data
Editor. It should recognise that the top row of the Excel file contains the
labels, which now become Stata variables. Within the Editor click on the variable
name and type in a variable label.
- Then use the dialog box for Describe, or Stata commands describe
and summarize to check your data.
- If you enter a summarize command
and find that a variable has 0 cases it usually means that Stata regards it
as a string variable. The easiest way to convert a string variable to numeric
is to use the destring command.
- For more help on inputting Excel files see
www.stata.com/support/faqs/data/newexcel.html
Creating a Stata dataset from other file formats
- Method 1: Use Stat/Transfer.
- Method 2: Save data from the other format as an Excel file and import it
using insheet.
Running a Stata session
- If you want to save the results of your session, set up a log file. The
Stata default is a SMCL file (Stata Markup and Control Language). You may
prefer to use an ASCII text file. For example, type: log
using fred01.txt, text. At the end of your session close the log
file with: log close.
- You can also open a command file to keep track of all commands you issue
during a session, which you could later edit into a do
file. The command cmdlog using temp01
produces an ASCII text file temp01.txt.
At the end of your session you close the command log file with: cmdlog
close. But if you forget it will save the log file and close automatically.
- A message at the bottom of the Results panel shows if you have log or command
log files open.
- You can also save the list of commands you used during the session by going
to the icon in the Review panel and selecting Save Review Contents. This produces
a Stata do file that is an ASCII file
you can edit with any text editor.
Copying Stata results to Word or Excel
The Results panel is scrollable although it only keeps about five screens of
results. If you want to copy some of the results to Word or Excel, highlight
them and select /Edit/Copy Table (Shift-Ctrl-C).
- When you drop your selection into Excel it is in columns (except where the
Stata output is a bit complicated as in anova results).
- If you drop your selection into Word you have the Stata columns separated
by tabs. You could then use Word menu /Table/Convert Text to Table, and perhaps
use /Table/Table AutoFormat to format your table.
- You can also copy a graph with right click and then Copy or Ctrl-C. When
you drop it into Word use menu /Edit/Paste Special. Select Picture but do
not select Float over text.
Training via the Internet
- Stata runs interactive web-based courses including an introduction to Stata,
programming in Stata, and survival analysis using Stata. For information about
the dates and costs for these courses see: www.stata.com/info/products/netcourse/.
- A comprehensive set of free Stata training materials is available from UCLA
at www.ats.ucla.edu/stat/stata/.
Related publications
Our bookshop has several publications to assist
in learning Stata data management and analyses. There are many books on sale
at special prices.
More tips
We add a new tip to our web site at the beginning of each month. For previous
tips go to our page on Tips for using Stata.