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: RE: Saving large result set from Mata to file

From   Nick Cox <[email protected]>
To   "'[email protected]'" <[email protected]>
Subject   st: RE: Saving large result set from Mata to file
Date   Tue, 6 Mar 2012 12:09:36 +0000

I would rule out 1) and 2). 

1) is quite unnecessary and would lose precision. There are other disadvantages, but I stop there. 

2) Stata matrices are very limited in size and putting results into Stata matrices would only be a first step. 

3) does look like your best option. But check out -getmata- as well. 

[email protected] 


I have a Mata program that generates a large number of instances of (i.e. > 1e6) of an integer-valued row vector of modest length, say < 30 
rows.  Using each such vector, a real scalar value is calculated in Mata.   I'd like to save these results as a Stata file as one would with -post- 
or the saving option of -simulate-.   The ways I'm thinking of doing this seem rather clumsy and slow, so I'm wondering if I'm not finding
 some easier approach. I've thought of 1) Writing the results as ASCII from Mata, and -insheeting- the file in Stata, in chunks if
necessary;   2) Passing the results back into Stata matrices, and using -post- on those matrices in Stata; 3) Keep the entire set of results
 in Mata matrices, and using -st_store- to put them back into Stata. The results may end up being too large to fit in Stata at one time, which 
makes 3) not entirely attractive.   

Would anyone offer other suggestions, or perhaps simply  a confirmation that these are my only options?


Mike Lacy
Dept. of Sociology
Colorado State University
Fort Collins CO 80523-1784

*   For searches and help try:

*   For searches and help try:

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