Skip to content. | Skip to navigation

Personal tools

Error messages

Error messages and what they mean

Stata's error messages are usually clear, but it's not always obvious what you can do about them. Here are a few that could use a little explanation.


 

1.     too many values
This error message can result from a 2-way tabulation of variables that each have a lot of values. If you really want to cross-tabulate these two variables, you can do it in pieces, limiting the range of one or the other variable in each tabulation:
       tab2 var1 var2  if var1 <= 10
       tab2 var1 var2  if var1 > 10 & var1 <= 20
          etc.

 


 

2.     no: data in memory would be lost
If you make any changes in the data currently in memory, then try to exit Stata, you'll get this message. Stata is reminding you that you have not saved the data in memory since making the changes. You can either save the data, if you want to keep the changes, or clear

the data from memory, if you don't want to keep the changes. Then exit.

 


 If you are using a version of Stata previous to version 12, you may get these error messages:

3.     no room to add more observations
You are asking Stata to read a file that is larger than the memory allocated to this Stata session. Use the set memory command to allocate more memory before using the file.

Alternatively, you may see:

       no room to add more variables
In this case you may have allocated enough total memory, but you've not allowed for the number of variables. Use the set maxvar command to increase the limit.

An easy way to see whether you will have enough room for either observations or variables is:

      describe using myfile, short

      Contains data                                 
        obs:        32,431                          
       vars:         5,101                          
       size:   213,493,273                          
      Sorted by:
This tells me that I need to:
      set memory 250m
      set maxvar 6000

Setting both memory and maxvar above the sizes shown in describe allows you to add variables once you get the data into memory.


Review again?

 

Another topic?

Questions or comments? If you are affiliated with the Carolina Population Center, send them to Phil Bardsley or Dan Blanchette.