Page 1 of 1

Programming a series with some zeros to fill in another number

Posted: Wed Feb 26, 2020 2:42 pm
by miorinnovo
I have some series that have some observations valued at 0. Is there a way to automatically have all 0 observations changed to 1 without having to explicitly tell the program the dates?

For example, I know
smpl sample

Code: Select all

variable.fill(s) 1
would work if I make the sample the exact date of the 0, but with many zeros it would get cumbersome so id like eviews to automatically find and replace zeros. Is that possible?

Re: Programming a series with some zeros to fill in another number

Posted: Wed Feb 26, 2020 2:45 pm
by startz
Maybe

Code: Select all

smpl if s=0 s=1 smpl @all

Re: Programming a series with some zeros to fill in another number

Posted: Wed Feb 26, 2020 2:46 pm
by miorinnovo
amazing. thanks!

Re: Programming a series with some zeros to fill in another number

Posted: Wed Feb 26, 2020 2:54 pm
by EViews Gareth

Code: Select all

s = @recode(s=0,1,s)