Hi everyone,
I have a time series object called y3_0mp from which I want to access the the 397th, 400th, 403rd, and 406th value (and multiply them with each other). Afterwards reiterate the process with plus 1 values. This is what I have come up with so far:
for !j=0 to 206
series y12_eh_{!j}=(@elem(y3_0mp, @otod(397+{!j})))*(@elem(y3_0mp, @otod(400+{!j}))))*(@elem(y3_0mp, @otod(403+{!j})))*(@elem(y3_0mp, @otod(406+{!j})))
next
However it gives me the followin error message: "Illegal date 397+0". I also tried just the loop in there and it didn't work, any ideas???? I also tried to simply type in the date as it is and it didn't work.
Thanks,
Billaudes
Accessing specific values from a series
Moderators: EViews Gareth, EViews Jason, EViews Moderator, EViews Matt
Accessing specific values from a series
Last edited by Billaudes on Sat Jun 27, 2009 10:03 am, edited 1 time in total.
-
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13317
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Accessing specific valies from a series
create string variables equal to the dates first, then use the string variables inside the @elem.
Follow us on Twitter @IHSEViews
Re: Accessing specific values from a series
Hi,
thanks for your response, I am however having difficulties converting those dates to strings, this is what I have tried so far:
y3_0mp=@datestr(yyyy/mm)
other commands also kinda failed (strnow), I think I am declaring the format in a wrong way. my dates are monthly (e.g.1959M02), not sure how the correct format would look like.
Thanks for your help,
Billaudes
thanks for your response, I am however having difficulties converting those dates to strings, this is what I have tried so far:
y3_0mp=@datestr(yyyy/mm)
other commands also kinda failed (strnow), I think I am declaring the format in a wrong way. my dates are monthly (e.g.1959M02), not sure how the correct format would look like.
Thanks for your help,
Billaudes
-
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13317
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Accessing specific values from a series
Follow us on Twitter @IHSEViews
Re: Accessing specific values from a series
That is brilliant thank you sooo much, I have been sitting on this quite a while now!!
Who is online
Users browsing this forum: No registered users and 32 guests