Page 1 of 1

@nan function

Posted: Thu May 28, 2009 7:14 am
by Martin
A daily variable is available in excel format for each year; in other words one spreadsheet per year. Time period is from 1967-2008. I created a workfile with this range and created a series for each year that has observed values for that year and N/A for every other observation. I would now like to merge every series.

Is their another function like @nan? Or a procedure I can follow to merge these series so I will have a value for each observation?


Thank you
Martin

Re: @nan function

Posted: Thu May 28, 2009 7:55 am
by startz
A daily variable is available in excel format for each year; in other words one spreadsheet per year. Time period is from 1967-2008. I created a workfile with this range and created a series for each year that has observed values for that year and N/A for every other observation. I would now like to merge every series.

Is their another function like @nan? Or a procedure I can follow to merge these series so I will have a value for each observation?


Thank you
Martin
You can change the NAs to zeros, and then add the series. Something like

Code: Select all

series allyears = @nan(y1,0)+@nan(y2,0)

Re: @nan function

Posted: Thu May 28, 2009 9:18 am
by Martin
Thank you Startz.

Unfortunately, some values need to remain N/A. In a specific year, one or two days of data might be missing. Is there another method to merge the series? I have been use @nan over and over. It gets the job done but it is time consuming.

Re: @nan function

Posted: Thu May 28, 2009 9:36 am
by EViews Gareth
It seems you've gone about this somewhat backwards.

I think what I would do would be to create an EViews page for each year (i.e. an EViews page for each Excel sheet you have). Then you can use the EViews page append to append all those pages into one big page.

Re: @nan function

Posted: Thu May 28, 2009 9:40 am
by EViews Glenn
Gareth is correct, but given where you are at the moment, if I understand the exercise correctly, the @RMEAN (or @RSUM) function should do what you want...

Suppose we have the two series X1 and X2 where we have

Code: Select all

X1 X2 ------- 1 NA 2 NA NA 3 NA 4 NA NA
Form a group containing the two series

Code: Select all

group allseries x1 x2
Then the command

Code: Select all

series joined = @rmean(allseries)
will create

Code: Select all

JOINED -------- 1 2 3 4 NA
Note that this works assuming that there is at most one value in the group that is valid for a given observation. You can check this restriction using @ROBS.

Re: @nan function

Posted: Thu May 28, 2009 10:36 am
by Martin
Gareth is correct, but given where you are at the moment, if I understand the exercise correctly, the @RMEAN (or @RSUM) function should do what you want...

Suppose we have the two series X1 and X2 where we have

Code: Select all

X1 X2 ------- 1 NA 2 NA NA 3 NA 4 NA NA
Form a group containing the two series

Code: Select all

group allseries x1 x2
Then the command

Code: Select all

series joined = @rmean(allseries)
will create

Code: Select all

JOINED -------- 1 2 3 4 NA
Note that this works assuming that there is at most one value in the group that is valid for a given observation. You can check this restriction using @ROBS.


PERFECT! Seriously you’re my hero.