0
votes

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

1 Answers

1
votes

Some misinformation here!

  1. If your matrix is already read in, fopen() sounds irrelevant to you.

  2. 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 and destring.

  3. st_view() is documented; presumably you are just looking in the wrong place. Start at help m4_stata.

  4. Mata won't change your Stata data unless you ask it to.