Stata_reference - EC 414 Brief Stata reference(ver 1.0...

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

View Full Document Right Arrow Icon

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

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the 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 don¡t 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 it¡s 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

This note was uploaded on 11/09/2010 for the course CAS ec399 taught by Professor Tack during the Spring '10 term at BCUC.

Page1 / 4

Stata_reference - EC 414 Brief Stata reference(ver 1.0...

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