Calculating a 12-month moving average of weekly series, but anchored at the last day of the month
- by richardh
I have a zoo object oi.zoo with weekly data. I would like to sooth this with a 12-month moving average (easy enough), but I can't figure out how to anchor the right edge of the the moving average window at the end of the month (to correspond with the on which factors I am regressing). For example:
> head(oi.zoo)
1986-01-15 1986-01-31 1986-02-14…