An Introduction to Stata Programming, Second Edition


Click to enlarge
See the back cover

Inside preview


Print eBook

$58.00 Print

Add to cart

What are VitalSource eBooks?
Your access code will be emailed upon purchase.

$52.00 eBook

Add to cart

Author:
Christopher F. Baum
Publisher: Stata Press
Copyright: 2016
ISBN-13: 978-1-59718-150-1
Pages: 412; paperback
Price: $58.00
Author:
Christopher F. Baum
Publisher: Stata Press
Copyright: 2016
ISBN-13: 978-1-59718-219-5
Pages: 412; eBook
Price: $52.00
Author index
Subject index
Errata
Download the datasets used in this book
Download the brochure (pdf)

Review of this book from the Stata Journal

Comment from the Stata technical group

Christopher F. Baum's An Introduction to Stata Programming, Second Edition, is a great reference for anyone who wants to learn Stata programming.

Baum assumes readers have some familiarity with Stata, but readers who are new to programming will find the book accessible. He begins by introducing programming concepts and basic tools. More advanced programming tools such as structures and pointers and likelihood-function evaluators using Mata are gradually introduced throughout the book alongside examples.

This new edition reflects some of the most important statistical tools added since Stata 10. 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.

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 command to calculate percentiles and the range of a variable, complete with documentation and certification.

After introducing the fundamentals of command development, Baum shows users how these concepts can be applied to help them write their own custom estimation commands by using 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. Baum briefly discusses how ado-file programming concepts relate to Mata functions and objects. He also explains some of the advantages of using Mata for certain programming tasks. Baum introduces concepts by providing the background and importance of 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 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.

Table of contents

View table of contents >>