<>
To really get used to -mata-, try Kit`s
http://www.stata.com/meeting/fnasug08/baum_StataMata.beamer.FNASUG08.pdf ,
and of course chapters 13 and 14 of his book
http://www.stata-press.com/books/isp.html. In addition, the "Mata Matters"
columns in the SJ, http://www.stata-journal.com/archives.html
HTH
Martin
-----Ursprüngliche Nachricht-----
Von: [email protected]
[mailto:[email protected]] Im Auftrag von Skipper Seabold
Gesendet: Freitag, 18. Dezember 2009 16:28
An: [email protected]
Betreff: st: Taking mata views of ereturn stats?
Hello all,
I am trying to get used to Stata's mata environment. I am somewhat
familiar with Stata but as far as the matrix operations am more
familiar with environments like R, Matlab, or Python, and am having
some trouble using Stata in the same way, though I understand that
mata is C-like.
For instance, say I want to do something like have a vector of the
standard errors that I can access element-wise. Is there a quick way
to go between stata and mata to do this. Given the following example,
webuse sysdsn1
mlogit insure age male nonwhite i.site
Is there a quick way to get e(V) into a matrix so that I can do
element-wise operations like taking the square root of the diagonal?
I was thinking that I could just assign e(V) to a matrix, then take a
view on this in mata, but this doesn't seem to be the way that Stata
works. Alternatively, I think I could save e(V) to a datset and load
it so that V is the dataset and use st_data or st_view, or I could
just program the whole estimator in mata, but this all seems like
overkill for something that's seems so natural in other environments.
Any help or pointers to other resources would be appreciated.
Cheers,
Skipper
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/