Tables that contain series that sometimes aren't populated

For questions regarding programming in the EViews programming language.

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

miorinnovo
Posts: 199
Joined: Sun Mar 01, 2015 5:01 pm

Tables that contain series that sometimes aren't populated

Postby miorinnovo » Thu Dec 06, 2018 7:38 am

I have a table in my program that displays a number of series. These series only get created if certain conditions are met. So I'm wondering if , when those conditions are not met, and the series is not created, can i somehow still have the table show up with an NA rather than the message I currently get which says "series is not defined."

Hope this makes sense, and thanks.

startz
Non-normality and collinearity are NOT problems!
Posts: 3775
Joined: Wed Sep 17, 2008 2:25 pm

Re: Tables that contain series that sometimes aren't populated

Postby startz » Thu Dec 06, 2018 7:46 am

One option--might or might not meet your needs--is to create the series and set them equal to NA. Then your code can populate them with real values or just leave them alone.

miorinnovo
Posts: 199
Joined: Sun Mar 01, 2015 5:01 pm

Re: Tables that contain series that sometimes aren't populated

Postby miorinnovo » Thu Dec 06, 2018 8:16 am

Thanks, That would create a second problem though because another formula is dependent on how many series get populated.

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

Re: Tables that contain series that sometimes aren't populated

Postby EViews Gareth » Thu Dec 06, 2018 8:28 am

Tables are entirely under your control. If you want to set an element of a table equal to NA, then do it.

In other words, I am not really sure what the issue is.
Follow us on Twitter @IHSEViews

miorinnovo
Posts: 199
Joined: Sun Mar 01, 2015 5:01 pm

Re: Tables that contain series that sometimes aren't populated

Postby miorinnovo » Thu Dec 06, 2018 8:35 am

The issue is I would rather not have to comment out and uncomment lines of tables all the time. I would like the table code to stay as it is whether all series are populated or only some are populated.

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

Re: Tables that contain series that sometimes aren't populated

Postby EViews Gareth » Thu Dec 06, 2018 8:46 am

The EViews programming language supports if statements. You can have your code do things or not do things based upon conditions. If there are lines of code that you don't want to occur if a condition is not met, use an if condition.
Follow us on Twitter @IHSEViews

miorinnovo
Posts: 199
Joined: Sun Mar 01, 2015 5:01 pm

Re: Tables that contain series that sometimes aren't populated

Postby miorinnovo » Thu Dec 06, 2018 9:02 am

Right, this is what I had in mind but I'm not sure how to code an if statement for whether a series exists.

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

Re: Tables that contain series that sometimes aren't populated

Postby EViews Gareth » Thu Dec 06, 2018 9:12 am

Code: Select all

if @isobject("seriesname") then

else

endif
Follow us on Twitter @IHSEViews

miorinnovo
Posts: 199
Joined: Sun Mar 01, 2015 5:01 pm

Re: Tables that contain series that sometimes aren't populated

Postby miorinnovo » Thu Dec 06, 2018 9:45 am

Amazing!

Thanks


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 34 guests