IDEAS home Printed from https://ideas.repec.org/
MyIDEAS: Log in (now much improved!) to save this book

An Introduction to Stata Programming, Second Edition

  • Christopher F Baum

    (Boston College)

Christopher F. Baum's An Introduction to Stata Programming, Second Edition, is a great reference for anyone that wants to learn Stata programming. For those learning, Baum assumes familiarity with Stata and gradually introduces more advanced programming tools. For the more advanced Stata programmer, the book introduces Stata's Mata programming language and optimization routines. This new edition of the book reflects some of the most important statistical tools added since Stata 10, when the book was introduced. Of note are factor variables and operators, the computation of marginal effects, marginal means, and predictive margins using margins, the use of gmm to implement generalized method of moments estimation, and the use of suest for seemingly unrelated estimation. As in the previous edition of the book, Baum steps the reader through the three levels of Stata programming. He starts with do-files. Do-files are powerful batch files that support loops and conditional statements and are ideal to automate your workflow as well as to guarantee reproducibility of your work. While giving examples of do-file programming, Baum introduces useful programming tips and advice. He then delves into ado-files, which are used to extend Stata by creating new commands that share the syntax and behavior of official commands. Baum gives an example of how to write a simple additional command for Stata, complete with documentation and certification. After writing the simple command, users can then learn how to write their own custom estimation commands by using both Stata's built-in numerical maximum-likelihood estimation routine, ml, its built-in nonlinear least-squares routines, nl and nlsur, and its built-in generalized method of moments estimation routine. Finally, he introduces Mata, Stata's matrix programming language. Mata programs are integrated into ado-files to build a custom estimation routine that is optimized for speed and numerical stability. While discussing Mata, Baum presents useful topics for advanced programming such as structures and pointers and likelihood-function evaluators using Mata. Baum introduces concepts by providing the background and importance for the topic, presents common uses and examples, and then concludes with larger, more applied examples he refers to as "cookbook recipes". Many of the examples in the book are of particular interest because they arose from frequently asked questions from Stata users. If you want to understand basic Stata programming or want to write your own routines and commands using advanced Stata tools, Baum's book is a great reference.

If you experience problems downloading a file, check if you have the proper application to view it first. In case of further problems read the IDEAS help page. Note that these files are not on the IDEAS site. Please be patient as the files may be large.

File URL: http://www.bc.edu/sites/libraries/facpub/stataprogramming/index.html
File Function: link to interview of author
Download Restriction: no

File URL: http://www.stata-press.com/data/itsp2.html
File Function: link to downloadable datasets
Download Restriction: no

as
in new window

This book is provided by StataCorp LP in its series Stata Press books with number isp and published in 2016.
ISBN: 978-1-59718-150-1
Order: http://www.stata-press.com/books/introduction-stata-programming/
Handle: RePEc:tsj:spbook:isp
Contact details of provider: Web page: http://www.stata-press.com/

No references listed on IDEAS
You can help add them by filling out this form.

This item is not listed on Wikipedia, on a reading list or among the top items on IDEAS.

When requesting a correction, please mention this item's handle: RePEc:tsj:spbook:isp. See general information about how to correct material in RePEc.

For technical questions regarding this item, or to correct its authors, title, abstract, bibliographic or download information, contact: (Christopher F. Baum)

or (Lisa Gilmore)

If you have authored this item and are not yet registered with RePEc, we encourage you to do it here. This allows to link your profile to this item. It also allows you to accept potential citations to this item that we are uncertain about.

If references are entirely missing, you can add them using this form.

If the full references list an item that is present in RePEc, but the system did not link to it, you can help with this form.

If you know of missing items citing this one, you can help us creating those links by adding the relevant references in the same way as above, for each refering item. If you are a registered author of this item, you may also want to check the "citations" tab in your profile, as there may be some citations waiting for confirmation.

Please note that corrections may take a couple of weeks to filter through the various RePEc services.

This information is provided to you by IDEAS at the Research Division of the Federal Reserve Bank of St. Louis using RePEc data.