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]

Re: st: Stata matrix to Mata matrix form


From   Nick Cox <[email protected]>
To   [email protected]
Subject   Re: st: Stata matrix to Mata matrix form
Date   Thu, 1 Nov 2012 14:52:45 +0000

. mat foo = J(6,7,42)

. mat li foo

foo[6,7]
    c1  c2  c3  c4  c5  c6  c7
r1  42  42  42  42  42  42  42
r2  42  42  42  42  42  42  42
r3  42  42  42  42  42  42  42
r4  42  42  42  42  42  42  42
r5  42  42  42  42  42  42  42
r6  42  42  42  42  42  42  42

. mata : mat_foo = st_matrix("foo")

. mata : mat_foo
        1    2    3    4    5    6    7
    +------------------------------------+
  1 |  42   42   42   42   42   42   42  |
  2 |  42   42   42   42   42   42   42  |
  3 |  42   42   42   42   42   42   42  |
  4 |  42   42   42   42   42   42   42  |
  5 |  42   42   42   42   42   42   42  |
  6 |  42   42   42   42   42   42   42  |
    +------------------------------------+

. mata : st_matrix("foo", mat_foo :/ 7)

. mat li foo

foo[6,7]
    c1  c2  c3  c4  c5  c6  c7
r1   6   6   6   6   6   6   6
r2   6   6   6   6   6   6   6
r3   6   6   6   6   6   6   6
r4   6   6   6   6   6   6   6
r5   6   6   6   6   6   6   6
r6   6   6   6   6   6   6   6


On Thu, Nov 1, 2012 at 2:25 PM, Bianca B. <[email protected]> wrote:

> Does anyone know how can I get stata matrix in mata matrix?
*
*   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