Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: AW: no observations R 2000 error


From   "Martin Weiss" <martin.weiss1@gmx.de>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: AW: no observations R 2000 error
Date   Fri, 3 Jul 2009 09:14:16 +0200

<> 

Could be several things, but it is critically important for the list to know
after which line Stata complains. Also, you could -set trace on- and report
the area around the error. 

Are you sure you have id running from 1 to 85? Type -levelsof id- to check!
If one of them is missing, the -reg- command throws up an error and stops
the whole thing... You can prevent this by adding -capture- in front of the
command in question...



HTH
Martin

-----Ursprüngliche Nachricht-----
Von: owner-statalist@hsphsun2.harvard.edu
[mailto:owner-statalist@hsphsun2.harvard.edu] Im Auftrag von Dias Marios
Gesendet: Freitag, 3. Juli 2009 08:02
An: statalist@hsphsun2.harvard.edu
Betreff: st: no observations R 2000 error

Hi

I know this type of error has been posted before but i have followed some
suggested solutions and i still cannot find a way to solve it.

THIS IS MY LIST OF VARIABLES

target_name           str34        %34s
company_id            byte        %8.0g
market_return         float        %9.0g
ret                   float        %9.0g
date                  float        %td
event_date            float        %td
datenum               float        %9.0g
td                    float        %9.0g
dif                   float        %9.0g
event_window          float        %9.0g
count_event_obs       float        %9.0g
estimation_window     float        %9.0g

AND HERE IS THE CODE I AM TRYING TO RUN AND GET THE ERROR

set more off 

gen predicted_return=.
egen id=group(company_id) 
forvalues i=1(1)85 { 
	l id company_id if id==`i' & dif==0
	reg ret market_return if id==`i' & estimation_window==1 
	predict p if id==`i'
	replace predicted_return = p if id==`i' & event_window==1 
	drop p
}  


I have checked that in my variables all missing values are replaced with a "
. " so i would  guess that is not the problem.

Thanks

Marios



      
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index