Hi,

I am trying to use rangestat to perform rolling regressions over a data panel. My data correspond to daily observations as of Friday of each week. Dates are formatted as daily (%td). This is the command I am using:

xtset ticker date_end, delta(7)
rangestat (reg) excess_ret excess_mkt anomaly, interval(date_end -260 0) by(ticker)

Looking at the results of this command, I find that the number of observations in the regressions is equal to 38, which roughly matches 260/7. I also realize that changing the interval to 1820 (which is equal to 260 * 7) give 260 observations in each regression. However, I am not sure if this aproximation is right.

I also tried to format the dates to weekly (%tw), but this creates repeated values within groups. Also, I tried creating an index 1,...,n, to identify weeks, but this seems problematic since I also have gaps in my data.

I would like to know if there is any way to correctly format the dates to get the results I want without having to approximate the size of the interval.

Thanks.