how to program it?
y has 20 observations y(1),y(2),y(3),y(4),......y(20) ,I want to extract the first 2 observations and get the maximum denoted x(2),then compute z(2)=x(2)-y(3),loop this ,first 3 observations,the maximum x(3),z(3)=x(3)-y(4),......first 19 obs,x(19),z(19)=x(19)-y(20)
and finally z(2) z(3)......z(19)form a new series z.
how to program it?
Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt
Re: how to program it?
As far as I understand, you are looking for something like this:
Code: Select all
series z
series x = @cummax(y)
for !i=2 to 19
z(!i) = x(!i) - y(!i+1)
nextWho is online
Users browsing this forum: No registered users and 2 guests
