I have some large matrices I want to process in Mata, i.e., typical matrix operations such as inverting, multiplying, etc. These are Stata files with variable names in the first row. Some are quite large, >15 GB. So, the first problem is reading the data. I read something about setting up views, but my version of Stata does not show any help for st_view. The help for Mata talks about opening a file with fopen(), but it's pretty cryptic. I also read something about Mata adding changes to the original data. I'd prefer some strategy that doesn't alter my original data as it takes a long time to create the original matrices. Can someone point me in the right direction?
1 Answers
1
votes
Some misinformation here!
If your matrix is already read in,
fopen()
sounds irrelevant to you.If your matrix consists of variables already in Stata, consider using
putmata
. However, if variable names really are in the first row (i.e. observation) you may need to take them out anddestring
.st_view()
is documented; presumably you are just looking in the wrong place. Start athelp m4_stata
.Mata won't change your Stata data unless you ask it to.