1
Stata  Basics by example1
You should see 4 windows when Stata is opened. You will type in commands in the
Stata
Command
window.
These commands will be echoed in the
Review
window.
They may be used again simply by
clicking on the desired command in the
Review
window, which brings it back to the Stata
Command
window.
Once a dataset is opened, variable names will appear in the
Variables
window.
This is especially
helpful when one has complicated variable names as it is possible to click on the variable name to enter it into
a Stata Command rather than typing it out.
Finally, results will appear in the
Results
window.
Whenever
output from a command exceeds one page, you will see the word
more
at the bottom of the
Results
window.
Hit the spacebar to see the next page of output.
For now, its easiest to type commands into the Stata
Command
window and obtain output in the
Results
window, which can then be sent to the printer.
But there are more elegant ways of doing both, which we’ll
learn after we are familiar with the basics.
In what follows, Stata commands and output are reported in
boldface Courier 10point
font to
distinguish it from my explanations.
Basic commands are described using an example.
Important note: Stata is case sensitive so
help
is not the same as
Help.
. use “d:\teaching\eco721\lab\sales.dta”, clear
use
reads in Stata format datasets.
Stata format datasets already have variable labels and are ready for use.
Obviously, most data does not automatically arrive in Stata format.
Very often, data is in a raw ascii format.
Othertimes, it may be in the format of some other statistical software or as a spreadsheet file.
There are a
variety of ways to convert data into Stata format. When the data are in ascii (raw) format, a form of
infile
is probably the best way to read the data.
If the data are already in some other proprietary format (SAS,
Excel, Dbase, etc.), Stata provides data translation software called StatTransfer that is most useful.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
This is the end of the preview.
Sign up
to
access the rest of the document.
 Spring '09
 Partha
 Statistics, Econometrics, Stata Command window, STATA format

Click to edit the document details