Home  /  Bookstore  /  Documentation  /  Mata Reference Manual

## Mata Reference Manual

 Publisher: Stata Press Copyright: 2023 ISBN-13: 978-1-59718-388-8 Pages: 1,178 Suggested citation StataCorp. 2023. Stata 18 Mata Reference Manual. College Station, TX: Stata Press. Supplemental material

Brief contents

[M-0] Introduction to the Mata manual

 Intro Introduction to the Mata manual

 Intro Introduction and advice Ado Using Mata with ado-files First Introduction and first session help Obtaining help in Stata How How Mata works Interactive Using Mata interactively LAPACK Linear algebra package (LAPACK) routines Limits Limits and memory utilization Naming Advice on naming functions and variables Permutation An aside on permutation matrices and vectors Returned args Function arguments used to return results Source Viewing the source code Tolerance Use and specification of tolerances

[M-2] Language definition

 Intro Language definition break Break out of for, while, or do loop class Object-oriented programming (classes) Comments Comments continue Continue with next iteration of for, while, or do loop Declarations Declarations and types do do ... while (exp) Errors Error codes exp Expressions for for (exp1; exp2; exp3) stmt ftof Passing functions to functions goto goto label if if (exp)... else... op_arith Arithmetic operators op_assignment Assignment operator op_colon Colon operators op_conditional Conditional operator op_increment Increment and decrement operators op_join Row- and column-join operators op_kronecker Kronecker direct-product operator op_logical Logical operators op_range Range operators op_transpose Conjugate transpose operator optargs Optional arguments pointers Pointers pragma Suppressing warning messages reswords Reserved words return return and return(exp) Semicolons Use of semicolons struct Structures Subscripts Use of subscripts Syntax Mata language grammar and syntax version Version control void Void matrices while while (exp) stmt

[M-3] Commands for controlling Mata

 Intro Commands for controlling Mata end Exit Mata and return to Stata lmbuild Easily create function library mata Mata invocation command mata clear Clear Mata's memory mata describe Describe contents of Mata's memory mata drop Drop matrix or function mata help Obtain help in Stata mata matsave Save and restore matrices mata memory Report on Mata's memory usage mata mlib Create function library mata mosave Save function's compiled code in object file mata rename Rename matrix or function mata set Set and display Mata system parameters mata stata Execute Stata command mata which Identify function namelists Specifying matrix and function names

[M-4] Categorical guide to Mata functions

 Intro Categorical guide to Mata functions Dates Date and time functions IO I/O functions Manipulation Matrix manipulation Mathematical Important mathematical functions Matrix Matrix functions Programming Programming functions Scalar Scalar mathematical functions Solvers Functions to solve AX=B and to obtain A inverse Standard Functions to create standard matrices Stata Stata interface functions Statistical Statistical functions String String manipulation functions Utility Matrix utility functions

[M-5] Alphabetical index to Mata functions