Matching a date with a series observation

For questions regarding programming in the EViews programming language.

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

ashtongate
Posts: 21
Joined: Thu Sep 25, 2008 10:39 am
Location: Washington DC

Matching a date with a series observation

Postby ashtongate » Mon Nov 23, 2009 8:20 am

Anyone know how to match a series observation to a date? I know about @dtoo and @otod, but I am thinking more of identifying the date for which a series reached it maximum value; i.e. I do not know the observation number, just the criteris (that it is the max),

Cheers!

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

Re: Matching a date with a series observation

Postby EViews Gareth » Mon Nov 23, 2009 8:59 am

Code: Select all

=@otod(@imax(x))


where x is the name of your series.
Follow us on Twitter @IHSEViews

ashtongate
Posts: 21
Joined: Thu Sep 25, 2008 10:39 am
Location: Washington DC

Re: Matching a date with a series observation

Postby ashtongate » Mon Nov 23, 2009 9:12 am

Great, thanks!

atoch
Posts: 15
Joined: Wed Dec 02, 2009 2:54 am
Location: Paris, France
Contact:

Re: Matching a date with a series observation

Postby atoch » Thu Dec 03, 2009 10:20 am

Bonjour,

I'm trying to use the @otod() function.
Documentation says it returns a string but when I try to store the output of @otod() into an object of type alpha, I receive an error massage saying that @OTOD is not a Genr or series expression function.

Code: Select all

alpha mytext
mytext = @otod(@imax(FRA_CG_ADBQ))


Where FRA_CG_ADBQ is a quarterly time series with a sample running from 1950q1 to 2009q2.
I've tried simplier versions of the above code like :

Code: Select all

%1 = @otod(5)


I don't receive the error message but I can't access the content of the temporary variable %1 so it doesn't help.

Thanks

Arnaud Atoch

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

Re: Matching a date with a series observation

Postby EViews Gareth » Thu Dec 03, 2009 11:00 am

Code: Select all

alpha mytext
%s = @otod(5)
mytext = %s
Follow us on Twitter @IHSEViews

atoch
Posts: 15
Joined: Wed Dec 02, 2009 2:54 am
Location: Paris, France
Contact:

Re: Matching a date with a series observation

Postby atoch » Thu Dec 03, 2009 12:26 pm

Thanks.

When running your above code the following error is produced :
%s is not defined

Both with Eviews6 and Eviews7 beta.

Arnaud Atoch

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

Re: Matching a date with a series observation

Postby EViews Gareth » Thu Jan 21, 2010 10:38 am

Sounds like you're running the code from the command line, rather than from within an EViews program. You'll have to run it in an EViews program.

If you want to use it from the command line, you could do:

Code: Select all

alpha mytext
string s = @otod(5)
mytext = s
Follow us on Twitter @IHSEViews


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 41 guests