Page 1 of 1

evaluating condition in a model

Posted: Sun May 06, 2018 8:58 am
by zezza
I have the following problem: I want to specify a variable according to a condition

Code: Select all

test.append eta = (dcd=0)*0+(dcd<>0)*(2/dcd)
test.append dcd = cd-cd(-1)

I want Eviews to assign the value zero to ETA when the denominator of the resulting ratio would be zero, and compute a ratio otherwise.
The problem is that when DCD assumes a zero value, Eviews returns an error message when solving the model (unable to compute due to missing data)

How can this be specified?

Thank you!

Re: evaluating condition in a model

Posted: Sun May 06, 2018 9:12 am
by EViews Gareth
zezza wrote:I have the following problem: I want to specify a variable according to a condition

Code: Select all

test.append eta = (dcd=0)*0+(dcd<>0)*(2/dcd)
test.append dcd = cd-cd(-1)

I want Eviews to assign the value zero to ETA when the denominator of the resulting ratio would be zero, and compute a ratio otherwise.
The problem is that when DCD assumes a zero value, Eviews returns an error message when solving the model (unable to compute due to missing data)

How can this be specified?

Thank you!

Have you tried a @recode?

Re: evaluating condition in a model

Posted: Mon May 07, 2018 8:10 am
by zezza
Thank you, this has fixed the problem!