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
@nan function
Moderators: EViews Gareth, EViews Steve, EViews Moderator, EViews Jason
-
startz
- Non-normality and collinearity are NOT problems!
- Posts: 3796
- Joined: Wed Sep 17, 2008 2:25 pm
Re: @nan function
You can change the NAs to zeros, and then add the series. Something likeA 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
Code: Select all
series allyears = @nan(y1,0)+@nan(y2,0)Re: @nan function
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.
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.
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13586
- Joined: Tue Sep 16, 2008 5:38 pm
Re: @nan function
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.
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.
-
EViews Glenn
- EViews Developer
- Posts: 2682
- Joined: Wed Oct 15, 2008 9:17 am
Re: @nan function
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
Form a group containing the two series
Then the command
will create
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.
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
Code: Select all
group allseries x1 x2
Code: Select all
series joined = @rmean(allseries)
Code: Select all
JOINED
--------
1
2
3
4
NA
Re: @nan function
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 haveForm a group containing the two seriesCode: Select all
X1 X2 ------- 1 NA 2 NA NA 3 NA 4 NA NAThen the commandCode: Select all
group allseries x1 x2will createCode: Select all
series joined = @rmean(allseries)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.Code: Select all
JOINED -------- 1 2 3 4 NA
PERFECT! Seriously you’re my hero.
Who is online
Users browsing this forum: No registered users and 2 guests
