cross-sectional differencing with panel data

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

jusi
Posts: 3
Joined: Wed Oct 20, 2010 11:41 pm

cross-sectional differencing with panel data

Postby jusi » Thu Oct 21, 2010 12:09 am

I'm using Eviews 7 and I have my data in panel form. I would like to know if there is an easy way to take cross-sectional differences, i.e. x(t,i)-x(t,j), i<>j, or even better, combine time-series differencing with cross-sectional differencing, x(t,i)-x(t-1,j). Using indirect referencing, for example x(t,i)-@meansby(x,t,j), is computationally heavy.

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

Re: cross-sectional differencing with panel data

Postby EViews Glenn » Thu Oct 21, 2010 9:15 am

Before I write this one up, I want to make certain that I understand what you want to do. Is j fixed for all t in this setting (e.g., all cross-sections are differenced relative to a base cross-section for each period)? So the reference cross-section gets zeroed out while all others are in deviations from the base for each period?

jusi
Posts: 3
Joined: Wed Oct 20, 2010 11:41 pm

Re: cross-sectional differencing with panel data

Postby jusi » Thu Oct 21, 2010 11:26 pm

No, j is fixed for each i. In other words, j depends on i characteristics and stays the same for each i through the data period.

Take euro-area interest rates as an example: I wouldn't be interested in the evolution of yield spreads between Germany and other euro countries, but yield spreads between each euro area country, where the suitable benchmark interest rate is chosen according to, say, country fiscal characteristics.

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

Re: cross-sectional differencing with panel data

Postby EViews Glenn » Fri Oct 22, 2010 9:36 am

Okay, you lost me. Perhaps I'm being a bit slow this morning so bear with me...

Say you have three countries, C1, C2, and C3 observed over T periods each. We index the countries by i=1,2,3.

You say that the reference country j is "fixed" for each i, and "stays the same for each i through the data period". I don't quite know what you mean by "stays the same for each i" since that implies that everyone has the same reference country. But given your comments, I can only interpret this to mean that each country i is differenced relative to a reference country j which is the same for all *t*, and that the identity of j the depends on characteristics of i. Thus one possible outcome is that C2 is C1's reference country and C2 is C3's j and C1 is C2's.

If this is the case, then all we need to know is for you to describe in greater detail the rule for how the reference country is chosen for a given country.

Or I could still be way off on what you are trying to do.
:)

jusi
Posts: 3
Joined: Wed Oct 20, 2010 11:41 pm

Re: cross-sectional differencing with panel data

Postby jusi » Tue Oct 26, 2010 12:01 am

Ach so,

"each country i is differenced relative to a reference country j which is the same for all *t*, and that the identity of j the depends on characteristics of i" is indeed what I mean, thanks for setting it straight. I would prefer that the identity of the benchmark country is defined using logical operators. For example,

interest rate (Denmark, t) - interest rate[any country (excluding Denmark) with gdp/debt > 0.9*Denmark gdp/debt AND in_EMU=1,t]

in above example, the benchmark country may change within the data period, and its ok. I would like to know, however, how to keep it fixed (say, based on t=0 values) as well.

Many thanks,
jusi

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

Re: cross-sectional differencing with panel data

Postby EViews Glenn » Tue Oct 26, 2010 9:43 am

Okay, we're getting close, but the particulars of your example are still beyond my ability to comprehend. In particular, what I don't understand is the fact that there may be more than one country meeting the .9 and in_EMU criteria. (I'm also assuming that there are t subscripts on the remaining variables, even though you don't provide them.) So unless you are creating multiple series or contracting across the series that satisfy the condition I'm not sure how to think about computing that difference. How do you want to handle the multiples?

Because you are explicitly excluding the own country, I have a feeling we'll have to do this with a loop over countries, but I'll know better when I get more information about what you are doing.

Perhaps if you defined a set of specific series and a set of specific calculations you wish to perform we could nail this down.

Suppose we have INTEREST as the interest rate series and GDPDEBT and INEMU as the other series that are stacked by country in a panel structure. What exactly do you want to compute for Denmark and what do you want to compute for, say Germany, and France..?

jalle7
Posts: 5
Joined: Wed Feb 02, 2011 3:57 am

Re: cross-sectional differencing with panel data

Postby jalle7 » Wed Feb 02, 2011 4:09 am

Hi,

I have a cross-sectional data set for 1991, 1993, 1995 and 1997?

Can I use eviews to compare them over time, similar to panel data?
Do I select an unstructured/undated workfile?

For example:

1991
State 1
State 2
State 3
State 4
1993
State 1
State 2
State 3
State 4
1995
State 1
State 2
State 3
State 4
1997
State 1
State 2
State 3
State 4

Many Thanks

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

Re: cross-sectional differencing with panel data

Postby EViews Glenn » Wed Feb 02, 2011 12:00 pm

This is a bit vague. Are State1 in 1991 and State1 in 1993 the same state?

jalle7
Posts: 5
Joined: Wed Feb 02, 2011 3:57 am

Re: cross-sectional differencing with panel data

Postby jalle7 » Wed Feb 02, 2011 1:27 pm

Yes State 1 in 1991 is the same as State 1 in 1993, 1995, 1997 and so on.

Many Thanks

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

Re: cross-sectional differencing with panel data

Postby EViews Glenn » Wed Feb 02, 2011 1:37 pm

So I'm semi-officially confused. You should be able to structure this as a panel and then perform various forms of analysis.

What do you mean "compare over time"?

jalle7
Posts: 5
Joined: Wed Feb 02, 2011 3:57 am

Re: cross-sectional differencing with panel data

Postby jalle7 » Wed Feb 02, 2011 1:52 pm

Sorry for the confusion.
I was told that it is not panel data, as the same individuals are not surveyed each year and you cannot therefore track the same individuals through time. I'm not sure if this is true?

I wanted to run a regression including the different years and so I would have 16 observations in total.

Thanks

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

Re: cross-sectional differencing with panel data

Postby EViews Glenn » Wed Feb 02, 2011 2:32 pm

Wait. I'm even more confused.

You have 16 total observations? And you simply want to run a regression using all of them? If so, then just use unstructured. If no, them I really don't understand what's going on :)


Return to “Data Manipulation”

Who is online

Users browsing this forum: No registered users and 2 guests