How to make program advance one obs sideways

For questions regarding programming in the EViews programming language.

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

gcg
Posts: 11
Joined: Wed Oct 29, 2008 9:18 pm

How to make program advance one obs sideways

Postby gcg » Tue Aug 18, 2009 9:59 am

Hi,

I have a program and I am trying to do a calculation on a dataset that increases by one obs for each series. My question is how to make eviews advance sideways on a set of series. For example, the first two series have 20 and 21 obs, respectively. The third has 22, the fourth has 23, etc. I want to perform a calculation first on series 1and 2. Then on series 1,2,and 3. Then on 1,2,3, and 4. etc.

The way I have it now is not allowing the data set to grow by adding a new series "sideways" as desired. Any suggestions would be much appreciated. Thanks!

for !i = 1 to !length-1-!window

'set sample to estimation period for xxx series
smpl 1971:01 1971:01+!window-1+!i-1
!n = @obs(xxx_25)

'find the largest number of series with #obs at least equal to window and make program add a series each time
!k = 0
for !j = 2 to 25
if (@obs(xxx_!j) >= !window) then
!k = !j
endif
next

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

Re: How to make program advance one obs sideways

Postby EViews Gareth » Tue Aug 18, 2009 10:07 am

I'm not quite sure I understand what you're doing, or why what you are currently doing is not achieving what you want to achieve.

What does "advance sideways" mean?

gcg
Posts: 11
Joined: Wed Oct 29, 2008 9:18 pm

Re: How to make program advance one obs sideways

Postby gcg » Tue Aug 18, 2009 10:12 am

I just mean that I want to increase the number of series in the group by one at each iteration, and each series has one more obs than the one before it. Then I perform another calc on the groups, which increase by one series. The first group has two series, the second has three, then 4, 5, etc. But I cant seem to get the groups to grow by one series progressively. Instead Eviews is taking all 25 series at once.

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

Re: How to make program advance one obs sideways

Postby EViews Gareth » Tue Aug 18, 2009 10:15 am

Code: Select all

group xs for %xname x1 x2 x3 x4 x5 x6 x7 x8 xs.add {%name} 'do calculation on xs here next

gcg
Posts: 11
Joined: Wed Oct 29, 2008 9:18 pm

Re: How to make program advance one obs sideways

Postby gcg » Tue Aug 18, 2009 10:16 am

thanks - I'll give it a try and report back

gcg
Posts: 11
Joined: Wed Oct 29, 2008 9:18 pm

Re: How to make program advance one obs sideways

Postby gcg » Tue Aug 18, 2009 11:17 am

does not work, unfortunately. Eviews still taking all the series at once. Any other suggestions?

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

Re: How to make program advance one obs sideways

Postby EViews Gareth » Tue Aug 18, 2009 11:22 am

You'll have to be more specific.

The code I posted adds the series one at a time. The most likely thing is that you have not implemented it in your code properly, but without seeing your code, that is impossible to say.


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 3 guests