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

From   "Lacy,Michael" <[email protected]>
To   "'[email protected]'" <[email protected]>
Subject   st: Saving large result set from Mata to file
Date   Mon, 5 Mar 2012 20:54:29 +0000

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:

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