m.pdf
(
6869 KB
)
Pobierz
MATA REFERENCE MANUAL
RELEASE 11
A Stata Press Publication
StataCorp LP
College Station, Texas
Copyright c
1985–2009 by StataCorp LP
All rights reserved
Version 11
Published by Stata Press, 4905 Lakeway Drive, College Station, Texas 77845
Typeset in T
E
X
Printed in the United States of America
10
9
8
7
6
5
4
3
2
1
ISBN-10: 1-59718-056-4 (volumes 1–2)
ISBN-10: 1-59718-057-2 (volume 1)
ISBN-10: 1-59718-058-0 (volume 2)
ISBN-13: 978-1-59718-056-6 (volumes 1–2)
ISBN-13: 978-1-59718-057-3 (volume 1)
ISBN-13: 978-1-59718-058-0 (volume 2)
This manual is protected by copyright. All rights are reserved. No part of this manual may be reproduced, stored
in a retrieval system, or transcribed, in any form or by any means—electronic, mechanical, photocopy, recording, or
otherwise—without the prior written permission of StataCorp LP unless permitted by the license granted to you by
StataCorp LP to use the software and documentation. No license, express or implied, by estoppel or otherwise, to any
intellectual property rights is granted by this document.
StataCorp provides this manual “as is” without warranty of any kind, either expressed or implied, including, but
not limited to, the implied warranties of merchantability and fitness for a particular purpose. StataCorp may make
improvements and/or changes in the product(s) and the program(s) described in this manual at any time and without
notice.
The software described in this manual is furnished under a license agreement or nondisclosure agreement. The software
may be copied only in accordance with the terms of the agreement. It is against the law to copy the software onto
DVD, CD, disk, diskette, tape, or any other medium for any purpose other than backup or archival purposes.
The automobile dataset appearing on the accompanying media is Copyright c
1979 by Consumers Union of U.S.,
Inc., Yonkers, NY 10703-1057 and is reproduced by permission from CONSUMER REPORTS, April 1979.
Stata and Mata are registered trademarks and NetCourse is a trademark of StataCorp LP.
Other brand and product names are registered trademarks or trademarks of their respective companies.
For copyright information about the software, type
help copyright
within Stata.
The suggested citation for this software is
StataCorp. 2009. Stata: Release 11 . Statistical Software. College Station, TX: StataCorp LP.
i
Brief contents
[M-0] Introduction to the Mata manual
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
[M-1] Introduction and advice
[M-2] Language definition
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
[M-3] Commands for controlling Mata
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219
[M-4] Index and guide to functions
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 253
[M-5] Mata functions
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 295
[M-6] Mata glossary of common terms
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 883
iii
Table of contents
[M-0] Introduction to the Mata manual
intro
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Introduction to the Mata manual
3
[M-1] Introduction and advice
intro
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Introduction and advice
11
ado
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Using Mata with ado-files
13
first
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Introduction and first session
20
help
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Obtaining online help
35
how
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
How Mata works
36
interactive
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Using Mata interactively
41
LAPACK
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The LAPACK linear-algebra routines
49
limits
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Limits and memory utilization
50
naming
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Advice on naming functions and variables
52
permutation
. . . . . . . . . . . . . . . . . . . . . . . . . . .
An aside on permutation matrices and vectors
55
returnedargs
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Function arguments used to return results
61
source
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Viewing the source code
64
tolerance
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Use and specification of tolerances
65
[M-2] Language definition
intro
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Language definition
71
break
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Break out of for, while, or do loop
73
class
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Object-oriented programming (classes)
74
comments
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Comments
98
continue
. . . . . . . . . . . . . . . . . . . . . . .
Continue with next iteration of for, while, or do loop
100
declarations
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Declarations and types
102
do
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
do ::: while (exp)
111
errors
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Error codes
112
exp
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Expressions
117
for
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
for (exp1; exp2; exp3) stmt
123
ftof
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Passing functions to functions
125
goto
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
goto label
127
if (exp)
:::
else
:::
129
if
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
op arith
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Arithmetic operators
131
op assignment
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Assignment operator
133
op colon
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Colon operators
138
op conditional
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Conditional operator
141
op increment
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Increment and decrement operators
143
op join
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Row- and column-join operators
146
op kronecker
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Kronecker direct-product operator
149
op logical
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Logical operators
151
op range
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Range operators
154
op transpose
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Conjugate transpose operator
156
optargs
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Optional arguments
159
pointers
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Pointers
164
pragma
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Suppressing warning messages
175
Plik z chomika:
norrdec
Inne pliki z tego folderu:
p.pdf
(5736 KB)
r.pdf
(17170 KB)
gsw.pdf
(14742 KB)
gsu.pdf
(13361 KB)
gsm.pdf
(12934 KB)
Inne foldery tego chomika:
ado
Zgłoś jeśli
naruszono regulamin