Thanks for giving me help.
the sample:
stock reportdate forecasterro marketvalue beta firmexperience analyst
001 2002-01-05 0.66 783749 1.22 0.22 EAHH01
001 2003-12-04 0.24 835455 1.24 0.43 EAHL02
001 2003-12-08 0.32 835353 1.24 0.23 EARY03
001 2004-01--01 0.44 823311 1.25 0.43 EAHL02
001 2004-03-24 0.54 834672 1.43 0.54 EAHH01
002 2002-06-11 0.89 437535 0.99 0.23 EAWW03
002 2002-07-31 0.92 478281 0.89 0.13 EAHH01
002 2003-11-21 0.82 472481 0.89 0.28 EAHH01
........
I want to get a dummy variable for analyst i 's forecast for stock j in year t.it is equal to 1 if analyst i 's forecast is above both the analyst's prior forecast and the mean forecast which is based on forecasts issued in the 90 days prior to analyst i's forecast revision.it is set to 0 otherwise.
how can i get the result?