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: Mata programming questions; STATA 12 (referencing to columns using stringnames)


From   "J. J. W." <[email protected]>
To   [email protected]
Subject   st: Mata programming questions; STATA 12 (referencing to columns using stringnames)
Date   Wed, 25 Sep 2013 22:03:50 +0200

Dear all,

I have a few questions regarding Mata programming in Stata 12. The
questions are as follows:

- Is it possible to create a matrix that automatically increases in
size? (i.e. suppose I define a matrix of size 5 x 5, but after a while
I want a larger matrix, can I increase the size of my current matrix
without defining a new one or redefining the old one? Can I "just add"
something?)

- How should I update a value inside a matrix? Suppose the following code:
matrix define test = J(2,2,.)
matrix define test[1,1] = 5

This is how I update my matrix, but is this also the "correct" way to do this?

- Last, I would like to ask how the regress function can create
_beta["varname"] to refer to the coefficients. I would like that too!
How can I create that?

Thanks in advance!

Yours sincerely,

Wen Jun Jie
*
*   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