UCLA Academic Technology Services HomeServicesClassesContactJobs
Search

Stata FAQ
How can I handle the "no room to add more observations" error?

You may go to use a data file in Stata and get the error...
no room to add more observations
r(901);
Stata is probably telling you that Stata has not allocated enough memory to read the data file.  You can check to see how much memory is allocated to hold your data using the memory command.  I am running Stata under Windows, and this is what the memory command told me.
memory

Total memory                            1,024,000 bytes    100.00%

  overhead (pointers)                             0            0.00%
  data                                            0            0.00%
                                       ------------
  data + overhead                                 0            0.00%

  programs, saved results, etc.                 368            0.04%
                                       ------------
  Total                                         368            0.04%

  Free                                    1,023,632           99.96%
This tells me that I have a little bit under 1 megabyte free for reading in a data file.  I have a data file called bigfile.dta that I want to read that is about 1.7 megabytes, so that is why I was getting the no room to add more observations error. I will allocate 5 megabytes of memory with the set memory command below, and then try using my file.
set memory 5m
(5120k)

use bigfile
Now that I have allocated enough memory, I was able to read the file. If I want to allocate 5m (five megabytes) every time I start Stata, I can type
set memory 5m, permanently
And then Stata will allocate this amount of memory every time you start Stata.

How to cite this page

Report an error on this page

UCLA Researchers are invited to our Statistical Consulting Services
We recommend others to our list of Other Resources for Statistical Computing Help
These pages are Copyrighted (c) by UCLA Academic Technology Services


The content of this web site should not be construed as an endorsement of any particular web site, book, or software product by the University of California