0 / 0 = 0

For requesting general information about EViews, sharing your own tips and tricks, and information on EViews training or guides.

Moderators: EViews Gareth, EViews Moderator

jlbrillet
Posts: 49
Joined: Mon Feb 16, 2009 6:03 am

0 / 0 = 0

Postby jlbrillet » Wed Jan 19, 2011 7:32 am

A very simple (stupid?) trick.

Many models include conceptually null variables (like exports from a country to itself.... When you compare the relative difference between two simulations, or simulations and historical, EViews will divide zero by zero, giving a NA value and an annoying error message.

From an economic point of view, an absolute error of zero means there is no error, so the relative error should also be zero, even starting from a zero value.

To avoid this, you should give you just have to add to the numerator a condition, testing if the variable is null.

Instead of :

genr pc_x = 100 * (x_1 - x_0) / x_0

you will use :

genr pc_x = 100 * (x_1 - x_0) / (x_0+(x_0=0))

If x_0 <> 0, the condition is false, giving zero, and the computation is performed normally.
If x_0 = 0, the condition gives 1, and the result is 0 / 1 = 0

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

0 / 0 = 0

Postby startz » Wed Jan 19, 2011 8:13 am

Is the result 100*x_1 what you want when x_0=0, in general?


Return to “General Information and Tips and Tricks”

Who is online

Users browsing this forum: No registered users and 5 guests