- AEM411 Introduction to Econometrics Introduction to Stata Marc F Bellemare Basic Commands To input commands into Stata one can either type them

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

View Full Document Right Arrow Icon
AEM411 – Introduction to Econometrics Introduction to Stata Marc F. Bellemare Basic Commands To input commands into Stata, one can either type them directly in the software window or use a .do file. I find the latter method to be more efficient, as it allows me to run long programs rather quickly. To use the .do file method, you just need to type your program using the Microsoft® Windows Notepad and save it with a .do extension (instead of the usual .txt extension). You should always begin your program with the following three commands: .clear clears the memory; .drop _all drops all the variables; .set mem #m sets Stata’s memory use to the number # of megabytes you specify; Usually, eight or 16 megabytes will be enough, but for very large datasets (such as panel datasets), you might need to specify as many as 256 megabytes. Note that if you want to drop a single variable x instead of all the variables, you just need to type: .drop x where x is the name of the variable you want to drop; To import data into Stata, you can either use a file that is already in Stata format (a .dta file) or import from an ASCII file. If you use the latter method, make sure the columns are delimited by tabs and that they represent the variables while the rows represent observations! Also, make sure the first line of your data file is not made up of the names of your variables, as you will name them using the following command: .infile x1 … xk using c:\file.txt
Background image of page 1

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

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

This note was uploaded on 09/13/2009 for the course AEM 4110 taught by Professor Just,d. during the Fall '07 term at Cornell University (Engineering School).

Page1 / 4

- AEM411 Introduction to Econometrics Introduction to Stata Marc F Bellemare Basic Commands To input commands into Stata one can either type them

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

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