Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[no subject]


You cannot use mata interactively in a program because end both defines the
end of the program and the end of the use of mata (interactively). You have
to create a mata function that do the mata part and then insert in the
program a call to this function. In other words you have to replace the mata
code with one line of code which calls the mata functon.

for example

program myprog

...your stata code

mata:mymataprog(arg1,arg2,etc.)  //<= call of mata function replacing your


// Definition of your mata function

clear mata

function mymataprog(arg1,arg2,...)

...mata code...



Hope it helps

Zhi Su
348 Holmes Hall
Northeastern University
360 Huntington Avenue
Boston, MA 02115
*   For searches and help try:

© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index