For a +/- 2 month-year interval, I want to calculate for a given id, how many times did that id appear in the id2 column.
based on the link below, I tried:
1) countmatch id id2
2) rangestat (count) n=id2, interval(id2 id id)
But what I am unable to figure out is how to count it over a time interval?
Would you have any advice to do this?
based on the link below, I tried:
1) countmatch id id2
2) rangestat (count) n=id2, interval(id2 id id)
But what I am unable to figure out is how to count it over a time interval?
Would you have any advice to do this?
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input double(id monthyear id2) 4217 525 . 3217 526 4217 4217 526 . 3217 528 4217 4217 528 . 3217 529 . 4217 529 4217 3217 530 4217 4217 530 3217 4217 530 4217 4217 533 . 4217 533 4217 3217 535 4217 4217 535 4217 4217 535 4217 4217 535 4217 4217 535 4217 3217 536 4217 3217 536 4217 4217 536 4217 3217 537 4217 3217 537 4217 4217 685 . end format %tm monthyear
Comment