I'm trying to program a script to extract observations from different series into a new one. I have series in the naming format of aW_Y & bW_Y where W=week number and Y=year. Example: a01_06, b52_96. The observations are dated about 5 times a week, and I want to take the 7th last observation from every series, and input into a new time series. It would be greatly appreciated if someone could offer support.
Code: Select all
series new
for !i = 1 to 53
for !j = 95 to 99
series new = A{i}_{j}.(@dateadd(@last, -7, "dd"))
next
next
for !i = 1 to 53
for !j =00 to 99
series new = B{i}_{j}.(@dateadd(@last, -7, "dd"))
next
next