I am working with WRDS data. A short sample (not real) is pasted below (sorry for the formatting of dates).
data company Retruns
31may2010 X 1
31may2011 X 2
31may2012 X 3
31may2013 X 4
31may2014 X 5
31may2015 X 6
31may2016 X 7
31may2017 X 8
31may2018 X 9
30-nov-10 Y 1
30-nov-11 Y 2
30-nov-12 Y 3
30-nov-13 Y 5
30-nov-14 Y 6
30-nov-17 Y 4
30-nov-18 Y
.
.
I want to drop a company if the return in the last month/year/observation (2018 here) is missing and if the returns in 25 of the previous 60 months/years are also missing (in actual sample). Would appreciate if someone could help with the code for doing so. Thank You.