No observations ошибка stata

Apologies for using my student number as my username, I have sent a request to Admin to change it to my name. Thank you for answers to my question.

Fernando:

the nature of the data is such that if there are values in PPE1 then there won’t be values in PPE2, PPE3, PPE4 & PPE5. There will only be a value in one of these (PPE1, PPE2, PPE3, PPE4 & PPE5) for each company and the other 4 will be missing values. I want a single set of results for presentation purposes. Apart from running 5 different regressions — is there any way to run the regression taking this into account?

Nick:

none of the variables are string — there are numerous missing values throughout the data.

2 questions:
1. For each company, there will only be one value for PPE1, PPE2, PPE3, PPE4 & PPE5 — the other four will be missing values. Is there any way to factor that in to the regression?
2. How do I take the panel structure into account with my regression?

. count if !missing(PRICE, BV, NI, PPE1, PPE2, PPE3, PPE4, PPE5)
0

Thanks again for the help.

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 am able to read the file. If you
want to allocate 5m (five megabytes) every time I start Stata, you can type

set memory 5m, permanently

And then Stata will allocate this amount of memory every time you start
Stata.

If you routinely use very large datasets then you might want to consider setting the
memory allocated to Stata to be a much larger value, say…

set memory 100m, permanently

You can permanently set the memory to any value that you require and that your computer can
manage. It is also possible to set the permanent memory size from the Stata preferences page for
your system.

bertalob…@gmail.com

unread,

Dec 17, 2012, 8:24:58 PM12/17/12

to stata-us…@googlegroups.com

Hello,

I am having some problems when I trying to do the regression model tobit. I am insert the data and then, when I select statistics and choose the tobit model appears this error: no observations r(2000). Can you help me?

I send the print of the error.

Thank´s 

Berta Pacheco

J

unread,

Dec 17, 2012, 9:05:52 PM12/17/12

to stata-us…@googlegroups.com

Berta,

   It looks like all of your variables are strings rather than numeric values. You to convert the strings to numeric values. For example, look at the command destring.

Joseph 

bertalob…@gmail.com

unread,

Dec 18, 2012, 2:06:00 AM12/18/12

to stata-us…@googlegroups.com

Joseph Cullen

unread,

Dec 18, 2012, 2:53:48 AM12/18/12

to stata-us…@googlegroups.com

You are generating all missing values. Read in the manual about missing values and the function «destring».  «Real» is not the function you want to use.

On Monday, December 17, 2012 at 4:43 PM, bertalob…@gmail.com wrote:

Thank’s,

I generate the new variables and then I select to do the tobit model and the error «no observations» still appearing. I send the print of the error.

eric.a.booth

unread,

Mar 11, 2013, 11:36:29 PM3/11/13

to stata-us…@googlegroups.com

Berta — I realize this is an old thread, but (1) J’s advice is correct, you need to use -destring- on all your variables in the model and (2) your screenshot shows that you are using an illegal copy of Stata, you should consider purchasing a license.

— EAB

This article notes a technical problem that STATA noobs like myself may run into where it looks like STAT is failing to import certain variables or observations properly.

A big thanks to Joshua Ingber who solved this issue for me.

This article will solve a particular case of missing observations, not the general case. The general case could originate in a number of ways.

Problem description:

  1. Import delimited data into STAT
  2. STATA reports that it imported the variable, but when you enter “sum myvariablename”, STATA states that there are 0 observations.
  3. Use the toolbar at the top of the STATA GUI and open the data browser by clicking Data -> Data Editor -> Data Editor (Browse)
  4. Notice that the data appears in the browser even though it is not reported using “sum”

What’s really going on?

The issue is that your numerical data was interpreted by STATA as a string. We need to tell STATA that the variable is numerical by running the following:

“destring myVariableName, gen(myNewVariableName)”

Problem solved! Now sum works:

sum-pernp

  • 1
  •  
  •  
  •  

In some instance the standard option that STATA stops whenever an error occurs is a (minor) annoyance. In one of my projects I was running the same set of regressions over several groups with loops. However, whenever STATA found a group that could not run the regressions it would stop, stating the error no observations. Similar things can happen when you select (sub)groups to run commands like summarize, tabulate etc.

One solution is to “capture” the command, so that any error that is returned does not stop the do-file. My favourite example for capture is the following statement that can be found in almost all of my do-files…:


capture log close
log using mylog, replace

The capture log close before my log statement allows me to open a log, even if a log file has been open. It closes a running log-file. However, if no log-file is open, STATA would react with an error on the statement log close and exit. With a capture in front, this does not happen.

If you want to run the entire do-file without stopping, you could also state:


do my_do_file.do, nostop

Понравилась статья? Поделить с друзьями:
  • No movie in file error
  • No more threads error
  • No module named tkinter ошибка
  • No module named tensorflow ошибка
  • No module named sklearn ошибка