### Avoiding spurious"division by zero" messages

Posted:

**Thu Jun 14, 2012 4:23 am**How to avoid the "divide by zero" when computing the relative error on a null variable.

In the economic domain, no variable is null by chance. The relative variation on a null variable should be considered as zero, but for Eviews any division by zero fails with an annoying and maybe misleading error message.

Avoiding this problem is very simple.

replace the element in the denominator by :

(variable + (variable=0))

If the variable is 0 (with zero variations) you get 0/(0+1) = 0

If the variable is not, the condition gives zero and the additional term has no impact.

In the economic domain, no variable is null by chance. The relative variation on a null variable should be considered as zero, but for Eviews any division by zero fails with an annoying and maybe misleading error message.

Avoiding this problem is very simple.

replace the element in the denominator by :

(variable + (variable=0))

If the variable is 0 (with zero variations) you get 0/(0+1) = 0

If the variable is not, the condition gives zero and the additional term has no impact.