Combining two data series into one

For questions regarding the import, export and manipulation of data in EViews, including graphing and basic statistics.

Moderators: EViews Gareth, EViews Steve, EViews Moderator, EViews Jason

miorinnovo
Posts: 199
Joined: Sun Mar 01, 2015 5:01 pm

Combining two data series into one

Postby miorinnovo » Tue Mar 10, 2015 11:03 am

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?

trubador
Did you use forum search?
Posts: 1520
Joined: Thu Nov 20, 2008 12:04 pm

Re: Combining two data series into one

Postby trubador » Tue Mar 10, 2015 11:10 am

Yes, you can quickly and easily do it with adjusting the sample period. You may also find @recode function very useful.

miorinnovo
Posts: 199
Joined: Sun Mar 01, 2015 5:01 pm

Re: Combining two data series into one

Postby miorinnovo » Tue Mar 10, 2015 11:14 am

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

trubador
Did you use forum search?
Posts: 1520
Joined: Thu Nov 20, 2008 12:04 pm

Re: Combining two data series into one

Postby trubador » Tue Mar 10, 2015 11:58 am


miorinnovo
Posts: 199
Joined: Sun Mar 01, 2015 5:01 pm

Re: Combining two data series into one

Postby miorinnovo » Tue Mar 10, 2015 12:17 pm

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.

trubador
Did you use forum search?
Posts: 1520
Joined: Thu Nov 20, 2008 12:04 pm

Re: Combining two data series into one

Postby trubador » Tue Mar 10, 2015 12:42 pm

It is really quite straightforward to do that in reverse. Since you can do it in Excel, you already know how to formulate it.

miorinnovo
Posts: 199
Joined: Sun Mar 01, 2015 5:01 pm

Re: Combining two data series into one

Postby miorinnovo » Tue Mar 10, 2015 2:15 pm

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 :?

miorinnovo
Posts: 199
Joined: Sun Mar 01, 2015 5:01 pm

Re: Combining two data series into one

Postby miorinnovo » Wed Mar 11, 2015 10:00 am

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.

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13611
Joined: Tue Sep 16, 2008 5:38 pm

Re: Combining two data series into one

Postby EViews Gareth » Wed Mar 11, 2015 10:13 am

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)

miorinnovo
Posts: 199
Joined: Sun Mar 01, 2015 5:01 pm

Re: Combining two data series into one

Postby miorinnovo » Wed Mar 11, 2015 10:31 am

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.

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13611
Joined: Tue Sep 16, 2008 5:38 pm

Re: Combining two data series into one

Postby EViews Gareth » Wed Mar 11, 2015 10:49 am

Which version of EViews?

miorinnovo
Posts: 199
Joined: Sun Mar 01, 2015 5:01 pm

Re: Combining two data series into one

Postby miorinnovo » Wed Mar 11, 2015 1:46 pm

8

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13611
Joined: Tue Sep 16, 2008 5:38 pm

Re: Combining two data series into one

Postby EViews Gareth » Wed Mar 11, 2015 7:34 pm

Make sure it is fully up to date. Also make sure you copied my code exactly.

miorinnovo
Posts: 199
Joined: Sun Mar 01, 2015 5:01 pm

Re: Combining two data series into one

Postby miorinnovo » Thu Mar 12, 2015 6:32 am

It worked! thank you again! (I had tried to create a new variable rather than extend the x2)

heyhey
Posts: 1
Joined: Thu Nov 28, 2019 2:33 pm

Re: Combining two data series into one

Postby heyhey » Fri Nov 29, 2019 9:18 am

How would the code change in EViews 11?


Return to “Data Manipulation”

Who is online

Users browsing this forum: No registered users and 2 guests