s-news
[Top] [All Lists]

Merging Time Series

To: <s-news@lists.biostat.wustl.edu>
Subject: Merging Time Series
From: "Horace Tso" <Horace_Tso@pgn.com>
Date: Thu, 19 Jun 2003 18:24:09 -0700
Hi folks,
 
Using 6.1 under Win2K, I want to do a Union of two Time Series. Sounds simple? I've tried every trick out there and nothing works. SPlus support suggests using merge(), but that doesn't work. Each series has identical column names, Y1, Y2, Y3. There are some overlapping dates in both. Here they are, 
 
> t1
Position    Y1    Y2      Y3
02/12/1997 7.00  6.50 7.50 
02/26/1997 6.50  6.25 6.75 
02/27/1997 6.50  6.25 6.75
02/28/1997 6.50  6.25 6.75
03/01/1997 6.50  6.25 6.75
03/03/1997 6.50  6.25 6.75
03/04/1997 9.21  7.25 10.00
03/05/1997 10.00 9.75  10.25
03/06/1997 8.75  8.50  9.00
 
>t2
Position    Y1    Y2      Y3
02/12/1997 6.00  8.50 7.50 
02/26/1997 6.15  6.00 6.75 
02/27/1997 4.50  4.25 4.75
02/28/1997 3.50  3.25 3.25
03/01/1997 6.50  6.25 6.75
03/04/1997 6.50  6.25 6.75
03/05/1997 1.21  2.25 1.00
03/08/1997 1.00  0.75  0.25
03/09/1997 2.25  2.50  2.00
 
I want to create the following,
 
Position         Y1    Y2      Y3    Y11    Y21    Y31
02/12/1997  6.00  8.50 7.50  7.00   6.50   7.50
02/26/1997  6.15  6.00 6.75  6.50   6.25   6.75
02/27/1997  4.50  4.25 4.75  6.50   6.25    6.75
02/28/1997  3.50  3.25 3.25  6.50   6.25    6.75
03/01/1997  6.50  6.25 6.75  6.50   6.25    6.75
03/03/1997  NA     NA   NA     6.50   6.25    6.75
03/04/1997  6.50  6.25 6.75   9.21  7.25   10.00
03/05/1997  1.21  2.25 1.00  10.00 9.75   10.25
03/06/1997  NA     NA   NA     8.75    8.50   9.00
03/08/1997  1.00  0.75   0.25 NA     NA      NA
03/09/1997  2.25  2.50   2.00 NA     NA      NA
 
Thanks a lot.
 
Horace W. Tso
Senior Quantitative Analyst
Portland General Electric
Portland, Oregon
503-464-8430 (D)
 
 
<Prev in Thread] Current Thread [Next in Thread>