Loop that uses exclude?

For questions regarding programming in the EViews programming language.

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

chester
Posts: 44
Joined: Thu May 12, 2016 11:14 am

Loop that uses exclude?

Postby chester » Mon Jun 27, 2016 11:13 am

Okay so my data is formatted with time periods (years) as rows and variables as columns.
I'd like EViews to determine the first year with incomplete data ('NA' values in the row), and solve for the missing values.
Then I would like it to solve normally for the years thereafter.
However, I do NOT want EViews to solve and overwrite the values for variables which DO have values.
I understand you must use the 'exclude' term but how can I write this as a loop which can be applied to any group of series?

In pseudocode:

Code: Select all

row = 0 for row <= last row if row contains missing values solve for all cells that contain 'NA' exclude all cells that contain values else solve normally row = row + 1 next exit

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

Re: Loop that uses exclude?

Postby EViews Gareth » Mon Jun 27, 2016 11:23 am

Not exactly sure what you're asking, but I think you just want to use the actexist=t option on exclude:
http://www.eviews.com/help/helpintro.ht ... 23ww215852

chester
Posts: 44
Joined: Thu May 12, 2016 11:14 am

Re: Loop that uses exclude?

Postby chester » Tue Jun 28, 2016 11:52 am

Right now I manually exclude variables for the year 2015 because we have actual values for them. I only want to forecast values for that year which we do NOT have. How can I use the 'actexist=true' option so that EViews can determine what is the latest year with incomplete data and then automatically exclude variables with actual values?

So far, this is what I do to forecast x.

Code: Select all

x.exclude ik("2015 2015") xk("2015 2015") mk("2015 2015") invk("2015 2015") gck("2015 2015")

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

Re: Loop that uses exclude?

Postby EViews Gareth » Tue Jun 28, 2016 12:18 pm

Code: Select all

X.exlude(actexisit=t)


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests