Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, statalist.org is already up and running.


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

st: Mata data question


From   rraciborski@stata.com
To   statalist@hsphsun2.harvard.edu
Subject   st: Mata data question
Date   Mon, 01 Aug 2011 13:53:32 -0500

Benjamin Allaire <btallaire@hotmail.com> 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 <tzygmund@googlemail.com> 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-.

--Rafal
rraciborski@stata.com
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index