Statalist


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

st: no observations R 2000 error


From   Dias Marios <diasmarios@yahoo.com>
To   statalist@hsphsun2.harvard.edu
Subject   st: no observations R 2000 error
Date   Thu, 2 Jul 2009 23:01:56 -0700 (PDT)

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/



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