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.

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
  •  
  •  
  •  


Go to stata


Error r2000 «No Observations»

Hello, I am trying to run a mixed effects logistic regression and keep getting error r(2000) «no observations.» I have already used the «describe» function and all of my variables are byte or float. Any suggestions on what may be the issue? An example of my do-file command is below

melogit POSTOP_CIN GENDER MAXDIA_o69 eGFR_u30 AGE RACE BMIreal PREOP_SMOKING HTN DIABETES PRIOR_CABG PRIOR_CAD PRIOR_CHF COPD PRIOR_CVD PREOP_ACE PRIOR_ANEURREP PREOP_ASA PREOP_P2Y PREOP_STATIN PREOP_BETABLOCKER PREOP_ANTICOAG PREOP_MAXAAADIA ILIACANEUR PRIOR_PCI || CENTERID: , or

I have a survey dataset identified by household id and person id. There’s a question in the survey about members of the household with disability. Due to the framing of the question, I noticed that the characteristics of the person with disability (e.g. age, educ, etc) were encoded to other members’ data.

We were tasked to do logistic regression where the dependent variable is the disability variable. When I run logit in Stata, I get error 2000 saying that there are no observations. What am I supposed to do? Should I transfer the observations from the other members’ profile to the person with ‘disability profile’? This might be the reason why I get the error code in Stata.

Nick Cox's user avatar

Nick Cox

35.2k6 gold badges31 silver badges47 bronze badges

asked Dec 4, 2013 at 14:16

user3064575's user avatar

This is marginal for Stack Overflow, which is not really for general questions about software, but more about problems in developing your own Stata programs or code (in this case). Nevertheless Stata users on SO generally try to accommodate this kind of question.

Please note: not only can we not see your dataset, but also you seem to be assuming that we can understand what it is all about from a brief verbal description. In general that is unlikely.

Nevertheless your problem is likely to be very simple. error 2000 here often means that you have one or more variables that should be numeric in string form. logit requires all of the variables fed to it to be numeric. Look carefully at the results of describe to see if any of the variables you use is actually string. If so, consider using destring or encode as appropriate to produce numeric variables.

For future reference: this is generic to essentially all statistical commands in Stata.

It is also possible that error 2000 reflects a problem with missing values in one or more variables. In that case, look carefully at the results of summarize and/or codebook, compact.

answered Dec 4, 2013 at 16:54

Nick Cox's user avatar

Nick CoxNick Cox

35.2k6 gold badges31 silver badges47 bronze badges

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.

Понравилась статья? Поделить с друзьями:
  • No more spool space teradata ошибка
  • No module named tkinter ошибка
  • No module named tensorflow ошибка
  • No module named sklearn ошибка
  • No module named selenium ошибка