Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: mata vector to stata variable


From   Kit Baum <[email protected]>
To   [email protected]
Subject   st: mata vector to stata variable
Date   Fri, 16 Dec 2005 17:06:01 -0500

Oleksandr wants to know how to use st_store. Here is a code snippet:

> // add the new variable to the current Stata data set
> resindex = st_addvar("float",vnew)
> // store the calculated values in the new Stata variable
> st_store((1,rows(v3)),resindex,v3)

Here vnew is the name to be given to the new variable and v3 is a Mata column vector.

Kit Baum, Boston College Economics
http://ideas.repec.org/e/pba1.html


*
* 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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index