I am rather new to eviews and have a simple question.
I have a time-series full of ones and want to replace the ones to 2 if condition x is met and 3 if condition y is met and so on....
So in the end for each value in time I want to have 1, 2,3 ... depending on the specified condition.
Basically, I want a replace if function.
What I have so far is the following:
Code: Select all
series Original=1
Series Original = @Recode(X>1,2,1)
Series Original = @Recode(X>2,3,1)
My problem here is the 1 near the end of the bracket. If the condition returns false recodes returns the 1 but I want the value untouched if the condition returns false, i.e. return the value that has been previously there. For example, if the value is 2 and X=1.5 I want that the code returns a 2 instead of a 1.
Basically im looking for something like this:
Code: Select all
Series Original = @Recode(X>1,2,"previous value, i.e. do nothing")
How do I dothat in Eviews?
Best regards,