Page 1 of 1

How to link data from dated page to undated page?

Posted: Tue Sep 25, 2012 1:38 am
by landyang
Hello,

I have a dated weekly series that I want to link to an undated page where each series contains data only for one specific year.
The data I have in weekly page:
1/02/2010 -1.22
1/09/2010 -0.24
1/16/2010 -0.25
1/23/2010 -0.27
.
.
.
1/01/2011 2.93
1/08/2011 4.92
1/15/2011 3.90
1/22/2011 3.89
.
.
And I want to link them to an undated page with 2 series:
data_2010 data_2011
-1.22 2.93
-0.24 4.92
-0.25 3.90
-0.27 3.89
. .
. .

Does anybody know how do I set a link to special paste the data? Thanks a lot!

Re: How to link data from dated page to undated page?

Posted: Tue Sep 25, 2012 7:56 am
by EViews Gareth
What are the observations in the undated page? How do you wish to match the observations in the undated with the observations in the dated?

Re: How to link data from dated page to undated page?

Posted: Thu Sep 27, 2012 8:21 am
by landyang
Basically, in undated page I'd like to create several series with each series for one year, i.e. undated page should have 53 (53 weeks in some years) observations, and each series corresponds to one year in dated page. Each observation in a series/year should link to the week number of that specific year in dated pages. Thanks!

Re: How to link data from dated page to undated page?

Posted: Thu Sep 27, 2012 8:34 am
by EViews Gareth
Doing it with a copy is complicated. Easier to do it with a page unstack.

Create two new series in your weekly page containing the week number and the year number:

Code: Select all

series weeknum = @datepart(@date, "ww") series yearnum = @year
Then use Proc->Reshape Current Page->Unstack in New Page, and enter "yearnum" in the first box, and "weeknum" in the second, and hit ok.

Re: How to link data from dated page to undated page?

Posted: Thu Nov 08, 2012 10:58 am
by landyang
Thank you, Gareth! This works well, but I have one concern. Since I need to update weekly page every week and do analysis in the undated page, if I create a new page every time, I will have to re-do the analysis. Is there any other way to directly link the data in weekly pages to the undated page? Thanks a lot!

Doing it with a copy is complicated. Easier to do it with a page unstack.

Create two new series in your weekly page containing the week number and the year number:

Code: Select all

series weeknum = @datepart(@date, "ww") series yearnum = @year
Then use Proc->Reshape Current Page->Unstack in New Page, and enter "yearnum" in the first box, and "weeknum" in the second, and hit ok.

Re: How to link data from dated page to undated page?

Posted: Thu Nov 08, 2012 11:16 am
by EViews Gareth

Code: Select all

create(page=full) w 1990 2000 series weeknum = @datepart(@date, "ww") series y=nrnd pagecreate(page=weeks) u 53 series weeknum = @trend+1 for !i=1990 to 2000 link y_{!i} %smplspec = "if @year = " + @str(!i) y_{!i}.linkto(smpl=%smplspec) full\y weeknum weeknum next

Re: How to link data from dated page to undated page?

Posted: Thu Nov 22, 2012 8:20 am
by landyang
Thank you so much! That works perfectly!

Code: Select all

create(page=full) w 1990 2000 series weeknum = @datepart(@date, "ww") series y=nrnd pagecreate(page=weeks) u 53 series weeknum = @trend+1 for !i=1990 to 2000 link y_{!i} %smplspec = "if @year = " + @str(!i) y_{!i}.linkto(smpl=%smplspec) full\y weeknum weeknum next