Page 1 of 1

NA versus zero values

Posted: Sat Jun 23, 2018 12:47 am
by RDS
I have some time series that in some periods have "NA"

I set the "NA" to zero with the following expression:

smpl @all if SERIES1 =NA
genr SERIES1 = 0


However, when I sum SERIES1 with another complete SERIES2, the generated SERIES3 has exactly the "NA" of SERIES1:
SERIES3 = SERIES1 + SERIES2 (SERIES3 contains "NA")

Amazingly, if I open as a group SERIES3 and SERIES1, SERIES3 does no longer contain the "NA"
What's going on?

Re: NA versus zero values

Posted: Sat Jun 23, 2018 6:35 am
by EViews Matt
Hello,

When you say that "SERIES3 has exactly the 'NA' of SERIES1", do you mean that SERIES3 has NAs for the same observations that SERIES1 did originally, or do you mean that SERIES3 has NAs for all the other observations (the original non-NA observations of SERIES1)? If it's the latter, you just forgot to return to the full sample (smpl @all) before adding the two series.

Re: NA versus zero values

Posted: Thu Jun 28, 2018 12:10 am
by RDS
Yes, SERIES3 has NAs for the same observations that SERIES1 did originally

Re: NA versus zero values

Posted: Thu Jun 28, 2018 8:32 am
by startz
Is it possible that in one case you are only looking at the current smpl and that in the other you are looking at all observations?

Re: NA versus zero values

Posted: Thu Jun 28, 2018 9:11 am
by EViews Matt
Yes, this seems like a sample issue. Does the following sequence result in NAs in SERIES3?

Code: Select all

smpl @all if SERIES1 = na SERIES1 = 0 smpl @all SERIES3 = SERIES1 + SERIES2