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
Related Posts with Command for Calculating the Average for 7 days periods in Panel Data
Marginal effects for group comparisons in probit regressionHi all, I am trying to use a probit model to analyze a bunch of interaction effects for a binary de…
Modelling temporal dependence in within-between "hybrid" modelsDear Statalisters, I would like to know how to properly specify a temporal variable in within-betwe…
Idiosyncratic SkewnessI run the below code on appended dataset to calculate monthly idiosyncratic skewness as skewness of …
local macro and loopHi Statalist, I am trying to use a local macro with a foreach loop to clean up some vars. Here is my…
Likehood ratio test showing errorDear colleagues, can someone kindly assist me in identifying problem while you likelihood ratio test…
Subscribe to:
Post Comments (Atom)
0 Response to Command for Calculating the Average for 7 days periods in Panel Data
Post a Comment