Hi:
I have been programming for a couple of years in Stata (now using Stata/SE 9.2)
and I am currently deciding whether to learn Mata (or switch to something like
Matlab), so I have a couple of questions:
What is the best way to learn Mata? I bought the books M[0-3] and M[4-6], but
they are reference guides, not learning books. Is there not a book/website,
etc. that shows more snippets of code so you can actually learn the language
by example?
I played around a bit, but I even failed to create something as elementary
as:
function tryit()
{
for (i==1; i<10; i++) printf("i=%g\n",i)
}
After writing this in the do editor and running it, I get the following error:
nothing found where 'while' expected
Alternatively, when I input it interactively and then call it with:
tryit()
I get this error message:
tryit(): 3200 conformability error
<istmt>: - function returned error
Not exactly your average "Hello World!" gratification, so your help would be
much appreciated!
Cheers,
Erik
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/