Hi all,

I am working with a data set that has event data at the district-month level where

Code:
* Example generated by -dataex-. To install: ssc install dataex
clear
input float(uniqueid year month count)
1001 1990  1  1
1001 1990  2  1
1001 1990  3  3
1001 1990  4  4
1001 1990  5  3
1001 1990  6  5
1001 1990  7  5
1001 1990  8  2
1001 1990  9  2
1001 1990 10  1
1001 1990 11  5
1001 1990 12  2
1001 1991  1  5
1001 1991  2 12
1001 1991  3  1
1001 1991  4  3
1001 1991  7  2
1001 1991  8  6
1001 1991  9  4
1001 1991 10  4
1001 1991 11  5
1001 1991 12  2
1001 1992  1  2
1001 1992  2  3
1001 1992  4  3
1001 1992  5  3
1001 1992  6  3
1001 1992  7  2
1001 1992  8  3
1001 1992  9  1
1001 1992 10  2
1001 1992 11  2
1001 1992 12  2
1001 1993  1  6
1001 1993  2  2
1001 1993  3  5
1001 1993  4  2
1001 1993  5  1
1001 1993  8  1
1001 1993  9  2
1001 1993 10  3
1001 1993 11  3
1001 1994  1  2
1001 1994  2  2
1001 1994  3  1
1001 1994  5  2
1001 1994  7  1
1001 1994  8  1
1001 1994  9  2
1001 1994 10  3
1001 1994 11  2
1001 1994 12  1
1001 1995  1  2
1001 1995  2  3
1001 1995  3  1
1001 1995  4  1
1001 1995  5  3
1001 1995  6  3
1001 1995  7  5
1001 1995  8  2
1001 1995  9  6
1001 1995 10  1
1001 1995 11  1
1001 1996  1  2
1001 1996  2  6
1001 1996  3  1
1001 1996  4  1
1001 1996  7  5
1001 1996  9  2
1001 1996 10  3
1001 1996 11  3
1001 1996 12  3
1001 1997  1  1
1001 1997  2  2
1001 1997  3  4
1001 1997  4  1
1001 1997  5  1
1001 1997  7  1
1001 1997  8  1
1001 1997  9  4
1001 1997 10  1
1001 1997 12  3
1001 1998  1  2
1001 1998  2  1
1001 1998  3  5
1001 1998  4  5
1001 1998  5  6
1001 1998  6  1
1001 1998  7  4
1001 1998  8  2
1001 1998  9  3
1001 1998 10  1
1001 1998 11  4
1001 1998 12  3
1001 1999  1  3
1001 1999  2  1
1001 1999  3  2
1001 1999  5  1
1001 1999  8  3
1001 1999  9  4
end
uniqueid is the district identifier. I would like to create five year averages for each municipality- but I am not sure how to take into account the fact that missing months mean no event occurred. What is the proper way to approach this?

Thank you.