Hi,
I need your help related to @elem in Eviews 6.....
I have a serie X from 1980 to 2008. I wanted to do a FOR loop to extract since
2000 to 2008 values:
For !i = 2000 to 2008
scalar x(!i)=@elem(x, "!i")
Next
But did not work!!! :( , show a error related to string....
Can you help me, I need it really....
thank you very much.
@elem EV6
Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13603
- Joined: Tue Sep 16, 2008 5:38 pm
Re: @elem EV6
Code: Select all
For !i = 2000 to 2008
%date = @str(!i)
scalar x(!i)=@elem(x, %date)
Next
Re: @elem EV6
thanks you gareth......you save me!!!!
Re: @elem EV6
Hi Gareth,
This is very helpful. I am a rookie Eviews user. How can I apply this to monthly data?
Thanks!!
Rowena
This is very helpful. I am a rookie Eviews user. How can I apply this to monthly data?
Thanks!!
Rowena
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13603
- Joined: Tue Sep 16, 2008 5:38 pm
Re: @elem EV6
What is it you're trying to do?
Re: @elem EV6
I am trying to check for zero's in the series, if so, set it to previous month value, else let it be. but the @elem function didn't like my @str(%date).
for !j=2005 to 2010
for !i=1 to 12
%date=@str(!jm!i)
if @elem(price_mpr_sm,%date)=0 then
@elem(price_mpr_sm,%date)=price_mpr_sm(-1)
else
@elem(price_mpr_sm,%date)=price_mpr_sm
endif
next
next
for !j=2005 to 2010
for !i=1 to 12
%date=@str(!jm!i)
if @elem(price_mpr_sm,%date)=0 then
@elem(price_mpr_sm,%date)=price_mpr_sm(-1)
else
@elem(price_mpr_sm,%date)=price_mpr_sm
endif
next
next
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13603
- Joined: Tue Sep 16, 2008 5:38 pm
Re: @elem EV6
Can't you just do:
without worrying about loops etc...
Code: Select all
price_mpr_sm = @recode(price_mpr_sm=0, price_mpr_sm(-1), price_mpr_sm)
Who is online
Users browsing this forum: No registered users and 2 guests
