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.
How to a new panel data series
Moderators: EViews Gareth, EViews Steve, EViews Moderator, EViews Jason
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13586
- Joined: Tue Sep 16, 2008 5:38 pm
Re: How to a new panel data series
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
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
I think it's doable in a panel.
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.
Code: Select all
smpl if country = "usa"
series temp = y
smpl @all
series scaled_y = y / @sumsby(temp, year)
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.
Who is online
Users browsing this forum: No registered users and 2 guests
