Page 1 of 1

How to a new panel data series

Posted: Tue Dec 30, 2014 7:50 am
by morak5
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.

Re: How to a new panel data series

Posted: Tue Dec 30, 2014 8:59 am
by EViews Gareth
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.

Re: How to a new panel data series

Posted: Tue Dec 30, 2014 9:15 am
by morak5
I see. Still good to know. Thanks, Gareth!

Re: How to a new panel data series

Posted: Wed Dec 31, 2014 11:17 am
by EViews Glenn
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.