Page 1 of 1

Divide one series into two

Posted: Sat Oct 08, 2016 10:15 am
by HJ123
Hi,

I have a time series with positive and negative values which I want to divide into two sperate ones. I want to generate one series with only all positive values (and all negative values being 0) and the other series to be only all negative values (all positive values being 0).

For example:
1. 1
2. -2
3. 4
4. -3

1. 1
2. 0
3. 4
4. 0

1. 0
2. -2
3. 0
4. -3

I tried and I failed miserably.

Thanks for the help!

Re: Divide one series into two

Posted: Sat Oct 08, 2016 10:42 am
by EViews Gareth
Series y = @recode(x>0,x,0)