Mata course: Two Matas

There are two -mata- commands

1. . mata

+-+
2. . mata|:|
+-+
(notice the colon)

What's the difference?

. mata

mata (type end to exit) ---
: make a mistake
invalid expression
r(3000);

: (We are still in Mata)

: end

and

. mata:

mata (type end to exit) ---
: make a mistake
invalid expression

r(3000);

. (We are back to Stata)

Recommendation:

1. Use mata interactively

+-+
2. Use mata|:| in ado-files and do-files
+-+

Top