This preview shows pages 1–2. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: EC 414 Brief Stata reference (ver 1.0). Denis Tkachenko February 22, 2010 This guide lists some bare essentials for coding in Stata. It will be updated with new material as we cover new econometric models. Suggestions for inclu- sion are welcome. 1 Do-&les and Log &les You will mainly deal with two types of &les when working with Stata. You are already familiar with data &les (.dta extension) from your hoework. Those &les usually contain the data and can be loaded from command line (see below) or by selecting File-Open from the dropdown menus. The second type is the so-called do-&le (extension .do). This is essentially a script text &le containing a sequence of commands. Executing such &le will result in Stata performing all of the commands written in that &le. Writing do-&les is an e cient way to perform many estimations e ciently. Once you write a do-&le, it is easy to modify it to tweak your regression speci&cations etc. so you dont have to type a lot into the console. Also, if you so choose, a log-&le can be produced while running a do-&le, which saves all commands and corresponding results into a text-&le. The idea is that you write a do-&le, then make Stata execute it. While its at it, you may go have a co/ee, and after you come back, you can study the log &le to see the results. Log-&les also are one way of more or less conveniently exporting your results. In order to start a blank do-&le, go to Window-Do-&le editor-New do-&le, or click the icon on the toolbar, or press Ctrl-8. You now see a blank text &le that will become your program script. Anything you type in there will be interpreted as a command by Stata, unless you put a * at the beginning of the line. This means the line is just a comment. It is useful to insert comments so that other people understand what you are doing and why (also useful for yourself in case...
View Full Document
- Spring '10