Dear Stata Specialists,

I have a daily panel data from 01/01/2012 to 12/31/2017 with 10 different regions.

I would like to generate two variables that represent 7 days the average.

For example below based on Excel,

Cell D9 = average (C3:C9), this value is the average rate for 7 days from 01/02/2012 to 01/08/2012).

Cell E9 = average (C2:C8), his value is the average rate for 7 days from 01/01/2012 to 01/07/2012).

Since I have 10 different regions (Region 1-10), it is really difficult to calculate the average manually in Excel.

I would like to generate those columns D and E in STATA based on STATA code.

Could you please help me on the code?

Thank you very much in advance.
Array