Hi all,
Is there any way to count the number of observation three months prior to every date observation?
I guess I first need to construct the date three months prior to the observed date, and next count the number of observations between those two dates.
Any suggestions?
Thanks in advance
The data looks as follows (don't focus on the id's, those are just to match the info to another dateset) the variable number2 is the total number of observations in my sample.
date id number2
1/20/2000 1932 2320
1/25/2000 1518 2320
1/26/2000 1452 2320
1/31/2000 449 2320
2/2/2000 150 2320
2/10/2000 2049 2320
2/14/2000 2050 2320
2/21/2000 846 2320
2/22/2000 1978 2320
3/1/2000 607 2320
3/2/2000 1807 2320
3/3/2000 2017 2320
3/3/2000 755 2320
3/4/2000 2044 2320
3/7/2000 2159 2320
3/7/2000 734 2320
3/8/2000 1112 2320
3/9/2000 1420 2320
3/13/2000 2031 2320
3/14/2000 1246 2320
3/15/2000 1255 2320
3/16/2000 1858 2320
3/16/2000 1067 2320
3/16/2000 2162 2320
3/17/2000 1 2320
3/20/2000 1275 2320
3/20/2000 288 2320
3/20/2000 268 2320
3/20/2000 2004 2320
3/22/2000 613 2320
3/24/2000 1704 2320
3/24/2000 1305 2320
3/25/2000 690 2320
3/27/2000 791 2320
3/30/2000 259 2320
3/31/2000 1937 2320
3/31/2000 260 2320
Is there any way to count the number of observation three months prior to every date observation?
I guess I first need to construct the date three months prior to the observed date, and next count the number of observations between those two dates.
Any suggestions?
Thanks in advance
The data looks as follows (don't focus on the id's, those are just to match the info to another dateset) the variable number2 is the total number of observations in my sample.
date id number2
1/20/2000 1932 2320
1/25/2000 1518 2320
1/26/2000 1452 2320
1/31/2000 449 2320
2/2/2000 150 2320
2/10/2000 2049 2320
2/14/2000 2050 2320
2/21/2000 846 2320
2/22/2000 1978 2320
3/1/2000 607 2320
3/2/2000 1807 2320
3/3/2000 2017 2320
3/3/2000 755 2320
3/4/2000 2044 2320
3/7/2000 2159 2320
3/7/2000 734 2320
3/8/2000 1112 2320
3/9/2000 1420 2320
3/13/2000 2031 2320
3/14/2000 1246 2320
3/15/2000 1255 2320
3/16/2000 1858 2320
3/16/2000 1067 2320
3/16/2000 2162 2320
3/17/2000 1 2320
3/20/2000 1275 2320
3/20/2000 288 2320
3/20/2000 268 2320
3/20/2000 2004 2320
3/22/2000 613 2320
3/24/2000 1704 2320
3/24/2000 1305 2320
3/25/2000 690 2320
3/27/2000 791 2320
3/30/2000 259 2320
3/31/2000 1937 2320
3/31/2000 260 2320
Comment