How to a new panel data series

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

morak5
Posts: 16
Joined: Thu Jan 16, 2014 2:19 pm

How to a new panel data series

Postby morak5 » Tue Dec 30, 2014 7:50 am

Hi, there.

I have a panel data workfile with countries as cross-section identifiers and years over 1980-2010. What I'm trying to do is to create a new series in which all time series values of cross-sections are divided by the respective values of a specific cross-section id (e.g. USA) over the same years (i.e. each value of FRA, JPN, ITA, ... over 1980-2010 divided by the year-corresponding value of USA). What would be a quick way to create this series? I'd very much appreciate your help.

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

Re: How to a new panel data series

Postby EViews Gareth » Tue Dec 30, 2014 8:59 am

That's really quite difficult to do in a panel workfile. You'll need to switch to a pool instead, then just divide the two series.

morak5
Posts: 16
Joined: Thu Jan 16, 2014 2:19 pm

Re: How to a new panel data series

Postby morak5 » Tue Dec 30, 2014 9:15 am

I see. Still good to know. Thanks, Gareth!

EViews Glenn
EViews Developer
Posts: 2682
Joined: Wed Oct 15, 2008 9:17 am

Re: How to a new panel data series

Postby EViews Glenn » Wed Dec 31, 2014 11:17 am

I think it's doable in a panel.

Code: Select all

smpl if country = "usa" series temp = y smpl @all series scaled_y = y / @sumsby(temp, year)
The first two commands extract just the values of the series for "USA" leaving all others at NA (I'm assuming that TEMP doesn't exist prior to the command).
The second two commands scale all of the data for the original Y by the sums of TEMP for each year, matched to the appropriate year. Since there is only one valid observation for each year in TEMP (the one for USA), this scales each value of Y by the corresponding value of Y in USA in that year.


Return to “Data Manipulation”

Who is online

Users browsing this forum: No registered users and 2 guests