@elem

For questions regarding programming in the EViews programming language.

Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt

cdewolfe
Posts: 4
Joined: Wed Jul 28, 2010 7:31 am

@elem

Postby cdewolfe » Wed Jul 28, 2010 7:49 am

Hello,
I'm very new to Eviews (I'm using v 6) so I apologize if this is a simple question or I'm not explaining it correctly. I'm trying to generate a new series using just the most current last value of another series. This is the command I'm using:

genr cur_nf = @elem(nf_consum_banks_tc, "@last")

This works but it gives me N/A because my workfile sample is set to 2000M1 to 2015M12. Is there a way to extract the last numerical value in this fashion? Or is there a way to set my workfile sample to start at 2000m1 and end at the last numerical value o feach series I'm working with?

Thank you,
Chris

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13603
Joined: Tue Sep 16, 2008 5:38 pm

Re: @elem

Postby EViews Gareth » Wed Jul 28, 2010 8:04 am

In EViews 6 this is somewhat tricky (EViews 7 has a few tools to make it easier for you).

This might work for you:

Code: Select all

series temp = @recode(nf_consum_banks_tc<>na,@trend,na)+1 !first = @min(temp) %firstdate=@otod(!first) series cur_nf = @elem(nf_consum_banks, %firstdate)

cdewolfe
Posts: 4
Joined: Wed Jul 28, 2010 7:31 am

Re: @elem

Postby cdewolfe » Wed Jul 28, 2010 8:42 am

Hi, thanks for your help. Unfortunately this only gives me the first value of the series, not the last.

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13603
Joined: Tue Sep 16, 2008 5:38 pm

Re: @elem

Postby EViews Gareth » Wed Jul 28, 2010 8:48 am

Ha, my bad.

Code: Select all

series temp = @recode(nf_consum_banks_tc<>na,@trend,na)+1 !last = @max(temp) %lastdate=@otod(!last) series cur_nf = @elem(nf_consum_banks, %lastdate)

cdewolfe
Posts: 4
Joined: Wed Jul 28, 2010 7:31 am

Re: @elem

Postby cdewolfe » Wed Jul 28, 2010 8:58 am

I suppose I could have noticed that too. :oops:

Thanks for the help!


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 1 guest