Hi,
I am trying to generate a household-specific monetary policy shock variable. Generally I have two data sets.
One containing panel data on household level from 2004-2018. The other contains changes in euro swaps around ECB meetings which is my indicator of monetary policy shocks.
Now I need to merge the two data sets. However, the households were interviewed at different points in time during the same year which means that HH1 that was interviewed in week 12 of 2004 and then again in week 20 of 2015 has experienced more monetary policy meetings than HH2 that was interviewed in week 12 of 2004 and then again in week 12 of 2005. Therefore, I have to sum up the changes in the Euro Swap for every HH individually from week x year t-1 to week x year t.

Do you know any command that would allow me to sum up the HH-specific amount of meetings more efficiently than doing it manually for 6,000 observations for 14 years.

Thank you,
Fabienne Leibfarth