Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: Re: moving from Stata to Mata


From   "Thomas Jacobs" <thomasjacobs@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Re: moving from Stata to Mata
Date   Tue, 16 Oct 2007 09:22:31 -0500

Dear Kit,

Thanks.  I ended up using st_data to create a matrix in mata from a
subset of my variables using the command:

I = st_data(., "var 1", "var2", etc.)

I then processed each row in succession.  I am now stuck trying to go
back with the results.

Sincerely,

Tom

On 10/16/07, Kit Baum <baum@bc.edu> wrote:
> Contrary to another poster's comment, st_view() will not help here.
> st_view allow you to access Stata's variables, not matrices or
> "vectors" (note that Stata does not have a vector data type; all
> "vectors" are matrices with a unit subscript on one dimension. Mata
> has true vectors, rowvectors and colvectors).
>
> st_local
> st_global
> st_numscalar
> st_matrix
>
> allow you to do the same with Stata's macros, scalars and matrices.
> They all have one- and two-argument forms. The one-argument form
> allows you to access the Stata object; the two-argument form allows
> you to update the contents (or indeed create) the Stata object. See
>
> help m4_stata
>
> for a complete list of the functions of this nature.
>
>
> Kit Baum, Boston College Economics and DIW Berlin
> http://ideas.repec.org/e/pba1.html
> An Introduction to Modern Econometrics Using Stata:
> http://www.stata-press.com/books/imeus.html
>
>
> On Oct 16, 2007, at 2:33 AM, statalist-digest wrote:
>
> >
> > If one is working with program or do file in Stata and wishes to move
> > to Mata within the program to use a Mata function for a matrix or
> > vector defined in the Stata program, is this possible?
>
> *
> *   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/
>


-- 
Thomas Jacobs
*
*   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/



© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index