Page 1 of 1

Series transformation problem

Posted: Wed Mar 24, 2010 1:56 pm
by jthodge
We recently uncovered an error in our Eviews code that might point to a possible bug in both Eviews 6 and 7. Our program reads in and manipulates population data, with series names such as POPTX (population in Texas).

After reading in the data, one of the lines in our code scales the variable using the following command:
GENR POP_TX = POP_TX/1000

You'll notice that the right-hand-side series name (incorrectly) includes an underscore ("_") whereas the original (correct) series name did not. However, for some reason Eviews allows this new series to be created from a non-existent series (the new series POP_TX is full of N/As).

In comparison, if we were to try generating a new series from a non-existent series that does not have an underscore in its name, e.g.,
GENR POP_TX = POPTEST/1000
we do receive an error message saying "POPTEST is not defined."

So, why the difference? Is "POP_" a reserved name in Eviews or is this some sort of bug?

Re: Series transformation problem

Posted: Wed Mar 24, 2010 2:07 pm
by jthodge
P.S.

I think the issue is that the left-hand-side and right-hand-side variables are the same.

Say you have a blank workfile. The following command will not generate an error:
GENR POPTEST = POPTEST/1000
(even though POPTEST did not exist prior to this command).

However, the following command will generate an error saying "POPTEST2 is not defined":
GENR POPTEST = POPTEST2/1000

Shouldn't both cases generate a "not defined" error?

Re: Series transformation problem

Posted: Wed Mar 24, 2010 2:27 pm
by EViews Gareth
Indeed, the "_" issue was a red herring.

The issue is this... With the line:
GENR POPTEST = POPTEST/1000

You're basically saying to EViews "Create a series called POPTEST. Now set that series equal to the expression POPTEST/1000." EViews can do that no problem at all. First it creates a new, empty series (populated with NAs), then it sets that series equal to the expression POPTEST/1000. Of course at this point POPTEST does exist, but it is full of NAs, so the result is full of NAs with no error given.

When you do:
GENR POPTEST = POPTEST2/1000

The same sequence happens - first POPTEST is created and full of NAs, then it is evaluated at POPTEST2/1000, but there is no series called POPTEST2, thus an error occurs.

This isn't really a bug. Just a quirk of the way that EViews (and many other languages) works.