Hello,
I'd like to know if you have any idea that is easy to implement in order to merge series. Say I have 2 series with annual frequency, Series 1 runs from 1970 to 2004 and Series 2 runs from 2000 to 2008.
I would like then to write some code to combine these into Series 3 which will have data from Series 1 from 1970-1999 and from Series 2 from 2000-2008.
Any suggestions welcome.
Thanks,
Javier
Merging series
Moderators: EViews Gareth, EViews Jason, EViews Moderator, EViews Matt
-
- Non-normality and collinearity are NOT problems!
- Posts: 3775
- Joined: Wed Sep 17, 2008 2:25 pm
Re: Merging series
javiersan wrote:Hello,
I'd like to know if you have any idea that is easy to implement in order to merge series. Say I have 2 series with annual frequency, Series 1 runs from 1970 to 2004 and Series 2 runs from 2000 to 2008.
I would like then to write some code to combine these into Series 3 which will have data from Series 1 from 1970-1999 and from Series 2 from 2000-2008.
Any suggestions welcome.
Thanks,
Javier
Code: Select all
smpl 1970 1999
series s3=s1
smpl 2000 2008
s3 = s2
smpl @all
Re: Merging series
Thanks Startz.
Regards,
Javier
Regards,
Javier
-
- EViews Developer
- Posts: 2672
- Joined: Wed Oct 15, 2008 9:17 am
Re: Merging series
Startz's answer is a good one. Here are a couple of alternatives that illustrate the use of other EViews tools:
or
The first approach is more efficient than the second.
Code: Select all
series s3 = @recode(@year<=1999, s1, s2)
or
Code: Select all
series s3 = (@year<=1999)*s1 + (@year>1999)*s2
The first approach is more efficient than the second.
Re: Merging series
Thanks, that's much neater.
Regards,
Javier
Regards,
Javier
Who is online
Users browsing this forum: No registered users and 55 guests