Eviews 8: Extrapolation

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

Daniel351
Posts: 6
Joined: Sat Jun 13, 2015 1:45 pm

Eviews 8: Extrapolation

Postby Daniel351 » Sat Jun 13, 2015 2:40 pm

Hi guys,
right now I am working on panel data
with 80 countries as cross-sections and
each country with data either starting from 1959 or starting from 1964, going until 2009 in 5 year periods

Now, my problem is the following: for one of the variables, there is missing data for each country until about 1971, however, the paper i am repeating, says that they extrapolated the missing data. The variables I am talking about are changing very slowly over time (democracy indicator and rule of law), so I thought that it would be easiest / best to "extrapolate" by simply taking the last value, or taking the avg over the last couple of values. If any of these two methods results in values, that are too far off from the existing series, I would consider linear extrapolation...

But I cannot find out how to do any of this in Eviews.

Thanks in advance for your help :D

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

Re: Eviews 8: Extrapolation

Postby EViews Gareth » Sun Jun 14, 2015 4:46 am

Just to be clear, you have data available from 1971 onwards, and want to extrapolate backwards in time to 1966, 1961 etc...

Daniel351
Posts: 6
Joined: Sat Jun 13, 2015 1:45 pm

Re: Eviews 8: Extrapolation

Postby Daniel351 » Sun Jun 14, 2015 5:22 am

Well, I have several variables. For most of them I have data for each country starting from 1959 or 1964 until 2009.
For the two variables I am actually talking about in the above post, there I have data starting from about 1971. So I need to extrapolate the missing parts.

So, to answer your question: yes, I have data from 1971 onwards and I want to extrapolate backwards

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

Re: Eviews 8: Extrapolation

Postby EViews Gareth » Sun Jun 14, 2015 5:37 am

Something like:

Code: Select all

smpl @first 1970 genr(r) x = x(1)

Daniel351
Posts: 6
Joined: Sat Jun 13, 2015 1:45 pm

Re: Eviews 8: Extrapolation

Postby Daniel351 » Sun Jun 14, 2015 6:35 am

This is working, but only for the very first year... Now I have values from 1970 onwards
Can I make it work for all years at once?

I tried changing it a little bit:

Code: Select all

smpl @first 1971 genr (r) r=r(8)
These commands seem to have mirrored all the values around 1970. So at 1969 there is the value for 1971; at 1968 the value for 1972; etc.

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

Re: Eviews 8: Extrapolation

Postby EViews Gareth » Sun Jun 14, 2015 5:23 pm

Ah, good point.

Try:

Code: Select all

smpl @first 1971 x = @recode(x=na, @firstsby(x, country), x)

Daniel351
Posts: 6
Joined: Sat Jun 13, 2015 1:45 pm

Re: Eviews 8: Extrapolation

Postby Daniel351 » Thu Jun 18, 2015 1:11 pm

Thanks Gareth,
this worked :D !!


Return to “Data Manipulation”

Who is online

Users browsing this forum: No registered users and 2 guests