Can you please help me with the following issue:
I would like to identify the ids of the companies that have observations over the whole sample period, i.e. from Jan 2005 to Dec 2017.
Here is an example of my data:
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input long date float(mdate id) double ret_eom 16467 540 14713 .0065657461766821384 16467 540 8468 -.003093270296692758 16467 540 17056 -.0016608393468379927 16467 540 29267 -.001942484988471897 16467 540 35903 -.01216822099008778 16467 540 33340 -.0028468637678217734 16467 540 29323 .007498869742503357 end format %d date format %tm mdate
Code:
egen v1= total(inrange(yr, 2005, 2017)), by (id) list if id == 63 & yr == 2006
0 Response to Identify variables in a range
Post a Comment