Bookmark and Share

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

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

st: Mata data question

From   [email protected]
To   [email protected]
Subject   st: Mata data question
Date   Mon, 01 Aug 2011 13:53:32 -0500

Benjamin Allaire <[email protected]> reported a problem with the
user-written -spmat- command.  He noted that when the matrix and spmat object
share the same name, -spmat putmatrix- erases the matrix from Mata memory:

> Why doesn't this code work? Why does G go away?
> . spmat putmatrix G G, replace
>                  <istmt>:  3499  G not found
> r(3499);

tzygmund mcfarlane <[email protected]> correctly explained that

> issuing the replace option clears any previous matrix with given "objname"
> (in this case, "G") first and then tries to save "matname" (in this case,
> also "G") to that location.... So for example, this code will work:
> spmat putmatrix newobj G, replace

We will fix this issue in a future update to -spmat-.

[email protected]
*   For searches and help try:

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