Page 1 of 2
Combining two data series into one
Posted: Tue Mar 10, 2015 11:03 am
by miorinnovo
Hi,
I'd like to sue the growth rates of one data series that has ended and use those growth rates to extend another data series that replaced it bacx in time. Anyone know a quick and easy way to program that?
Re: Combining two data series into one
Posted: Tue Mar 10, 2015 11:10 am
by trubador
Yes, you can quickly and easily do it with adjusting the sample period. You may also find @recode function very useful.
Re: Combining two data series into one
Posted: Tue Mar 10, 2015 11:14 am
by miorinnovo
So I have the sample period covering both data sets. For example series 1 is from 1990 to 2000 and series 2 is form 2000 to now. How would I extend series 2 back to 1990 using those growth rates? It's easy in excel but I'm not sure how to do it in eviews. thanks
Re: Combining two data series into one
Posted: Tue Mar 10, 2015 11:58 am
by trubador
Re: Combining two data series into one
Posted: Tue Mar 10, 2015 12:17 pm
by miorinnovo
Thanks. I think that link shows how to extend a series forward using the growth rates of a new series. Please tell me if I'm wrong.
I'm looking to extend a series backward with the growth rates of an old series.
Re: Combining two data series into one
Posted: Tue Mar 10, 2015 12:42 pm
by trubador
It is really quite straightforward to do that in reverse. Since you can do it in Excel, you already know how to formulate it.
Re: Combining two data series into one
Posted: Tue Mar 10, 2015 2:15 pm
by miorinnovo
I understand the logic in reversing it to go backward, but when i tried only one data point was added to the sereis and the rest are still NAs :?
Re: Combining two data series into one
Posted: Wed Mar 11, 2015 10:00 am
by miorinnovo
I am able to make a spliced series of the growth rates of one variable and then the growth rates of the second variable. Now I just need to know how to create a level series using the last data point and "growing" backward.
Re: Combining two data series into one
Posted: Wed Mar 11, 2015 10:13 am
by EViews Gareth
Might want to check my arithmetic, but the idea is sound:
Code: Select all
'make some data
create a 1990 2015
smpl 1990 2000
series x1=nrnd
smpl 2000 2015
series x2=nrnd
'calculate growth rates
smpl 1990 2000
series growth = (x1-x1(-1))/x1(-1)
'calculate x2 in the past
smpl 1990 1999
genr(r) x2 = x2(1)/(growth(1)+1)
Re: Combining two data series into one
Posted: Wed Mar 11, 2015 10:31 am
by miorinnovo
Hi Gareth,
That's essentially what I've been trying but it seems to only create one observation. It creates the observation reight before the start of the newer series and leaves everything else blank.
Re: Combining two data series into one
Posted: Wed Mar 11, 2015 10:49 am
by EViews Gareth
Which version of EViews?
Re: Combining two data series into one
Posted: Wed Mar 11, 2015 1:46 pm
by miorinnovo
8
Re: Combining two data series into one
Posted: Wed Mar 11, 2015 7:34 pm
by EViews Gareth
Make sure it is fully up to date. Also make sure you copied my code exactly.
Re: Combining two data series into one
Posted: Thu Mar 12, 2015 6:32 am
by miorinnovo
It worked! thank you again! (I had tried to create a new variable rather than extend the x2)
Re: Combining two data series into one
Posted: Fri Nov 29, 2019 9:18 am
by heyhey
How would the code change in EViews 11?