The Mata Book: a Book for Serious Programmers and Those Who Want To Be

Baptiste Leurent · Journal of the Royal Statistical Society Series A (Statistics in Society) · 2018

Mata is the matrix programming language within Stata that provides new types of objects and functions, similar to those in Gauss or R. It can be used either interactively or as code within a Stata program. Mata code executes much faster than Stata commands because it is compiled rather than interpreted. It can also be very memory efficient, in particular by using views within the data table as virtual matrices. Mata is therefore likely to interest anyone developing their own Stata commands. Before this book appeared, anyone like me who wanted to learn Mata had the choice between very rare courses, or going through the 1000-page Reference Manual (StataCorp, 2017)—not the most thrilling read. Gould's The Mata book nicely fills that gap by providing a pleasant read telling you all that you need to know for a good grasp of the language. The book starts by explaining the specifics of the language and the syntax; then it goes into more advanced features, using example programs to illustrate each of the points covered. All through the book, Gould—one of the original developers of Stata in the 1980s and currently StataCorp's President—shares his tips on writing elegant code to the highest programming standards. If his impressive resumé was not enough, he turns out to be also a skilled writer, and his enthusiasm for Mata is undeniably contagious. Writing a book about a programming language can be a tricky exercise, but Gould is up to the task and manages to make it an engaging read, providing the right level of details and anecdotes while clearly pointing out what must be ignored to avoid distraction. Nevertheless, the book is definitely aimed at programmers or, as the subtitle clarifies, anyone who is serious about programming. It is not a concise introduction to Mata, and other resources (e.g. Baum, (2016) or Drukker (2015)) may be more suitable for statisticians looking only to obtain a quick grasp of the language, e.g. to review an ado file by using Mata functions. In conclusion, this book is bound to become a classic, and it is highly recommended for any statistician or programmer planning to do some (serious) Mata programming.

Read the paper · More papers on PaperTik