Intro+to+Stata+9

Intro+to+Stata+9 - API-202 Empirical Methods II Spring 2009...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
API-202 Empirical Methods II Spring 2009 A SHORT INTRODUCTION TO STATA 9.0 Course materials and data sets will assume that you are using Stata to complete the analysis. Stata is available on all of the computers in the Kennedy School’s computer lab. However, the lab is in high demand, so if you have a home computer you may want to purchase a copy of Stata from the CMO. Stata is available for Windows98, Windows 2000, Windows ME, Windows XP, Windows NT, Macintosh, and UNIX operating systems. The Stata User’s Guide is also available from the CMO. The commands outlined below assume that you are using Stata Release 9.0 for Windows. However, most will also work with Stata Release 8.0 and with the Macintosh and UNIX versions of the software. Throughout this text, anything appearing in Courier font is a Stata command, whereas anything in Arial font is a comment or hint. Menu commands are indicated as, e.g., File | Open , to indicate that you first go to the File menu and then choose the Open option. mje; rev 8/97 rkr; rev 2/98 ls; rev 2/99 sjc; rev 1/01 clc; rev 2/04 nc; rev 1/06 ke; rev 1/09 sk G ETTING S TARTED ______________________________________________________ 2 1. How Does Stata Work? ______________________________________________ 2 2. Managing the Workspace ____________________________________________ 3 3. Logging a Stata Session_____________________________________________ 3 4. Viewing the Data ___________________________________________________ 4 5. Creating and Submitting a Do File_____________________________________ 4 W ORKING W ITH D ATA ___________________________________________________ 6 1. Using Operators____________________________________________________ 6 2. Creating and Changing Values of Variables _____________________________ 7 3. Using Functions____________________________________________________ 8 4. Deleting Variables and Observations __________________________________ 9 5. Describing and Examining Data_______________________________________ 9 6. Labeling Variables and Values_______________________________________ 11 S TATISTICAL A NALYSIS _________________________________________________ 11 1. Testing Hypotheses About Means____________________________________ 11 2. Estimating Linear Models (OLS and 2-Stage Least Squares) ______________ 12 3. Estimating Non-Linear Models (Logit and Probit) _______________________ 13 M ISCELLANEOUS ______________________________________________________ 13 1. Making Graphs____________________________________________________ 13 2. Converting Data Files (Excel to Stata)_________________________________ 15
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
A Short Introduction to Stata, p. 2 Getting Started 1. How Does Stata Work? Stata is a powerful tool for conducting statistical analyses. It can do everything you did last semester with Excel and much more. It is different from many other software programs you may be familiar with, however, in that it operates primarily by manually entering or programming commands rather than by choosing options from drop-down menus. You can work with Stata interactively by entering commands individually, or you can write programs (called “do files”) and have Stata run a series of commands in a row. Here is what a typical session in Stata looks like. Stata’s “Command Central”, the Command window, is at the bottom center of the screen. When working with Stata interactively, all commands are entered here. What is a command? It is a statement that tells Stata what to do – i.e., to open a file, to run a regression, to calculate a mean of a variable, etc. The Review window, in the upper left hand corner, shows a list of all the commands you have already run. (Here, it shows that I have opened a data file and then run a regression.) If you click on a previously-run command in the Review window, it will appear in the Command window and you can edit it or run it again. The Variables window shows a list of all the variables in the data set you have open, and finally the Results window shows you the results of your
Background image of page 2
A Short Introduction to Stata, p. 3
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 04/12/2009 for the course HKS API202A taught by Professor Levy during the Spring '09 term at Harvard.

Page1 / 15

Intro+to+Stata+9 - API-202 Empirical Methods II Spring 2009...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online