Quantcast
Channel: Statalist
Viewing all articles
Browse latest Browse all 65094

identifying latest obs

$
0
0
I'm using stata 13 with OS windows 10.

I have a data set with analysts consensus, earnings announcements and fiscal year end. I'd like to identify the last consensus before that given fiscal year ends. This is an example of my data.

Ibtic is firm identifier
pends is end of fiscal year date
anndats_an is analysts consensus date

What I want is the last anndats_an before pends.

Code:
* Example generated by -dataex-. To install: ssc install dataex
clear
input str6 ibtic float(pends anndats_an)
"0004" 20453 19949
"0004" 20453 19984
"0004" 20453 20012
"0004" 20453 20047
"0004" 20453 20075
"0004" 20453 20103
end
format %td pends
format %td anndats_an

Viewing all articles
Browse latest Browse all 65094

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>