@dtoo in a pool

For questions regarding programming in the EViews programming language.

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

mariposa
Posts: 21
Joined: Tue Dec 02, 2008 7:04 am

@dtoo in a pool

Postby mariposa » Mon Feb 16, 2009 9:03 am

Hallo,

I want to use the @dtoo command in a pool. Is this possible? (I only get error messages :( )

Context: I want to calculate the growth rate log(Y_2008) - log(Y_1950) in a pool (gdp series for different countries in the sample 1950 - 2008). In order to do the calculations I tried to get the value of the series in 2008 with the @dtoo command. However, this seems to be not possible in a pool... Does someone knows another way to solve this?

My code:
pool all _ALB _DZA _AGO _ARG

all.genr grow? = log(y_?(@dtoo("2008"))) - log(y_?(@dtoo("1950")))

Thanks!

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

Re: @dtoo in a pool

Postby EViews Gareth » Mon Feb 16, 2009 9:13 am

You can't use @dtoo to directly index a series like that (whether in a pool or not).

Try this:

Code: Select all

pool all _ALB _DZA _AGO _ARG !o1 = @dtoo("2008") !o2 = @dtoo("1950") all.genr grow? = log(y_?(!o1)) - log(y_?(!o2))

mariposa
Posts: 21
Joined: Tue Dec 02, 2008 7:04 am

Re: @dtoo in a pool

Postby mariposa » Mon Feb 16, 2009 9:26 am

Thanks for the help.

Unfortunately, this does not solve my problem, as EViews calculates for example grow_usa = log(y_usa(59)) - log(y_usa(1)) and this is always "NA". (I suppose, that it always takes the 59 lead which does not exist)

I think I will try to solve my calculations without the pool and make a big loop (for %a _ALB _DZA _AGO _ARG) ...

However, I really appreciate the quike responses in this forum!!

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

Re: @dtoo in a pool

Postby EViews Gareth » Mon Feb 16, 2009 9:45 am

My mistake. You're probably best off just using a for loop.

Code: Select all

!o1 = @dtoo("2008") !o2 = @dtoo("1950") for %j _ALB _DZA _AGO _ARG %name = "y" + %j !num = log({%name}(!01)) - log({%name}(!02)) %name2 = "grow" + %j series {%name2} = !num next


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests