Bookmark and Share

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


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

st: Creating object names in Mata through looping


From   Pedro Nakashima <[email protected]>
To   [email protected]
Subject   st: Creating object names in Mata through looping
Date   Fri, 28 Dec 2012 23:58:21 -0200

Dear Stata users

I'm looking for a way to create object names in Mata through looping.

For example:

capture program drop progby1
program progby1, byable(recall,noheader)
local inicio = _byn1()
local fim   = _byn2()
local rodada = _byindex()
local in "`inicio'/`fim'"
display "`in'"
mata: funcao2(`inicio',`fim',`rodada')
end

mata
void funcao2(real scalar inicio,real scalar fim,real scalar byi)
{
d=st_data((inicio::fim),("var1","var2"))
d
}
end

I would like that the matrix d of the function funcao2 had varying
names, depending on the value of argument byi

Does anyone know a solution to this problem?

Thank you..
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


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