Page 1 of 1

new series - Max function

Posted: Wed Dec 20, 2017 7:01 am
by quark2001
Hi,

I have a series within a model which have some negative values, creating problems in an equation specified in logs. I would like to declare to take the max(series,0) for all the elements in the series, shall I create a new one? Or can I do it in the equation?

Example:

equation eq_AAA.ls log(AA) c log(@max(series,0))

That syntax gives an error. How is the best way to do it?

Thanks

Re: new series - Max function

Posted: Wed Dec 20, 2017 9:41 am
by EViews Gareth
You can't take the log of zero.

@max finds the maximum of a series. You probably want @recode.

Re: new series - Max function

Posted: Wed Dec 20, 2017 10:04 am
by quark2001
EViews Gareth wrote:You can't take the log of zero.

@max finds the maximum of a series. You probably want @recode.


Of course sorry, I meant something like max(log(series),0)

But if the series is negative, log is not defined and max would not work, I guess. How should I do it with recode?

Thanks

Re: new series - Max function

Posted: Wed Dec 20, 2017 11:09 am
by EViews Gareth
Its not clear what you're trying to do.