I have a large scanner panel data set, which tracks consumptions made by households. What I'm interested in doing is the following: I want to (eventually) count the number of purchase observations 3, 6, 12 months before and after specific dates. I was told that the best way to go about doing this is by creating LET statement. However, I have no clue hwo this can be done... Can someone help please? Currently, the data looks as below: Household_ID Purchase_Date Specific_Date X Y Z 1 11/22/07 3/24/08 1 3/25/08 3/24/08 1 4/28/08 3/24/08 1 1/30/09 3/24/08 2 So, for household_id=1, for 3 months interval, i want to have two observations: 3/25/08 4/28/08 for 6 months interval, i want to have three observations: 11/22/07 3/25/08 4/28/08 for 12 months interval, i want all observations In the end, I need to create additional summary statistics for observations that fall belong to above time intervals. Such as avg(x), avg(y), avg(z)... any comments would be greatly appreciated. please let me know if anything is not clear
... View more